You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cip/README.md
+96-53Lines changed: 96 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ To address this challenge, we propose a transition to Ouroboros Leios — a nove
30
30
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.
31
31
32
32
> [!NOTE]
33
-
>
33
+
>
34
34
> For comprehensive research documentation, development history, and additional technical resources, visit the [Leios R&D website](https://leios.cardano-scaling.org/).
35
35
36
36
<details>
@@ -41,7 +41,7 @@ Leios achieves its scalability through a decoupled block production and aggregat
41
41
## Motivation: why is this CIP necessary?
42
42
43
43
> [!NOTE]
44
-
>
44
+
>
45
45
> 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`.
46
46
47
47
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
63
63
## Specification
64
64
65
65
> [!NOTE]
66
-
>
66
+
>
67
67
> 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
+
>
69
69
> This section must address the [Versioning](#versioning) requirement unless this is addressed in an optional Versioning section.
70
-
>
70
+
>
71
71
> If a proposal defines structure of on-chain data it must include a CDDL schema.
72
72
73
73
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
81
81
>
82
82
> TODO: cover phase1/2 split this idea into rationale and path to active sections
83
83
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
87
85
88
86
**Five-Stage Pipeline**: The protocol operates through a structured five-stage pipeline:
89
87
1.**Propose** - IBs generated uniformly
@@ -96,9 +94,25 @@ To understand the ledger design challenges, it's essential first to understand t
96
94
97
95
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.
98
96
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.
100
100
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.
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?
102
116
103
117
#### Endorser Blocks (EBs)
104
118
@@ -108,9 +122,46 @@ Aggregation blocks that reference multiple IBs from the current pipeline. EBs ar
108
122
109
123
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.
110
124
111
-
#### Ranking Blocks (RBs)
125
+
#### Input Blocks (IBs)
112
126
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:
> 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?
114
165
115
166
### Fundamental challenges
116
167
@@ -121,7 +172,7 @@ The concurrent nature of input block (IB) production in Leios introduces fundame
121
172
The primary challenges introduced by concurrent block production include:
122
173
123
174
-**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
125
176
-**Fee payment**: How to guarantee SPOs are compensated for their work when conflicts occur
126
177
-**Inclusion delays**: Balancing immediate inclusion with conflict prevention mechanisms
127
178
@@ -170,21 +221,13 @@ Three primary approaches have been identified to address these challenges:
170
221
171
222
Each approach offers different trade-offs between the seven properties, and the choice depends on the specific requirements and constraints of the deployment scenario.
172
223
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?
181
224
182
225
### Constraints on Leios protocol parameters
183
226
184
227
> [!WARNING]
185
-
>
228
+
>
186
229
> This is an incomplete work in progress.
187
-
>
230
+
>
188
231
> -[ ] Revise after protocol definition is complete.
189
232
> -[ ] Add paragraphs explain the rationale in more detail.
190
233
@@ -212,7 +255,7 @@ Leios is flexible regarding the details of [votes](#vote), certificates, and sor
212
255
213
256
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.
214
257
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.
216
259
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.
217
260
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.
218
261
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.
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.
250
293
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
252
295
253
296
$$
254
297
\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
292
335
- Aggregate signatures
293
336
-*Signed message:* This aggregate BLS signature on the message is 48 bytes (compressed).
294
337
-*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
+
296
339
Thus the total certificate size is
297
340
298
341
$$
@@ -308,33 +351,33 @@ but not including any minor overhead arising from CBOR serialization. As noted p
308
351
#### IB schema
309
352
310
353
> [!IMPORTANT]
311
-
>
354
+
>
312
355
> -[ ] Translate the Agda type for input blocks into CDDL.
313
356
314
357
#### EB schema
315
358
316
359
> [!IMPORTANT]
317
-
>
360
+
>
318
361
> -[ ] Translate the Agda type for endorser blocks into CDDL.
319
362
320
363
#### Certificate schema
321
364
322
365
> [!IMPORTANT]
323
-
>
366
+
>
324
367
> -[ ] Translate the Agda type for certificates into CDDL.
325
368
326
369
#### RB schema
327
370
328
371
> [!IMPORTANT]
329
-
>
372
+
>
330
373
> -[ ] Provide the diff for the CDDL for Praos blocks, so that Leios certificates are included.
331
374
332
375
## Rationale: how does this CIP achieve its goals?
333
376
334
377
> [!NOTE]
335
-
>
378
+
>
336
379
> 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
+
>
338
381
> 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.
339
382
340
383
### How Leios increases throughput
@@ -350,9 +393,9 @@ In analogy, imagine Praos as a single courier diligently collecting and deliveri
350
393
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.
351
394
352
395
> [!CAUTION]
353
-
>
396
+
>
354
397
> The plots below are placeholders. All of the simulations in this section need to be re-run:
355
-
>
398
+
>
356
399
> -[ ] Final version of the Leios protocol
357
400
> -[ ] Realistic mainnet topology
358
401
> -[ ] Protocol parameters close to the recommended value
@@ -431,9 +474,9 @@ Although the version of Leios proposed in this document does not support the par
431
474
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.
432
475
433
476
> [!WARNING]
434
-
>
477
+
>
435
478
> This is an incomplete work in progress.
436
-
>
479
+
>
437
480
> -[ ] Revise after the protocol definition is complete.
438
481
> -[ ] Each row should have a paragraph of justification.
439
482
@@ -489,9 +532,9 @@ Nearly all of these *hypothetical* threats are already mitigated by the protocol
489
532
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.
490
533
491
534
> [!CAUTION]
492
-
>
535
+
>
493
536
> The plots below are placeholders. All of the simulations in this section need to be re-run:
494
-
>
537
+
>
495
538
> -[ ] Final version of the Leios protocol
496
539
> -[ ] Realistic mainnet topology
497
540
> -[ ] Protocol parameters close to the recommended value
@@ -557,17 +600,17 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
557
600
## Path to active
558
601
559
602
> [!NOTE]
560
-
>
603
+
>
561
604
> Organised in two sub-sections:
562
605
563
606
-[ ] Clear evidence of stakeholder use cases that require the high transaction throughput that Leios provides.
564
607
565
608
### Acceptance criteria
566
609
567
610
> [!NOTE]
568
-
>
611
+
>
569
612
> Describes what are the acceptance criteria whereby a proposal becomes _'Active'_.
570
-
>
613
+
>
571
614
> 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".
572
615
573
616
-[ ] The revised `cardano-node` implementations pass the node-level conformance test suites.
@@ -579,9 +622,9 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
579
622
580
623
> [!NOTE]
581
624
> Either a plan to meet those criteria or `N/A` if not applicable.
582
-
>
625
+
>
583
626
> 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.
584
-
>
627
+
>
585
628
> In particular, an implementation that requires a hard-fork should explicitly mention it in its _'Implementation Plan'_.
586
629
587
630
-[ ] Detailed node-level (as opposed to this protocol-level) specification.
@@ -595,21 +638,21 @@ Note that by 2029, to compensate for Reserve depletion, the network would need t
595
638
## Versioning
596
639
597
640
> [!NOTE]
598
-
>
641
+
>
599
642
> if Versioning is not addressed in Specification
600
-
>
643
+
>
601
644
> 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.
602
-
>
645
+
>
603
646
> 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.
604
-
>
647
+
>
605
648
> 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.
606
649
607
650
Leios will be versioned via the major and minor version numbers of the Cardano protocol.
@@ -621,7 +664,7 @@ Leios will be versioned via the major and minor version numbers of the Cardano p
621
664
## Appendices
622
665
623
666
> [!NOTE]
624
-
>
667
+
>
625
668
> Optional
626
669
627
670
### Cryptographic benchmarks
@@ -638,7 +681,7 @@ The following benchmarks for Leios cryptographic operations were computed with R
638
681
| Non-persistent voters | 230 µs |
639
682
640
683
> [!NOTE]
641
-
>
684
+
>
642
685
> Persistent voters are computed once per epoch, non-persistent voters once per pipeline.
643
686
644
687
**Vote Benchmarks**
@@ -654,7 +697,7 @@ The following benchmarks for Leios cryptographic operations were computed with R
654
697
**Certificate Benchmarks**
655
698
656
699
> [!NOTE]
657
-
>
700
+
>
658
701
> For realistic number of pools, stake distribution, and committee size
659
702
660
703
| Operation | Timing |
@@ -732,9 +775,9 @@ A cryptographically signed message from an eligible committee member attesting t
732
775
## Copyright
733
776
734
777
> [!NOTE]
735
-
>
778
+
>
736
779
> The CIP must be explicitly licensed under acceptable copyright terms (see below).
737
-
>
780
+
>
738
781
> 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.
739
782
740
783
This CIP is licensed under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0).
0 commit comments