These fields are needed to solve miniscripts, which may have hash preimage challenges.
See https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-March/016720.html for some earlier (very short) discussion.
These fields are needed to solve miniscripts, which may have hash preimage challenges.
See https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-March/016720.html for some earlier (very short) discussion.
199 | @@ -200,6 +200,30 @@ The currently defined per-input types are defined as follows: 200 | ** Value: The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information. 201 | *** <tt>{porCommitment}</tt> 202 | 203 | +* Type: RIPEMD160 preimage <tt>PSBT_RIPEMD160 = 0x0a</tt> 204 | +** Key: The hash which the preimage must hash to 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>{porCommitment}</tt>
Should be preimage. same in the others.
206 | +** Value: The hash preimage, encoded as a byte vector, which must equal the key when run through the `RIPEMD160` algorithm 207 | +*** <tt>{porCommitment}</tt> 208 | + 209 | +* Type: SHA256 preimage <tt>PSBT_SHA256 = 0x0b</tt> 210 | +** Key: The hash which the preimage must hash to 211 | +*** <tt>{0x0b}|{20-byte hash}</tt>
Surely you mean 32 bytes
214 | +*** <tt>{preimage}</tt> 215 | + 216 | +* Type: HASH160 preimage <tt>PSBT_HASH160 = 0x0c</tt> 217 | +** Key: The hash which the preimage must hash to 218 | +*** <tt>{0x0c}|{20-byte hash}</tt> 219 | +** 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
followed by the RIPEMD160 algorithm
followed by the RIPEMD160 algorithm
need the `s
197 | @@ -198,7 +198,31 @@ The currently defined per-input types are defined as follows: 198 | ** Key: None. The key must only contain the 1 byte type. 199 | *** <tt>{0x09}</tt> 200 | ** Value: The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information. 201 | -*** <tt>{porCommitment}</tt> 202 | +*** <tt>{preimage}</tt> 203 | + 204 | +* Type: RIPEMD160 preimage <tt>PSBT_RIPEMD160 = 0x0a</tt> 205 | +** Key: The hash which the preimage must hash to
The hash which the preimage must hash to
imo, "The resulting hash of the preimage" suffices
Nice, I like this better. Fixed
197 | @@ -198,7 +198,31 @@ The currently defined per-input types are defined as follows: 198 | ** Key: None. The key must only contain the 1 byte type. 199 | *** <tt>{0x09}</tt> 200 | ** Value: The UTF-8 encoded commitment message string for the proof-of-reserves. See [[bip-0127.mediawiki|BIP 127]] for more information. 201 | -*** <tt>{porCommitment}</tt> 202 | +*** <tt>{preimage}</tt>
unintended change? This is an existing type.
Yes. Fixed.
ACK 277be22357a0b51fa77113277a6cc057484a6507
ACK
All the per-input fields have _IN_ in their names, but these new fields do not. Why ?
I regret not having a watch turned on the bip repo, so I'm late with my comments, this is already merged.
But IMO it would be better to have one new field, PSBT_IN_UNLOCKDATA, and a byte that specifies the type of unlock, PSBT_UNLOCKDATA_PREIMAGE_SHA256, etc. Or PSBT_IN_HASH_PREIMAGE and four types of hashes.
As I understand, there's no reason to have several preimages of different type for a single input. Thus having them in different fields creates ambiguity. Should having both SHA256 and RIPEMD160 preimages be treated as error ?
@apoelstra, what happened to the (c) part from https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-March/016720.html ?
(c) a map from public keys to 32-byte "tweaks" that are used in the pay-to-contract construction
I also see no PR for it being opened...