- An error test vector doesn’t specify the InvalidContributionError type
- In *DeterministicSign*, use GetXonlyPubkey instead of GetPubkey
- The key_agg_and_tweak fn doesn’t specify the return type
- In partial_sig_verify_internal, the pubkey arg should be PlainPk
- Remove unused enumerate() fn calls
- In test_sign_verify, add an additional assert statement
Numbers from the appendix were slightly innaccurate and out of date. Update to mention non-dust UTXOs
and update the numbers to reflect current usage.
Considering the appendix is purely informational and the corrections here are minor, Ive left of
adding a changelong entry.
It's an optional parameter in BIP 21 Bitcoin URIs, but it doesn't hurt
to make it explicit.
Co-authored-by: Martin Habovstiak <martin.habovstiak@gmail.com>
The original text is ambiguous to allowing transaction cut-through
or not. Transaction cut-through enables savings by posting multiple
transaction intents through a single 2-party payjoin and is used
in practice in payjoins today. Let's explicitly allow it in the text.
Co-authored-by: Martin Habovstiak <martin.habovstiak@gmail.com>
Disallowing mixed inputs was based on incorrect assumption that no
wallet supports mixed inputs and thus mixed inputs imply PayJoin.
However there are at least three wallets supporting mixed inputs.
(Confirmed: Bitcoin Core, LND, Coinomi) Thus it makes sense to enable
mixed inputs to avoid a payjoin-specific fingerptint. To avoid
compatibility issues a grace period is suggested.
Co-authored-by: Martin Habovstiak <martin.habovstiak@gmail.com>
On some operating systems, Python doesn't provide the expected ripemd160
implementation anymore, so the reference implementation fails to start.
E.g. in Ubuntu 22.04:
----------------------------------------------------------------------------------------------
$ ./reference.py send_and_receive_test_vectors.json
Simple send: two inputs
Traceback (most recent call last):
File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new
return _hashlib.new(name, data, **kwargs)
ValueError: [digital envelope routines] unsupported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thestack/bips/bip-0352/./reference.py", line 228, in <module>
pubkey = get_pubkey_from_input(vin)
File "/home/thestack/bips/bip-0352/./reference.py", line 46, in get_pubkey_from_input
pubkey_hash = hash160(pubkey_bytes)
File "/home/thestack/bips/bip-0352/bitcoin_utils.py", line 130, in hash160
return hashlib.new("ripemd160", hashlib.sha256(s).digest()).digest()
File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new
return __get_builtin_constructor(name)(data)
File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type ripemd160
----------------------------------------------------------------------------------------------
Fix this by providing a manual implementation, taken from the functional test framework
of Bitcoin Core. See corresponding issue https://github.com/bitcoin/bitcoin/issues/23710 and
PR https://github.com/bitcoin/bitcoin/pull/23716