Skip to content

Commit f6e1164

Browse files
authored
Merge pull request bitcoin#955 from apoelstra/2020-07-hash-preimages-to-174
BIP174: add hash preimage fields to inputs
2 parents a2cd496 + 277be22 commit f6e1164

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

bip-0174.mediawiki

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ The currently defined per-input types are defined as follows:
200200
** Value: The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information.
201201
*** <tt>{porCommitment}</tt>
202202
203+
* Type: RIPEMD160 preimage <tt>PSBT_RIPEMD160 = 0x0a</tt>
204+
** Key: The resulting hash of the preimage
205+
*** <tt>{0x0a}|{20-byte hash}</tt>
206+
** Value: The hash preimage, encoded as a byte vector, which must equal the key when run through the `RIPEMD160` algorithm
207+
*** <tt>{preimage}</tt>
208+
209+
* Type: SHA256 preimage <tt>PSBT_SHA256 = 0x0b</tt>
210+
** Key: The resulting hash of the preimage
211+
*** <tt>{0x0b}|{32-byte hash}</tt>
212+
** Value: The hash preimage, encoded as a byte vector, which must equal the key when run through the `SHA256` algorithm
213+
*** <tt>{preimage}</tt>
214+
215+
* Type: HASH160 preimage <tt>PSBT_HASH160 = 0x0c</tt>
216+
** Key: The resulting hash of the preimage
217+
*** <tt>{0x0c}|{20-byte hash}</tt>
218+
** Value: The hash preimage, encoded as a byte vector, which must equal the key when run through the `SHA256` algorithm followed by the `RIPEMD160` algorithm
219+
*** <tt>{preimage}</tt>
220+
221+
* Type: HASH256 preimage <tt>PSBT_HASH256 = 0x0d</tt>
222+
** Key: The resulting hash of the preimage
223+
*** <tt>{0x0d}|{32-byte hash}</tt>
224+
** Value: The hash preimage, encoded as a byte vector, which must equal the key when run through the `SHA256` algorithm twice
225+
*** <tt>{preimage}</tt>
226+
203227
* Type: Proprietary Use Type <tt>PSBT_IN_PROPRIETARY = 0xFC</tt>
204228
** Key: Variable length identifier prefix, followed by a subtype, followed by the key data itself.
205229
*** <tt>{0xFC}|<prefix>|{subtype}|{key data}</tt>

0 commit comments

Comments
 (0)