Skip to content

BIP458: Half-Aggregation of BIP 340 Signatures#2205

Open
fjahr wants to merge 3 commits into
bitcoin:masterfrom
fjahr:halfagg
Open

BIP458: Half-Aggregation of BIP 340 Signatures#2205
fjahr wants to merge 3 commits into
bitcoin:masterfrom
fjahr:halfagg

Conversation

@fjahr

@fjahr fjahr commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

This is the BIP draft for half-aggregation of BIP340 Schnorr signatures, which has marinated at https://github.com/BlockstreamResearch/cross-input-aggregation/blob/master/half-aggregation.mediawiki long enough.

Mailing list discussion: https://gnusha.org/pi/bitcoindev/33f275c2-06b1-4b4a-2a75-cafe36836503@gmail.com/

Compared to the master version of the BIP linked above and the state of things at the time of sharing this on the mailing list, this version has a few minor typo fixes as well as three significant changes:

  1. Removal of a max signatures limit, see halfagg: Remove fixed limit BlockstreamResearch/cross-input-aggregation#16
  2. Replacement of the reference implementation in hacspec with one in Python, based on secp256k1lab. See halfagg: Add Python specification and extensive test vectors BlockstreamResearch/cross-input-aggregation#21 which also adds the test vectors

Given the Python reference implementation, I am vendoring the latest master of secp256k1lab with the BIP, as seems to be the standard with other BIPs (seen merged at 374 and in the pull for 445).

@jonatack jonatack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks quite complete. Might be good to add a backward compatibility section (if not needed, that could be explicitly stated).

Comment thread bip-XXXX.mediawiki Outdated
Comment thread bip-0458.mediawiki
fjahr added a commit to fjahr/secp256k1 that referenced this pull request Jun 28, 2026
Code is based on the secp256k1-zkp implementation. Test vectors based on
the draft BIP: bitcoin/bips#2205

Co-authored-by: Benedikt <crypto@benedikt-wagner.dev>
fjahr added a commit to fjahr/secp256k1 that referenced this pull request Jun 28, 2026
Code is based on the secp256k1-zkp implementation. Test vectors based on
the draft BIP: bitcoin/bips#2205

Co-authored-by: Benedikt <crypto@benedikt-wagner.dev>
fjahr added a commit to fjahr/secp256k1 that referenced this pull request Jun 28, 2026
Code is based on the secp256k1-zkp implementation. Test vectors based on
the draft BIP: bitcoin/bips#2205

Co-authored-by: Benedikt <crypto@benedikt-wagner.dev>
@fjahr

fjahr commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Addressed your comments @jonatack , thanks!

Might be good to add a backward compatibility section (if not needed, that could be explicitly stated).

I added a "section not needed" section ;)

@theStack theStack 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.

Nice! Left some notation and style nits below (mostly related to secp256k1lab usage).

Comment thread bip-XXXX/run_test_vectors.py Outdated
Comment thread bip-0458.mediawiki

==== Notation ====

The following conventions are used, with constants as defined for [https://www.secg.org/sec2-v2.pdf secp256k1]. We note that adapting this specification to other elliptic curves is not straightforward and can result in an insecure scheme<ref>Among other pitfalls, using the specification with a curve whose order is not close to the size of the range of the nonce derivation function is insecure.</ref>.

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.

Fwiw, in BIP-445 a different notation is used (for the first time, as far as I'm aware) that leans more to secp256k1lab, with a table showing how the notation maps to the lab functions: https://github.com/siv2r/bips/blob/bip-frost-signing/bip-0445.md?plain=1#L255

(I found that quite a nice idea for improved readability and hopefully easier navigation through the reference implementation; but that's of course more a nit than a requirement; ultimately it's up to the BIP authors).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I didn't quite pick up on this despite looking at the BIP445 draft for some inspiration. But I am not sure it's the best idea to adapt this notation fully here. I think there is also some value in having the notation closer to BIP340 which is a prerequisite to this BIP here while BIP445 is not directly related. I did steal the idea of the mapping table though, please let me know if you agree with this decision and think the mapping table on it's own is helpful.

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.

Yeah good point, keeping the notation intentionally close to BIP340 seems reasonable. I think the small mapping table you added is definitely helpful for (reference implementation) readers.

Comment thread bip-XXXX/halfagg.py Outdated
Comment thread bip-XXXX/halfagg.py Outdated
Comment thread bip-XXXX/halfagg.py Outdated
@fjahr

fjahr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed feedback from @theStack , thanks a lot!

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, that was a splendid read. I especially enjoyed the ventilated prose. Looks like you have all the sections covered, already have a reference implementation, and the text is very polished already. I don’t have any improvement suggestions at this time, so let’s just go right ahead: assigned BIP454. Please move the document and auxiliary files to the corresponding file paths, update the BIP and Assigned headers, and add a table entry to the README.mediawiki.

@murchandamus murchandamus changed the title BIP draft: Half-Aggregation of BIP 340 Signatures BIP454: Half-Aggregation of BIP 340 Signatures Jul 1, 2026
@fjahr

fjahr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

that was a splendid read

Nice, 99% of that praise goes to @jonasnick and @real-or-random !

assigned BIP454

Thanks! I applied the necessary changes.

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM. Since this just got opened, I suggest we let it simmer for at least a couple weeks to see if there is any more useful review, but otherwise, this seems pretty much ready for publication to me. What do you think?

@fjahr

fjahr commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Since this just got opened, I suggest we let it simmer for at least a couple weeks to see if there is any more useful review, but otherwise, this seems pretty much ready for publication to me. What do you think?

Yeah, that sounds good for me. I will publish the draft for fullagg shortly and maybe there will be some additional feedback here from having the two side by side.

@murchandamus murchandamus changed the title BIP454: Half-Aggregation of BIP 340 Signatures BIP458: Half-Aggregation of BIP 340 Signatures Jul 6, 2026
@murchandamus

Copy link
Copy Markdown
Member

Assigned new number per request of @fjahr. Let’s refer to this as 458 instead of 454. Please update the table and preamble accordingly.

fjahr added 3 commits July 7, 2026 00:28
Add a vendored copy of the secp256k1lab library (master branch, commit
a265da139aea27386085a2a8760f8698e1bda64e) that the half-aggregation
reference implementation and test vector scripts depend on.
@fjahr

fjahr commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Assigned new number per request of @fjahr. Let’s refer to this as 458 instead of 454. Please update the table and preamble accordingly.

Done! Thanks and sorry for the inconvenience.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants