i'm a beginner in using blockchain. Based on my knowledge, there are two ways blocks are created, mining and sending transactions. As there is an explanation to input additional data while sending a new transaction to other user in here: How do I send an arbitary message to an Ethereum address?. I wonder, is there a way to input the additional data while mining? I just want to store the data inside the blocks and not sending any transactions. Thank you
2 Answers
There is only one way blocks are created: they are mined. Mining is the process of collecting a bunch of pending transactions, forming a block of them and trying to solve the Proof of Work puzzle for that block. If the miner manages to solve the puzzle then the block becomes valid and is added to the blockchain and the miner is rewarded.
So even if there was a way to add extra data into blocks when mining you couldn't use it the way you think. You'd have to: 1) be a miner and 2) mine successfully (have enough hardware to find a solution to the puzzle).
In any case blocks are not meant for such data propagation. All meaningful data should be in transactions.
Only mining creates blocks of transactions.
Transactions may include contract deployment instructions (CREATE), and/or messages to contracts, with data, as well as simple value transfers.
Hope it helps.