Skip to content

BIP460: CISA for Taproot key path spends - #36122

Draft
fjahr wants to merge 22 commits into
bitcoin:masterfrom
fjahr:bip460
Draft

fjahr wants to merge 22 commits into
bitcoin:masterfrom
fjahr:bip460

Conversation

@fjahr

@fjahr fjahr commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Reference implementation of BIP460 Cross-Input Signature Aggregation for Taproot key path spends. Implements witness v2 outputs whose key path spends can be aggregated with BIP458 half-aggregation or BIP459 full-aggregation, or opt out with a plain BIP341 signature.

Draft to accompany the BIPs, not intended for merge:

Further notes:

@DrahtBot

DrahtBot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #37055 (refactor: drop format calls on strings without arguments by fanquake)
  • #36986 (rpc, wallet: Convert walletprocesspsbt to use options parameter by jeanpablojp)
  • #36918 (Witness stacks in serialized form (optimization follow-ups) by sipa)
  • #36897 (wallet, migration: Contain all legacy wallet and migration related things in its own subdirectory, namespace, and classes by achow101)
  • #36885 (wallet, rpc: Add analyzedescriptor for multisig setups by pablomartin4btc)
  • #36820 (refactor: remove more dead code by fanquake)
  • #36794 (test: make script_combineSigs and spends_witness_prog cases independent by alexanderwiederin)
  • #36648 (descriptor, rpc, wallet: do not echo key material in error messages by fametrano)
  • #36409 (sign: use fresh randomness as BIP340 auxiliary data by fametrano)
  • #36167 (build: Enable -Wunused by fanquake)
  • #36154 (wallet: fill PSBT_GLOBAL_XPUB by jeanpablojp)
  • #36039 (psbt: classify missing Taproot script-path signatures as signer by btcpavao)
  • #35918 (descriptor: Expose key expression parsing by pseudoramdom)
  • #35793 (Implement BIP 54 (Consensus Cleanup) without mainnet activation by darosior)
  • #35662 (script: prevent partial reinitialization of sighash data by l0rinc)
  • #35444 (wallet: make descriptor SPKM mutex non-recursive by w0xlt)
  • #34520 (refactor: Add [[nodiscard]] to functions returning bool+mutable ref by maflcko)
  • #32857 (wallet: allow skipping script paths by Sjors)
  • #32575 (consensus: Remove special treatment for single threaded script checking by fjahr)
  • #29491 ([EXPERIMENTAL] Schnorr batch verification for blocks by fjahr)
  • #27260 (Enhanced error messages for invalid network prefix during address parsing. by portlandhodl)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • src/test/cisa_tests.cpp: key.Set(privkey.begin(), privkey.end(), true)
  • src/test/cisa_tests.cpp: tweaked_key.Set(tweaked_privkey.begin(), tweaked_privkey.end(), true)
  • test/functional/feature_cisa.py: TaprootSignatureHash(tx, spent, 0, input_index=0) (explicit-default test)
  • test/functional/feature_cisa.py: TaprootSignatureHash(tx, spent, 0, input_index=0) (marker-byte test)
  • test/functional/feature_cisa.py: TaprootSignatureHash(tx, spent, 0, input_index=6)
  • test/functional/feature_cisa.py: TaprootSignatureHash(tx, spent, 0, input_index=0, scriptpath=True, ...)
  • test/functional/feature_cisa.py: TaprootSignatureHash(tx, spent, 0, input_index=idx)

Possible places where comparison-specific test macros should replace generic comparisons:

  • test/functional/test_framework/cisa.py: assert len(pk) == 32 and len(msg) == 32 and len(sig) == 64 → Prefer assert_equal checks for each length.
  • test/functional/test_framework/cisa.py: assert u == len(seckeys) > 0 → Prefer assert_equal(u, len(msgs)) and assert_greater_than(u, 0).

2026-11-27 18:51:49

@fjahr

fjahr commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

The latest commits, prefixed with draft-bip: go further than BIP460 itself. They implement two companion BIPs necessary for adoption that have not been reviewed and I don't think they are worth sharing on the mailing list yet either:

They are included so that wallets and protocols, like payjoin or coinjoin for example, can build proofs of concept on top of this branch and exercise CISA end-to-end through the their already common descriptor, wallet and PSBT RPCs flows. Expect these commits to change as these drafts evolve. Review of the consensus and policy commits does not depend on them and I would prefer if review is focused on those unless you are building a PoC and depend on these later changes.

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