Throw errors when p2wsh or p2wpkh contain uncompressed pubkeys.
This will enforce BIP143 compressed pubkey rules on an address generation level.
This commit is contained in:
parent
4eb698df50
commit
25b5806cf1
7 changed files with 107 additions and 17 deletions
test/fixtures
17
test/fixtures/p2wpkh.json
vendored
17
test/fixtures/p2wpkh.json
vendored
|
@ -113,6 +113,23 @@
|
|||
"output": "OP_RESERVED ea6d525c0c955d90d3dbd29a81ef8bfb79003727"
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "Invalid pubkey for p2wpkh",
|
||||
"description": "Uncompressed pubkey in pubkey",
|
||||
"arguments": {
|
||||
"pubkey": "049fa211b0fca342589ca381cc96520c3d0e3924832158d9f29891936cac091e80687acdca51868ee1f89a3bb36bb16f186262938e1f94c1e7692924935b9b1457"
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "Witness has invalid pubkey",
|
||||
"description": "Uncompressed pubkey in witness",
|
||||
"arguments": {
|
||||
"witness": [
|
||||
"300602010002010001",
|
||||
"049fa211b0fca342589ca381cc96520c3d0e3924832158d9f29891936cac091e80687acdca51868ee1f89a3bb36bb16f186262938e1f94c1e7692924935b9b1457"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "Pubkey mismatch",
|
||||
"options": {},
|
||||
|
|
24
test/fixtures/p2wsh.json
vendored
24
test/fixtures/p2wsh.json
vendored
|
@ -344,6 +344,30 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "redeem.input or redeem.output contains uncompressed pubkey",
|
||||
"arguments": {
|
||||
"redeem": {
|
||||
"output": "049fa211b0fca342589ca381cc96520c3d0e3924832158d9f29891936cac091e80687acdca51868ee1f89a3bb36bb16f186262938e1f94c1e7692924935b9b1457 OP_CHECKSIG"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "redeem.input or redeem.output contains uncompressed pubkey",
|
||||
"arguments": {
|
||||
"redeem": {
|
||||
"input": "049fa211b0fca342589ca381cc96520c3d0e3924832158d9f29891936cac091e80687acdca51868ee1f89a3bb36bb16f186262938e1f94c1e7692924935b9b1457"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "Witness contains uncompressed pubkey",
|
||||
"arguments": {
|
||||
"witness": [
|
||||
"049fa211b0fca342589ca381cc96520c3d0e3924832158d9f29891936cac091e80687acdca51868ee1f89a3bb36bb16f186262938e1f94c1e7692924935b9b1457"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"exception": "Invalid prefix or Network mismatch",
|
||||
"arguments": {
|
||||
|
|
4
test/fixtures/transaction_builder.json
vendored
4
test/fixtures/transaction_builder.json
vendored
|
@ -2122,7 +2122,7 @@
|
|||
},
|
||||
{
|
||||
"description": "Transaction w/ P2WSH(P2PK), signing with uncompressed public key",
|
||||
"exception": "BIP143 rejects uncompressed public keys in P2WPKH or P2WSH",
|
||||
"exception": "redeem.input or redeem.output contains uncompressed pubkey",
|
||||
"inputs": [
|
||||
{
|
||||
"txId": "2fddebc1a7e67e04fc6b77645ae9ae10eeaa35e168606587d79b031ebca33345",
|
||||
|
@ -2148,7 +2148,7 @@
|
|||
},
|
||||
{
|
||||
"description": "Transaction w/ P2SH(P2WSH(P2PK)), signing with uncompressed public key",
|
||||
"exception": "BIP143 rejects uncompressed public keys in P2WPKH or P2WSH",
|
||||
"exception": "redeem.input or redeem.output contains uncompressed pubkey",
|
||||
"inputs": [
|
||||
{
|
||||
"txId": "2fddebc1a7e67e04fc6b77645ae9ae10eeaa35e168606587d79b031ebca33345",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue