Managing Transactions and Blocks

+2 votes

Related to the structure in which a block is made:

- Is it possible to limit the number of transactions that a block can contain, say for example to 50 transactions? After each 50 transaction, a block should be committed.

- Is it possible to remove the time constraint for committing a block? That means, a block commit should not depend on the predefined elapsed time, rather only on the number of transactions.

- How and in which files can I change the method by which the block header is generated? I would like to have my own SHA-256 custom and unique hash, not based on the transactions it contains and their metadata.

asked Mar 30, 2017 by jagrut.kosti

1 Answer

+2 votes
 
Best answer

To answer the questions in turn:

  • There isn't currently a setting to limit the number of transactions per block, but you can limit the block size using the maximum-block-size blockchain parameter, and this can provide an approximation to limiting the number of transactions.
  • There isn't currently a setting to say that mining nodes should wait until there are a certain number of transactions before creating a block.
  • You can of course modify the source code to change how the block header is generated. But if the block hash is not based on the transactions, you will lose the guarantee that all nodes agree on all transactions, since the consensus is enforced via block hashes.
We are curious – can you provide some information about what is motivating these requested changes?
answered Mar 31, 2017 by MultiChain
selected Apr 6, 2017 by jagrut.kosti
Thank you for your response! I am planning on building a Blockchain application using Multichain that requires to have a specific format of the Blocks. The application requires to group only a certain number of transactions into a block. These transactions will contain metadata as a part of OP_RETURN which are of utmost importance. The metadata in OP_RETURN of transactions in a block are related. Hence, the above questions.
OK - thanks for the information.
Hi,
Were you able to achieve this.
Like specific number of transactions in each block?
See the getblock / listblocks commands to obtain information like this about each block.
...