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/leios-design/README.md
+40-7Lines changed: 40 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -505,13 +505,12 @@ Non-persistent voters, on the other hand, are selected independently for each EB
505
505
Registered voters can generate and cast votes, each including an `endorser_block_hash` field that uniquely identifies the target EB.
506
506
Collected votes are then aggregated into a compact certificate.
507
507
508
-
#### Leios Voting in a Nutshell
508
+
**Leios Voting in a Nutshell**
509
509
-**Key Generation**
510
510
- A secret key ($sk$) is created to generate signatures for the corresponding signature scheme.
511
511
- The public key ($pk$) is securely derived from $sk$ and used to verify the corresponding signatures.
512
512
- A proof of possession ($PoP$) is generated for $sk$ to ensure key ownership.
513
513
> Note that keys are not rotated periodically, as forward security is not required for IBs, EBs, or votes.
514
-
515
514
-**Key Registration**
516
515
- The registration process is responsible for storing public keys and verifying proof of possession.
517
516
- Each stake pool registers with the following information:
@@ -520,17 +519,14 @@ Collected votes are then aggregated into a compact certificate.
520
519
- $PoP$
521
520
- A KES signature over the Pool ID, $pk$, and $PoP$
522
521
- Nodes verify the $PoP$s of all received $pk$s to confirm their validity.
523
-
524
522
-**Voter Determination**
525
523
- For each epoch, *persistent voters* are selected based on the stake distribution and participate in every election during that epoch.
526
524
- Within the same epoch, *non-persistent voters* are chosen randomly and independently for each election.
527
-
528
525
-**Voting**
529
526
- Voters sign the election ID and the EB hash with their $sk$.
530
527
- Each vote includes the election ID, the EB hash, and the corresponding signature.
531
528
- Persistent votes additionally include an epoch-specific identifier of the stake pool.
532
529
- Non-persistent votes include the Pool ID and an eligibility signature on the election ID.
533
-
534
530
-**Certificate Generation**
535
531
- Upon receiving votes, both voter identities and their signatures are verified.
536
532
- Non-persistent votes are further validated for eligibility.
@@ -541,7 +537,8 @@ Collected votes are then aggregated into a compact certificate.
541
537
- Eligibility proofs for non-persistent voters
542
538
- An aggregate signature combining all individual voter signatures
543
539
544
-
#### Requirements
540
+
**Requirements**
541
+
545
542
The voting and certificate scheme in Leios must satisfy key requirements to ensure security, efficiency, and practical deployability.
546
543
547
544
Key registration should be lightweight, requiring minimal data exchange or coordination among participants.
@@ -563,7 +560,7 @@ The large size of Praos KES signatures makes them unsuitable, highlighting the n
563
560
Lastly, the cryptographic operations for eligibility verification, vote generation, and certificate validation must be highly efficient.
564
561
The total workload should stay well within the CPU budget for Leios stages, ensuring strong performance and scalability under real-world conditions.
565
562
566
-
#### Design Choices
563
+
**Design Choices**
567
564
568
565
Several certificate schemes were evaluated for Leios, including ALBA variants, SNARK-based voting schemes, and BLS-based certificates, with the goal of identifying a design that best satisfies the security, efficiency, and deployability requirements described above.
569
566
After comparison, BLS certificates based on the *Fait Accompli* sortition scheme were selected as the preferred approach.
@@ -577,6 +574,42 @@ This approach is advantageous because it enables the aggregation of public keys
577
574
Beyond Leios, the BLS mechanism is also relevant to other Cardano subsystems; Mithril already employs BLS-based aggregation, and Peras is expected to adopt a similar approach in future implementations.
578
575
579
576
#### Implementation Plan
577
+
To implement the linear Leios design, efficient BLS signature functionality is essential for achieving fast and compact certificate generation.
578
+
With the adoption of [CIP-0381](https://cips.cardano.org/cip/CIP-0381), `cardano-base` already provides foundational utilities for BLS operations, offering a solid basis for this integration.
579
+
Building on these capabilities, the implementation plan introduces additional bindings and helper modules to ensure smooth interaction with the Leios protocol within the Haskell node.
580
+
581
+
This section presents the implementation plan for extending `cardano-base` with BLS signature support and outlines the modifications required to satisfy Leios-specific needs.
582
+
The requirements are organized into two main categories: **core functionality**, which defines the essential BLS operations needed, and **performance and quality**, which ensures the implementation meets the expected efficiency, reliability, and maintainability standards.
583
+
584
+
**Core functionality**
585
+
-**BLS types:** The `BLS12_381.Internal` module in `cardano-base` already provides a comprehensive set of types designed for safe interaction with the linked C functions from the `blst` library. As part of the integration effort, it is necessary to evaluate which additional types should be introduced beyond those already defined, ensuring full support for the BLS functionality required by Leios.
586
+
-**Key generation:**
587
+
- Secure key generation must ensure strong randomness and resilience against side-channel attacks. To achieve this, an integration with the `blst` library through a FFI is required. This involves adding the necessary foreign function imports to the `BLS12_381.Internal` module and implementing the corresponding `SecretKey` type to enable safe and efficient handling of secret keys within the Haskell environment.
588
+
- The `blst` library exposes a key-generation function [`blst_keygen`](https://github.com/supranational/blst/blob/e7f90de551e8df682f3cc99067d204d8b90d27ad/bindings/blst.h#L330)
which derives a secret key from input keying material (IKM) and optional `info`. To use this safely in `cardano-base`, we need to clarify the security guarantees of this construction: what qualifies as a cryptographically secure IKM (length, entropy, generation source) and how `info` should be used (additional entropy vs. domain/context bytes). In parallel, we should examine how `cardano-base` currently sources seeds for other schemes in the `DSIGN` class, review the `blst` keygen C implementation to assess robustness and side-channel posture, align our requirements with the IETF BLS draft’s guidance on key generation (see the “KeyGen” section in the CFRG draft), and determine whether `info` is treated as entropy input or merely contextual/domain-separation data; documenting these findings will let us standardize secure IKM generation and `info` usage for BLS within `cardano-base`.
593
+
-**Proof-of-Possession:** The `blst` C library does not provide a direct interface for generating a proof of possession ($PoP$). Therefore, this functionality must be implemented manually in `cardano-base`, leveraging the existing `blst` bindings to construct a $PoP$ from the available primitives.
594
+
-**Public key derivation:** Implement deterministic derivation of the public key ($pk$) from the corresponding secret key ($sk$) for the selected BLS variant. This requires adding a FFI binding to the `blst` library to enable secure and efficient key derivation within `cardano-base`.
595
+
-**Signature:** Implement signature generation and verification APIs that are variant-agnostic and support domain separation, with DST provided by the caller.
0 commit comments