Skip to content
Merged

CDDL #420

Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
28d2364
Miniature mainnet (#402)
bwbush Jun 12, 2025
be5ed74
Support configurable timestamp resolution in rust simulation (#404)
SupernaviX Jun 12, 2025
e309cb7
Update formal specification documentation
github-actions[bot] Jun 13, 2025
1dd9454
Reduced memory footprint of leios trace processor (#407)
bwbush Jun 15, 2025
76095cd
site: weekly update
will-break-it Jun 16, 2025
b58720a
Minor edits to the latest tech update (#408)
olgahryniuk Jun 16, 2025
f20c11d
Forgot to update logbook
SupernaviX Jun 16, 2025
f2ed765
Improvements to trace processor (#412)
bwbush Jun 17, 2025
12a6943
Pseudo-mainnet experiments at tag `leios-2025w23` (#389)
bwbush Jun 17, 2025
d9d6639
Mini-mainnet experiments at tag `leios-2025w24` (#403)
bwbush Jun 17, 2025
b20de35
Add entr to nix shell (#414)
nfrisby Jun 17, 2025
4d2e12a
Update formal specification documentation
github-actions[bot] Jun 18, 2025
9af61b1
Add support for conflicting transactions (#415)
SupernaviX Jun 18, 2025
b5dd5b4
Added bandwidth measurements to logbook
bwbush Jun 18, 2025
9a07b89
docs: add RB cddl diffs
will-break-it Jun 19, 2025
818e98a
docs: add votes & certs
will-break-it Jun 19, 2025
93532d8
docs: change order
will-break-it Jun 19, 2025
bd6d9bf
docs: add endorser blocks
will-break-it Jun 19, 2025
d60b4e8
docs: add vote bundles; add note for vote epheremal persistence;
will-break-it Jun 19, 2025
8569547
CIP section on metrics (#401)
bwbush Jun 19, 2025
eb80e15
Implement overcollateralization (#419)
SupernaviX Jun 19, 2025
8ae6b33
sim-rs: support weighted TX production, stake pools don't generate TXs
SupernaviX Jun 19, 2025
491458d
docs: minor structural changes
will-break-it Jun 20, 2025
dfbebbc
docs: add input blocks
will-break-it Jun 20, 2025
1faf112
docs: fix structure and headlines for extensions/ referencing
will-break-it Jun 20, 2025
7993484
docs: add sharded input blocks
will-break-it Jun 20, 2025
4c339de
docs: fix structure and headlines for extensions/ referencing
will-break-it Jun 20, 2025
b8bb53d
docs: add sharded transactions
will-break-it Jun 20, 2025
dea18f7
docs: add shared ib next section
will-break-it Jun 20, 2025
a10dd58
docs: minor typos/ alignment
will-break-it Jun 20, 2025
58aa97d
Doc Updates - add simple explainer (#421)
kbennett2000 Jun 20, 2025
60826b4
Update logbook
SupernaviX Jun 20, 2025
fa0bc3a
Initial draft of second technical report (#422)
bwbush Jun 20, 2025
e4a9fca
Update logbook
yveshauser Jun 21, 2025
bbe3fbc
docs: remove next section
will-break-it Jun 23, 2025
8ff5484
site: weekly update
will-break-it Jun 23, 2025
d450ebf
docs: add logbook entry for cddl draft
will-break-it Jun 23, 2025
a97b5ee
docs: refactored source referencing based on review proposal
will-break-it Jun 23, 2025
87d5144
Merge branch 'main' into cip/cddl
will-break-it Jun 23, 2025
f85c4cb
docs: remove unneeded sortition cddl definitions
will-break-it Jun 23, 2025
a32dd51
docs: mark all new block types with diff +
will-break-it Jun 23, 2025
67703e6
docs: reduce block references to be only hashes
will-break-it Jun 23, 2025
4773db2
docs: make EB header constant size by moving IB and EB references int…
will-break-it Jun 23, 2025
3b28647
docs: make RB reference required for IBs
will-break-it Jun 23, 2025
300419a
docs: added note for required use of machine-independent precision ar…
will-break-it Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/cddl/diffs/common/ranking-blocks.md
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)**
137 changes: 137 additions & 0 deletions docs/cddl/diffs/common/votes-certificates.md
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
, 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).

```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)
]

; 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)
]
```
<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)
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.

```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>