Skip to content

Commit c624414

Browse files
committed
bip-0322: remove the 'to_spend' transaction from serialization
1 parent 9e1beef commit c624414

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

bip-0322.mediawiki

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The <code>to_sign</code> transaction is:
7474
vout[0].nValue = 0
7575
vout[0].scriptPubKey = OP_RETURN
7676
77-
A full signature consists of the base64-encoding of the <code>to_spend</code> and <code>to_sign</code> transactions concatenated in standard network serialisation.
77+
A full signature consists of the base64-encoding of the <code>to_sign</code> transaction in standard network serialisation.
7878

7979
=== Full (Proof of Funds) ===
8080

@@ -102,11 +102,9 @@ A validator is given as input an address ''A'' (which may be omitted in a proof-
102102
Validation consists of the following steps:
103103

104104
# Basic validation
105-
## Decode ''s'' as the transactions <code>to_sign</code> and <code>to_spend</code>
106-
## Confirm that <code>message_hash</code> is the correct hash of ''m''
107-
## Confirm that <code>message_challenge</code> is the scriptPubKey corresponding to ''A'' if ''A'' is present, and otherwise must be <code>OP_TRUE</code>
108-
## Confirm that all other fields are set as specified above; in particular that
109-
##* <code>to_spend</code> has exactly one input and one output
105+
## Compute the transaction <code>to_spend</code> from ''m'' and ''A''
106+
## Decode ''s'' as the transaction <code>to_sign</code>
107+
## If ''s'' was a full transaction, confirm all fields are set as specified above; in particular that
110108
##* <code>to_sign</code> has at least one input and its first input spends the output of </code>to_spend</code>
111109
##* <code>to_sign</code> has exactly one output, as specified above
112110
## 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.
@@ -120,6 +118,7 @@ Validation consists of the following steps:
120118
## <code>MINIMALIF</code>: the argument of <code>IF</code>/<code>NOTIF</code> must be exactly 0x01 or empty push
121119
## If any of the above steps failed, the validator should stop and output the ''invalid'' state.
122120
# Check the **upgradeable rules**
121+
## The version of <code>to_sign</code> must be 0 or 2.
123122
## The use of NOPs reserved for upgrades is forbidden.
124123
## The use of segwit versions greater than 0 are forbidden.
125124
## If any of the above steps failed, the validator should stop and output the ''inconclusive'' state.
@@ -137,7 +136,7 @@ Signers who control an address ''A'' who wish to sign a message ''m'' act as fol
137136
They then encode their signature, choosing either ''simple'' or ''full'' as follows:
138137

139138
* If they added no inputs to <code>to_sign</code>, left nSequence and nLockTime at 0, and ''A'' is a Segwit address (either pure or P2SH-wrapped), then they may base64-encode <code>message_signature</code>
140-
* Otherwise they must base64-encode the concatenation of <code>to_spend</code> followed by <code>to_sign</code>.
139+
* Otherwise they must base64-encode <code>to_sign</code>.
141140
142141
== Compatibility ==
143142

0 commit comments

Comments
 (0)