Expand description
chain core properties
define the different properties a supported chain needs to implement to work in our models.
§Block
The Block is the atomic element that compose a chain. Or in other
words the chain is composed of a succession of Block
.
the Block
trait implements the necessary feature we expect of
a Block
in the chain. Having a function that requires the object
to implement the Block traits means that we are expecting to have
only access to:
- the block and its parent’s identifier (the block hash);
- the block number, its position in the blockchain relative to the beginning of the chain. We often call this number the block Date.
§Ledger
this trait is to make sure we are following the Transactions of the chain appropriately.
§LeaderSelection
This trait is following the protocol of the blockchain is followed properly and determined a given instance of the LeaderSelection object is selected to write a block in the chain.
Traits§
- Block
- Block property
- Block
Date - A trait representing block dates.
- BlockId
- Trait identifying the block identifier type.
- Chain
Length - Deserialize
- Define that an object can be read from a
Read
object. - Fragment
- A fragment is some item contained in a block, such as a transaction, a delegation-related certificate, an update proposal, and so on. Fragments can be serialized (so that they can be concatenated to form a binary block( and have a unique ID (typically the hash of their serialization).
- Fragment
Id - Trait identifying the fragment identifier type.
- FromStr
- Defines the way to parse the object from a UTF-8 string.
- HasFragments
- Accessor to fragments within a block.
- HasHeader
- Access to the block header.
- Header
- Trait identifying the block header type.
- Leader
Id - Trait identifying the leader identifier type.
- Leader
Selection - interface for the leader selection algorithm
- Ledger
- Define the Ledger side of the blockchain. This is not really on the blockchain
but should be able to maintain a valid state of the overall blockchain at a given
Block
. - Serialize
- Define that an object can be written to a
Write
object. - Settings
- the settings of the blockchain this is something that can be used to maintain the blockchain protocol update details:
- State
- Transaction
- define a transaction within the blockchain. This transaction can be used for the UTxO model. However it can also be used for any other elements that the blockchain has (a transaction type to add Stacking Pools and so on…).
- Transaction
Id - Trait identifying the transaction identifier type.