BIP 0322
How can a wallet sign messages for different address types?
A message signature shows that someone could satisfy an address’s spending conditions for that message. It does not establish their identity or a lasting balance.
Someone asks you to prove you can use a Bitcoin address. Sending a payment would demonstrate a spend, but it would also move coins. BIP 322 instead builds a pair of virtual transactions around a message and asks for the data that would satisfy the address’s script.12345
Legacy Bitcoin message signing was specified only for P2PKH addresses. It could not express the spending conditions of other address types. BIP 322 uses Bitcoin Script itself, so message signing can cover SegWit, Taproot and multisignature scripts as well.1267
The result belongs to that message and that address. It is evidence that someone could satisfy the script before presenting it. It does not tell the verifier who that person is, whether they sent an earlier payment, or whether they still control any coins.8910
Source details
This chapter is an independent explanation, not the proposal itself. Preamble fields are shown as the pinned files record them, without author e-mail addresses. Status is the proposal’s own field. It is not an endorsement or a sign of consensus.
BIP 322: Generic Signed Message Format
- BIP
- 322
- Layer
- Applications
- Title
- Generic Signed Message Format
- Authors
- Karl-Johan Alm
Oliver Gugger - Status
- Complete
- Type
- Specification
- Assigned
- 2018-09-10
- License
- CC0-1.0
- Version
- 2.0.0
- Requires
- 174, 340, 341
Make the message say what you need
A signature carries no reliable creation date. Its lock-time field T is a spending condition, not a timestamp. Freshness has to come from the message—for example, a challenge chosen by the verifier. Even a fresh response cannot promise that coins will remain unspent afterward.8910
The authors also caution that someone may sign messages on another person’s behalf while refusing to sign a real transaction for them. A message signature cannot settle every question of ownership or control.8
Because to_sign looks like a transaction, signing devices need care. When a signer recognises a BIP 322 request it must show the user the message and the address. The BIP asks that the screens resemble signing a message, not spending 0 satoshis.11
What a proof of funds can establish
What BIP 322 sets out to show, in its authors’ words, is narrower: that the signer will be able to control funds sent to the address. It cannot show that the signer sent some earlier transaction. A proof of funds can list UTXOs, but it does not show they are all the address holds, nor that they are still unspent; a verifier needs the current UTXO set for that.912
A spend that cannot move coins
The first virtual transaction, to_spend, pays to the address’s script and commits to the message. Its input names an output that does not exist. The second, to_sign, spends that virtual output. Satisfying its input script produces the message signature.234
Follow a valid example through the virtual transactions, then choose Wrong message. Rebuilding the proof for that message changes the commitment, so the response no longer verifies. The proof belongs to the message it was made for.23413
Fig. A18.2 to_spend and to_sign
Static view: the first vector, both virtual transactions and the message hash. With JavaScript you can switch vectors and views.
to_sign spends to_spend's output 0 and pays 0 satoshis to OP_RETURN. Its witness, 2 items, is the signature. Verdict: valid at time 0 and age 0.
Exact values for this vector
- Message and address
- “Hello World”
bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l - Message hash
f0eb03b1a75ac6d9847f55c624a99169b5dccba2a31f5b23bea77ba270de0a7a- to_spend and to_sign IDs
b79d196740ad5217771c1098fc4a4b51e0535c32236c71f1ea4d61a2d603352b88737ae86f2077145f93cc4b153ae9a1cb8d56afa511988c149c5c8c9d93bddf- Address script
00142b05d564e6a7a33c087f16e0f730d1440123799d- Signature (witness items)
304402206517c8637a7bfc3a154edcba6196d64bbd5b73955cb7da7d1626bcdde466c364022022bf10d19fc0bb69b4596e306b362acaa835293cf693bb176f7324b531f5afec0102c7f12003196442943d8588e01aee840423cc54fc1521526a3b85c2b0cbd58872
BIP 322 test vectors; to_spend, to_sign and the verdict rebuilt by the tested model, which fails the build if a verdict differs from the expected outcome.
Neither transaction is meant to be broadcast. The nonexistent input prevents to_spend from being relayed as an ordinary transaction, and to_sign depends on it. The authors chose this shape so existing transaction-signing hardware could support message signing.515
The message hash is a BIP 340 tagged hash with the tag BIP0322-signed-message, taken over the message exactly as given, with no length prefix and no terminator. Change the message, even by one character, and the hash changes, and so does to_spend’s ID.3
Fig. A18.3 Another message, another hash
Exact values
- “Hello World”: hash, to_spend
f0eb03b1a75ac6d9847f55c624a99169b5dccba2a31f5b23bea77ba270de0a7ab79d196740ad5217771c1098fc4a4b51e0535c32236c71f1ea4d61a2d603352b- “Wrong message that was not signed”: hash, to_spend
eeb67912c691a5815637889a366a85af050f089742c09be7cd428eeea685c3c6bdcdb146dfd2e8ebf74f4cd29d078eb04205cb0fc66ac2b2b015f6c28ceb08f4
Except for the deliberately missing coin, the pair must satisfy the consensus rules. A script may require more than one signature, or no cryptographic signature at all. The published 3-of-3 multisig example contains three ECDSA signatures, an empty dummy item and the witness script.216
Fig. A18.4 A signature that is a witness stack
Exact witness items
(empty)3044022055fd69aa8f256ab615fda4a5e9f96c50d389df9e86050ea475742df8e7717cb802203718d89c17b68a3f37696bd3c2a6669842cde91ddfaa6efbe15ddc4e08a08030013045022100ff10b5e0e82358c944228c283de89b60be08d96fd76c9750ada1fe1001ec9371022054cff50006e5165fc30ade80d60260f93fe2daa5394900f4f7e721149ce8951c01304502210096a45f485c96355421bda0a799e579b729de88258c4dc15bbae8e80ffa456b7c022069d98df41bf0da25498abd6ac57e65e05290218725caa7695e09612e4c60f106015321027568b11f122ff8a7bc1c57e5c7642055bc618967b2f7bfe8e11fe99903c94dd321020a8bdf79cfa421d9655e9282800f115ff1d9db1e721ceb4248a3fcfec7faa67c21030c529e0ea40a00975d202624e39915daf7bdd2b71f31aa08596838781ce5f33a53ae
The fields of the two virtual transactions
The construction uses two virtual transactions. The first, to_spend, commits to the message and the address. Its single input spends output 0xFFFFFFFF of a transaction whose ID is all zeros, an output that does not exist, and its scriptSig pushes the message hash. Its single output pays 0 satoshis to the address’s script, which the BIP calls the message challenge.3
The second, to_sign, spends to_spend’s output 0 and pays 0 satoshis to a bare OP_RETURN. The signer fills in its witness, or in the full format its scriptSig and other fields too, exactly as they would to spend a real coin locked to the address. In the simple format that witness is the signature; in the full format, the whole signed to_sign is.4
How much of the proof is sent?
The simple format sends only the witness. The verifier can rebuild everything else when the address is native SegWit and the virtual transaction uses its defaults. The full format sends the signed transaction too, which allows scriptSigs and time locks. Proof of funds adds inputs naming the UTXOs to demonstrate and carries the result in a finalized PSBT.7121718
Fig. A18.5 Three ways to carry the response
Read from BIP 322’s “Types of Signatures” table (line 61).
Prefixes, supported scripts and compatibility
The simple format, prefixed smp, carries only the witness stack. It may be used only when to_sign keeps all its defaults, nothing added and version, sequence and lock time left at 0, and the address is native SegWit: P2WPKH, P2WSH or P2TR. The verifier rebuilds both transactions itself.1718
The full format, prefixed ful, carries the whole signed to_sign transaction. It covers every script type, including P2PKH and P2SH, which need a scriptSig, and scripts with time locks, which need to_sign’s version, lock time or sequence set. The proof-of-funds variant, prefixed pof, adds further inputs for any UTXOs the signer wants to show control of, and travels as a finalized PSBT.4712
Signers MUST put the prefix on. A verifier may still read an unprefixed signature as simple, for compatibility with implementations written before the BIP was finalized; one of the published vectors tests exactly that. The legacy format MAY still be used, but MUST be restricted to P2PKH addresses, and new proofs SHOULD use the new formats for every address type, P2PKH included.1920
Coordinating multiple signers
Signing for a multisig address works the way spending from one does. Each signer produces a partial signature on to_sign, coordinated through a PSBT, and BIP 322 adds one global PSBT field, number 0x09, that carries the message itself. The BIP recommends keeping messages to a few kilobytes and committing to very large ones by hash.2122
Legacy signatures and the proposal’s history
Exchanges, auditors and counterparties sometimes ask: can you show that this address is yours? The old answer, the legacy signmessage format, was specified only for P2PKH addresses, the ones starting with 1, as the BIP’s authors note. Its signatures also have a flaw the BIP’s authors spell out. They are ECDSA signatures that do not commit to the public key, so they do not actually prove knowledge of a secret key. Third parties can also tweak a valid one into a valid signature for certain related keys.623
BIP 322, assigned in 2018 and recorded as Complete at version 2.0.0, replaces the special-purpose signature with Bitcoin Script itself. A message signature becomes whatever would satisfy the address’s script in a transaction built around the message, so any address, whatever script controls it, can in principle be signed for. The signature comes in several formats, each new format marked by a three-letter prefix.161924
A verifier can also say “I cannot check this”
The verifier starts with the address, message and response. It reconstructs the virtual transactions, checks that they refer to each other correctly, and validates the script under BIP 322’s additional rules. In the explorer’s wrong-message example, the changed message changes the message hash and so to_spend, and the signature no longer verifies.3132526
The outcome is one of three states, not two. Invalid means some check failed. Inconclusive means the verifier could not check the scripts. A verifier without a full script interpreter should stop there for any script it does not understand. The BIP’s upgradeable rules also end in inconclusive. Valid comes with two numbers, “valid at time T and age S”. T is to_sign’s lock time and S is its first input’s sequence, so a signature that relies on a time lock says so.14272829
Fig. A18.6 Three verdicts
A verifier that does not understand a script should not turn that gap into an assurance that the proof passed. The BIP says it should stop and answer inconclusive. This page’s verifier covers the published simple and full examples; proof-of-funds PSBTs and committed scripts outside its supported set remain inconclusive unless an earlier check has failed.13252728
Required verification rules and reported time locks
A verifier is given an address, a message and a signature. It computes to_spend from the message and address, and decodes to_sign from the signature. It checks that to_sign’s first input spends to_spend’s output and that it has exactly one output. Then it checks that the pair satisfies the consensus rules, except that to_sign’s lock time and first sequence are not enforced but reported. (A simple signature has no to_sign to check; the verifier builds it.)25
On top of consensus the BIP adds required rules. Every signature MUST use SIGHASH_ALL, or SIGHASH_DEFAULT where the output type supports it. CODESEPARATOR and FindAndDelete are forbidden. ECDSA signatures must be strictly DER-encoded with a low S value, and a failing one must be empty. Pushes must be minimal, IF arguments must be exactly 0x01 or empty, and only a single stack element may remain. Breaking any of these makes the signature invalid.26
What the examples verify
This site’s model is such a partial verifier. Its script interpreter runs only a reviewed set of opcodes, enough for every published simple and full vector: P2PKH, P2SH, nested and native SegWit, multisig, Taproot key and script paths, and time locks. It applies the required rules in all of them and rejects every published error vector. It answers inconclusive for proof-of-funds signatures and for any committed script or spend shape outside what it covers, unless an earlier check has already failed. For a full signature, a wrong message or a wrong address fails before any script is run: it changes to_spend’s ID, so the transmitted to_sign no longer spends it. For a simple signature the verifier rebuilds to_sign around the new to_spend, and the signature no longer verifies.1325
A useful message proof answers a specific challenge for a specific address. Its meaning comes from that challenge and the script it satisfies; identity and a lasting balance do not follow from the signature alone.28910
Evidence
Each numbered marker in the text points here, and the ↩ links lead back to the text. Quotes are verbatim
from the BIP files at commit 3a10b5b, wiki markup
included. Links open the exact lines. Labels say what kind of statement each entry is: a rule, the
author’s rationale, history, a test vector, or our own inference.
-
↩ a b c Author’s rationale BIP 322 is a standard for signed messages based on Bitcoin Script, for proving availability of funds or committing to a message as the intended recipient of funds sent to an address.
Quoted source text (1)
A standard for interoperable signed messages based on the Bitcoin Script format, either for proving availability of funds, or for committing to a message as the intended recipient of funds sent to the invoice address.
-
↩ a b c d e f g h Rule In BIP 322 a "signature" is a witness stack, a full transaction or a PSBT that satisfies the address's script, and may not contain a cryptographic signature at all.
Quoted source text (1)
whenever the word "signature" or similar is used, it refers to the output of the signing process described below, and, depending on the script type of the <code>message_challenge</code>, is either a full transaction input witness stack, a full transaction, or a PSBT packet that can be validated against a Bitcoin Script Interpreter. Such a "signature" may or may not contain an actual cryptographic (ECDSA or Schnorr) signature, depending on what is required to satisfy the script corresponding to the <code>message_challenge</code>.
-
↩ a b c d e f g h i Rule to_spend has version 0, lock time 0, one input spending 000…000:0xFFFFFFFF with sequence 0 and scriptSig OP_0 PUSH32[message_hash], and one 0-value output to message_challenge; message_hash is the BIP 340 tagged hash with tag BIP0322-signed-message of the message as-is.
BIP 322 L138–146 BIP 322 L148–151
Quoted source text (2)
nVersion = 0 nLockTime = 0 vin[0].prevout.hash = 0000...000 vin[0].prevout.n = 0xFFFFFFFF vin[0].nSequence = 0 vin[0].scriptSig = OP_0 PUSH32[ message_hash ] vin[0].scriptWitness = [] vout[0].nValue = 0 vout[0].scriptPubKey = message_challenge
where <code>message_hash</code> is a BIP340-tagged hash of the message, i.e., sha256_tag(m), where tag = <code>BIP0322-signed-message</code> and <code>m</code> is the message as-is without length prefix or null terminator, and <code>message_challenge</code> is the (public) key script to be proven.
-
↩ a b c d e f Rule to_sign spends to_spend's output 0, carries message_signature as its witness, and has one 0-value OP_RETURN output; version, lock time and sequence are 0 unless the full format sets them (e.g. for time locks).
Quoted source text (1)
nVersion = 0 or (FULL format only) as appropriate (e.g., 2 for time locks) nLockTime = 0 or (FULL format only) as appropriate (for time locks) vin[0].prevout.hash = to_spend.txid vin[0].prevout.n = 0 vin[0].nSequence = 0 or (FULL format only) as appropriate (for time locks) vin[0].scriptSig = [] or (FULL format only) as appropriate (for non segwit-native transactions) vin[0].scriptWitness = message_signature vout[0].nValue = 0 vout[0].scriptPubKey = OP_RETURN
-
↩ a b Editorial inference to_spend spends an output that cannot exist, so neither virtual transaction can be valid on chain; they are built only to be checked.
Quoted source text (2)
except that it contains an invalid input, so it cannot be spent on any real network
output with prevout <code>000...000:FFFFFFFF</code> does not exist.
-
↩ a b c Author’s rationale The authors note the current (legacy) message signing standard only works for P2PKH addresses; basing signatures on Script means any coins can in principle be signed for.
BIP 322 L30–32 BIP 322 L461–462
Quoted source text (2)
The current message signing standard only works for P2PKH (1...) invoice addresses. We propose to extend and generalize the standard by using an approach based on Bitcoin Script. This ensures that any coins, no matter what script they are controlled by, can in principle be signed for.
This specification is backwards-compatible with the legacy signmessage/verifymessage specification
-
↩ a b c d Rule A full signature is the ful-prefixed base64 encoding of the signed to_sign transaction.
Quoted source text (1)
A ''full'' signature consists of the variant-prefixed (<code>ful</code>) base64-encoding of the <code>to_sign</code> transaction in standard network serialisation once it has been signed.
-
↩ a b c d e Author’s rationale No message signing protocol can prove control of funds: a signature is obsolete once created, and a key holder may sign messages for others without signing transactions.
Quoted source text (1)
Ultimately, no message signing protocol can actually prove control of funds, both because a signature is obsolete as soon as it is created, and because the possessor of a secret key may be willing to sign messages on others' behalf even if it would not sign actual transactions. No message signing protocol can fix these limitations.
-
↩ a b c d e Author’s rationale BIP 322 shows a signer will be able to control funds sent to the address; it cannot prove that the signer sent a prior transaction.
Quoted source text (1)
Finally, this BIP only addresses the use case where a signer shows they will be able to control funds sent to the invoice address. Proving that a signer sent a prior transaction is not possible using this BIP.
-
↩ a b c d Editorial inference A BIP 322 signature carries no timestamp (T is a lock-time field, not a signing date); how recent it is depends on the message containing something the verifier chose fresh.
Quoted source text (2)
a signature is obsolete as soon as it is created
Let ''T'' be the nLockTime of <code>to_sign</code>
-
↩ Rule A PSBT signer must tell the user the message and address being signed for, and should present it like signing a message, not a transaction.
Quoted source text (1)
If all of the above steps are true, the signer must inform the user about the message they are signing and the address they are signing for. <ol> <li> Even though the message being signed is a transaction, the user interaction (e.g., the steps and messages shown on a hardware signing device's screen) should resemble the steps to sign a legacy message, not the steps for signing a transaction.
-
↩ a b c d Rule Proof of Funds adds inputs for any UTXOs the signer wants to show control of, encoded as a pof-prefixed finalized PSBT; it does not prove completeness or that the UTXOs are unspent, which needs the current UTXO set.
BIP 322 L170–171 BIP 322 L175–177 BIP 322 L207–208
Quoted source text (3)
The Proof of Funds variant extends the basic scheme: in addition to signing a message under a single address's key, the signer proves control over an arbitrary set of UTXOs.
In any case, however, the UTXO list does not aim to prove completeness (e.g., it does NOT mean: "these are all UTXOs that exist for an address"), nor that they are unspent (e.g., a validator must consult the blockchain to verify that).
Unlike an ordinary signature, validators of a proof of funds need access to the current UTXO set, to learn that the claimed inputs exist on the blockchain and remain unspent.
-
↩ a b c d e f g h Test vector This site's BIP 322 model reproduces the published message hashes and both transaction IDs, and verifies every published simple and full vector (P2PKH, P2SH, P2SH-wrapped and native SegWit, multisig, P2TR key and script paths, and time locks) with a script interpreter limited to a reviewed opcode set that applies the required rules in every script version; it reports inconclusive for proof-of-funds signatures, whose PSBTs it does not decode, and for any committed script or spend shape outside what it covers (opcodes outside that set, non-push scriptSigs, annexes, other leaf versions, P2SH-wrapped v1+), unless an earlier check has already made the spend invalid. It rejects every published error vector. The build fails if a figure's verdict differs from the one recorded for that vector.
Quoted source text (1)
Basic test vectors for message hashing, transaction hashes and "simple" variant test cases can be found in [[bip-0322/basic-test-vectors.json|<code>basic-test-vectors.json</code>]]. Generated test vectors for more "simple" and "full" variant test cases can be found in [[bip-0322/generated-test-vectors.json|<code>generated-test-vectors.json</code>]].
-
↩ a b c Rule A validator outputs one of three states: valid at time T and age S, inconclusive (unable to check the scripts), or invalid.
Quoted source text (1)
A validator is given as input an address ''A'', signature ''s'' and message ''m'', and outputs one of three states: <ul> <li> ''valid at time T and age S'' indicates that the signature has set timelocks but is otherwise valid </li> <li> ''inconclusive'' means the validator was unable to check the scripts </li> <li> ''invalid'' means that some check failed
-
↩ Author’s rationale The signature format resembles a Bitcoin transaction, for compatibility with signing hardware, but contains an invalid input so it cannot be spent on any real network.
Quoted source text (1)
For easy interoperability with existing signing hardware, we also define a signature message format that resembles a Bitcoin transaction (except that it contains an invalid input, so it cannot be spent on any real network).
-
↩ a b Rule Except for legacy, to_spend and to_sign must pass all consensus checks, except that the output 000…000:FFFFFFFF does not exist.
Quoted source text (1)
For all signature types, except legacy, the <code>to_spend</code> and <code>to_sign</code> transactions must be valid transactions which pass all consensus checks, except of course that the output with prevout <code>000...000:FFFFFFFF</code> does not exist.
-
↩ a b c Rule A simple signature is a witness stack, consensus-encoded and base64-encoded with prefix smp; validators rebuild to_spend and to_sign with default values and proceed as for a full signature.
Quoted source text (2)
A ''simple'' signature consists of a witness stack, consensus encoded as a vector of vectors of bytes, and base64-encoded, prefixed by the variant (<code>smp</code>). Validators should construct <code>to_spend</code> and <code>to_sign</code> as defined below, with default values for all fields
and then proceed as they would for a full signature.
-
↩ a b Rule A signer may use simple if they added no inputs, left version, sequence and lock time at 0, and the address is native SegWit; full if they added no inputs; otherwise they must use proof of funds.
BIP 322 L296–306 BIP 322 L301–306
Quoted source text (2)
If they added no inputs to <code>to_sign</code>, left nVersion, nSequence and nLockTime at 0, and ''A'' is a "native" Segwit address (P2WPKH, P2WSH, P2TR), then they may base64-encode <code>message_signature</code> with <code>smp</code> as prefix.
If they added no inputs to <code>to_sign</code>, they may base64-encode <code>to_sign</code> with <code>ful</code> as prefix. </li> <li> Otherwise, they must base64-encode the finalized PSBT of <code>to_sign</code> with <code>pof</code> as prefix.
-
↩ a b c Rule BIP 322 specifies three formats, legacy, simple and full, plus a full variant for proving control of a set of UTXOs; signers MUST prefix the signature with its variant (smp, ful, pof), and a verifier might assume simple when no prefix is present.
Quoted source text (2)
This BIP specifies three formats for signing messages: ''legacy'', ''simple'' and ''full''. Additionally, a variant of the ''full'' format can be used to demonstrate control over a set of UTXOs.
Signers MUST prefix the signature with the variant that was used to create the signature. To support backward compatibility with implementations of this BIP before it was finalized, a verifier might assume the ''simple'' variant in the absence of a prefix.
-
↩ a b Rule New proofs SHOULD use the new format for all addresses including P2PKH; the legacy format MAY be used but MUST be restricted to P2PKH; the table's other legacy script types are possible on a technical level but SHOULD NOT be used.
BIP 322 L103–105 BIP 322 L93–94
Quoted source text (2)
New proofs SHOULD use the new format for all invoice address formats, including P2PKH. The legacy format MAY be used, but MUST be restricted to the legacy P2PKH invoice address format.
1: Possible on a technical level but SHOULD NOT be used anymore in the context of this BIP
-
↩ Rule Multisig signatures are produced by coordinating signers through a PSBT, as for a real multisig spend; BIP 322 adds the global field PSBT_GLOBAL_GENERIC_SIGNED_MESSAGE (0x09) carrying the UTF-8 message.
BIP 322 L312–315 BIP 322 L332–336
Quoted source text (2)
A valid witness stack for a multisig address must be constructed by coordinating different signers to produce a partial signature each. The coordination procedure is not specified by this BIP, but due to the use of PSBTs it should closely resemble the coordination of signing a multisig transaction for publishing to the network.
| <tt>PSBT_GLOBAL_GENERIC_SIGNED_MESSAGE = 0x09</tt> | None | No key data | <tt><bytes message></tt> | The UTF-8 encoded message to be signed.
-
↩ Rule The BIP recommends keeping messages to a few kilobytes for compatibility and committing to very large messages by hash.
Quoted source text (1)
There is no specified maximum length of an input's <code>valuedata</code> or a PSBT as a whole in [[bip-0174.mediawiki|BIP174]], but different signers might impose safety limits. It is recommended to use a maximum length of a few kilobytes to maximize compatibility. Very large messages should be committed to by hash instead.
-
↩ Author’s rationale Legacy signatures are ECDSA signatures that do not commit to the public key, so they do not prove knowledge of a secret key; third parties can tweak them into valid signatures for related keys.
Quoted source text (1)
Additionally, the current message signature format uses ECDSA signatures that do not commit to the public key, meaning that they do not actually prove knowledge of any secret keys. (Indeed, valid signatures can be tweaked by third parties to become valid signatures on certain related keys.)
-
↩ History BIP 322 (Karl-Johan Alm, Oliver Gugger), assigned in 2018, is recorded as Complete at version 2.0.0; it was marked Complete in 2026.
BIP 322 L4–9 BIP 322 L18 BIP 322 L496–497
Quoted source text (3)
Title: Generic Signed Message Format Authors: Karl-Johan Alm <karljohan-alm@garage.co.jp> Oliver Gugger <gugger@gmail.com> Status: Complete Type: Specification Assigned: 2018-09-10
Version: 2.0.0
* '''1.0.0''' (2026-04-15): ** Mark Complete
-
↩ a b c d Rule Validation recomputes to_spend from the message and address, decodes to_sign, and for full signatures checks that to_sign's first input spends to_spend's output and that it has exactly one output. The pair must satisfy consensus, except for to_spend's missing input and to_sign's lock time and first sequence, which are not checked.
BIP 322 L243–246 BIP 322 L249 BIP 322 L250
Quoted source text (3)
## Compute the transaction <code>to_spend</code> from ''m'' and ''A'' ## Decode ''s'' as the transaction <code>to_sign</code> ## If ''s'' was a full transaction or PSBT, confirm all fields are set as specified above; in particular that ##* <code>to_sign</code> has at least one input and its first input spends the output of <code>to_spend</code>
##* <code>to_sign</code> has exactly one output, as specified above
## Confirm that the two transactions together satisfy all consensus rules, except for <code>to_spend</code>'s missing input, and except that ''nSequence'' of <code>to_sign</code>'s first input and ''nLockTime'' of <code>to_sign</code> are not checked.
-
↩ a b Rule Required rules: signatures MUST use SIGHASH_ALL (or SIGHASH_DEFAULT where supported); CODESEPARATOR and FindAndDelete are forbidden; LOW_S, STRICTENC, NULLFAIL, MINIMALDATA, CLEANSTACK and MINIMALIF apply; failure means invalid.
BIP 322 L253–254 BIP 322 L255–258 BIP 322 L259
Quoted source text (3)
## All signatures MUST use the <code>SIGHASH_ALL</code> flag, unless the output type supports <code>SIGHASH_DEFAULT</code>, which then MAY be used alternatively (e.g., [[bip-0341.mediawiki|BIP341 P2TR]]). ## The use of <code>CODESEPARATOR</code> or <code>FindAndDelete</code> is forbidden.
## <code>LOW_S</code>, <code>STRICTENC</code> and <code>NULLFAIL</code>: valid ECDSA signatures must be strictly DER-encoded and have a low-S value; invalid ECDSA signature must be the empty push ## <code>MINIMALDATA</code>: all pushes must be minimally encoded ## <code>CLEANSTACK</code>: require that only a single stack element remains after evaluation ## <code>MINIMALIF</code>: the argument of <code>IF</code>/<code>NOTIF</code> must be exactly 0x01 or empty push
## If any of the above steps failed, the validator should stop and output the ''invalid'' state.
-
↩ a b c Rule A validator without a full script interpreter should check it understands all scripts being satisfied, and otherwise output inconclusive.
Quoted source text (1)
# (Optional) If the validator does not have a full script interpreter, it should check that it understands all scripts being satisfied. If not, it should stop here and output ''inconclusive''.
-
↩ a b Rule Upgradeable rules: to_sign's version must be 0 or 2, upgrade NOPs and SegWit versions above 1 are forbidden; failure means inconclusive.
Quoted source text (1)
## The version of <code>to_sign</code> must be 0 or 2. ## The use of NOPs reserved for upgrades is forbidden. ## The use of Segwit versions greater than 1 is forbidden. ## If any of the above steps failed, the validator should stop and output the ''inconclusive'' state.
-
↩ a b Rule T is to_sign's nLockTime and S the nSequence of its first input; the output is valid at time T and age S.
Quoted source text (1)
# Let ''T'' be the nLockTime of <code>to_sign</code> and ''S'' be the nSequence of the first input of <code>to_sign</code>. Output the state ''valid at time T and age S''.