In MultiChain, block creators must prove their identity by signing blocks
Block signatures
Block signatures are embedded inside the OP_RETURN
metadata of the coinbase transaction, using a regular bitcoin-style signature format. The payload signed by the block creator is the full block header, with the following modifications:
- The
merkle_root
is recalculated based on the txid of the coinbase transaction with theOP_RETURN
removed. This prevents a dependency loop from block signature → coinbase txid → merkle root → block header → block signature. - The
nonce
field is set to0
. This avoids having to recalculate the signature for every attempt at finding a block hash to match the target difficulty. However it does lead to some malleability in that a user withoutmine
permissions could generate a block with the same content as a valid block, but with a differentnonce
. Seeing as thenonce
serves no purpose other than to randomize the block’s content for its hash, this should not be a source of concern.
In the case of a permissioned MultiChain blockchain, consensus is based on block signatures and a customizable round-robin consensus scheme, rather than proof-of-work as in bitcoin.
On the first server, run:
grant 15ZLxwAQU4XFrLVs2hwQz1NXW9DmudRMcyx2ZV mine
(Even though the permission is called mine
note that there is no real “mining” taking place, in the sense of proof-of-work.) On the second server, check that two permitted block validators are listed:
listpermissions mine
Run this on both servers to maximize the degree of validator randomness:
setruntimeparam miningturnover 1
Now wait for a couple of minutes, so that a few blocks are added. (This assumes you left the block time on the default of 15 seconds.) On either server, check the creators of the last few blocks:
listblocks -10
The address of the validator of each block is in the miner
field of each element of the response.
Snippet:
RR Mining
Node-1 Terminal | Node-2 Terminal
Reference: https://www.multichain.com/developers/mining-block-signatures/
https://www.multichain.com/getting-started/