Skip to content

Add BLS key support#1148

Merged
palas merged 3 commits intomasterfrom
bls-key-gen-and-hash
Mar 23, 2026
Merged

Add BLS key support#1148
palas merged 3 commits intomasterfrom
bls-key-gen-and-hash

Conversation

@palas
Copy link
Contributor

@palas palas commented Mar 23, 2026

Changelog

- description: |
    Added support for BLS keys.
  type:
    - feature
  projects:
    - cardano-api

Context

This works towards addressing the first part of: input-output-hk/ouroboros-leios#776

It adds a new kind of key (BLS), in order to be able to support key generation and hashing for this kind of key in cardano-cli. See PR: IntersectMBO/cardano-cli#1355

How to trust this PR

This follows the pattern for other keys, the only major decision is the usage of BLS12381MinSigDSIGN curve, instead of the other one. Also, you can test this code by using the CLI PR that is based in this PR: IntersectMBO/cardano-cli#1355

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@palas palas self-assigned this Mar 23, 2026
Copilot AI review requested due to automatic review settings March 23, 2026 17:14
@palas palas requested review from Jimbo4350 and dcoutts as code owners March 23, 2026 17:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds BLS12-381 (MinSig) key support to cardano-api so downstream tooling (e.g., cardano-cli) can generate, serialise, and hash BLS keys.

Changes:

  • Introduces a new internal BlsKey type with Key, Bech32, raw-bytes, CBOR, and text-envelope instances.
  • Extends SomeAddressVerificationKey to include BLS verification keys in rendering/mapping/deserialisation.
  • Exposes BlsKey (and AsBlsKey) via Cardano.Api.Key and wires the new module into the Cabal library.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
cardano-api/src/Cardano/Api/Key/Internal/SomeAddressVerificationKey.hs Adds a BLS constructor and includes it in Bech32 rendering/mapping/deserialisation.
cardano-api/src/Cardano/Api/Key/Internal/Leios.hs New module defining BlsKey and associated instances for serialisation and hashing.
cardano-api/src/Cardano/Api/Key.hs Re-exports BlsKey and AsBlsKey in the public API.
cardano-api/cardano-api.cabal Exposes the new Cardano.Api.Key.Internal.Leios module.

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

Can you add some haddocks describing what this key is for?

@palas palas force-pushed the bls-key-gen-and-hash branch 2 times, most recently from 1d8c253 to 7d1acd8 Compare March 23, 2026 21:00
@palas palas enabled auto-merge March 23, 2026 21:43
@palas palas added this pull request to the merge queue Mar 23, 2026
Merged via the queue into master with commit 0e1989c Mar 23, 2026
41 of 52 checks passed
@palas palas deleted the bls-key-gen-and-hash branch March 23, 2026 22:58
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.

Tools for key generation and registration

3 participants