Sjors / libwally-swift

Swift wrapper for LibWally, a collection of useful primitives for cryptocurrency wallets
MIT License
40 stars 18 forks source link

Script multisig: check threshold > 0 #38

Closed Sjors closed 3 years ago

Sjors commented 4 years ago

Preempt a crash in wally_scriptpubkey_multisig_from_bytes below. The constraint is not documented upstream, but it's sane.

I believe consensus rules do allow for 0 signatures by the way: https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1032-L1053

But's non-standard (and a bad idea): https://github.com/bitcoin/bitcoin/blob/46fc4d1a24c88e797d6080336e3828e45e39c3fd/src/test/script_standard_tests.cpp#L135-L138