Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bip-0327.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
License: BSD-3-Clause
Discussion: 2022-04-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020198.html [bitcoin-dev] MuSig2 BIP
2022-10-11: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html [bitcoin-dev] MuSig2 BIP
Version: 1.0.4
Version: 1.0.5
</pre>

== Introduction ==
Expand Down Expand Up @@ -782,6 +782,8 @@ An exception to this rule is <code>MAJOR</code> version zero (0.y.z) which is fo
The <code>MINOR</code> version is incremented whenever the inputs or the output of an algorithm changes in a backward-compatible way or new backward-compatible functionality is added.
The <code>PATCH</code> version is incremented for other changes that are noteworthy (bug fixes, test vectors, important clarifications, etc.).

* '''1.0.5''' (2026-10-11):
** Add test vectors for cases not previously covered.
* '''1.0.4''' (2026-08-19):
** Fix two minor bugs in the specification of ''PartialSigAgg''.
* '''1.0.3''' (2026-01-05):
Expand Down
9 changes: 8 additions & 1 deletion bip-0327/gen_vectors_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def sig_agg_vectors():
"75448A87274B056468B977BE06EB1E9F657577B7320B0A3376EA51FD420D18A8"])
msg = bytes.fromhex("599C67EA410D005B9DA90817CF03ED3B1C868E4DA4EDF00A5880B0082C237869")

psigs = [None] * 9
psigs = [None] * 10

valid_test_cases = [
{
Expand Down Expand Up @@ -111,6 +111,13 @@ def sig_agg_vectors():
"tweak_indices": [0, 1, 2],
"is_xonly": [True, False, True],
"psig_indices": [6, 7],
}, {
"aggnonce": None,
"nonce_indices": [0],
"key_indices": [0],
"tweak_indices": [],
"is_xonly": [],
"psig_indices": [9],
},
]
for (i, test_case) in enumerate(valid_test_cases):
Expand Down
14 changes: 14 additions & 0 deletions bip-0327/vectors/det_sign_vectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
"7B1246C5889E59CB0375FA395CC86AC42D5D7D59FD8EAB4FDF1DCAB2B2F006EA"
],
"comment": "Tweaked public key"
},
{
"rand": "0000000000000000000000000000000000000000000000000000000000000000",
"aggothernonce": "032DE2662628C90B03F5E720284EB52FF7D71F4284F627B68A853D78C78E1FFE9303E4C5524E83FFE1493B9077CF1CA6BEB2090C93D930321071AD40B2F44E599046",
"key_indices": [0, 1, 2],
"tweaks": ["E8F791FF9225A2AF0102AFFF4A9A723D9612A682A25EBE79802B263CDFCD83BB", "AE2EA797CC0FE72AC5B97B97F3C6957D7E4199A167A58EB08BCAFFDA70AC0455"],
"is_xonly": [false, true],
"msg_index": 1,
"signer_index": 0,
"expected": [
"0303156D63DFA4CC98A355A5EE728AC727DFB7FC8FDB3003C5EA3E5F5C040802C9037A826CD3B3BE009B94305173E36C3C8B4B0953802BEECDDFF8EF9FE01C5F20B8",
"B48F81F569C917EB3911642CEBF131740151559623B14048E2389710B3F32CB6"
],
"comment": "Plain and x-only tweaks with a message longer than 32 bytes"
}
],
"error_test_cases": [
Expand Down
11 changes: 11 additions & 0 deletions bip-0327/vectors/nonce_gen_vectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@
"extra_in": null,
"expected_secnonce": "89BDD787D0284E5E4D5FC572E49E316BAB7E21E3B1830DE37DFE80156FA41A6D0B17AE8D024C53679699A6FD7944D9C4A366B514BAF43088E0708B1023DD289702F9308A019258C31049344F85F89D5229B531C845836F99B08601F113BCE036F9",
"expected_pubnonce": "02C96E7CB1E8AA5DAC64D872947914198F607D90ECDE5200DE52978AD5DED63C000299EC5117C2D29EDEE8A2092587C3909BE694D5CFF0667D6C02EA4059F7CD9786"
},
{
"rand_": "0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F",
"sk": "0202020202020202020202020202020202020202020202020202020202020202",
"pk": "024D4B6CD1361032CA9BD2AEB9D900AA4D45D9EAD80AC9423374C451A7254D0766",
"aggpk": "0707070707070707070707070707070707070707070707070707070707070707",
"msg": "0101010101010101010101010101010101010101010101010101010101010101",
"extra_in": "08080808",
"expected_secnonce": "8BEDC2ABC2D7F00976C8A932314683C9A9BE9B8A71A7C2F3F54B9C303215AE7C13C471707BA3CDC623D7B4F9B6BF3AFD140B9A3C936F6FE05FF22F344387D853024D4B6CD1361032CA9BD2AEB9D900AA4D45D9EAD80AC9423374C451A7254D0766",
"expected_pubnonce": "0357C9EEBFFA55BF667E0AACF5412C1E9EBDEBEFFC764F9FCBEA748BBFD275C4400303C378032670DCBC1D9ACDF8EC113FE863A249FC74D3E88F898C1B2540A7CC00",
"comment": "extra_in shorter than 32 bytes"
}
]
}
18 changes: 17 additions & 1 deletion bip-0327/vectors/sig_agg_vectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"DDEF427BBB847CC027BEFF4EDB01038148917832253EBC355FC33F4A8E2FCCE4",
"97B890A26C981DA8102D3BC294159D171D72810FDF7C6A691DEF02F0F7AF3FDC",
"53FA9E08BA5243CBCB0D797C5EE83BC6728E539EB76C2D0BF0F971EE4E909971",
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
"03E2479CF7C582CB216D2411DFEAA169037639E77FA0A7440DF5BCC2359E072D"
],
"msg": "599C67EA410D005B9DA90817CF03ED3B1C868E4DA4EDF00A5880B0082C237869",
"valid_test_cases": [
Expand Down Expand Up @@ -114,6 +115,21 @@
7
],
"expected": "839B08820B681DBA8DAF4CC7B104E8F2638F9388F8D7A555DC17B6E6971D7426CE07BF6AB01F1DB50E4E33719295F4094572B79868E440FB3DEFD3FAC1DB589E"
},
{
"aggnonce": "036E5EE6E28824029FEA3E8A9DDD2C8483F5AF98F7177C3AF3CB6F47CAF8D94AE902DBA67E4A1F3680826172DA15AFB1A8CA85C7C5CC88900905C8DC8C328511B53E",
"nonce_indices": [
0
],
"key_indices": [
0
],
"tweak_indices": [],
"is_xonly": [],
"psig_indices": [
9
],
"expected": "0EAAB454E75DF2C5B4B7AA07126D4525171B6331A5E6A074C75924738709A1B603E2479CF7C582CB216D2411DFEAA169037639E77FA0A7440DF5BCC2359E072D"
}
],
"error_test_cases": [
Expand Down
62 changes: 59 additions & 3 deletions bip-0327/vectors/sign_verify_vectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
],
"secnonces": [
"508B81A611F100A6B2B6B29656590898AF488BCF2E1F55CF22E5CFB84421FE61FA27FD49B1D50085B481285E1CA205D55C82CC1B31FF5CD54A489829355901F703935F972DA013F80AE011890FA89B67A27B7BE6CCB24D3274D18B2D4067F261A9",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003935F972DA013F80AE011890FA89B67A27B7BE6CCB24D3274D18B2D4067F261A9"
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003935F972DA013F80AE011890FA89B67A27B7BE6CCB24D3274D18B2D4067F261A9",
"508B81A611F100A6B2B6B29656590898AF488BCF2E1F55CF22E5CFB84421FE61000000000000000000000000000000000000000000000000000000000000000003935F972DA013F80AE011890FA89B67A27B7BE6CCB24D3274D18B2D4067F261A9",
"508B81A611F100A6B2B6B29656590898AF488BCF2E1F55CF22E5CFB84421FE61FA27FD49B1D50085B481285E1CA205D55C82CC1B31FF5CD54A489829355901F702F9308A019258C31049344F85F89D5229B531C845836F99B08601F113BCE036F9"
],
"pnonces": [
"0337C87821AFD50A8644D820A8F3E02E499C931865C2360FB43D0A0D20DAFE07EA0287BF891D2A6DEAEBADC909352AA9405D1428C15F4B75F04DAE642A95C2548480",
Expand All @@ -22,12 +24,14 @@
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"048465FCF0BBDBCF443AABCCE533D42B4B5A10966AC09A49655E8C42DAAB8FCD61037496A3CC86926D452CAFCFD55D25972CA1675D549310DE296BFF42F72EEEA8C9",
"028465FCF0BBDBCF443AABCCE533D42B4B5A10966AC09A49655E8C42DAAB8FCD61020000000000000000000000000000000000000000000000000000000000000009",
"028465FCF0BBDBCF443AABCCE533D42B4B5A10966AC09A49655E8C42DAAB8FCD6102FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC30"
"028465FCF0BBDBCF443AABCCE533D42B4B5A10966AC09A49655E8C42DAAB8FCD6102FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC30",
"0337C87821AFD50A8644D820A8F3E02E499C931865C2360FB43D0A0D20DAFE07EA0287BF891D2A6DEAEBADC909352AA9405D1428C15F4B75F04DAE642A95C2548480"
],
"msgs": [
"F95466D086770E689964664219266FE5ED215C92AE20BAB5C9D79ADDDDF3C0CF",
"",
"2626262626262626262626262626262626262626262626262626262626262626262626262626"
"2626262626262626262626262626262626262626262626262626262626262626262626262626",
"000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263"
],
"valid_test_cases": [
{
Expand Down Expand Up @@ -80,6 +84,24 @@
"signer_index": 0,
"expected": "E184351828DA5094A97C79CABDAAA0BFB87608C32E8829A4DF5340A6F243B78C",
"comment": "38-byte message"
},
{
"key_indices": [0, 1, 2],
"nonce_indices": [0, 1, 2],
"aggnonce_index": 0,
"msg_index": 3,
"signer_index": 0,
"expected": "103F7D985150590F773A7249D8FDAA04F905DCC62FF2E4CEF4B36BB361969A8E",
"comment": "100-byte message"
},
{
"key_indices": [0],
"nonce_indices": [0],
"aggnonce_index": 5,
"msg_index": 0,
"signer_index": 0,
"expected": "22D1B07E5D00C726B7E1362C87166935722EE66E7D8312182085D3010D71A536",
"comment": "A single signer"
}
],
"sign_error_test_cases": [
Expand Down Expand Up @@ -153,6 +175,28 @@
"message": "first secnonce value is out of range."
},
"comment": "Secnonce is invalid which may indicate nonce reuse"
},
{
"key_indices": [0, 1, 2],
"aggnonce_index": 0,
"msg_index": 0,
"secnonce_index": 2,
"error": {
"type": "value",
"message": "second secnonce value is out of range."
},
"comment": "Secnonce is invalid because its second half is zero"
},
{
"key_indices": [0, 1, 2],
"aggnonce_index": 0,
"msg_index": 0,
"secnonce_index": 3,
"error": {
"type": "value",
"message": "Public key does not match nonce_gen argument"
},
"comment": "Secnonce was generated for another signer's public key"
}
],
"verify_fail_test_cases": [
Expand Down Expand Up @@ -207,6 +251,18 @@
"contrib": "pubkey"
},
"comment": "Invalid pubkey"
},
{
"sig": "012ABBCB52B3016AC03AD82395A1A415C48B93DEF78718E62A7A90052FE224FB",
"key_indices": [0, 1, 2],
"nonce_indices": [0, 1],
"msg_index": 0,
"signer_index": 0,
"error": {
"type": "value",
"message": "The `pubnonces` and `pubkeys` arrays must have the same length."
},
"comment": "Fewer pubnonces than pubkeys"
}
]
}
27 changes: 26 additions & 1 deletion bip-0327/vectors/tweak_vectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"AE2EA797CC0FE72AC5B97B97F3C6957D7E4199A167A58EB08BCAFFDA70AC0455",
"F52ECBC565B3D8BEA2DFD5B75A4F457E54369809322E4120831626F290FA87E0",
"1969AD73CC177FA0B4FCED6DF1F7BF9907E665FDE9BA196A74FED0A3CF5AEF9D",
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
"E8F791FF9225A2AF0102AFFF4A9A723D9612A682A25EBE79802B263CDFCD83"
],
"msg": "F95466D086770E689964664219266FE5ED215C92AE20BAB5C9D79ADDDDF3C0CF",
"valid_test_cases": [
Expand Down Expand Up @@ -79,6 +80,30 @@
"message": "The tweak must be less than n."
},
"comment": "Tweak is invalid because it exceeds group size"
},
{
"key_indices": [1, 2, 0],
"nonce_indices": [1, 2, 0],
"tweak_indices": [5],
"is_xonly": [false],
"signer_index": 2,
"error": {
"type": "value",
"message": "The tweak must be a 32-byte array."
},
"comment": "Tweak is invalid because it is 31 bytes"
},
{
"key_indices": [1, 2, 0],
"nonce_indices": [1, 2, 0],
"tweak_indices": [0],
"is_xonly": [],
"signer_index": 2,
"error": {
"type": "value",
"message": "The `tweaks` and `is_xonly` arrays must have the same length."
},
"comment": "Fewer is_xonly flags than tweaks"
}
]
}
Loading