Skip to content

Commit 990a5ab

Browse files
authored
Merge pull request bitcoin#838 from kallewoof/bip322-fix-testvectors
bip322: fix test-vectors
2 parents fffeba1 + c28773f commit 990a5ab

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

bip-0322.mediawiki

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,29 @@ All of the above, plus (subject to change):
230230

231231
== Native segwit test vector ==
232232

233-
* <code>address = bcrt1qe7nte4zk4ayly5tc53dtdjupgkz0lr8azx3rzz</code>
234-
* <code>message = hello</code>
235-
* <code>sighash = 790eef86c204f0bff969ff822121317aa34eff0215dbd30ccf031e7b2f3f0cc1</code> (<code>sha256d("Bitcoin Signed Message:\n:hello")</code>)
233+
<pre>
234+
address = bcrt1qe7nte4zk4ayly5tc53dtdjupgkz0lr8azx3rzz
235+
scriptpubkey = 0014cfa6bcd456af49f25178a45ab6cb814584ff8cfd
236+
message = hello
237+
preimage = 0014cfa6bcd456af49f25178a45ab6cb814584ff8cfd426974636f696e205369
238+
676e6564204d6573736167653a0a68656c6c6f
239+
(scriptpubkey || "Bitcoin Signed Message:\nhello")
240+
sighash = 790eef86c204f0bff969ff822121317aa34eff0215dbd30ccf031e7b2f3f0cc1
241+
(sha256d(preimage), displayed in big-endian)
242+
</pre>
236243

237-
A possible proof is:
244+
The proof becomes:
238245

239-
* HEX: <code>01000000010002473044022075b4fb40421d55c55462879cb352a85eeb3af2138d3f02902c9143f12870f5f70220119c2995c1661138142f3899c1fd6d1af7e790e0e081be72db9ce7bf5b5b932901210290beccd02b73eca57467b2b6f1e47161a9b76a5e67586e7c1dee9ea6e2dcd869</code>
240-
* Base64: <code>AQAAAAEAAkcwRAIgdbT7QEIdVcVUYoecs1KoXus68hONPwKQLJFD8Shw9fcCIBGcKZXBZhE4FC84mcH9bRr355Dg4IG+ctuc579bW5MpASECkL7M0Ctz7KV0Z7K28eRxYam3al5nWG58He6epuLc2Gk=</code>
246+
<pre>
247+
HEX: 01000000010002473044022075b4fb40421d55c55462879cb352a85eeb3af2138d3f0290
248+
2c9143f12870f5f70220119c2995c1661138142f3899c1fd6d1af7e790e0e081be72db9c
249+
e7bf5b5b932901210290beccd02b73eca57467b2b6f1e47161a9b76a5e67586e7c1dee9e
250+
a6e2dcd869
251+
252+
Base64: AQAAAAEAAkcwRAIgdbT7QEIdVcVUYoecs1KoXus68hONPwKQLJFD8Shw9fcCIBGcKZXBZhE4
253+
FC84mcH9bRr355Dg4IG+ctuc579bW5MpASECkL7M0Ctz7KV0Z7K28eRxYam3al5nWG58He6e
254+
puLc2Gk=
255+
</pre>
241256

242257
Split into components:
243258

0 commit comments

Comments
 (0)