Open GlenDC opened 4 years ago
Papers such as the following one can help with going from this request for decent review towards an actual decent implementation that would allow Light clients to be the normality:
thanks @GlenDC
On top of that some chains also store a Nonce in the header
That's because of the Proof of work, I removed that in the early rivine days when implementing the proof of blockstake.
Since the release of the first Rivine-based chain, the Threefold Chain (
tfchain
in short) the block structure of such chains can be seen as a structure with the following properties in the order as defined:The
BlockStakeOutputIndexes
is defined by the following structure:Each miner payout can be seen as a pair of a
Value
and anUnlockHash
(the address which received the pairedValue
.For the sake of this issue each transaction can be seen as an opaque binary object with the first byte indicating its version. How the object is to be decoded is defined by the chain, but not relevant for this issue.
Compared to other chains we make no difference between Header and Body. However given that you could see the first 3 properties as the header, with the next 2 being the body you could go from a conceptual concept to an implemented one. It would require at the very least one adaptation:
Besides this we might also want the following adaptations:
BlockStakeOutputIndexes
property with an opaque binary object, which could be called thesettlement
or however you wish to call it. The decoding of which depends on a version, either unique to this object or coupled directly to a block version as proposed in the next bullet point;On top of that some chains also store a
Nonce
in the header. At the moment I am however not sure why this would be desired, given a Merkle Root hash together with the other properties (e.g. the parent ID) should be enough to make the header unique. If not, I would think you have an issues with your cryptographic primitives used. I might however mis something here.In Memory we do already have a
BlockHeader
structure defined as follows:This header is derived from the block structure listed earlier. As we already calculate the MerkleRoot based on the transactions, it wouldn't be hard to add it to an actually implementation used block header. Again I would propose to turn the
BlockStakeOutputIndexes
object into an opaque binary object linked to a version, so we can change the consensus algorithm when needed without hardcoding all these things in such a transparent manner. Further we again miss the version here.Thus so far a proposal for new structures would be as follows: