Blockchain-based applications come up with cryptocurrencies, especially Bitcoin, introducing a distributed ledger technologies for peer-to-peer networks and essentially records the transactions in blocks containing hash value of the previous blocks. Block generation constitutes the basis of this technology, and the optimization of such systems is among the most crucial concerns. Determining either the block size or the number of transactions in the block brings out a remarkable problem that has been solved by the miners in recent years. First, higher block size results in higher transaction time, on the other hand, smaller block size has many disadvantages such as security, lower transaction fees, lower transaction numbers in a given time interval which makes it unable to compete with other currency systems due to this bulky structure and higher block generation time. In this study, multi-objective optimization problem (OP) is proposed by minimizing block generation and transmission time. This multi-objective OP is transformed into a single OP by applying weighted sum method. To determine the optimal block size, particle swarm optimization (PSO) algorithm and whale optimization evolutionary algorithm (WOA) are employed. Although both algorithms have capability to reach optimum block size and corresponding time, WOA achieves better performance than PSO in terms of the convergence speed and output fluctuation. Moreover, analysis of the prediction of optimum block size is carried out under different weights which creates many optimization functions. Experimental results indicate that if higher weight is assigned to the transmission time, then block size decreases sharply. Furthermore, the experimental results reveal that design of the blockchain network and number of nodes in network profoundly affect the block size selection due to the time constraints.