Skip to main content

Crate tari_sidechain

Crate tari_sidechain 

Source

Modules§

hashing
The consensus hashers of the Ootle sidechain. Validators, the base layer and every client that verifies a commit proof hash with these, so a domain, version or label changes only at a network reset.

Structs§

BlockHeaderHashFieldsV1
BurnClaimProof
BurnOutputProof
Proves that a burn output was mined in a block, against that block’s block_output_mr.
ChainLink
CommandCommitProofV1
CompleteClaimBurnProof
EndEpochAtom
The atom committed by an EndEpoch command.
FixedHash
A 32-byte hash. Its serde and Borsh encodings are those of a [u8; 32], the same as the base layer’s tari_common_types::types::FixedHash, so proofs encoded by either side decode on the other.
FixedHashSizeError
InvalidQuorumDecisionByteError
MmrInclusionProof
An inclusion proof of a leaf in a Merkle mountain range, in a self-describing form so that consumers can verify it without decoding the bincode encoding of tari_mmr::MerkleProof.
OutputHashPreimage
The fields of a base layer TransactionOutput that its hash commits to, in hash order. The range proof is carried only as its hash, which is all the output hash commits to.
ProposalCertificateSignatureFieldsV1
QuorumCertificate
ShardGroup
ShardGroupAccumulatedData
SidechainBlockCommitProof
SidechainBlockHeader
SignerBitmap
The committee members that signed a quorum certificate. Bit i % 8 of byte i / 8, counting from the least significant bit, is set if the member at index i of the SigningCommittee signed.
TransactionAtom
A transaction command’s atom as the sidechain Borsh-encodes it. The bytes are opaque except for their leading fields, the transaction id followed by the decision, which every transaction atom begins with.

Enums§

BlockHeaderHashFields
The hash preimage schemas for a sidechain block header, one per shape the header has taken. The variant is selected by SidechainBlockHeader::protocol_version, so the variant index is consensus-bound: entries are append-only and never reordered.
Command
A command as the sidechain commits to it in its command merkle root. Each variant’s discriminant is the first byte of the command’s hash preimage, so it is load-bearing. 6 was the retired EvictNode command and must not be reused.
CommandCommitProof
CommitProofElement
ProposalVoteMessage
The message a proposal vote signs, in the shape the block’s protocol version calls for. Signing and verifying both go through this so that the two cannot select different shapes.
QcSignatures
The signatures of a quorum certificate, tagged by the scheme they are made under.
QcSignaturesError
QuorumDecision
SidechainProofValidationError
TransactionAtomDecodeError
TransactionDecision
The decision a transaction atom carries. An abort’s reason is the sidechain’s abort reason code, which this crate does not interpret.

Constants§

MAX_PROOF_ELEMS
The maximum number of elements a commit proof may contain. A proof holds the three quorum certificates of the 3-chain that commits its block and at most one more element: a chain of links down to the block or, when the block is the parent of the 3-chain’s last block, that block’s own certificate.
MAX_QC_SIGNATURES
The maximum number of signatures a quorum certificate may contain. A valid quorum certificate contains at most one signature per committee member, so this bound holds only while no committee exceeds 1000 members.

Traits§

SigningCommittee
The committee that signs a quorum certificate, in ascending lexicographic order of the members’ 32-byte compressed Ristretto public keys, with each key listed once. A SignerBitmap addresses members by their index in this order.
ToCommand

Functions§

check_proof_elements
Validates that proof_elements prove header committed on network, signed by a quorum of committee. quorum_threshold must be positive: a QC with no signatures holds no power, so a threshold of 0 would accept one.
check_proof_elements_num_qcs
check_proof_structure
Validates that proof_elements form a 3-chain of quorum certificates in header.epoch with consecutive descending heights that, followed by any chain links, descends to header at header.height. A proof that passes proves header only once each of its quorum certificates is validated against a committee, as check_proof_elements does.
jmt_hash_scheme
The JMT hash scheme a sidechain block’s command_merkle_root was built with, selected by the header’s protocol_version. Ootle builds the root, so this mapping must match Ootle’s for every protocol version. A new scheme is a new arm here.

Type Aliases§

CompressedPublicKey
DecodedValidatorBlockSignature
A ValidatorBlockSignature decoded to curve points, the form it is verified in.
PrivateKey
UncompressedPublicKey
ValidatorBlockSignature