Skip to content

Commit 13c2b35

Browse files
committed
Re-organize and sketh specification section
1 parent 4e0b55a commit 13c2b35

File tree

1 file changed

+96
-53
lines changed

1 file changed

+96
-53
lines changed

docs/cip/README.md

Lines changed: 96 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To address this challenge, we propose a transition to Ouroboros Leios — a nove
3030
Leios achieves its scalability through a decoupled block production and aggregation mechanism. This allows for a higher rate of input-block generation, followed by efficient endorsement and anchoring onto the main chain. This document formally specifies the Leios protocol using Agda and provides a detailed rationale and supporting evidence demonstrating its efficacy in overcoming the throughput limitations inherent in the current Ouroboros Praos protocol.
3131

3232
> [!NOTE]
33-
>
33+
>
3434
> For comprehensive research documentation, development history, and additional technical resources, visit the [Leios R&D website](https://leios.cardano-scaling.org/).
3535
3636
<details>
@@ -41,7 +41,7 @@ Leios achieves its scalability through a decoupled block production and aggregat
4141
## Motivation: why is this CIP necessary?
4242

4343
> [!NOTE]
44-
>
44+
>
4545
> A clear explanation that introduces a proposal's purpose, use cases, and stakeholders. If the CIP changes an established design, it must outline design issues that motivate a rework. For complex proposals, authors must write a [Cardano Problem Statement (CPS) as defined in CIP-9999][CPS] and link to it as the `Motivation`.
4646
4747
While Cardano's current transaction processing capabilities often meet the immediate demands of its user base, the underlying Ouroboros Praos consensus protocol inherently imposes limitations on scalability. The critical requirement for timely and reliable global propagation of newly generated blocks within a short time interval necessitates a careful balancing act. This constraint directly restricts the maximum size of individual blocks and the computational resources available for the validation of transactions and Plutus scripts, effectively establishing a ceiling on the network's transaction throughput that cannot be overcome through simple parameter adjustments alone.
@@ -63,11 +63,11 @@ Ouroboros Praos cannot support the high transaction volume needed to generate th
6363
## Specification
6464

6565
> [!NOTE]
66-
>
66+
>
6767
> The technical specification should describe the proposed improvement in sufficient technical detail. In particular, it should provide enough information that an implementation can be performed solely based on the design outlined in the CIP. A complete and unambiguous design is necessary to facilitate multiple interoperable implementations.
68-
>
68+
>
6969
> This section must address the [Versioning](#versioning) requirement unless this is addressed in an optional Versioning section.
70-
>
70+
>
7171
> If a proposal defines structure of on-chain data it must include a CDDL schema.
7272
7373
Given the problem statement and motivation given above, but also considering our [analysis]() and identified [trade-offs](), we propose to implement Leios in a phased approach:
@@ -81,9 +81,7 @@ Consequently we will give a detailed specification for a **Phase 1 Leios** proto
8181
>
8282
> TODO: cover phase1/2 split this idea into rationale and path to active sections
8383
84-
### Leios protocol overview (Phase 1)
85-
86-
To understand the ledger design challenges, it's essential first to understand the key components of the Leios protocol:
84+
### Leios phase 1
8785

8886
**Five-Stage Pipeline**: The protocol operates through a structured five-stage pipeline:
8987
1. **Propose** - IBs generated uniformly
@@ -96,9 +94,25 @@ To understand the ledger design challenges, it's essential first to understand t
9694

9795
The protocol operates through a structured five-stage pipeline: (1) **Propose** - IBs generated uniformly, (2) **Deliver 1** - IB diffusion using freshest-first strategy, (3) **Deliver 2** - complete IB delivery, (4) **Endorse** - EBs generated at stage start, (5) **Vote** - voting on EBs and certificate creation. This pipeline approach enables concurrent transaction processing while maintaining deterministic ordering and conflict resolution.
9896

99-
#### Input Blocks (IBs)
97+
#### Ranking Blocks (RBs)
98+
99+
The main Praos consensus chain blocks that contain at most one certificate per block, attesting to the validity of an EB. RBs anchor the Leios consensus into the established Praos security model and may also contain regular transactions.
100100

101-
Transaction-containing blocks produced at a uniform rate during the "Propose" stage of each [pipeline](#pipeline). IBs are generated by stake pools that win VRF-based [sortition](#sortition), with the protocol utilizing approximately one-third of available network bandwidth for IB traffic. Multiple IBs can be produced concurrently across the network.
101+
```diff
102+
block =
103+
[ header
104+
, transaction_bodies : [* transaction_body]
105+
, transaction_witness_sets : [* transaction_witness_set]
106+
, auxiliary_data_set : {* transaction_index => auxiliary_data }
107+
, invalid_transactions : [* transaction_index ]
108+
+ , ? leios_cert : leios_certificate
109+
]
110+
```
111+
112+
Upon synchronizing a new block via the [chain-sync]() mini-protocol, the ...
113+
114+
> [!WARNING]
115+
> TODO: building the ledger state here requires to re-apply all references transactions. How many possible without impacting praos security? Why is this fine?
102116
103117
#### Endorser Blocks (EBs)
104118

@@ -108,9 +122,46 @@ Aggregation blocks that reference multiple IBs from the current pipeline. EBs ar
108122

109123
During the "Vote" stage, stake pools [vote](#vote) on EBs if they meet strict criteria: all referenced IBs must be available, all IBs seen by the "Deliver 1" deadline must be referenced, and all referenced IBs must validate. When enough votes are collected (achieving a [quorum](#quorum)), a [certificate](#certificate) is created and included in an RB.
110124

111-
#### Ranking Blocks (RBs)
125+
#### Input Blocks (IBs)
112126

113-
The main Praos consensus chain blocks that contain at most one certificate per block, attesting to the validity of an EB. RBs anchor the Leios consensus into the established Praos security model and may also contain regular transactions.
127+
- Transaction-containing blocks produced at a uniform rate during the "Propose" stage of each [pipeline](#pipeline).
128+
- IBs are generated by stake pools that win VRF-based [sortition](#sortition), with the protocol utilizing approximately one-third of available network bandwidth for IB traffic.
129+
130+
> ![WARNING]
131+
> TODO: how are blocks transmitted through the network, block fetch instantiated for it? same direction as praos blocks? freshest first?
132+
133+
- Multiple IBs can be produced concurrently across the network.
134+
- IBs contain transactions, similar to praos blocks:
135+
136+
```diff
137+
input_block =
138+
[ ib_header
139+
, transaction_bodies : [* transaction_body]
140+
, transaction_witness_sets : [* transaction_witness_set]
141+
, auxiliary_data_set : {* transaction_index => auxiliary_data }
142+
, invalid_transactions : [* transaction_index ]
143+
]
144+
145+
ib_header =
146+
[ ib_header_body
147+
, body_signature : kes_signature
148+
]
149+
150+
ib_header_body =
151+
[ slot : slot_no
152+
, issuer_vkey : vkey
153+
, vrf_vkey : vrf_vkey
154+
, vrf_result : vrf_cert
155+
, ...?
156+
]
157+
```
158+
159+
### Leios phase 2
160+
161+
> [!WARNING]
162+
>
163+
> TODO: expand the phase 1 protocol spec with a concrete proposal how to solve the massively increased concurrency and its consequences
164+
> TODO: maybe put the discussion into rationale?
114165
115166
### Fundamental challenges
116167

@@ -121,7 +172,7 @@ The concurrent nature of input block (IB) production in Leios introduces fundame
121172
The primary challenges introduced by concurrent block production include:
122173

123174
- **Conflicts**: Multiple IBs may include transactions spending the same UTxO
124-
- **Duplicates**: The same transaction may appear in multiple IBs
175+
- **Duplicates**: The same transaction may appear in multiple IBs
125176
- **Fee payment**: How to guarantee SPOs are compensated for their work when conflicts occur
126177
- **Inclusion delays**: Balancing immediate inclusion with conflict prevention mechanisms
127178

@@ -170,21 +221,13 @@ Three primary approaches have been identified to address these challenges:
170221

171222
Each approach offers different trade-offs between the seven properties, and the choice depends on the specific requirements and constraints of the deployment scenario.
172223

173-
### Normative Leios specification in Agda
174-
175-
> [!IMPORTANT]
176-
>
177-
> Work in progress: https://github.com/input-output-hk/ouroboros-leios-formal-spec/tree/main/formal-spec/Leios.
178-
>
179-
> - [ ] Do we plan to embed the Agda in this document?
180-
> - [ ] If so, will all of the Agda be embedded, instead of just the core subset?
181224

182225
### Constraints on Leios protocol parameters
183226

184227
> [!WARNING]
185-
>
228+
>
186229
> This is an incomplete work in progress.
187-
>
230+
>
188231
> - [ ] Revise after protocol definition is complete.
189232
> - [ ] Add paragraphs explain the rationale in more detail.
190233
@@ -212,7 +255,7 @@ Leios is flexible regarding the details of [votes](#vote), certificates, and sor
212255

213256
1. *Succinct registration of keys:* The registration of voting keys should not involve excessive data transfer or coordination between parties. Ideally, such registration would occur as part of the already existing operational certificates and not unduly increase their size.
214257
2. *Key rotation:* The cryptographic keys used to sign Leios votes and certificates *do not* need to be rotated periodically because the constraints on Leios voting rounds and the key rotation already present in Praos secure the protocol against attacks such as replay and key compromise.
215-
3. *Deterministic signatures:* Deterministic signatures can guard against attacks that weakening key security.
258+
3. *Deterministic signatures:* Deterministic signatures can guard against attacks that weakening key security.
216259
4. *Local sortition:* Selection of the voting committee should not be so deterministic and public as to open attack avenues such as denial-of-service or subversion.
217260
5. *Liveness:* Adversaries with significant stake (e.g., more than 35%) should not be able to thwart a honest majority from reaching a [quorum](#quorum) of votes for an EB.
218261
6. *Soundness:* Adversaries with near majority stake (e.g., 49%) should not be able to form an adversarial quorum that certifies the EB of their choice.
@@ -248,7 +291,7 @@ Altogether, a key registration occupies $28 + 96 + 2 \times 48 + 448 = 668$ byte
248291

249292
Figure 7 of the Fait Accompli paper[^1] provides the algorithm for determining which pools are persistent voters. The inequality for this determination can be computed exactly using rational arithmetic, so there is no danger of round-off errors. The input to the formula is the size of the committee and the distribution of stake among the pools.
250293

251-
The non-persistent pools are subject to local sortition (LS) for each vote, based on an updated stake distribution where the persistent voters have been removed and where the distribution is normalized to unit probability. The VRF value for that sortition is the bytes of the SHA-256 hash of the BLS signature on the election identifier $eid$. The probability that a pool with fraction $\sigma$ of the stake is awarded $k$ votes of the committee of $n$ votes is
294+
The non-persistent pools are subject to local sortition (LS) for each vote, based on an updated stake distribution where the persistent voters have been removed and where the distribution is normalized to unit probability. The VRF value for that sortition is the bytes of the SHA-256 hash of the BLS signature on the election identifier $eid$. The probability that a pool with fraction $\sigma$ of the stake is awarded $k$ votes of the committee of $n$ votes is
252295

253296
$$
254297
\mathcal{P}(k) := \frac{(n \cdot \sigma)^k \cdot e^{- n \cdot \sigma}}{k!}
@@ -292,7 +335,7 @@ Consider the committee size $n$, which contains $m$ persistent voters. The certi
292335
- Aggregate signatures
293336
- *Signed message:* This aggregate BLS signature on the message is 48 bytes (compressed).
294337
- *Signed election proofs:* Perhaps not strictly necessary, but another 48 byte (compressed) BLS signature can attest to the proof of the eligibility, see **BLS.BSig** in the Leios paper[^2].
295-
338+
296339
Thus the total certificate size is
297340

298341
$$
@@ -308,33 +351,33 @@ but not including any minor overhead arising from CBOR serialization. As noted p
308351
#### IB schema
309352

310353
> [!IMPORTANT]
311-
>
354+
>
312355
> - [ ] Translate the Agda type for input blocks into CDDL.
313356
314357
#### EB schema
315358

316359
> [!IMPORTANT]
317-
>
360+
>
318361
> - [ ] Translate the Agda type for endorser blocks into CDDL.
319362
320363
#### Certificate schema
321364

322365
> [!IMPORTANT]
323-
>
366+
>
324367
> - [ ] Translate the Agda type for certificates into CDDL.
325368
326369
#### RB schema
327370

328371
> [!IMPORTANT]
329-
>
372+
>
330373
> - [ ] Provide the diff for the CDDL for Praos blocks, so that Leios certificates are included.
331374
332375
## Rationale: how does this CIP achieve its goals?
333376

334377
> [!NOTE]
335-
>
378+
>
336379
> The rationale fleshes out the specification by describing what motivated the design and what led to particular design decisions. It should describe alternate designs considered and related work. The rationale should provide evidence of consensus within the community and discuss significant objections or concerns raised during the discussion.
337-
>
380+
>
338381
> It must also explain how the proposal affects the backward compatibility of existing solutions when applicable. If the proposal responds to a [CPS][], the 'Rationale' section should explain how it addresses the CPS and answer any questions that the CPS poses for potential solutions.
339382
340383
### How Leios increases throughput
@@ -444,9 +487,9 @@ $$`
444487
The Leios paper[^2] provides a rigorous theoretical analysis of the safety and throughput of the protocol. That has been reinforced and demonstrated by prototype simulations written in Haskell and Rust.
445488

446489
> [!CAUTION]
447-
>
490+
>
448491
> The plots below are placeholders. All of the simulations in this section need to be re-run:
449-
>
492+
>
450493
> - [ ] Final version of the Leios protocol
451494
> - [ ] Realistic mainnet topology
452495
> - [ ] Protocol parameters close to the recommended value
@@ -525,9 +568,9 @@ Although the version of Leios proposed in this document does not support the par
525568
The table below documents a set of Leios protocol parameters that provided high throughput and reasonably fast settlement in the prototype Haskell and Rust simulations of Leios. The exact choice of parameters that would be adopted on the Cardano mainnet must be subject to discussion and consideration of tradeoffs.
526569

527570
> [!WARNING]
528-
>
571+
>
529572
> This is an incomplete work in progress.
530-
>
573+
>
531574
> - [ ] Revise after the protocol definition is complete.
532575
> - [ ] Each row should have a paragraph of justification.
533576
@@ -583,9 +626,9 @@ Nearly all of these *hypothetical* threats are already mitigated by the protocol
583626
The resource requirements for operating Leios nodes have been estimated from benchmarking and simulation studies. The benchmark values for various Leios operations come either from measurements of the cryptography prototype[^3] or from the IOG benchmarking cluster for the Cardano node. These were input to the Haskell and Rust simulators for Leios to make holistic estimates of resource usage of operating nodes.
584627

585628
> [!CAUTION]
586-
>
629+
>
587630
> The plots below are placeholders. All of the simulations in this section need to be re-run:
588-
>
631+
>
589632
> - [ ] Final version of the Leios protocol
590633
> - [ ] Realistic mainnet topology
591634
> - [ ] Protocol parameters close to the recommended value
@@ -651,17 +694,17 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
651694
## Path to active
652695

653696
> [!NOTE]
654-
>
697+
>
655698
> Organised in two sub-sections:
656699
657700
- [ ] Clear evidence of stakeholder use cases that require the high transaction throughput that Leios provides.
658701

659702
### Acceptance criteria
660703

661704
> [!NOTE]
662-
>
705+
>
663706
> Describes what are the acceptance criteria whereby a proposal becomes _'Active'_.
664-
>
707+
>
665708
> This sub-section must define a list of criteria by which the proposal can become active. Criteria must relate to observable metrics or deliverables and be reviewed by editors and project maintainers when applicable. For example: "The changes to the ledger rules are implemented and deployed on Cardano mainnet by a majority of the network", or "The following key projects have implemented support for this standard".
666709
667710
- [ ] The revised `cardano-node` implementations pass the node-level conformance test suites.
@@ -673,9 +716,9 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
673716

674717
> [!NOTE]
675718
> Either a plan to meet those criteria or `N/A` if not applicable.
676-
>
719+
>
677720
> This sub-section should define the plan by which a proposal will meet its acceptance criteria, when applicable. More, proposals that require implementation work in a specific project may indicate one or more implementors. Implementors must sign off on the plan and be referenced in the document's preamble.
678-
>
721+
>
679722
> In particular, an implementation that requires a hard-fork should explicitly mention it in its _'Implementation Plan'_.
680723
681724
- [ ] Detailed node-level (as opposed to this protocol-level) specification.
@@ -689,21 +732,21 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
689732
## Versioning
690733

691734
> [!NOTE]
692-
>
735+
>
693736
> if Versioning is not addressed in Specification
694-
>
737+
>
695738
> CIPs must indicate how the defined Specification is versioned. **Note** this does not apply to the CIP text, for which annotated change logs are automatically generated and [available through the GitHub UI](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/viewing-and-comparing-commits/differences-between-commit-views) as a history of CIP files and directories.
696-
>
739+
>
697740
> Authors are free to describe any approach to versioning that allows versioned alterations to be added without author oversight. Stipulating that the proposal must be superseded by another is also considered to be valid versioning.
698-
>
741+
>
699742
> A single Versioning scheme can be placed either as a subsection of the Specification section or in an optional Versioning top-level section near the end. If the Specification contains multiple specification subsections, each of these can have a Versioning subsection within it.
700743
701744
Leios will be versioned via the major and minor version numbers of the Cardano protocol.
702745

703746
## References
704747

705748
> [!NOTE]
706-
>
749+
>
707750
> Optional
708751
709752
- [CPS-18: Greater transaction throughput](https://github.com/cardano-foundation/CIPs/blob/master/CPS-0018/README.md)
@@ -715,7 +758,7 @@ Leios will be versioned via the major and minor version numbers of the Cardano p
715758
## Appendices
716759

717760
> [!NOTE]
718-
>
761+
>
719762
> Optional
720763
721764
### Cryptographic benchmarks
@@ -732,7 +775,7 @@ The following benchmarks for Leios cryptographic operations were computed with R
732775
| Non-persistent voters | 230 µs |
733776

734777
> [!NOTE]
735-
>
778+
>
736779
> Persistent voters are computed once per epoch, non-persistent voters once per pipeline.
737780
738781
**Vote Benchmarks**
@@ -748,7 +791,7 @@ The following benchmarks for Leios cryptographic operations were computed with R
748791
**Certificate Benchmarks**
749792

750793
> [!NOTE]
751-
>
794+
>
752795
> For realistic number of pools, stake distribution, and committee size
753796
754797
| Operation | Timing |
@@ -826,9 +869,9 @@ A cryptographically signed message from an eligible committee member attesting t
826869
## Copyright
827870

828871
> [!NOTE]
829-
>
872+
>
830873
> The CIP must be explicitly licensed under acceptable copyright terms (see below).
831-
>
874+
>
832875
> CIPs are licensed in the public domain. More so, they must be licensed under one of the following licenses. Each new CIP must identify at least one acceptable license in its preamble. In addition, each license must be referenced by its respective abbreviation below in the _"Copyright"_ section.
833876
834877
This CIP is licensed under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0).

0 commit comments

Comments
 (0)