BIP 0322
How do you prove you control an address?
BIP 322 signs a message by building a transaction that spends a pretend coin locked to the address, and checking it like any other spend. What it proves is narrower than it sounds.
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, and third parties can tweak a valid one into a valid signature for certain related keys.12
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.1345
Source details
This chapter is an independent explanation, not the proposals themselves. Preamble fields are shown as recorded in the pinned files, with author e-mail addresses omitted. Status is the proposal’s own field, 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
| format | script types | prefix | what the signature is |
|---|---|---|---|
| Legacy | P2PKH, P2SH-P2WPKH¹, P2WPKH¹ | n/a | compact, public key recoverable ECDSA signature, base64-encoded |
| Simple | P2WPKH, P2WSH², P2TR² | smp | witness stack, consensus-encoded and base64-encoded |
| Full | all | ful | full to_sign transaction, consensus-encoded and base64-encoded |
| Full (Proof of Funds) | all | pof | full finalized PSBT of the to_sign transaction, consensus-encoded and base64-encoded |
Read from BIP 322’s “Types of Signatures” table (from line 61). ¹ Technically possible but SHOULD NOT be used; the legacy format MAY be used but MUST be restricted to P2PKH. ² Excluding time-lock scripts.
Two transactions that never leave
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.10
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 one character of the message and the hash changes, and so does to_spend’s ID.10
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. That witness is the signature.11
A · Interactive
Static view: the first vector, both virtual transactions and the message hash. With JavaScript you can switch vectors and views.
- message
Hello World
- address
bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0lP2WPKH- signature
smpAkcwRAIgZRfIY3p7/DoVT…147 characters, prefix “smp”- message hash
f0eb03b1a75ac6d9847f55c624a99169b5dccba2a31f5b23bea77ba270de0a7atagged hash “BIP0322-signed-message” of the UTF-8 message
to_spend not meant to be broadcast
| nVersion | 0 |
|---|---|
| input | spends 000…000:FFFFFFFF, an output that does not exist |
| scriptSig | OP_0 PUSH32 f0eb03b1a75ac6…70de0a7a |
| nSequence · nLockTime | 0 · 0 |
| output | 0 sats to 00142b05d564e6…0123799d, the address’s script |
| txid | b79d196740ad5217771c1098fc4a4b51e0535c32236c71f1ea4d61a2d603352b |
to_sign not meant to be broadcast
| nVersion | 0 |
|---|---|
| input | spends b79d196740ad52…d603352b:0, to_spend’s output |
| scriptSig | (empty) |
| witness |
|
| nSequence · nLockTime | 0 · 0 |
| output | 0 sats to OP_RETURN |
| txid | 88737ae86f2077145f93cc4b153ae9a1cb8d56afa511988c149c5c8c9d93bddf |
Valid at time T = 0 and age S = 0. The signature satisfies the address’s script for this message. Checked by the model: p2wpkh.
Source: BIP 322 basic-test-vectors.json, line 48. Rebuilt and verified at build time by the tested model; the build fails if its verdict differs from the one recorded for this vector.
B · Worked example
BIP 322’s vector for the message “Hello World”, signed for bc1q9vza2e8x57…: two transactions built only to be checked, not to be broadcast.
Hash the message with a tag
- message
Hello World- sha256_tag("BIP0322-signed-message", m)
f0eb03b1a75ac6d9847f55c624a99169b5dccba2a31f5b23bea77ba270de0a7a
to_spend commits to the hash and the address
- scriptSig: OP_0 PUSH32
f0eb03b1a75ac6d9847f55c624a99169b5dccba2a31f5b23bea77ba270de0a7a- output script (the address)
00142b05d564e6a7a33c087f16e0f730d1440123799d- to_spend txid
b79d196740ad5217771c1098fc4a4b51e0535c32236c71f1ea4d61a2d603352b
Its one input spends 000…000:FFFFFFFF, an output that does not exist; it is built only to be checked.
to_sign spends it
- input
b79d196740ad5217771c1098fc4a4b51e0535c32236c71f1ea4d61a2d603352b:0- output
0 sats to OP_RETURN
The signature is to_sign’s witness
- witness item 1
304402206517c8637a7bfc3a154edcba6196d64bbd5b73955cb7da7d1626bcdde466c364022022bf10d19fc0bb69b4596e306b362acaa835293cf693bb176f7324b531f5afec01- witness item 2
02c7f12003196442943d8588e01aee840423cc54fc1521526a3b85c2b0cbd58872
Verify as if to_sign were spending a real coin
- verdict
valid at time 0, age 0
Source: BIP 322 basic-test-vectors.json (line 48); rebuilt and verified by the tested model.
Neither transaction is meant to be broadcast. to_spend spends an output that does not exist, so it cannot be relayed as an ordinary transaction, and to_sign spends to_spend. The BIP gives this shape a practical purpose: it resembles a Bitcoin transaction closely enough that existing signing hardware can sign it, while containing an invalid input so it cannot be spent on any real network.1415
Apart from that missing coin, both transactions must be valid: they must pass all consensus checks. A signature is therefore not limited to one key. The published vectors include a 3-of-3 multisig address, whose “signature” is three ECDSA signatures, an empty dummy item and the witness script, and in BIP 322’s terms a signature need not contain a cryptographic signature at all, only whatever satisfies the script.1617
Simple, full, proof of funds
The simple format, prefixed smp, carries only the witness stack. It applies 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.718
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.8911
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 only for P2PKH addresses, and new proofs SHOULD use the new formats for every address type, P2PKH included.56
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.1920
Valid, invalid, inconclusive
A verifier is given an address, a message and a signature. It computes to_spend from the message and address, decodes to_sign from the signature, checks that to_sign’s first input spends to_spend’s output and that it has exactly one output, and then 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.)21
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.22
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, and the BIP’s upgradeable rules also end in inconclusive. Valid comes with two numbers, “valid at time T and age S”, where 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.13232425
valid
P2WPKH, lock time and sequence set: message KLE5MMJBTNF4AVZXIO3GIL5UWF
valid at time T = 2016 and age S = 2016
invalid
Wrong message: message Wrong message that was not signed
invalid signature: NULLFAIL: a failed signature must be empty
inconclusive
P2PKH proof of funds: message 2JNEDD7IJDSYLREMJ6Q7PTCQJD
proof-of-funds PSBTs are outside this model
Vectors from BIP 322’s test files, checked by the tested model. “Inconclusive” here means this model does not decode proof-of-funds PSBTs, so it cannot check the scripts they satisfy.
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, answers inconclusive for any script outside that set and for proof-of-funds signatures, and rejects every published error vector. 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.1221
What a signature does not prove
BIP 322 is careful about its own limits, and they matter more than the mechanics. The authors write that no message signing protocol can actually prove control of funds. A signature is obsolete as soon as it is created: the coins may have moved a minute later. And whoever holds a key may be willing to sign messages on someone else’s behalf even if they would never sign a real transaction for them.26
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.927
So treat a BIP 322 signature as evidence about one moment and one script. It says that at some point before it was presented, someone could produce what the address’s script demands for this exact message. It carries no date: T is a lock-time field, not a timestamp, so freshness has to come from the message, for example a challenge the verifier chose. It says nothing about who that someone is, whether they still can, or whether the coins are still there.262728
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, and the BIP asks that the screens resemble signing a message, not spending 0 satoshis.29
Evidence
Each numbered marker in the text points here, and the ↩ links lead back to every place that cites an entry. Quotes are verbatim from the BIP files at commit
3a10b5b, including their wiki markup; links open
the exact lines; the quoted text sits under each entry. Labels say what kind of statement each is: a rule, the author’s rationale, history,
a test vector, or our own inference.
-
↩ a b 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
-
↩ 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
-
↩ 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 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
-
↩ a b 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 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 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 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 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 c 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 scripts outside that set and for proof-of-funds signatures, whose PSBTs it does not decode. 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
-
↩ 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.
-
↩ 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).
-
↩ 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.
-
↩ 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>.
-
↩ 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.
-
↩ 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.
-
↩ a b 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.
-
↩ 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 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''.
-
↩ 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''.
-
↩ a b 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 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.
-
↩ 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.