Skip to content

[Leios] BLS voting primitives in the core crypto structure - #1304

Open
williamdemeo wants to merge 3 commits into
leios-mainfrom
leios-bls-primitives
Open

[Leios] BLS voting primitives in the core crypto structure#1304
williamdemeo wants to merge 3 commits into
leios-mainfrom
leios-bls-primitives

Conversation

@williamdemeo

Copy link
Copy Markdown
Member

Splits the first commit out of #1300, as agreed with @ch1bo on Slack, with his authorship on the commit: the abstract BLS carriers and verification predicates (BlsVKey, BlsSig, BlsPoP, isValidPoP, isSignedByAggregate over Ser) and the strict total order on key hashes that serves as the Leios committee tie-break, added to Ledger.Core.Specification.Crypto's CryptoStructure and mirrored in the Foreign instance and the test implementation, plus the BlsKeyMaxAgeᶜ voting-key time-to-live in the genesis constants.

This part of #1300 is stable under both answers to the open key-registration question (the pool-registration field of CIP-164's current text, or the dedicated certificate with expiry of cardano-scaling/CIPs#38), and both [LLF1-2] (#1298) and [LLF1-3] (#1301) build on it, so it lands first; #1300 rebases on top once the registration mechanism is settled.

Refs #1295, #1298.

ch1bo and others added 2 commits September 1, 2026 18:51
CIP-164's voting scheme needs BLS12-381 keys with proofs of possession
and aggregate signature verification, abstracted here like the existing
PKKScheme.  The strict total order on key hashes is the committee
tie-break (byte-wise ascending pool id).  BlsKeyMaxAgeᶜ joins the
genesis constants: a registered voting key is honoured for that many
epochs, mirroring the KES rotation cadence (recommendation: 20).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 17cdefc)
The line is #1300's own wording for this commit, taken verbatim so the
eventual rebase of #1300 drops it cleanly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The interface additions are consistently propagated to the foreign and test implementations with no unresolved correctness issues.

Pull request overview

Adds foundational Leios BLS voting abstractions and voting-key lifetime configuration to the core ledger specification.

Changes:

  • Extends CryptoStructure with BLS types, verification predicates, and ordered key hashes.
  • Adds BlsKeyMaxAgeᶜ to global constants.
  • Updates foreign and test implementations accordingly.
File summaries
File Description
CHANGELOG.md Records the new Leios primitives.
src/Ledger/Core/Specification/Crypto.lagda.md Defines BLS abstractions and key-hash ordering.
src/Ledger/Core/Specification/Epoch.lagda.md Defines voting-key maximum age.
src/Ledger/Core/Foreign/Crypto/Structure.agda Implements the new crypto fields.
src/Ledger/Core/Foreign/Epoch.agda Supplies the foreign expiry constant.
formal-ledger-test/src/Test/LedgerImplementation.lagda.md Supplies test implementations for the new fields.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

-- BLS12-381 signature scheme used for Leios voting (CIP-0164).
field BlsVKey BlsSig BlsPoP : Type
isValidPoP : BlsVKey → BlsPoP → Type
isSignedByAggregate : List BlsVKey → Ser → BlsSig → Type

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the order of BlsVKeys matter? (Maybe this should be a set?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer List type to Set, but we can discuss.

Comment thread src/Ledger/Core/Specification/Crypto.lagda.md
Comment thread src/Ledger/Core/Specification/Crypto.lagda.md Outdated
Quorum : ℕ
NetworkId : Network
-- Epochs a registered Leios voting key is honoured before it must be re-registered (CIP-0164).
BlsKeyMaxAgeᶜ : ℕ

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a constant or a pparam?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants