bitcoin-musig2
БесплатноБез исполняемых скриптовНе проверенMuSig2 (BIP327): two-round Schnorr key aggregation for n-of-n multisig. Aggregates n public keys into a single 32-byte x-only pubkey indistinguishable from a…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
MuSig2 (BIP327)
Quick refs: protocol.md, key-agg.md, attacks.md
MuSig2 is the standard Schnorr key-aggregation protocol for Bitcoin.
n parties hold separate private keys, jointly produce a single public
key Q and a single signature (R, s) indistinguishable from a
single-key Schnorr signature.
Replaces MuSig1 (3-round) and MuSig-DN with simpler 2-round + better security proofs.
BIP327 is Status: Deployed, spec version 1.0.4 (as of September 2026).
Properties
- Indistinguishable — observers cannot tell
Qwas aggregated. - Off-chain coordination — n-of-n in 2 rounds with no on-chain multisig.
- Provably secure in the Algorithmic One-More-Discrete-Log (AOMDL)
- Random Oracle Model.
- Fits Taproot key-path — cheapest spend; no script-path needed for cooperative case.
Two-round protocol summary
Round 1 — Nonce exchange
Each signer i:
- Generates two ephemeral nonces
(k_{i,1}, k_{i,2}). - Computes
(R_{i,1}, R_{i,2}) = (k_{i,1}*G, k_{i,2}*G). - Broadcasts
R_{i,1}, R_{i,2}to all other signers (66 bytes total).
Aggregator computes:
R_1 = sum(R_{i,1}),R_2 = sum(R_{i,2}).b = TaggedHash("MuSig/noncecoef", R_1 || R_2 || agg_pubkey || msg).R = R_1 + b*R_2.
Round 2 — Partial sig exchange
Each signer i:
- Computes their partial sig
s_iusingR, message, key-agg coefficienta_i, etc. - Broadcasts
s_i.
Aggregator: s = sum(s_i) mod n.
Final sig: (R.x, s) — 64 bytes, valid BIP340 sig under Q.
Key aggregation
Inputs: pubkeys P_1, ..., P_n (in agreed-upon order)
1. L = sorted(P_i) (canonical order, byte-lex)
2. a_i = TaggedHash("KeyAgg coefficient", L || P_i.x)
3. Q = sum(a_i * P_i)
If Q.y is odd, parity bit g_q = -1, otherwise g_q = +1. This
parity is tracked through signing.
The coefficients a_i defeat the rogue-key attack that MuSig1
patched but earlier schemes had: an attacker who could pick their
public key after seeing others' would otherwise control the sum.
Tweaks (Taproot integration)
After key aggregation, Taproot tweak applies:
Q_tweaked = Q + t*G where t = TaggedHash("TapTweak", Q.x || merkle_root)
Signing for Q_tweaked requires an extra adjustment in the partial
sig phase. BIP327 specifies "tweak context" maintaining the
accumulated tweak.
Pre-shared nonces (NonceGen variants)
NonceGendeterministic from secret + msg + extra_in.- "MuSig2 with non-determinism" requires careful aux entropy.
- Critical: nonces must NOT be reused across different signing sessions, even with different messages. State must be persisted carefully (e.g., in encrypted nonce wallet).
Use cases in Bitcoin
- Joint custody — 2 partners co-spend with single-sig appearance.
- Lightning — Taproot channels (BOLT update) replace OP_2 pubkey with MuSig2-aggregated key for channel funding output.
- DAO multisig with privacy — n directors sign as one.
- Vault hot/cold cooperative spend — cold key + hot key aggregated for everyday use.
- Coinjoin servers with k-anonymity → users + service jointly sign.
Descriptors, PSBTs and wallet integration
BIP327 covers only the signing math. Three companion BIPs (all by Ava Chow) carry MuSig2 into wallet software — statuses as of September 2026:
- BIP328 (Complete) — Derivation Scheme for MuSig2 Aggregate
Keys. Wraps a plain aggregate pubkey in a synthetic xpub:
depth 0, child number 0, fixed chaincode
868087ca02a6f974c4598924c36b57762d32cb45717167e300622c7167e38965(SHA256 of the textMuSig2MuSig2MuSig2). Only unhardened derivation is possible — there is no aggregate private key. EachCKDpubstep'sI_Lenters the session context as a plain tweak (is_xonly_t = false), so every signer must recompute the derivation tweaks for the child key being signed for. - BIP390 (Draft, v0.2.0) — the
musig(KEY,KEY,...,KEY)descriptor key expression. Allowed only insidetr(),rawtr()orsp(), never nested in anothermusig(). Keys are sorted withKeySortafter all derivation and before aggregation, so the order written in the descriptor does not matter.musig(...)/NUM/.../*derives from the aggregate key per BIP328, and is legal only when every participant is an xpub (or derived from one) and no participant itself uses/*or/<NUM;NUM;...>. No hardened steps aftermusig(). - BIP373 (Complete) — MuSig2 PSBT Fields, carrying both rounds
through an otherwise ordinary PSBT workflow:
PSBT_IN_MUSIG2_PARTICIPANT_PUBKEYS(0x1a),PSBT_IN_MUSIG2_PUB_NONCE(0x1b),PSBT_IN_MUSIG2_PARTIAL_SIG(0x1c) andPSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS(0x08).
Bitcoin Core parses musig() descriptors and reads/writes the BIP373
PSBT fields from v30.0 (October 2025); descriptor support merged
in PR #31244 (2025-07-31). Core accepts musig() only insi
Установить bitcoin-musig2 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobВложенные файлы
FAQ
Что делает скилл bitcoin-musig2?
MuSig2 (BIP327): two-round Schnorr key aggregation for n-of-n multisig. Aggregates n public keys into a single 32-byte x-only pubkey indistinguishable from a single-sig. Used in Taproot cooperative spends. Quick refs: protocol round-trip, key aggregation math, common attacks. USE WHEN: implementing n-of-n cooperative Taproot signing, designing Lightning Taproot channels, joint custody.
Как установить скилл bitcoin-musig2?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bitcoin-musig2 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic