-
Notifications
You must be signed in to change notification settings - Fork 9
CDDL #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CDDL #420
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
28d2364
Miniature mainnet (#402)
bwbush be5ed74
Support configurable timestamp resolution in rust simulation (#404)
SupernaviX e309cb7
Update formal specification documentation
github-actions[bot] 1dd9454
Reduced memory footprint of leios trace processor (#407)
bwbush 76095cd
site: weekly update
will-break-it b58720a
Minor edits to the latest tech update (#408)
olgahryniuk f20c11d
Forgot to update logbook
SupernaviX f2ed765
Improvements to trace processor (#412)
bwbush 12a6943
Pseudo-mainnet experiments at tag `leios-2025w23` (#389)
bwbush d9d6639
Mini-mainnet experiments at tag `leios-2025w24` (#403)
bwbush b20de35
Add entr to nix shell (#414)
nfrisby 4d2e12a
Update formal specification documentation
github-actions[bot] 9af61b1
Add support for conflicting transactions (#415)
SupernaviX b5dd5b4
Added bandwidth measurements to logbook
bwbush 9a07b89
docs: add RB cddl diffs
will-break-it 818e98a
docs: add votes & certs
will-break-it 93532d8
docs: change order
will-break-it bd6d9bf
docs: add endorser blocks
will-break-it d60b4e8
docs: add vote bundles; add note for vote epheremal persistence;
will-break-it 8569547
CIP section on metrics (#401)
bwbush eb80e15
Implement overcollateralization (#419)
SupernaviX 8ae6b33
sim-rs: support weighted TX production, stake pools don't generate TXs
SupernaviX 491458d
docs: minor structural changes
will-break-it dfbebbc
docs: add input blocks
will-break-it 1faf112
docs: fix structure and headlines for extensions/ referencing
will-break-it 7993484
docs: add sharded input blocks
will-break-it 4c339de
docs: fix structure and headlines for extensions/ referencing
will-break-it b8bb53d
docs: add sharded transactions
will-break-it dea18f7
docs: add shared ib next section
will-break-it a10dd58
docs: minor typos/ alignment
will-break-it 58aa97d
Doc Updates - add simple explainer (#421)
kbennett2000 60826b4
Update logbook
SupernaviX fa0bc3a
Initial draft of second technical report (#422)
bwbush e4a9fca
Update logbook
yveshauser bbe3fbc
docs: remove next section
will-break-it 8ff5484
site: weekly update
will-break-it d450ebf
docs: add logbook entry for cddl draft
will-break-it a97b5ee
docs: refactored source referencing based on review proposal
will-break-it 87d5144
Merge branch 'main' into cip/cddl
will-break-it f85c4cb
docs: remove unneeded sortition cddl definitions
will-break-it a32dd51
docs: mark all new block types with diff +
will-break-it 67703e6
docs: reduce block references to be only hashes
will-break-it 4773db2
docs: make EB header constant size by moving IB and EB references int…
will-break-it 3b28647
docs: make RB reference required for IBs
will-break-it 300419a
docs: added note for required use of machine-independent precision ar…
will-break-it File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Ranking Blocks - Leios CDDL Changes | ||
|
|
||
| Ranking Blocks (RBs) are extended Praos blocks that include optional Leios certificates. | ||
|
|
||
| ## Base Block Structure Extension | ||
|
|
||
| ```diff | ||
| ranking_block = | ||
| [ header : block_header | ||
| , transaction_bodies : [* transaction_body] | ||
| , transaction_witness_sets : [* transaction_witness_set] | ||
| , auxiliary_data_set : {* transaction_index => auxiliary_data} | ||
| , invalid_transactions : [* transaction_index] | ||
| + , ? leios_cert : leios_certificate | ||
| ] | ||
| ``` | ||
| <sub>[1] [Conway Base](https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl#L8-L14), [2] [Leios Base](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Base.agda#L21-L22)</sub> | ||
|
|
||
| **→ [Votes and Certificates - Detailed CDDL Specification](votes-certificates.md)** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # Votes and Certificates - Leios CDDL Changes | ||
|
|
||
| Leios introduces a new BLS-based voting system with certificates for endorser block validation. | ||
|
|
||
| ## Certificate Structure | ||
|
|
||
| Leios certificates are embedded in Ranking Blocks as described in [Ranking Blocks - CDDL Changes](ranking-blocks.md). Here is the complete certificate structure: | ||
|
|
||
| ```cddl | ||
| ; Complete Leios certificate structure (from crypto-benchmarks implementation) | ||
| leios_certificate = | ||
| [ election_id : election_id ; 8-byte election identifier (EID) | ||
| , endorser_block_hash : hash32 ; Hash of the endorsed block (EB) | ||
| , persistent_voters : [* persistent_voter_id] ; Set of persistent voter IDs | ||
| , nonpersistent_voters : {* pool_id => bls_signature} ; Non-persistent voters with eligibility proofs | ||
| , ? aggregate_elig_sig : bls_signature ; Optional aggregate eligibility signature | ||
will-break-it marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| , aggregate_vote_sig : bls_signature ; Aggregate BLS signature on (election_id || endorser_block_hash) | ||
| ] | ||
| ``` | ||
| <sub>[1] [Certificate Reference Implementation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/cert.rs#L13-L21), [2] [Certificate Abstract Interface](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Base.agda#L24-L28)</sub> | ||
|
|
||
| ## Vote Structure | ||
|
|
||
| The Leios voting system supports two types of voters: persistent voters (selected per epoch) and non-persistent voters (selected per election via local sortition). | ||
|
|
||
will-break-it marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ```cddl | ||
| ; Vote cast in a Leios election | ||
| leios_vote = persistent_vote / non_persistent_vote | ||
|
|
||
| ; Vote cast by a persistent voter (90 bytes) | ||
| persistent_vote = | ||
| [ 0 ; Vote type identifier for persistent voter | ||
| , election_id ; 8-byte election identifier | ||
| , endorser_block_hash ; 32-byte hash of the endorser block being voted on | ||
| , persistent_voter_id ; 2-byte epoch-specific pool identifier | ||
| , vote_signature ; 48-byte BLS signature on (election_id || endorser_block_hash) | ||
will-break-it marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] | ||
|
|
||
| ; Vote cast by a non-persistent voter (164 bytes) | ||
| non_persistent_vote = | ||
| [ 1 ; Vote type identifier for non-persistent voter | ||
| , election_id ; 8-byte election identifier | ||
| , endorser_block_hash ; 32-byte hash of the endorser block being voted on | ||
| , pool_id ; 28-byte pool identifier | ||
| , eligibility_signature ; 48-byte BLS signature proving eligibility to vote | ||
| , vote_signature ; 48-byte BLS signature on (election_id || endorser_block_hash) | ||
will-break-it marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ] | ||
| ``` | ||
| <sub>[1] [Vote Reference Implementation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/vote.rs#L13-L27), [2] [Formal Specification - Vote Abstract Interface](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Abstract.agda#L24-L27)</sub> | ||
|
|
||
| ## BLS Key Registration | ||
|
|
||
| For pools to participate in Leios voting, they must register BLS keys in their operational certificates: | ||
|
|
||
| ```diff | ||
| operational_cert = | ||
| [ hot_vkey : kes_vkey | ||
| , sequence_number : uint .size 8 | ||
| , kes_period : uint | ||
| , sigma : signature | ||
| + , ? bls_key_reg : bls_key_registration | ||
| ] | ||
| ``` | ||
| <sub>[1] [Conway Base](https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl#L114-L119)</sub> | ||
|
|
||
| ```cddl | ||
| ; BLS key registration for voting (included in operational certificates) | ||
| bls_key_registration = | ||
| [ pool_id : pool_id ; Pool identifier (28 bytes) | ||
| , bls_public_key : bls_vkey ; BLS12-381 G2 public key (96 bytes) | ||
| , proof_of_possession : bls_proof_of_possession ; Proof of secret key possession (96 bytes) | ||
| , kes_signature : kes_signature ; KES signature over the registration (448 bytes) | ||
| ] | ||
|
|
||
| ; Total size: 28 + 96 + 96 + 448 = 668 bytes | ||
| ``` | ||
| <sub>[1] [Registration Struct](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L156-L162), [2] [Proof Generation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/bls_vote.rs#L19-L23)</sub> | ||
|
|
||
| ## Cryptographic Types | ||
|
|
||
| ```cddl | ||
| ; Core BLS cryptographic primitives | ||
| bls_signature = bytes .size 48 ; BLS12-381 G1 signature (compressed) | ||
| bls_vkey = bytes .size 96 ; BLS12-381 G2 public key (compressed) | ||
bwbush marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bls_proof_of_possession = | ||
| [ mu1 : bls_signature ; Signature on public key | ||
| , mu2 : bls_signature ; Signature on empty message | ||
| ] | ||
|
|
||
| ; Leios-specific identifiers | ||
| election_id = bytes .size 8 ; Slot-based election identifier | ||
| persistent_voter_id = uint .size 2 ; Epoch-specific voter identifier (0-65535) | ||
| pool_id = bytes .size 28 ; Stake pool identifier | ||
| endorser_block_hash = bytes .size 32 ; Hash of endorser block | ||
|
|
||
| ; Additional Cardano types used | ||
| kes_signature = bytes .size 448 ; KES signature | ||
| hash32 = bytes .size 32 ; 32-byte hash (used for endorser_block_hash) | ||
| ``` | ||
| <sub>[1] [Sig](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L100), [2] [PubKey](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L62), [3] [PoP](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L139-L143), [4] [Eid](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L76), [5] [PersistentId](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/registry.rs#L14), [6] [PoolKeyhash](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L14), [7] [EbHash](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L117), [8] [KesSig](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L170)</sub> | ||
|
|
||
| ## Committee Selection | ||
|
|
||
| The Fait Accompli algorithm determines persistent voters for each epoch, while local sortition selects non-persistent voters for each election. | ||
will-break-it marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```cddl | ||
| ; Result of Fait Accompli committee selection for an epoch | ||
| fait_accompli_result = | ||
| [ epoch : epoch ; Epoch this applies to | ||
| , persistent_voters : [* persistent_voter_designation] ; Designated persistent voters | ||
| , total_persistent_stake : stake_weight ; Total stake of persistent voters | ||
| , non_persistent_stake : stake_weight ; Remaining stake for local sortition | ||
| ] | ||
|
|
||
| ; Persistent voter designation | ||
| persistent_voter_designation = | ||
| [ pool_id : pool_id ; Pool identifier | ||
| , persistent_voter_id : persistent_voter_id ; Epoch-specific short identifier | ||
| , stake_weight : stake_weight ; Stake weight of this voter | ||
| ] | ||
|
|
||
| ; Local sortition result for non-persistent voters | ||
| local_sortition_result = | ||
| [ pool_id : pool_id ; Pool identifier | ||
| , election_id : election_id ; Election identifier | ||
| , vrf_proof : vrf_cert ; VRF proof of eligibility | ||
| , vote_count : vote_count ; Number of votes awarded (usually 0 or 1) | ||
| , stake_weight : stake_weight ; Stake weight for this election | ||
| ] | ||
|
|
||
| ; Supporting types | ||
| epoch = uint64 ; Epoch number | ||
| stake_weight = uint64 ; Stake amount in lovelace | ||
| vrf_cert = bytes ; VRF certificate from existing Cardano types | ||
| vote_count = uint8 ; Number of votes (typically 0 or 1) | ||
| ``` | ||
| <sub>[1] [FaSortition](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/fait_accompli.rs#L9-L17)</sub> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.