Skip to content

Commit

Permalink
NULLFAIL
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Nov 2, 2021
1 parent 1289699 commit 43a179d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ Hashing
Signature Verification
----------------------
* ``bool checkSig(Sig sig, PubKey pk)``
* ``bool checkMultiSig(Sig[] sigs, PubKey[] pks)``

Returns true if the signature matches the public key. Returns false if the signature is an empty byte array.
Otherwise, the entire contract fails immediately, due to the `NULLFAIL rule <https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki#NULLFAIL>`_.

* ``bool checkMultiSig(Sig[M] sigs, PubKey[N] pks)``

Returns true if and only M signatures match M out of N public keys. M and N can be any number as long as M <= N.
Returns false if all signatures are an empty byte array.
Otherwise, the entire contract fails immediately.

``bytes`` Operations
--------------------
Expand Down

0 comments on commit 43a179d

Please sign in to comment.