1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-28 00:58:09 +00:00

chore(tests): update Bitcoin test cases to use valid prevtxes

This commit is contained in:
grdddj 2022-01-24 21:23:58 +01:00 committed by matejcik
parent 9d717b2085
commit 3e11e8bba2
83 changed files with 1693 additions and 1553 deletions

View File

@ -22,14 +22,14 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import (
from .payment_req import make_payment_request
from .signtx import (
request_finished,
request_input,
request_meta,
request_output,
request_payment_req,
)
from .payment_req import make_payment_request
B = messages.ButtonRequestType
@ -39,8 +39,8 @@ TX_CACHE_MAINNET = TxCache("Bitcoin")
TXHASH_e5b7e2 = bytes.fromhex(
"e5b7e21b5ba720e81efd6bfa9f854ababdcddc75a43bfa60bf0fe069cfd1bb8a"
)
TXHASH_65b811 = bytes.fromhex(
"65b811d3eca0fe6915d9f2d77c86c5a7f19bf66b1b1253c2c51cb4ae5f0c017b"
FAKE_TXHASH_f982c0 = bytes.fromhex(
"f982c0a283bd65a59aa89eded9e48f2a3319cb80361dfab4cf6192a03badb60a"
)
PIN = "1234"
@ -51,6 +51,8 @@ pytestmark = pytest.mark.skip_t1
@pytest.mark.setup_client(pin=PIN)
def test_sign_tx(client: Client):
# NOTE: FAKE input tx
commitment_data = b"\x0fwww.example.com" + (1).to_bytes(ROUND_ID_LEN, "big")
with client:
@ -113,7 +115,7 @@ def test_sign_tx(client: Client):
messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_hash=FAKE_TXHASH_f982c0,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
),
@ -188,10 +190,10 @@ def test_sign_tx(client: Client):
request_output(0, TXHASH_e5b7e2),
request_output(1, TXHASH_e5b7e2),
request_input(1),
request_meta(TXHASH_65b811),
request_input(0, TXHASH_65b811),
request_output(0, TXHASH_65b811),
request_output(1, TXHASH_65b811),
request_meta(FAKE_TXHASH_f982c0),
request_input(0, FAKE_TXHASH_f982c0),
request_output(0, FAKE_TXHASH_f982c0),
request_output(1, FAKE_TXHASH_f982c0),
request_input(0),
request_input(1),
request_output(0),
@ -215,7 +217,7 @@ def test_sign_tx(client: Client):
assert (
serialized_tx.hex()
== "010000000001028abbd1cf69e00fbf60fa3ba475dccdbdba4a859ffa6bfd1ee820a75b1be2b7e50000000000ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff0550c3000000000000160014b7a51ede0a66ae36558a3ab097ad86bbd800786150c3000000000000160014167dae080bca35c9ea49c0c8335dcc4b252a1d70cb616e00000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe8c3af0000000000001600142e01768ca46e57210f0bd2c99e630e8168fa5fe50a000000000000001976a914a579388225827d9f2fe9014add644487808c695d88ac00024730440220694105071db8c6c8ba3d385d01694b6f7c17546327ab26d4c53a6503fee301e202202dd310c23a195a6cebc904b91ebd15d782e6dacd08670a72ade2795e7d3ff4ec012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
== "010000000001028abbd1cf69e00fbf60fa3ba475dccdbdba4a859ffa6bfd1ee820a75b1be2b7e50000000000ffffffff0ab6ad3ba09261cfb4fa1d3680cb19332a8fe4d9de9ea89aa565bd83a2c082f90100000000ffffffff0550c3000000000000160014b7a51ede0a66ae36558a3ab097ad86bbd800786150c3000000000000160014167dae080bca35c9ea49c0c8335dcc4b252a1d70cb616e00000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe8c3af0000000000001600142e01768ca46e57210f0bd2c99e630e8168fa5fe50a000000000000001976a914a579388225827d9f2fe9014add644487808c695d88ac0002473044022010bcbb2ae63db4bfdfdce298bcf3e302e2b1923d02ff57a2155eaae65fdb2949022026289b6d04d7615bf53b7aa0030b25619c465d639b233297b10d0da9ce1a6ca4012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
)
# Test for a second time.
@ -274,7 +276,7 @@ def test_unfair_fee(client: Client):
messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_hash=FAKE_TXHASH_f982c0,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
),
@ -375,7 +377,7 @@ def test_no_anonymity(client: Client):
messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_hash=FAKE_TXHASH_f982c0,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
),

View File

@ -22,7 +22,13 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_API = TxCache("Bcash")
@ -30,14 +36,17 @@ TX_API = TxCache("Bcash")
TXHASH_bc37c2 = bytes.fromhex(
"bc37c28dfb467d2ecb50261387bf752a3977d7e5337915071bb4151e6b711a78"
)
FAKE_TXHASH_bd32ff = bytes.fromhex(
"bd32ff85c3827fc2de6150548fb79d3e6826e353f08c68dda396b3321f2b1092"
)
TXHASH_502e85 = bytes.fromhex(
"502e8577b237b0152843a416f8f1ab0c63321b1be7a8cad7bf5c5c216fcf062c"
)
TXHASH_f68caf = bytes.fromhex(
"f68caf10df12d5b07a34601d88fa6856c6edcbf4d05ebef3486510ae1c293d5f"
FAKE_TXHASH_062fbd = bytes.fromhex(
"062fbdf491a60db4daf48148899e390bc48ae5153ab465078693ec781a1a685d"
)
TXHASH_8b6db9 = bytes.fromhex(
"8b6db9b8ba24235d86b053ea2ccb484fc32b96f89c3c39f98d86f90db16076a0"
FAKE_TXHASH_203416 = bytes.fromhex(
"203416cda0f2f7f0b4d666c6160190126edb07236394e927bf605821866f2a71"
)
pytestmark = pytest.mark.altcoin
@ -84,9 +93,10 @@ def test_send_bch_change(client: Client):
client, "Bcash", [inp1], [out1, out2], prev_txes=TX_API
)
assert (
serialized_tx.hex()
== "0100000001781a716b1e15b41b07157933e5d777392a75bf87132650cb2e7d46fb8dc237bc000000006a473044022061aee4f17abe044d5df8c52c9ffd3b84e5a29743517e488b20ecf1ae0b3e4d3a02206bb84c55e407f3b684ff8d9bea0a3409cfd865795a19d10b3d3c31f12795c34a412103a020b36130021a0f037c1d1a02042e325c0cb666d6478c1afdcd9d913b9ef080ffffffff0272ee1c00000000001976a914b1401fce7e8bf123c88a0467e0ed11e3b9fbef5488acec1e0100000000001976a914d51eca49695cdf47e7f4b55507893e3ad53fe9d888ac00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://bch1.trezor.io/api/tx/502e8577b237b0152843a416f8f1ab0c63321b1be7a8cad7bf5c5c216fcf062c",
tx_hex="0100000001781a716b1e15b41b07157933e5d777392a75bf87132650cb2e7d46fb8dc237bc000000006a473044022061aee4f17abe044d5df8c52c9ffd3b84e5a29743517e488b20ecf1ae0b3e4d3a02206bb84c55e407f3b684ff8d9bea0a3409cfd865795a19d10b3d3c31f12795c34a412103a020b36130021a0f037c1d1a02042e325c0cb666d6478c1afdcd9d913b9ef080ffffffff0272ee1c00000000001976a914b1401fce7e8bf123c88a0467e0ed11e3b9fbef5488acec1e0100000000001976a914d51eca49695cdf47e7f4b55507893e3ad53fe9d888ac00000000",
)
@ -140,9 +150,10 @@ def test_send_bch_nochange(client: Client):
client, "Bcash", [inp1, inp2], [out1], prev_txes=TX_API
)
assert (
serialized_tx.hex()
== "01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://bch1.trezor.io/api/tx/5594fd9e5e26dcb4437cbbbba517401720849159bac4e2158e1e6401ffd5fdb7",
tx_hex="01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000",
)
@ -196,17 +207,20 @@ def test_send_bch_oldaddr(client: Client):
client, "Bcash", [inp1, inp2], [out1], prev_txes=TX_API
)
assert (
serialized_tx.hex()
== "01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://bch1.trezor.io/api/tx/5594fd9e5e26dcb4437cbbbba517401720849159bac4e2158e1e6401ffd5fdb7",
tx_hex="01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000",
)
def test_attack_change_input(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/145h/10h/0/0"),
amount=1_995_344,
prev_hash=TXHASH_bc37c2,
prev_hash=FAKE_TXHASH_bd32ff,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
@ -244,9 +258,9 @@ def test_attack_change_input(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_bc37c2),
request_input(0, TXHASH_bc37c2),
request_output(0, TXHASH_bc37c2),
request_meta(FAKE_TXHASH_bd32ff),
request_input(0, FAKE_TXHASH_bd32ff),
request_output(0, FAKE_TXHASH_bd32ff),
request_input(0),
messages.Failure(code=messages.FailureType.ProcessError),
]
@ -257,6 +271,8 @@ def test_attack_change_input(client: Client):
@pytest.mark.multisig
def test_send_bch_multisig_wrongchange(client: Client):
# NOTE: fake input tx used
nodes = [
btc.get_public_node(
client, parse_path(f"m/48h/145h/{i}h/0h"), coin_name="Bcash"
@ -288,7 +304,7 @@ def test_send_bch_multisig_wrongchange(client: Client):
multisig=getmultisig(1, 0, [b"", sig, b""]),
# bitcoincash:pp6kcpkhua7789g2vyj0qfkcux3yvje7euhyhltn0a
amount=24_000,
prev_hash=TXHASH_f68caf,
prev_hash=FAKE_TXHASH_062fbd,
prev_index=1,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
@ -314,10 +330,10 @@ def test_send_bch_multisig_wrongchange(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_f68caf),
request_input(0, TXHASH_f68caf),
request_output(0, TXHASH_f68caf),
request_output(1, TXHASH_f68caf),
request_meta(FAKE_TXHASH_062fbd),
request_input(0, FAKE_TXHASH_062fbd),
request_output(0, FAKE_TXHASH_062fbd),
request_output(1, FAKE_TXHASH_062fbd),
request_input(0),
request_output(0),
request_finished(),
@ -328,16 +344,18 @@ def test_send_bch_multisig_wrongchange(client: Client):
)
assert (
signatures1[0].hex()
== "304402205ce02f7bf3ef225e4a17e2b5a98dc6ca5536a6b68088f94200390a1d505c4f3e022045657781095e01422736c5541b03b014101d76e54089eda030cb016dfce10e98"
== "3044022044d6faf6cca46c368a24220079863e5fb608192eb33e0726d8f529980465122302202903f91c1cc32dee5530f1fc5b88aad2563b44ba74471fd4903b974124db25da"
)
assert (
serialized_tx.hex()
== "01000000015f3d291cae106548f3be5ed0f4cbedc65668fa881d60347ab0d512df10af8cf601000000fc0047304402205ce02f7bf3ef225e4a17e2b5a98dc6ca5536a6b68088f94200390a1d505c4f3e022045657781095e01422736c5541b03b014101d76e54089eda030cb016dfce10e984147304402207274b5a4d15e75f3df7319a375557b0efba9b27bc63f9f183a17da95a6125c94022000efac57629f1522e2d3958430e2ef073b0706cfac06cce492651b79858f09ae414c69522102962724052105f03332ab700812afc5ca665d264b13339be1fe7f7fdd3a2a685821024364cd1fdc2aa05bc8b09874a57aa1082a47ac9062d35f22ed5f4afefb3f67fc21024d375b44804f3b0c3493ea0806eb25cc85f51e0d616d6bd6e4ef0388e71cd29e53aeffffffff01d85900000000000017a9140d5566bfc721e6c3d5ab583841d387f3939ffed38700000000"
== "01000000015d681a1a78ec93860765b43a15e58ac40b399e894881f4dab40da691f4bd2f0601000000fc00473044022044d6faf6cca46c368a24220079863e5fb608192eb33e0726d8f529980465122302202903f91c1cc32dee5530f1fc5b88aad2563b44ba74471fd4903b974124db25da4147304402207274b5a4d15e75f3df7319a375557b0efba9b27bc63f9f183a17da95a6125c94022000efac57629f1522e2d3958430e2ef073b0706cfac06cce492651b79858f09ae414c69522102962724052105f03332ab700812afc5ca665d264b13339be1fe7f7fdd3a2a685821024364cd1fdc2aa05bc8b09874a57aa1082a47ac9062d35f22ed5f4afefb3f67fc21024d375b44804f3b0c3493ea0806eb25cc85f51e0d616d6bd6e4ef0388e71cd29e53aeffffffff01d85900000000000017a9140d5566bfc721e6c3d5ab583841d387f3939ffed38700000000"
)
@pytest.mark.multisig
def test_send_bch_multisig_change(client: Client):
# NOTE: fake input tx used
nodes = [
btc.get_public_node(
client, parse_path(f"m/48h/145h/{i}h/0h"), coin_name="Bcash"
@ -356,7 +374,7 @@ def test_send_bch_multisig_change(client: Client):
address_n=parse_path("m/48h/145h/3h/0h/0/0"),
multisig=getmultisig(0, 0, EMPTY_SIGNATURES),
amount=48_490,
prev_hash=TXHASH_8b6db9,
prev_hash=FAKE_TXHASH_203416,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
@ -380,9 +398,9 @@ def test_send_bch_multisig_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_8b6db9),
request_input(0, TXHASH_8b6db9),
request_output(0, TXHASH_8b6db9),
request_meta(FAKE_TXHASH_203416),
request_input(0, FAKE_TXHASH_203416),
request_output(0, FAKE_TXHASH_203416),
request_input(0),
request_output(0),
request_output(1),
@ -395,7 +413,7 @@ def test_send_bch_multisig_change(client: Client):
assert (
signatures1[0].hex()
== "304402202b75dbb307d2556b9a85851d27ab118b3f06344bccb6e21b0a5dfcf74e0e644f02206611c59396d44741d34fd7bb602be06ef91690b22b47c3f3c271e15e20176ac0"
== "3045022100fc790bc8d069cafb6422e937fb922cc15cca0c32919402e415c03ce0208dab6a02205d218b33c6e0a990e0f78646b4b75c67c8de05a7cc42a9c892d748b94ea25112"
)
inp1 = messages.TxInputType(
@ -403,7 +421,7 @@ def test_send_bch_multisig_change(client: Client):
multisig=getmultisig(0, 0, [b"", b"", signatures1[0]]),
# bitcoincash:pqguz4nqq64jhr5v3kvpq4dsjrkda75hwy86gq0qzw
amount=48_490,
prev_hash=TXHASH_8b6db9,
prev_hash=FAKE_TXHASH_203416,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
@ -418,9 +436,9 @@ def test_send_bch_multisig_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_8b6db9),
request_input(0, TXHASH_8b6db9),
request_output(0, TXHASH_8b6db9),
request_meta(FAKE_TXHASH_203416),
request_input(0, FAKE_TXHASH_203416),
request_output(0, FAKE_TXHASH_203416),
request_input(0),
request_output(0),
request_output(1),
@ -433,11 +451,11 @@ def test_send_bch_multisig_change(client: Client):
assert (
signatures1[0].hex()
== "3045022100cc12faf18a489d8014e978ef7ca0760aa6487cdb40b49dd991bfe9c66625f5a802206088fef49ecad30679d55eaa870741bbb8b83fac08eb078872ac276c8139015d"
== "3045022100bf3f7b31f1e6c063cebf2651edde5ae4bc1d65cc815aaa83bc60a035b2b0391802206cd098f23bf66f10ce23bd3596f05cf3a71da891d7abfe89d777c14ee2856601"
)
assert (
serialized_tx.hex()
== "0100000001a07660b10df9868df9393c9cf8962bc34f48cb2cea53b0865d2324bab8b96d8b00000000fdfd0000483045022100cc12faf18a489d8014e978ef7ca0760aa6487cdb40b49dd991bfe9c66625f5a802206088fef49ecad30679d55eaa870741bbb8b83fac08eb078872ac276c8139015d4147304402202b75dbb307d2556b9a85851d27ab118b3f06344bccb6e21b0a5dfcf74e0e644f02206611c59396d44741d34fd7bb602be06ef91690b22b47c3f3c271e15e20176ac0414c6952210290cc724ccb90a6c7c1c3b291938449464ea474390183909e51bcd2807ecb779d210222f537684e2933563f737192fbf1947fd9034402e5708d10f6decd8e1f03e172210350df5cb41013d6b06581230556006b0a85ccccd205745cc10c927755193c241b53aeffffffff02c05d0000000000001976a91400741952f6a6eab5394f366db5cc5a54b0c2429f88acc05d00000000000017a914dfc8c2dda26f7151ed7df8aeeca24089e6410fdd8700000000"
== "0100000001712a6f86215860bf27e994632307db6e12900116c666d6b4f0f7f2a0cd16342000000000fdfe0000483045022100bf3f7b31f1e6c063cebf2651edde5ae4bc1d65cc815aaa83bc60a035b2b0391802206cd098f23bf66f10ce23bd3596f05cf3a71da891d7abfe89d777c14ee285660141483045022100fc790bc8d069cafb6422e937fb922cc15cca0c32919402e415c03ce0208dab6a02205d218b33c6e0a990e0f78646b4b75c67c8de05a7cc42a9c892d748b94ea25112414c6952210290cc724ccb90a6c7c1c3b291938449464ea474390183909e51bcd2807ecb779d210222f537684e2933563f737192fbf1947fd9034402e5708d10f6decd8e1f03e172210350df5cb41013d6b06581230556006b0a85ccccd205745cc10c927755193c241b53aeffffffff02c05d0000000000001976a91400741952f6a6eab5394f366db5cc5a54b0c2429f88acc05d00000000000017a914dfc8c2dda26f7151ed7df8aeeca24089e6410fdd8700000000"
)
@ -498,7 +516,8 @@ def test_send_bch_external_presigned(client: Client):
client, "Bcash", [inp1, inp2], [out1], prev_txes=TX_API
)
assert (
serialized_tx.hex()
== "01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://bch1.trezor.io/api/tx/5594fd9e5e26dcb4437cbbbba517401720849159bac4e2158e1e6401ffd5fdb7",
tx_hex="01000000022c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50000000006a47304402207a2a955f1cb3dc5f03f2c82934f55654882af4e852e5159639f6349e9386ec4002205fb8419dce4e648eae8f67bc4e369adfb130a87d2ea2d668f8144213b12bb457412103174c61e9c5362507e8061e28d2c0ce3d4df4e73f3535ae0b12f37809e0f92d2dffffffff2c06cf6f215c5cbfd7caa8e71b1b32630cabf1f816a4432815b037b277852e50010000006a473044022062151cf960b71823bbe68c7ed2c2a93ad1b9706a30255fddb02fcbe056d8c26102207bad1f0872bc5f0cfaf22e45c925c35d6c1466e303163b75cb7688038f1a5541412102595caf9aeb6ffdd0e82b150739a83297358b9a77564de382671056ad9e5b8c58ffffffff0170861d00000000001976a91434e9cec317896e818619ab7dc99d2305216ff4af88ac00000000",
)

View File

@ -19,22 +19,31 @@ import pytest
from trezorlib import btc, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, btc_hash, parse_path
from trezorlib.tools import H_, parse_path, tx_hash
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import request_finished, request_input, request_meta, request_output
B = messages.ButtonRequestType
TX_API = TxCache("Bgold")
TXHASH_25526b = bytes.fromhex(
"25526bf06c76ad3082bba930cf627cdd5f1b3cd0b9907dd7ff1a07e14addc985"
TXHASH_aade05 = bytes.fromhex(
"aade0536c655334908e677204742f06092fc9dad30f7b98b0c7a51090e7fa8a9"
)
TXHASH_db77c2 = bytes.fromhex(
"db77c2461b840e6edbe7f9280043184a98e020d9795c1b65cb7cef2551a8fb18"
FAKE_TXHASH_7f1f6b = bytes.fromhex(
"7f1f6bfe8d5a23e038c58bdcf47e6eb3b5ddb93300176b273564951105206b39"
)
TXHASH_f55c5b = bytes.fromhex(
"f55c5bc925eb2a0bf9de0ac142b24bed81ec46dd2151d5f69728070eaea1aded"
FAKE_TXHASH_db7239 = bytes.fromhex(
"db7239c358352c10996115b3de9e3f37ea0a97be4ea8c4b9e08996e257a21d0e"
)
FAKE_TXHASH_6f0398 = bytes.fromhex(
"6f0398f8bac639312afc2e40210ce5253535f92326167f40e1f38dd7047b00ec"
)
FAKE_TXHASH_aae50f = bytes.fromhex(
"aae50f8dc1c19c35517e5bbc2214d38e1ce4b4ff7cb3151b5b31bf0f723f8e06"
)
FAKE_TXHASH_a63dbe = bytes.fromhex(
"a63dbedd8cd284bf0d3c468e84b9b0eeb14c3a08824eab8f80e7723a299f30db"
)
pytestmark = pytest.mark.altcoin
@ -42,10 +51,12 @@ pytestmark = pytest.mark.altcoin
# All data taken from T1
def test_send_bitcoin_gold_change(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/156h/0h/0/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_6f0398,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
@ -68,10 +79,10 @@ def test_send_bitcoin_gold_change(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_6f0398),
request_input(0, FAKE_TXHASH_6f0398),
request_output(0, FAKE_TXHASH_6f0398),
request_output(1, FAKE_TXHASH_6f0398),
request_input(0),
request_output(0),
request_output(1),
@ -83,16 +94,18 @@ def test_send_bitcoin_gold_change(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "39a0716c361610724c7c40916baa20808cbdd7538b6c38689ce80cb73e7f51d1"
tx_hash(serialized_tx).hex()
== "58fccf99181283bbde5f2634fed0bff490a02df0b61bf50742a0437107d13f54"
)
def test_send_bitcoin_gold_nochange(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/156h/0h/1/0"),
address_n=parse_path("m/44h/156h/0h/0/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_6f0398,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
@ -100,7 +113,7 @@ def test_send_bitcoin_gold_nochange(client: Client):
address_n=parse_path("m/44h/156h/0h/0/1"),
# 1LRspCZNFJcbuNKQkXgHMDucctFRQya5a3
amount=38_448_607,
prev_hash=TXHASH_db77c2,
prev_hash=FAKE_TXHASH_aae50f,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
@ -118,15 +131,15 @@ def test_send_bitcoin_gold_nochange(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_6f0398),
request_input(0, FAKE_TXHASH_6f0398),
request_output(0, FAKE_TXHASH_6f0398),
request_output(1, FAKE_TXHASH_6f0398),
request_input(1),
request_meta(TXHASH_db77c2),
request_input(0, TXHASH_db77c2),
request_input(1, TXHASH_db77c2),
request_output(0, TXHASH_db77c2),
request_meta(FAKE_TXHASH_aae50f),
request_input(0, FAKE_TXHASH_aae50f),
request_input(1, FAKE_TXHASH_aae50f),
request_output(0, FAKE_TXHASH_aae50f),
request_input(0),
request_input(1),
request_output(0),
@ -138,21 +151,23 @@ def test_send_bitcoin_gold_nochange(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "ac9d452b900eb747d3137e1f3044bb0f46efaeb6e0fc8c27b02d1d08d238a904"
tx_hash(serialized_tx).hex()
== "77b595d25ed2a4d08fee9e9219e48def9f26f3e0945fd370c445aba5b72888d4"
)
def test_attack_change_input(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/156h/11h/0/0"),
address_n=parse_path("m/44h/156h/0h/0/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_6f0398,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
out1 = messages.TxOutputType(
address_n=parse_path("m/44h/156h/11h/1/0"),
address_n=parse_path("m/44h/156h/0h/1/0"),
amount=1_896_050,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -185,10 +200,10 @@ def test_attack_change_input(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_6f0398),
request_input(0, FAKE_TXHASH_6f0398),
request_output(0, FAKE_TXHASH_6f0398),
request_output(1, FAKE_TXHASH_6f0398),
request_input(0),
messages.Failure(code=messages.FailureType.ProcessError),
]
@ -199,6 +214,8 @@ def test_attack_change_input(client: Client):
@pytest.mark.multisig
def test_send_btg_multisig_change(client: Client):
# NOTE: fake input tx used
nodes = [
btc.get_public_node(
client, parse_path(f"m/48h/156h/{i}h/0h"), coin_name="Bgold"
@ -218,7 +235,7 @@ def test_send_btg_multisig_change(client: Client):
multisig=getmultisig(0, 0, EMPTY_SIGS),
# 33Ju286QvonBz5N1V754ZekQv4GLJqcc5R
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_a63dbe,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
@ -242,10 +259,10 @@ def test_send_btg_multisig_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_a63dbe),
request_input(0, FAKE_TXHASH_a63dbe),
request_output(0, FAKE_TXHASH_a63dbe),
request_output(1, FAKE_TXHASH_a63dbe),
request_input(0),
request_output(0),
request_output(1),
@ -258,14 +275,14 @@ def test_send_btg_multisig_change(client: Client):
assert (
signatures[0].hex()
== "30440220263c427e6e889c161206edee39b9b969350c154ddd8eb76d2ab8ca8e0fc083b702200fb1d0ef430fa2d0293dcbb0b237775d4f9748222a6ed9fc3ff747837b99020a"
== "3045022100bb9b465d2bd7a22b17adc4d8c4600282cfaced0469969f32a2d85e152a528074022030a3698f460c7c935c284f4ffa97d6e44afc200b0c38319d259d15d3deb7c5ac"
)
inp1 = messages.TxInputType(
address_n=parse_path("m/48h/156h/1h/0h/0/0"),
multisig=getmultisig(0, 0, [b"", b"", signatures[0]]),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_a63dbe,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
@ -280,10 +297,10 @@ def test_send_btg_multisig_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_a63dbe),
request_input(0, FAKE_TXHASH_a63dbe),
request_output(0, FAKE_TXHASH_a63dbe),
request_output(1, FAKE_TXHASH_a63dbe),
request_input(0),
request_output(0),
request_output(1),
@ -296,19 +313,21 @@ def test_send_btg_multisig_change(client: Client):
assert (
signatures[0].hex()
== "3045022100c9094b060b4b095e78403493912b0e06ca12ffbdc0f2fbeec20b02d7eaa73f8702206813e33e04a2b9c4493ecfa2024f2e9d69b5a2ab5c10433d9ab762add5bdde27"
== "30440220093c9b193883cd50e81668eb80efe6f82faf01ea707c16c4c33ce1eb40419ccf02200c81b328991389b53a04fcc091365bcc71c2a5c17f62982240b39f1bdefb91f7"
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "2677130ec0c5eea2249787fe17b85770cfb35dfce550830a7fb6c6acd9375114"
tx_hash(serialized_tx).hex()
== "e5f0bea13c61bf0d02972bbe66f4ca107abd13803015aa785f013114ecec55b7"
)
def test_send_p2sh(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/156h/0h/1/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_db7239,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
@ -332,10 +351,10 @@ def test_send_p2sh(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_db7239),
request_input(0, FAKE_TXHASH_db7239),
request_output(0, FAKE_TXHASH_db7239),
request_output(1, FAKE_TXHASH_db7239),
request_input(0),
request_output(0),
request_output(1),
@ -348,16 +367,18 @@ def test_send_p2sh(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "d5732fc8a594ae3b7ba695d7b276b2186f8572b0eb157120e0ba35d3511c6060"
tx_hash(serialized_tx).hex()
== "fe743152e9480c1e12df378d012fb969a9b97f605c25cda98f08ed6c2e418dbf"
)
def test_send_p2sh_witness_change(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/156h/0h/1/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_db7239,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
@ -380,10 +401,10 @@ def test_send_p2sh_witness_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_db7239),
request_input(0, FAKE_TXHASH_db7239),
request_output(0, FAKE_TXHASH_db7239),
request_output(1, FAKE_TXHASH_db7239),
request_input(0),
request_output(0),
request_output(1),
@ -396,13 +417,15 @@ def test_send_p2sh_witness_change(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "eed4ef86a408602e35ae416591f349847db38cdaddef1429a9bb0e39520d100d"
tx_hash(serialized_tx).hex()
== "b891b4aacfe2b7d7fc7653f617faac305aeab336a73ec57b3604ede71db598d6"
)
@pytest.mark.multisig
def test_send_multisig_1(client: Client):
# NOTE: fake input tx used
nodes = [
btc.get_public_node(
client, parse_path(f"m/49h/156h/{i}h"), coin_name="Bgold"
@ -415,7 +438,7 @@ def test_send_multisig_1(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/156h/1h/1/0"),
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_7f1f6b,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
multisig=multisig,
@ -436,10 +459,10 @@ def test_send_multisig_1(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_7f1f6b),
request_input(0, FAKE_TXHASH_7f1f6b),
request_output(0, FAKE_TXHASH_7f1f6b),
request_output(1, FAKE_TXHASH_7f1f6b),
request_input(0),
request_output(0),
request_input(0),
@ -458,10 +481,10 @@ def test_send_multisig_1(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_7f1f6b),
request_input(0, FAKE_TXHASH_7f1f6b),
request_output(0, FAKE_TXHASH_7f1f6b),
request_output(1, FAKE_TXHASH_7f1f6b),
request_input(0),
request_output(0),
request_input(0),
@ -473,25 +496,27 @@ def test_send_multisig_1(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "efa5b21916ac7ea5316c38b2d7d5520d80cbe563c58304f956ea6ddb241001d1"
tx_hash(serialized_tx).hex()
== "98e87ee2b5254e9346f2768993950dbfc3a3a4bd084983d0fb78337f1deeca3c"
)
def test_send_mixed_inputs(client: Client):
# NOTE: fake input tx used
# First is non-segwit, second is segwit.
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/156h/11h/0/0"),
address_n=parse_path("m/44h/156h/0h/0/1"),
# 1LRspCZNFJcbuNKQkXgHMDucctFRQya5a3
amount=38_448_607,
prev_hash=TXHASH_db77c2,
prev_hash=FAKE_TXHASH_aae50f,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
inp2 = messages.TxInputType(
address_n=parse_path("m/49h/156h/0h/1/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_db7239,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
@ -507,31 +532,33 @@ def test_send_mixed_inputs(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "2c64109fba890657e37f0782efda29bbc277dfd521658f185d302ddffcacffd2"
tx_hash(serialized_tx).hex()
== "52b17dc977c51eac75b330fe071ebcae8adde73437e3612e7b9bb501b00df840"
)
@pytest.mark.skip_t1
def test_send_btg_external_presigned(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/156h/0h/1/0"),
address_n=parse_path("m/44h/156h/0h/0/0"),
amount=1_252_382_934,
prev_hash=TXHASH_25526b,
prev_hash=FAKE_TXHASH_6f0398,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
inp2 = messages.TxInputType(
# address_n=parse_path("49'/156'/0'/0/0"),
# AXibjT5r96ZaVA8Lu4BQZocdTx7p5Ud8ZP
amount=58_456,
prev_hash=TXHASH_f55c5b,
prev_hash=TXHASH_aade05,
prev_index=0,
script_type=messages.InputScriptType.EXTERNAL,
script_pubkey=bytes.fromhex("a914aee37ad448e17438cabfee1756f2a08e33ed3ce887"),
script_sig=bytes.fromhex("1600147c5edda9b293db2c8894b9d81efd77764910c445"),
witness=bytes.fromhex(
"024730440220091eece828409b3a9aa92dd2f9b032f9fb3a12b21b323a3fdea3cb18d08249af022065412107afcf76b0d28b90188c802f8f17b41790ed81c868d0ee23f1dd2ec53441210386789a34fe1a49bfc3e174adc6706c6222b0d80de76b884a0e3d32f8e9c4dc3e"
script_pubkey=bytes.fromhex(
"76a9147c5edda9b293db2c8894b9d81efd77764910c44588ac"
),
script_sig=bytes.fromhex(
"4830450221008fb6fe8913178f2a3ab6fad1665c99a9ea0b7f5d4c079208dfc0a6d528a6d2f602206b2cd948bc367caec7da7c0806fe640a55fe8005979cadc4d414b1590109226141210386789a34fe1a49bfc3e174adc6706c6222b0d80de76b884a0e3d32f8e9c4dc3e"
),
)
out1 = messages.TxOutputType(
@ -548,19 +575,18 @@ def test_send_btg_external_presigned(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_25526b),
request_input(0, TXHASH_25526b),
request_output(0, TXHASH_25526b),
request_output(1, TXHASH_25526b),
request_meta(FAKE_TXHASH_6f0398),
request_input(0, FAKE_TXHASH_6f0398),
request_output(0, FAKE_TXHASH_6f0398),
request_output(1, FAKE_TXHASH_6f0398),
request_input(1),
request_meta(TXHASH_f55c5b),
request_input(0, TXHASH_f55c5b),
request_output(0, TXHASH_f55c5b),
request_output(1, TXHASH_f55c5b),
request_meta(TXHASH_aade05),
request_input(0, TXHASH_aade05),
request_output(0, TXHASH_aade05),
request_output(1, TXHASH_aade05),
request_input(0),
request_input(1),
request_output(0),
request_input(1),
request_finished(),
]
)
@ -569,6 +595,6 @@ def test_send_btg_external_presigned(client: Client):
)
assert (
btc_hash(serialized_tx)[::-1].hex()
== "95ebe5cdfb8dc3c112eb0107fc3bd7701689ac5ec4a74a3d12e203333d0832d3"
tx_hash(serialized_tx).hex()
== "3265a374759499b2043cf8ce57d11cf7ad35999bc5c470daa45eafef9c2ba2f2"
)

View File

@ -21,7 +21,7 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import (
from .signtx import (
request_extra_data,
request_finished,
request_input,

View File

@ -21,45 +21,44 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import request_finished, request_input, request_meta, request_output
B = messages.ButtonRequestType
TX_API = TxCache("Decred Testnet")
TXHASH_e16248 = bytes.fromhex(
"e16248f0b39a0a0c0e53d6f2f84c2a944f0d50e017a82701e8e02e46e979d5ed"
FAKE_TXHASH_4d8acd = bytes.fromhex(
"4d8acde26d5efc7f5df1b3cdada6b11027616520c883e09c919b88f0f0cb6410"
)
TXHASH_5e6e35 = bytes.fromhex(
"5e6e3500a333c53c02f523db5f1a9b17538a8850b4c2c24ecb9b7ba48059b970"
FAKE_TXHASH_f341fd = bytes.fromhex(
"f341fde6a78c2e150619d1c5ecbd90fabeb9e278024cc38ea4190d0b4a6d61d8"
)
TXHASH_ccf95b = bytes.fromhex(
"ccf95b0fd220ef59ae2e5b17005a81e222758122682d522eff8ae1fcbc93bc74"
FAKE_TXHASH_5f3a7d = bytes.fromhex(
"5f3a7d29623eba20788e967439c1ccf122688589dfc07cddcedd1b27dc14b568"
)
TXHASH_f395ef = bytes.fromhex(
"f395ef3e72a831a766db15e7a38bc28025d4ee02234d68bdea2d8353b47a3113"
FAKE_TXHASH_9ac7d2 = bytes.fromhex(
"9ac7d222f4460ccf4ef38eee047eaf8b3a09505364afe4fe27b765e4c5508fd1"
)
TXHASH_3f7c39 = bytes.fromhex(
"3f7c395521d38387e7617565fe17628723ef6635a08537ad9c46cfb1619e4c3f"
FAKE_TXHASH_48f5b8 = bytes.fromhex(
"48f5b85f8b1cf796d0d07388ced491f154e2d26b0615529d2d6ba9c170542df3"
)
TXHASH_16da18 = bytes.fromhex(
"16da185052740d85a630e79c140558215b64e26c500212b90e16b55d13ca06a8"
FAKE_TXHASH_f8e2f2 = bytes.fromhex(
"f8e2f2b4eab772f6e3743cba92db341f64b84d9c16ae375c7690fbf0bf02fc7b"
)
TXHASH_8b6890 = bytes.fromhex(
"8b6890c10a3764fe6f378bc5b7e438148df176e9be1dde704ce866361149e254"
)
TXHASH_1f00fc = bytes.fromhex(
"1f00fc54530d7c4877f5032e91b6c507f6a1531861dede2ab134e5c0b5dfe8c8"
FAKE_TXHASH_51bc9c = bytes.fromhex(
"51bc9c71f10a81eef3caedb5333062eb4b1f70998adf02916fe98fdc04c572e8"
)
pytestmark = [pytest.mark.altcoin, pytest.mark.decred]
def test_send_decred(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
# TscqTv1he8MZrV321SfRghw7LFBCJDKB3oz
address_n=parse_path("m/44h/1h/0h/0/0"),
prev_hash=TXHASH_e16248,
prev_hash=FAKE_TXHASH_4d8acd,
prev_index=1,
amount=200_000_000,
script_type=messages.InputScriptType.SPENDADDRESS,
@ -81,10 +80,10 @@ def test_send_decred(client: Client):
messages.ButtonRequest(code=B.FeeOverThreshold),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_e16248),
request_input(0, TXHASH_e16248),
request_output(0, TXHASH_e16248),
request_output(1, TXHASH_e16248),
request_meta(FAKE_TXHASH_4d8acd),
request_input(0, FAKE_TXHASH_4d8acd),
request_output(0, FAKE_TXHASH_4d8acd),
request_output(1, FAKE_TXHASH_4d8acd),
request_input(0),
request_finished(),
]
@ -95,15 +94,17 @@ def test_send_decred(client: Client):
assert (
serialized_tx.hex()
== "0100000001edd579e9462ee0e80127a817e0500d4f942a4cf8f2d6530e0c0a9ab3f04862e10100000000ffffffff01802b530b0000000000001976a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000100c2eb0b0000000000000000ffffffff6a473044022009e394c7dec76ab6988270b467839b1462ad781556bce37383b76e026418ce6302204f7f6ef535d2986b095d7c96232a0990a0b9ce3004894b39c167bb18e5833ac30121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
== "01000000011064cbf0f0889b919ce083c82065612710b1a6adcdb3f15d7ffc5e6de2cd8a4d0100000000ffffffff01802b530b0000000000001976a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000100c2eb0b0000000000000000ffffffff6a47304402202f77445fd8b2d47f6d28fa6087d4bc3ac6986904bf9009c41e527245905d21870220227f463d1dbfba492514e1ee78e32060bfdb4ca9251c4e0557c232e740515eb70121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
)
@pytest.mark.skip_t1
def test_purchase_ticket_decred(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
prev_hash=TXHASH_e16248,
prev_hash=FAKE_TXHASH_4d8acd,
prev_index=1,
amount=200_000_000,
decred_tree=0,
@ -136,10 +137,10 @@ def test_purchase_ticket_decred(client: Client):
request_output(2),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_e16248),
request_input(0, TXHASH_e16248),
request_output(0, TXHASH_e16248),
request_output(1, TXHASH_e16248),
request_meta(FAKE_TXHASH_4d8acd),
request_input(0, FAKE_TXHASH_4d8acd),
request_output(0, FAKE_TXHASH_4d8acd),
request_output(1, FAKE_TXHASH_4d8acd),
request_input(0),
request_finished(),
]
@ -155,15 +156,17 @@ def test_purchase_ticket_decred(client: Client):
assert (
serialized_tx.hex()
== "0100000001edd579e9462ee0e80127a817e0500d4f942a4cf8f2d6530e0c0a9ab3f04862e10100000000ffffffff03603bea0b0000000000001aba76a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000000206a1edc1a98d791735eb9a8715a2a219c23680edcedad00c2eb0b000000000058000000000000000000001abd76a914000000000000000000000000000000000000000088ac00000000000000000100c2eb0b0000000000000000ffffffff6b4830450221008ced5411a6d92b761bdd8b9f7fbc5bfae3c31f9369050c218977f4540ab1ec9602206e89c821878ebfd959d1c4a63100eec5b1154c8d9508c039bb78e333498a73b40121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
== "01000000011064cbf0f0889b919ce083c82065612710b1a6adcdb3f15d7ffc5e6de2cd8a4d0100000000ffffffff03603bea0b0000000000001aba76a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000000206a1edc1a98d791735eb9a8715a2a219c23680edcedad00c2eb0b000000000058000000000000000000001abd76a914000000000000000000000000000000000000000088ac00000000000000000100c2eb0b0000000000000000ffffffff6b483045022100b3a11ff4befcc035623de7665aaa76dacc9252e53aabf2a5d61238151e696532022004cbcc537c1d539e04c823140bac4524bdba09f528f5c4b76f3f1022b7dc0ad40121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
)
@pytest.mark.skip_t1
def test_spend_from_stake_generation_and_revocation_decred(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
prev_hash=TXHASH_8b6890,
prev_hash=FAKE_TXHASH_f8e2f2,
prev_index=2,
amount=200_000_000,
script_type=messages.InputScriptType.SPENDADDRESS,
@ -173,7 +176,7 @@ def test_spend_from_stake_generation_and_revocation_decred(client: Client):
inp2 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
prev_hash=TXHASH_1f00fc,
prev_hash=FAKE_TXHASH_51bc9c,
prev_index=0,
amount=200_000_000,
script_type=messages.InputScriptType.SPENDADDRESS,
@ -196,16 +199,16 @@ def test_spend_from_stake_generation_and_revocation_decred(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_8b6890),
request_input(0, TXHASH_8b6890),
request_input(1, TXHASH_8b6890),
request_output(0, TXHASH_8b6890),
request_output(1, TXHASH_8b6890),
request_output(2, TXHASH_8b6890),
request_meta(FAKE_TXHASH_f8e2f2),
request_input(0, FAKE_TXHASH_f8e2f2),
request_input(1, FAKE_TXHASH_f8e2f2),
request_output(0, FAKE_TXHASH_f8e2f2),
request_output(1, FAKE_TXHASH_f8e2f2),
request_output(2, FAKE_TXHASH_f8e2f2),
request_input(1),
request_meta(TXHASH_1f00fc),
request_input(0, TXHASH_1f00fc),
request_output(0, TXHASH_1f00fc),
request_meta(FAKE_TXHASH_51bc9c),
request_input(0, FAKE_TXHASH_51bc9c),
request_output(0, FAKE_TXHASH_51bc9c),
request_input(0),
request_input(1),
request_finished(),
@ -217,17 +220,19 @@ def test_spend_from_stake_generation_and_revocation_decred(client: Client):
assert (
serialized_tx.hex()
== "010000000254e249113666e84c70de1dbee976f18d1438e4b7c58b376ffe64370ac190688b0200000001ffffffffc8e8dfb5c0e534b12adede611853a1f607c5b6912e03f577487c0d5354fc001f0000000001ffffffff0160fdd5170000000000001976a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000200c2eb0b0000000000000000ffffffff6b483045022100bdcb877c97d72db74eca06fefa21a7f7b00afcd5d916fce2155ed7df1ca5546102201e1f9efd7d652b449474c2c70171bfc4535544927bed62021f7334447d1ea4740121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6a473044022030c5743c442bd696d19dcf73d54e95526e726de965c2e2b4b9fd70248eaae21d02201305a3bcc2bb0e33122277763990e3b48f317d61264a68d190fb8acfc004cc640121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
== "01000000027bfc02bff0fb90765c37ae169c4db8641f34db92ba3c74e3f672b7eab4f2e2f80200000001ffffffffe872c504dc8fe96f9102df8a99701f4beb623033b5edcaf3ee810af1719cbc510000000001ffffffff0160fdd5170000000000001976a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac00000000000000000200c2eb0b0000000000000000ffffffff6b483045022100f74f652a073bdaf2197ede47b4df0d90609bbfd0dc8a94199d36ebb1429de09b022040366292a8812135ec7572a94eb6e969fa1fa97a52c03f08a337f20bc4fb71de0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6b483045022100ca385c05a008239c038e107989bbc30eec1ecd5a66e4973265eb21df034c77a9022070c3dceb24b39cb6e9f8c973572b955b37a4754e9caa704cdd37113c46e2b2970121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0"
)
def test_send_decred_change(client: Client):
# NOTE: fake input tx used
inp1 = messages.TxInputType(
# TscqTv1he8MZrV321SfRghw7LFBCJDKB3oz
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=190_000_000,
prev_hash=TXHASH_5e6e35,
prev_index=0,
prev_hash=FAKE_TXHASH_4d8acd,
prev_index=1,
amount=200_000_000,
script_type=messages.InputScriptType.SPENDADDRESS,
decred_tree=0,
)
@ -236,7 +241,7 @@ def test_send_decred_change(client: Client):
# TscqTv1he8MZrV321SfRghw7LFBCJDKB3oz
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=200_000_000,
prev_hash=TXHASH_ccf95b,
prev_hash=FAKE_TXHASH_f341fd,
prev_index=1,
script_type=messages.InputScriptType.SPENDADDRESS,
decred_tree=0,
@ -246,7 +251,7 @@ def test_send_decred_change(client: Client):
# Tskt39YEvzoJ5KBDH4f1auNzG3jViVjZ2RV
address_n=parse_path("m/44h/1h/0h/0/1"),
amount=200_000_000,
prev_hash=TXHASH_f395ef,
prev_hash=FAKE_TXHASH_5f3a7d,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
decred_tree=0,
@ -254,7 +259,7 @@ def test_send_decred_change(client: Client):
out1 = messages.TxOutputType(
address="TsWjioPrP8E1TuTMmTrVMM2BA4iPrjQXBpR",
amount=489_975_000,
amount=499_975_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -276,19 +281,20 @@ def test_send_decred_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_5e6e35),
request_input(0, TXHASH_5e6e35),
request_output(0, TXHASH_5e6e35),
request_meta(FAKE_TXHASH_4d8acd),
request_input(0, FAKE_TXHASH_4d8acd),
request_output(0, FAKE_TXHASH_4d8acd),
request_output(1, FAKE_TXHASH_4d8acd),
request_input(1),
request_meta(TXHASH_ccf95b),
request_input(0, TXHASH_ccf95b),
request_output(0, TXHASH_ccf95b),
request_output(1, TXHASH_ccf95b),
request_meta(FAKE_TXHASH_f341fd),
request_input(0, FAKE_TXHASH_f341fd),
request_output(0, FAKE_TXHASH_f341fd),
request_output(1, FAKE_TXHASH_f341fd),
request_input(2),
request_meta(TXHASH_f395ef),
request_input(0, TXHASH_f395ef),
request_output(0, TXHASH_f395ef),
request_output(1, TXHASH_f395ef),
request_meta(FAKE_TXHASH_5f3a7d),
request_input(0, FAKE_TXHASH_5f3a7d),
request_output(0, FAKE_TXHASH_5f3a7d),
request_output(1, FAKE_TXHASH_5f3a7d),
request_input(0),
request_input(1),
request_input(2),
@ -305,13 +311,15 @@ def test_send_decred_change(client: Client):
assert (
serialized_tx.hex()
== "010000000370b95980a47b9bcb4ec2c2b450888a53179b1a5fdb23f5023cc533a300356e5e0000000000ffffffff74bc93bcfce18aff2e522d6822817522e2815a00175b2eae59ef20d20f5bf9cc0100000000ffffffff13317ab453832deabd684d2302eed42580c28ba3e715db66a731a8723eef95f30000000000ffffffff02d86c341d0000000000001976a9143eb656115197956125365348c542e37b6d3d259988ac00e1f5050000000000001976a9143ee6f9d662e7be18373d80e5eb44627014c2bf6688ac000000000000000003802b530b0000000000000000ffffffff6a47304402200e50a6d43c462045917792e7d03b4354900c3baccb7abef66f556a32b12f2ca6022031ae94fdf2a41dd6ed2e081faf0f8f1c64411a1b46eb26f7f35d94402b2bde110121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6a47304402204894c2f8e76c4645d2df600cdd01443aeb48807b72150c4bc10eebd126529532022054cd37462a3f0ddb85c75b4e874ab0c2aad7eebcff3e6c1ac20e1c16babe36720121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6b4830450221009f1ba584023da8aafd57374e83be68f1a097b906967ec9e50736f31bfc7989f102204a190fc2885e394572b5c2ced046657b1dd07abdb19144e21e78987968c7f17601210294e3e5e77e22eea0e4c0d30d89beb4db7f69b4bf1ae709e411d6a06618b8f852"
== "01000000031064cbf0f0889b919ce083c82065612710b1a6adcdb3f15d7ffc5e6de2cd8a4d0100000000ffffffffd8616d4a0b0d19a48ec34c0278e2b9befa90bdecc5d11906152e8ca7e6fd41f30100000000ffffffff68b514dc271bddcedd7cc0df89856822f1ccc13974968e7820ba3e62297d3a5f0000000000ffffffff025803cd1d0000000000001976a9143eb656115197956125365348c542e37b6d3d259988ac00e1f5050000000000001976a9143ee6f9d662e7be18373d80e5eb44627014c2bf6688ac00000000000000000300c2eb0b0000000000000000ffffffff6a47304402205eec688bd8d52908dae5fa29d121637b6d5c7df0246235a0dbab8170e3d0309e0220774560da627134cb1942a8cafd3926e67317af70287f0c8422468821ea4f78560121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6a4730440220171d7840fee536f2c41e80bdcd9d2248eadfe32f51e0404582aa9ce8d7c31f5f022075c6fbb39394dd34a6271ada25a9e68dc26ddb46fa84962c40a11fafadf9e2fd0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd000c2eb0b0000000000000000ffffffff6a47304402207121e3da42ec635e3ba9d5c4e7f4921c6acab87c60d58956f60d89eab69defa60220649c2d9a987407e259088e5ebebae289e4b8a82bc77850004978021561299fcc01210294e3e5e77e22eea0e4c0d30d89beb4db7f69b4bf1ae709e411d6a06618b8f852"
)
@pytest.mark.multisig
def test_decred_multisig_change(client: Client):
paths = [parse_path(f"m/48h/1h/{index}h/0h") for index in range(3)]
# NOTE: fake input tx used
paths = [parse_path(f"m/48h/1h/{index}'/0'") for index in range(3)]
nodes = [
btc.get_public_node(client, address_n, coin_name="Decred Testnet").node
for address_n in paths
@ -334,7 +342,7 @@ def test_decred_multisig_change(client: Client):
# TchpthUkRys1VQWgnQyLJNaA4MLBjVmRL2c
multisig=multisig,
amount=200_000_000,
prev_hash=TXHASH_3f7c39,
prev_hash=FAKE_TXHASH_9ac7d2,
prev_index=1,
script_type=messages.InputScriptType.SPENDMULTISIG,
decred_tree=0,
@ -346,7 +354,7 @@ def test_decred_multisig_change(client: Client):
# TcnfDEfMhkM3oLWqiq9v9GmYgLK7qfjitKG
multisig=multisig,
amount=200_000_000,
prev_hash=TXHASH_16da18,
prev_hash=FAKE_TXHASH_48f5b8,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
decred_tree=0,
@ -377,15 +385,15 @@ def test_decred_multisig_change(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_3f7c39),
request_input(0, TXHASH_3f7c39),
request_output(0, TXHASH_3f7c39),
request_output(1, TXHASH_3f7c39),
request_meta(FAKE_TXHASH_9ac7d2),
request_input(0, FAKE_TXHASH_9ac7d2),
request_output(0, FAKE_TXHASH_9ac7d2),
request_output(1, FAKE_TXHASH_9ac7d2),
request_input(1),
request_meta(TXHASH_16da18),
request_input(0, TXHASH_16da18),
request_output(0, TXHASH_16da18),
request_output(1, TXHASH_16da18),
request_meta(FAKE_TXHASH_48f5b8),
request_input(0, FAKE_TXHASH_48f5b8),
request_output(0, FAKE_TXHASH_48f5b8),
request_output(1, FAKE_TXHASH_48f5b8),
request_input(0),
request_input(1),
request_finished(),
@ -408,5 +416,5 @@ def test_decred_multisig_change(client: Client):
assert (
serialized_tx.hex()
== "01000000023f4c9e61b1cf469cad3785a03566ef23876217fe657561e78783d32155397c3f0100000000ffffffffa806ca135db5160eb91202506ce2645b215805149ce730a6850d74525018da160000000000ffffffff02605af40500000000000017a914d4ea4e064d969064ca56a4cede56f7bf6cf62f118700a3e1110000000000001976a9143eb656115197956125365348c542e37b6d3d259988ac00000000000000000200c2eb0b0000000000000000fffffffffc483045022100a35fd1ed579362ac65b583ba910a3d814c5e9b87da835993bf4166a6b3a8482b02204b3e167fad7d37dd62aa585c68d3c8e00c3c43bf7a25d74f6407870a4a7499e9014730440220720fd7b6dfd337056c5e6dad76e307b3758e702ccfd39471bf90e0db3a5f5eba02205bd062c78fcdd56057723a0e39d661a790f325e59e643b54c47b7218a5781684014c69522103defea6f243b97354449bb348446a97e38df2fbed33afc3a7185bfdd26757cfdb2103725d6c5253f2040a9a73af24bcc196bf302d6cc94374dd7197b138e10912670121038924e94fff15302a3fb45ad4fc0ed17178800f0f1c2bdacb1017f4db951aa9f153ae00c2eb0b0000000000000000fffffffffc4730440220625357288f0880be21d6a44275033fd84cf04bc23227eef810455ad711507e4402207d303548bb0476f98c52f223fe4430f82a78a73f757b186453948b0908f5af3101483045022100e140f586e370824b13576c77cf9f2855294fd415316f2a130126d8412a7cf08c0220308d1f5c83847458b271c93bfca5eba7fc1691b9c5d6e57955985affd1110e24014c695221021ef4b5d81f21593071b993bd4d8c564c569a6f84de0d4511135cbc66d8bf7bcd2103f1e53b6e0ff99adf7e8fa826a94bdac83163d8abbc1d19a8d6b88a4af91b9a67210390c8ea70e1f2f60e0052be65183c43bb01b2f02dfa4e448f74e359997f74e6ad53ae"
== "0100000002d18f50c5e465b727fee4af645350093a8baf7e04ee8ef34ecf0c46f422d2c79a0100000000fffffffff32d5470c1a96b2d9d5215066bd2e254f191d4ce8873d0d096f71c8b5fb8f5480000000000ffffffff02605af40500000000000017a914d4ea4e064d969064ca56a4cede56f7bf6cf62f118700a3e1110000000000001976a9143eb656115197956125365348c542e37b6d3d259988ac00000000000000000200c2eb0b0000000000000000fffffffffc483045022100e7056e4cbc0941a1255e85ab95634fd9ae497be9a8ab0e793d6049f7dd97fa07022031c17d6279211843ea1e0815a1831748aa44c3a3083669293805f8e9e803d78d01473044022039b74918f67afd24f20c0bf4d0ea40637d85005bbb942e7c79e17694e4729e0902202563fa43376220261bb177fc87d637d39809e0ffa4991a1477dbc60a1c2e3997014c69522103defea6f243b97354449bb348446a97e38df2fbed33afc3a7185bfdd26757cfdb2103725d6c5253f2040a9a73af24bcc196bf302d6cc94374dd7197b138e10912670121038924e94fff15302a3fb45ad4fc0ed17178800f0f1c2bdacb1017f4db951aa9f153ae00c2eb0b0000000000000000fffffffffb473044022047afb55f956ef7ac7d4a32e97fe35b3981cd827866ccd76e66b7f186a5338f9302201415cdd987876e8c6c13037e53d055aac467acece41d9357657e4fd8290d914101473044022005cb0efd5889d697e040b2db5d56ef7e1d29fcd20b74a8cc44d670092b6cfaee02202150837c1f5108af8b6cc022bd2d40e54170869ad39b2d1d61c67a47ad21e019014c695221021ef4b5d81f21593071b993bd4d8c564c569a6f84de0d4511135cbc66d8bf7bcd2103f1e53b6e0ff99adf7e8fa826a94bdac83163d8abbc1d19a8d6b88a4af91b9a67210390c8ea70e1f2f60e0052be65183c43bb01b2f02dfa4e448f74e359997f74e6ad53ae"
)

View File

@ -18,9 +18,10 @@ import pytest
from trezorlib import btc, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import btc_hash, parse_path
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from .signtx import assert_tx_matches
TX_API = TxCache("Firo Testnet")
TXHASH_8a34cc = bytes.fromhex(
@ -46,12 +47,8 @@ def test_spend_lelantus(client: Client):
_, serialized_tx = btc.sign_tx(
client, "Firo Testnet", [inp1], [out1], prev_txes=TX_API
)
assert (
serialized_tx.hex()
== "010000000125d6f69fdb2e1715a3eb9c71a60ecb7178b3af4033309843d18f13afcecc348a000000006a47304402207b490135583a2ac6650806c706dfd15954f9ac85b64a75d7264653e4b1cd4e29022052946b28f97a415bd0b2b02c3a71ac8cb26f9a9387ac82856b4c7116848d090c01210313a443e806f25052ac7363adc689fcfa72893f2a51a35ab5e096ed5e6cd8517effffffff0118c69a3b000000001976a91499af2ecbf5892079e0297c59b91981b067da36a988ac00000000"
)
# accepted by network: https://testblockbook.firo.org/tx/866bc7041989ad038e5b38b7577325d015b67238ea9387cde6ba837fff4a61be
assert (
btc_hash(serialized_tx)[::-1].hex()
== "866bc7041989ad038e5b38b7577325d015b67238ea9387cde6ba837fff4a61be"
assert_tx_matches(
serialized_tx,
hash_link="https://testblockbook.firo.org/api/tx/866bc7041989ad038e5b38b7577325d015b67238ea9387cde6ba837fff4a61be",
tx_hex="010000000125d6f69fdb2e1715a3eb9c71a60ecb7178b3af4033309843d18f13afcecc348a000000006a47304402207b490135583a2ac6650806c706dfd15954f9ac85b64a75d7264653e4b1cd4e29022052946b28f97a415bd0b2b02c3a71ac8cb26f9a9387ac82856b4c7116848d090c01210313a443e806f25052ac7363adc689fcfa72893f2a51a35ab5e096ed5e6cd8517effffffff0118c69a3b000000001976a91499af2ecbf5892079e0297c59b91981b067da36a988ac00000000",
)

View File

@ -21,7 +21,7 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import (
from .signtx import (
request_extra_data,
request_finished,
request_input,

View File

@ -19,31 +19,46 @@ import pytest
from trezorlib import btc, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path, tx_hash
from trezorlib.tools import parse_path
from ...common import MNEMONIC12
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_API = TxCache("Bitcoin")
TX_API_TESTNET = TxCache("Testnet")
TXHASH_c6091a = bytes.fromhex(
"c6091adf4c0c23982a35899a6e58ae11e703eacd7954f588ed4b9cdefc4dba52"
)
TXHASH_6189e3 = bytes.fromhex(
"6189e3febb5a21cee8b725aa1ef04ffce7e609448446d3a8d6f483c634ef5315"
TXHASH_509e08 = bytes.fromhex(
"509e08424b047403b34dc83e9899e09185ea36791716e42c00a74e1f12bcb6ef"
)
TXHASH_fbbff7 = bytes.fromhex(
"fbbff7f3c85f8067453d7c062bd5efb8ad839953376ae5eceaf92774102c6e39"
TXHASH_6b07c1 = bytes.fromhex(
"6b07c1321b52d9c85743f9695e13eb431b41708cdf4e1585258d51208e5b93fc"
)
TXHASH_0d5b56 = bytes.fromhex(
"0d5b5648d47b5650edea1af3d47bbe5624213abb577cf1b1c96f98321f75cdbc"
)
pytestmark = pytest.mark.multisig
@pytest.mark.multisig
def test_2_of_3(client: Client):
# input tx: 6b07c1321b52d9c85743f9695e13eb431b41708cdf4e1585258d51208e5b93fc
nodes = [
btc.get_public_node(client, parse_path(f"m/48h/0h/{index}h/0h")).node
btc.get_public_node(
client, parse_path(f"m/48h/1h/{index}h/0h"), coin_name="Testnet"
).node
for index in range(1, 4)
]
@ -52,47 +67,47 @@ def test_2_of_3(client: Client):
)
# Let's go to sign with key 1
inp1 = messages.TxInputType(
address_n=parse_path("m/48h/0h/1h/0h/0/0"),
amount=100_000,
prev_hash=TXHASH_c6091a,
prev_index=1,
address_n=parse_path("m/48h/1h/1h/0h/0/0"),
amount=1_496_278,
prev_hash=TXHASH_6b07c1,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
multisig=multisig,
)
out1 = messages.TxOutputType(
address="12iyMbUb4R2K3gre4dHSrbu5azG5KaqVss",
amount=100_000,
address="mnY26FLTzfC94mDoUcyDJh1GVE3LuAUMbs", # "44h/1h/0h/0/6"
amount=1_496_278 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
# Expected responses are the same for both two signings
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_6b07c1),
request_input(0, TXHASH_6b07c1),
request_output(0, TXHASH_6b07c1),
request_input(0),
request_output(0),
request_output(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_c6091a),
request_input(0, TXHASH_c6091a),
request_output(0, TXHASH_c6091a),
request_output(1, TXHASH_c6091a),
request_input(0),
request_output(0),
request_output(0),
request_finished(),
]
)
client.set_expected_responses(expected_responses)
# Now we have first signature
signatures1, _ = btc.sign_tx(
client, "Bitcoin", [inp1], [out1], prev_txes=TX_API
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
signatures1[0].hex()
== "30450221009276eea820aa54a24bd9f1a056cb09a15f50c0816570a7c7878bd1c5ee7248540220677d200aec5e2f25bcf4000bdfab3faa9e1746d7f80c4ae4bfa1f5892eb5dcbf"
== "304402206c99b48a12f340599076b93efdc2578b0cdeaedf9092aed628788f4ffc579a50022031b16212dd1f0f62f01bb5862b6d128276c7a5430746aa27a04ae0c8acbcb3b1"
)
# ---------------------------------------
@ -111,59 +126,46 @@ def test_2_of_3(client: Client):
# Let's do a second signature with key 3
inp3 = messages.TxInputType(
address_n=parse_path("m/48h/0h/3h/0h/0/0"),
amount=100_000,
prev_hash=TXHASH_c6091a,
prev_index=1,
address_n=parse_path("m/48h/1h/3h/0h/0/0"),
amount=1_496_278,
prev_hash=TXHASH_6b07c1,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
multisig=multisig,
)
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_c6091a),
request_input(0, TXHASH_c6091a),
request_output(0, TXHASH_c6091a),
request_output(1, TXHASH_c6091a),
request_input(0),
request_output(0),
request_output(0),
request_finished(),
]
)
client.set_expected_responses(expected_responses)
signatures2, serialized_tx = btc.sign_tx(
client, "Bitcoin", [inp3], [out1], prev_txes=TX_API
client, "Testnet", [inp3], [out1], prev_txes=TX_API_TESTNET
)
assert (
signatures2[0].hex()
== "3045022100c2a9fbfbff1be87036d8a6a22745512b158154f7f3d8f4cad4ba7ed130b37b83022058f5299b4c26222588dcc669399bd88b6f2bc6e04b48276373683853187a4fd6"
== "304502210089153ad97c0d69656cd9bd9eb2056552acaec91365dd7ab31250f3f707123baa02200f884de63041d73bd20fbe8804c6036968d8149b7f46963a82b561cd8211ab08"
)
assert (
serialized_tx.hex()
== "010000000152ba4dfcde9c4bed88f55479cdea03e711ae586e9a89352a98230c4cdf1a09c601000000fdfe00004830450221009276eea820aa54a24bd9f1a056cb09a15f50c0816570a7c7878bd1c5ee7248540220677d200aec5e2f25bcf4000bdfab3faa9e1746d7f80c4ae4bfa1f5892eb5dcbf01483045022100c2a9fbfbff1be87036d8a6a22745512b158154f7f3d8f4cad4ba7ed130b37b83022058f5299b4c26222588dcc669399bd88b6f2bc6e04b48276373683853187a4fd6014c69522103dc0ff15b9c85c0d2c87099758bf47d36229c2514aeefcf8dea123f0f93c679762102bfe426e8671601ad46d54d09ee15aa035610d36d411961c87474908d403fbc122102a5d57129c6c96df663ad29492aa18605dad97231e043be8a92f9406073815c5d53aeffffffff01a0860100000000001976a91412e8391ad256dcdc023365978418d658dfecba1c88ac00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/4123415574c16899b4bb5b691f9b65643dbe566a9b68e4e2e7a8b29c79c83f2b",
tx_hex="0100000001fc935b8e20518d2585154edf8c70411b43eb135e69f94357c8d9521b32c1076b00000000fdfd000047304402206c99b48a12f340599076b93efdc2578b0cdeaedf9092aed628788f4ffc579a50022031b16212dd1f0f62f01bb5862b6d128276c7a5430746aa27a04ae0c8acbcb3b10148304502210089153ad97c0d69656cd9bd9eb2056552acaec91365dd7ab31250f3f707123baa02200f884de63041d73bd20fbe8804c6036968d8149b7f46963a82b561cd8211ab08014c69522103725d6c5253f2040a9a73af24bcc196bf302d6cc94374dd7197b138e10912670121038924e94fff15302a3fb45ad4fc0ed17178800f0f1c2bdacb1017f4db951aa9f12102aae8affd0eb8e1181d665daef4de1828f23053c548ec9bafc3a787f558aa014153aeffffffff01c6ad1600000000001976a9144cfc772f24b600762f905a1ee799ce0e9c26831f88ac00000000",
)
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
@pytest.mark.multisig
def test_15_of_15(client: Client):
# input tx: 0d5b5648d47b5650edea1af3d47bbe5624213abb577cf1b1c96f98321f75cdbc
node = btc.get_public_node(
client, parse_path("m/48h/0h/1h/0h"), coin_name="Bitcoin"
client, parse_path("m/48h/1h/1h/0h"), coin_name="Testnet"
).node
pubs = [messages.HDNodePathType(node=node, address_n=[0, x]) for x in range(15)]
signatures = [b""] * 15
out1 = messages.TxOutputType(
address="17kTB7qSk3MupQxWdiv5ZU3zcrZc2Azes1",
amount=10_000,
address="mnY26FLTzfC94mDoUcyDJh1GVE3LuAUMbs", # "44h/1h/0h/0/6"
amount=1_476_278 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -173,26 +175,27 @@ def test_15_of_15(client: Client):
)
inp1 = messages.TxInputType(
address_n=parse_path(f"m/48h/0h/1h/0h/0/{x}"),
amount=20_000,
prev_hash=TXHASH_6189e3,
prev_index=1,
address_n=parse_path(f"m/48h/1h/1h/0h/0/{x}"),
amount=1_476_278,
prev_hash=TXHASH_0d5b56,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
multisig=multisig,
)
with client:
sig, serialized_tx = btc.sign_tx(
client, "Bitcoin", [inp1], [out1], prev_txes=TX_API
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
signatures[x] = sig[0]
assert (
tx_hash(serialized_tx).hex()
== "63b16e3107df552c5c74bb5d91bb8fcd0069bac461fb42ebef982c5b2cfc4cf4"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/b41284067577e1266ad3632f7caffead5d58277cc35f42642455bfd2a3fa0325",
)
@pytest.mark.multisig
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_missing_pubkey(client: Client):
node = btc.get_public_node(
@ -234,6 +237,7 @@ def test_missing_pubkey(client: Client):
assert exc.value.message.endswith("Pubkey not found in multisig script")
@pytest.mark.multisig
def test_attack_change_input(client: Client):
"""
In Phases 1 and 2 the attacker replaces a non-multisig input
@ -241,17 +245,17 @@ def test_attack_change_input(client: Client):
attacker to provide a 1-of-2 multisig change address. When `input_real`
is provided in the signing phase, an error must occur.
"""
address_n = parse_path("m/48h/1h/0h/1h/0/0")
address_n = parse_path("m/48h/1h/0h/1h/0/0") # 2NErUdruXmM8o8bQySrzB3WdBRcmc5br4E8
attacker_multisig_public_key = bytes.fromhex(
"03653a148b68584acb97947344a7d4fd6a6f8b8485cad12987ff8edac874268088"
)
input_real = messages.TxInputType(
address_n=address_n,
prev_hash=TXHASH_fbbff7,
prev_index=1,
prev_hash=TXHASH_509e08,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
amount=1_000_000,
amount=61_093,
)
multisig_fake = messages.MultisigRedeemScriptType(
@ -280,7 +284,7 @@ def test_attack_change_input(client: Client):
output_payee = messages.TxOutputType(
address="n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi",
amount=1_000,
amount=10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -291,6 +295,16 @@ def test_attack_change_input(client: Client):
multisig=multisig_fake,
)
# Transaction can be signed without the attack processor
with client:
btc.sign_tx(
client,
"Testnet",
[input_real],
[output_payee, output_change],
prev_txes=TX_API_TESTNET,
)
attack_count = 3
def attack_processor(msg):
@ -311,10 +325,9 @@ def test_attack_change_input(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_fbbff7),
request_input(0, TXHASH_fbbff7),
request_output(0, TXHASH_fbbff7),
request_output(1, TXHASH_fbbff7),
request_meta(TXHASH_509e08),
request_input(0, TXHASH_509e08),
request_output(0, TXHASH_509e08),
request_input(0),
request_output(0),
request_output(1),
@ -329,10 +342,8 @@ def test_attack_change_input(client: Client):
"Testnet",
[input_real],
[output_payee, output_change],
prev_txes=TxCache("Testnet"),
prev_txes=TX_API_TESTNET,
)
# must not produce this tx:
# 01000000000101396e2c107427f9eaece56a37539983adb8efd52b067c3d4567805fc8f3f7bffb01000000171600147a876a07b366f79000b441335f2907f777a0280bffffffff02e8030000000000001976a914e7c1345fc8f87c68170b3aa798a956c2fe6a9eff88ac703a0f000000000017a914a1261837f1b40e84346b1504ffe294e402965f2687024830450221009ff835e861be4e36ca1f2b6224aee2f253dfb9f456b13e4b1724bb4aaff4c9c802205e10679c2ead85743119f468cba5661f68b7da84dd2d477a7215fef98516f1f9012102af12ddd0d55e4fa2fcd084148eaf5b0b641320d0431d63d1e9a90f3cbd0d540700000000
assert exc.value.code == messages.FailureType.ProcessError
assert exc.value.message.endswith("Transaction has changed during signing")

View File

@ -23,7 +23,7 @@ from trezorlib.tools import H_, parse_path
from ... import bip32
from ...common import MNEMONIC12
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import request_finished, request_input, request_meta, request_output
B = messages.ButtonRequestType
TX_API = TxCache("Testnet")

View File

@ -20,19 +20,9 @@ from trezorlib import btc, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from .signtx import forge_prevtx
TX_CACHE_MAINNET = TxCache("Bitcoin")
TXHASH_6189e3 = bytes.fromhex(
"6189e3febb5a21cee8b725aa1ef04ffce7e609448446d3a8d6f483c634ef5315"
)
TXHASH_d5f65e = bytes.fromhex(
"d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882"
)
VECTORS = (
VECTORS = ( # path, script_types
# GreenAddress A m/[1,4]/address_index
(
"m/4/255",
@ -77,7 +67,7 @@ VECTORS = (
)
# 2-of-3 multisig, first path is ours
VECTORS_MULTISIG = (
VECTORS_MULTISIG = ( # paths, address_index
# GreenAddress A m/[1,4]/address_index
(("m/1", "m/1", "m/4"), [255]),
# GreenAddress B m/3'/[1-100]'/[1,4]/address_index
@ -140,14 +130,15 @@ def test_signmessage(client: Client, path, script_types):
@pytest.mark.parametrize("path, script_types", VECTORS)
def test_signtx(client: Client, path, script_types):
# tx: d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882
# input 0: 0.0039 BTC
address_n = parse_path(path)
for script_type in script_types:
address = btc.get_address(client, "Bitcoin", address_n, script_type=script_type)
prevhash, prevtx = forge_prevtx([(address, 390_000)])
inp1 = messages.TxInputType(
address_n=parse_path(path),
address_n=address_n,
amount=390_000,
prev_hash=TXHASH_d5f65e,
prev_hash=prevhash,
prev_index=0,
script_type=script_type,
)
@ -159,7 +150,7 @@ def test_signtx(client: Client, path, script_types):
)
_, serialized_tx = btc.sign_tx(
client, "Bitcoin", [inp1], [out1], prev_txes=TX_CACHE_MAINNET
client, "Bitcoin", [inp1], [out1], prev_txes={prevhash: prevtx}
)
assert serialized_tx.hex()
@ -191,8 +182,6 @@ def test_getaddress_multisig(client: Client, paths, address_index):
assert address
# NOTE: we're signing input using the wrong key (and possibly script type) so
# the test is going to fail if we make firmware stricter about this
@pytest.mark.multisig
@pytest.mark.parametrize("paths, address_index", VECTORS_MULTISIG)
def test_signtx_multisig(client: Client, paths, address_index):
@ -210,21 +199,34 @@ def test_signtx_multisig(client: Client, paths, address_index):
pubkeys=pubs, signatures=signatures, m=2
)
address_n = parse_path(paths[0]) + address_index
address = btc.get_address(
client,
"Bitcoin",
address_n,
multisig=multisig,
script_type=messages.InputScriptType.SPENDMULTISIG,
)
prevhash, prevtx = forge_prevtx([(address, 20_000)])
inp1 = messages.TxInputType(
address_n=address_n,
amount=20_000,
prev_hash=prevhash,
prev_index=0,
script_type=messages.InputScriptType.SPENDMULTISIG,
multisig=multisig,
)
out1 = messages.TxOutputType(
address="17kTB7qSk3MupQxWdiv5ZU3zcrZc2Azes1",
amount=10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
inp1 = messages.TxInputType(
address_n=parse_path(paths[0]) + address_index,
amount=20_000,
prev_hash=TXHASH_6189e3,
prev_index=1,
script_type=messages.InputScriptType.SPENDMULTISIG,
multisig=multisig,
sig, _ = btc.sign_tx(
client, "Bitcoin", [inp1], [out1], prev_txes={prevhash: prevtx}
)
sig, _ = btc.sign_tx(client, "Bitcoin", [inp1], [out1], prev_txes=TX_CACHE_MAINNET)
assert sig[0]

View File

@ -22,27 +22,37 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_API = TxCache("Bitcoin")
TX_API_TESTNET = TxCache("Testnet")
TXHASH_d5f65e = bytes.fromhex(
"d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882"
)
TXHASH_4075a1 = bytes.fromhex(
"4075a1ae38ce607a20a9157840430354608201b3bfa2c7dba851473199f9d08f"
)
def test_opreturn(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/0h/0h/0/2"),
amount=390_000,
prev_hash=TXHASH_d5f65e,
address_n=parse_path("m/44h/1h/1h/0/21"), # myGMXcCxmuDooMdzZFPMmvHviijzqYKhza
amount=89_581,
prev_hash=TXHASH_4075a1,
prev_index=0,
)
out1 = messages.TxOutputType(
address="1MJ2tj2ThBE62zXbBYA5ZaN3fdve5CPAz1",
amount=390_000 - 10_000,
address="2MyAH3SSRbmkABYPj8WCfizMiyUpmBB2j62", # 49h/1h/0h/0/66
amount=89_581 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -62,10 +72,9 @@ def test_opreturn(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_d5f65e),
request_input(0, TXHASH_d5f65e),
request_input(1, TXHASH_d5f65e),
request_output(0, TXHASH_d5f65e),
request_meta(TXHASH_4075a1),
request_input(0, TXHASH_4075a1),
request_output(0, TXHASH_4075a1),
request_input(0),
request_output(0),
request_output(1),
@ -75,12 +84,13 @@ def test_opreturn(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Bitcoin", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "010000000182488650ef25a58fef6788bd71b8212038d7f2bbe4750bc7bcb44701e85ef6d5000000006b483045022100bc36e1227b334e856c532bbef86d30a96823a5f2461738f4dbf969dfbcf1b40b022078c5353ec9a4bce2bb05bd1ec466f2ab379c1aad926e208738407bba4e09784b012103330236b68aa6fdcaca0ea72e11b360c84ed19a338509aa527b678a7ec9076882ffffffff0260cc0500000000001976a914de9b2a8da088824e8fe51debea566617d851537888ac00000000000000001c6a1a74657374206f6620746865206f705f72657475726e206461746100000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/c3185a82c0328304adfb52bfd07d4bca2c34f13153b32d9d034390365c46bbd2",
tx_hex="01000000018fd0f999314751a8dbc7a2bfb3018260540343407815a9207a60ce38aea17540000000006b483045022100f6b228f0a1b8eb5037f13f28619aacc4c21a4c338318d631be2fda4cc653b6cf022015fc2975792f5d22d61601ca0523cad2d015b14fdf0ebe2af0790e3fac3ebbdb012102eee6b3ec6435f42ca071707eb1b14647d2121e0f8a53fa7fa9f92a691227a3d9ffffffff02dd3601000000000017a91440e1397e36e9bb6b731ac4ea186ba53111284e868700000000000000001c6a1a74657374206f6620746865206f705f72657475726e206461746100000000",
)

View File

@ -21,11 +21,16 @@ import pytest
from trezorlib import btc, device, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, parse_path, tx_hash
from trezorlib.tools import H_, parse_path
from ...common import assert_tx_matches
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
@ -38,8 +43,8 @@ TXHASH_157041 = bytes.fromhex(
TXHASH_d5f65e = bytes.fromhex(
"d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882"
)
TXHASH_d6da21 = bytes.fromhex(
"d6da21677d7cca5f42fbc7631d062c9ae918a0254f7c6c22de8e8cb7fd5b8236"
FAKE_TXHASH_005f6f = bytes.fromhex( # FAKE transaction (coinbase)
"005f6f7ff4b70aa09a15b3bc36607d378fad104c4efa4f0a1c8e970538622b3e"
)
TXHASH_d2dcda = bytes.fromhex(
"d2dcdaf547ea7f57a713c607f15e883ddc4a98167ee2c43ed953c53cb5153e24"
@ -981,10 +986,14 @@ def test_attack_change_input_address(client: Client):
def test_spend_coinbase(client: Client):
# NOTE: the input transaction is not real
# We did not have any coinbase transaction at connected with `all all` seed,
# so it was artificially created for the test purpose
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"), # mvbu1Gdy8SUjTenqerxUaZyYjmveZvt33q
amount=2_500_278_230,
prev_hash=TXHASH_d6da21,
prev_hash=FAKE_TXHASH_005f6f,
prev_index=0,
)
@ -1002,9 +1011,9 @@ def test_spend_coinbase(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_d6da21),
request_input(0, TXHASH_d6da21),
request_output(0, TXHASH_d6da21),
request_meta(FAKE_TXHASH_005f6f),
request_input(0, FAKE_TXHASH_005f6f),
request_output(0, FAKE_TXHASH_005f6f),
request_input(0),
request_output(0),
request_output(0),
@ -1017,8 +1026,8 @@ def test_spend_coinbase(client: Client):
# Transaction does not exist on the blockchain, not using assert_tx_matches()
assert (
tx_hash(serialized_tx).hex()
== "cf5a8ad5a4f0211953e0d40d9145d6651f0d90203e52913e780065bd00840da3"
serialized_tx.hex()
== "01000000013e2b623805978e1c0a4ffa4e4c10ad8f377d6036bcb3159aa00ab7f47f6f5f00000000006b483045022100a9a3e743017256fa7da39f73e7fd477edd9ba173055b32c99c99da59c23f2cde022023e4d28392f8a11967eaf8548883f9ffbb08dc7722937eb91db732fa1bef4b5b0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff01c6100795000000001976a9143d2496e67f5f57a924353da42d4725b318e7a8ea88ac00000000"
)

View File

@ -21,11 +21,12 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from .signtx import assert_tx_matches
TX_API = TxCache("Testnet")
TXHASH_091446 = bytes.fromhex(
"09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a"
TXHASH_b36780 = bytes.fromhex(
"b36780ceb86807ca6e7535a6fd418b1b788cb9b227d2c8a26a0de295e523219e"
)
VECTORS = ( # amount_unit
@ -40,21 +41,22 @@ VECTORS = ( # amount_unit
@pytest.mark.parametrize("amount_unit", VECTORS)
def test_signtx(client: Client, amount_unit):
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
# tb1qajr3a3y5uz27lkxrmn7ck8lp22dgytvagr5nqy
address_n=parse_path("m/84h/1h/0h/0/87"),
amount=100_000,
prev_hash=TXHASH_b36780,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp",
amount=5_000_000,
amount=40_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
out2 = messages.TxOutputType(
address="tb1q694ccp5qcc0udmfwgp692u2s2hjpq5h407urtu",
address="tb1qe48wz5ysk9mlzhkswcxct9tdjw6ejr2l9e6j8q",
script_type=messages.OutputScriptType.PAYTOADDRESS,
amount=12_300_000 - 11_000 - 5_000_000,
amount=100_000 - 40_000 - 10_000,
)
with client:
_, serialized_tx = btc.sign_tx(
@ -66,7 +68,8 @@ def test_signtx(client: Client, amount_unit):
amount_unit=amount_unit,
)
assert (
serialized_tx.hex()
== "010000000001018a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff02404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987a8386f0000000000160014d16b8c0680c61fc6ed2e407455715055e41052f502473044022073ce72dcf2f6e42eeb44adbe7d5038cf3763f168d1c04bd8b873a19b53331f51022016b051725731e7f53a567021bcd9c370727f551c81e857ebae7c128472119652012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/65047a2b107d6301d72d4a1e49e7aea9cf06903fdc4ae74a4a9bba9bc1a414d2",
tx_hex="010000000001019e2123e595e20d6aa2c8d227b2b98c781b8b41fda635756eca0768b8ce8067b30000000000ffffffff02409c00000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c98750c3000000000000160014cd4ee15090b177f15ed0760d85956d93b5990d5f0247304402200c734ed16a9226162a29133c14fad3565332c60346050ceb9246e73a2fc8485002203463d40cf78eb5cc9718d6617d9f251b987e96cb58525795a507acb9b91696c7012103f60fc56bf7b5326537c7e86e0a63b6cd008eeb87d39af324cee5bcc3424bf4d000000000",
)

View File

@ -22,7 +22,7 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import request_finished, request_input, request_meta, request_output
B = messages.ButtonRequestType
@ -35,12 +35,6 @@ TXHASH_e5040e = bytes.fromhex(
TXHASH_d830b8 = bytes.fromhex(
"d830b877c3d9237a0a68be88825a296da01ac282a2efd2f671d8f17f15117b74"
)
TXHASH_091446 = bytes.fromhex(
"09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a"
)
TXHASH_65b811 = bytes.fromhex(
"65b811d3eca0fe6915d9f2d77c86c5a7f19bf66b1b1253c2c51cb4ae5f0c017b"
)
TXHASH_e5b7e2 = bytes.fromhex(
"e5b7e21b5ba720e81efd6bfa9f854ababdcddc75a43bfa60bf0fe069cfd1bb8a"
)
@ -65,6 +59,15 @@ TXHASH_afde2d = bytes.fromhex(
TXHASH_4012d9 = bytes.fromhex(
"4012d9abb675243758b8f2cfd0042ce9a6c1459aaf5327dcac16c80f9eff1cbf"
)
TXHASH_1c022d = bytes.fromhex(
"1c022d9da3aa8bc8cf2a617c42c8f2c343e810af76b3ab9770c5ab6ca54ddab5"
)
TXHASH_ec16dc = bytes.fromhex(
"ec16dc5a539c5d60001a7471c37dbb0b5294c289c77df8bd07870b30d73e2231"
)
TXHASH_20912f = bytes.fromhex(
"20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337"
)
@pytest.mark.skip_t1
@ -168,21 +171,21 @@ def test_p2pkh_presigned(client: Client):
def test_p2wpkh_in_p2sh_presigned(client: Client):
inp1 = messages.TxInputType(
# 2N1LGaGg836mqSQqiuUBLfcyGBhyZbremDX
amount=111_145_789,
prev_hash=TXHASH_091446,
prev_index=1,
amount=123_456_789,
prev_hash=TXHASH_20912f,
prev_index=0,
script_type=messages.InputScriptType.EXTERNAL,
script_pubkey=bytes.fromhex("a91458b53ea7f832e8f096e896b8713a8c6df0e892ca87"),
script_sig=bytearray.fromhex("160014d16b8c0680c61fc6ed2e407455715055e41052f5"),
witness=bytes.fromhex(
"02483045022100ead79ee134f25bb585b48aee6284a4bb14e07f03cc130253e83450d095515e5202201e161e9402c8b26b666f2b67e5b668a404ef7e57858ae9a6a68c3837e65fdc69012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b79"
"024830450221009962940c7524c8dee6807d76e0ce1ba4a943604db0bce61357dabe5a4ce2d93a022014fa33769e33eb7e6051d9db28f06cff7ead6c7013839cc26c43f887736a9af1012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b79"
),
)
inp2 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=10_000,
prev_hash=TXHASH_ec16dc,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
@ -198,7 +201,7 @@ def test_p2wpkh_in_p2sh_presigned(client: Client):
)
out3 = messages.TxOutputType(
address="mvbu1Gdy8SUjTenqerxUaZyYjmveZvt33q",
amount=111_145_789 + 7_289_000 - 11_000 - 12_300_000 - 45_600_000,
amount=123_456_789 + 10_000 - 11000 - 12_300_000 - 45_600_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -215,15 +218,15 @@ def test_p2wpkh_in_p2sh_presigned(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_20912f),
request_input(0, TXHASH_20912f),
request_output(0, TXHASH_20912f),
request_output(1, TXHASH_20912f),
request_input(1),
request_meta(TXHASH_65b811),
request_input(0, TXHASH_65b811),
request_output(0, TXHASH_65b811),
request_output(1, TXHASH_65b811),
request_meta(TXHASH_ec16dc),
request_input(0, TXHASH_ec16dc),
request_output(0, TXHASH_ec16dc),
request_output(1, TXHASH_ec16dc),
request_input(0),
request_input(1),
request_output(0),
@ -244,7 +247,7 @@ def test_p2wpkh_in_p2sh_presigned(client: Client):
assert (
serialized_tx.hex()
== "010000000001028a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090100000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff03e0aebb0000000000160014a579388225827d9f2fe9014add644487808c695d00cdb7020000000017a91491233e24a9bf8dbb19c1187ad876a9380c12e787870d859b03000000001976a914a579388225827d9f2fe9014add644487808c695d88ac02483045022100ead79ee134f25bb585b48aee6284a4bb14e07f03cc130253e83450d095515e5202201e161e9402c8b26b666f2b67e5b668a404ef7e57858ae9a6a68c3837e65fdc69012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7902463043021f585c54a84dc7326fa60e22729accd41153c7dd4725bd4c8f751aa3a8cd8d6a0220631bfd83fc312cc6d5d129572a25178696d81eaf50c8c3f16c6121be4f4c029d012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
== "0100000000010237c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff31223ed7300b8707bdf87dc789c294520bbb7dc371741a00605d9c535adc16ec0000000000ffffffff03e0aebb0000000000160014a579388225827d9f2fe9014add644487808c695d00cdb7020000000017a91491233e24a9bf8dbb19c1187ad876a9380c12e787874d4de803000000001976a914a579388225827d9f2fe9014add644487808c695d88ac024830450221009962940c7524c8dee6807d76e0ce1ba4a943604db0bce61357dabe5a4ce2d93a022014fa33769e33eb7e6051d9db28f06cff7ead6c7013839cc26c43f887736a9af1012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7902473044022009b2654cd576227c781b14b775df4749d0bcc5661cc39a08b5c42b8ffbc33c5d02203893cc57c46811ec2fb2d27764f3a3b3406040a24d1373cc7f38f79d80dfef1f012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
)
# Test corrupted script hash in scriptsig.
@ -262,10 +265,10 @@ def test_p2wpkh_in_p2sh_presigned(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_20912f),
request_input(0, TXHASH_20912f),
request_output(0, TXHASH_20912f),
request_output(1, TXHASH_20912f),
messages.Failure(code=messages.FailureType.DataError),
]
)
@ -348,32 +351,32 @@ def test_p2wpkh_presigned(client: Client):
def test_p2wsh_external_presigned(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
amount=10_000,
prev_hash=TXHASH_ec16dc,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp2 = messages.TxInputType(
# 1-of-2 multisig
# m/84'/1'/0/0/0' for "alcohol woman abuse ..." seed.
# m/84'/1'/0/0/0' for "all all ... all" seed.
# 1 of 2 multisig
# m/84'/1'/0' for "alcohol woman abuse ..." seed.
# m/84'/1'/0' for "all all ... all" seed.
# tb1qpzmgzpcumztvmpu3q27wwdggqav26j9dgks92pvnne2lz9ferxgssmhzlq
prev_hash=TXHASH_a345b8,
prev_index=0,
prev_hash=TXHASH_1c022d,
prev_index=2,
amount=100_000,
script_type=messages.InputScriptType.EXTERNAL,
script_pubkey=bytes.fromhex(
"002008b681071cd896cd879102bce735080758ad48ad45a05505939e55f115391991"
),
amount=100,
witness=bytearray.fromhex(
"030047304402206b570b99c22c841548a35a9b9c673fa3b87a9563ed64ad7d979aa3e01b2e303802201d0bebf58b7243e09798e734fc32892936c4d0c4984bec755dc951ef646e4a9a0147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae"
"03004830450221009c74f5b89440665857f2c775f7c63eb208456aeda12ef9f4ba2c739474f3436202205a069c3bcb31a9fe751818920ae94db4087d432ebd2762741922281d205ac3620147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae"
),
)
out1 = messages.TxOutputType(
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp",
amount=12_300_000 + 100 - 10_000,
amount=10_000 + 100_000 - 1_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -386,14 +389,16 @@ def test_p2wsh_external_presigned(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_ec16dc),
request_input(0, TXHASH_ec16dc),
request_output(0, TXHASH_ec16dc),
request_output(1, TXHASH_ec16dc),
request_input(1),
request_meta(TXHASH_a345b8),
request_input(0, TXHASH_a345b8),
request_output(0, TXHASH_a345b8),
request_meta(TXHASH_1c022d),
request_input(0, TXHASH_1c022d),
request_output(0, TXHASH_1c022d),
request_output(1, TXHASH_1c022d),
request_output(2, TXHASH_1c022d),
request_input(0),
request_input(1),
request_output(0),
@ -404,12 +409,16 @@ def test_p2wsh_external_presigned(client: Client):
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1, inp2], [out1], prev_txes=TX_CACHE_TESTNET
client,
"Testnet",
[inp1, inp2],
[out1],
prev_txes=TX_CACHE_TESTNET,
)
assert (
serialized_tx.hex()
== "010000000001028a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff48e37c58a68ab4899400dc0950a661817ea7bac3e4556044c685b35957b845a30000000000ffffffff013488bb000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c9870247304402204270cf602ec151e72b99c5048755379c368c6c7cd722e4234ad4bb7b1b87d09d02207fa59b1c2926ea6b4f0094ab77c08e50b089a199a5bc8419e1ee6674809c4fb4012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f862030047304402206b570b99c22c841548a35a9b9c673fa3b87a9563ed64ad7d979aa3e01b2e303802201d0bebf58b7243e09798e734fc32892936c4d0c4984bec755dc951ef646e4a9a0147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae00000000"
== "0100000000010231223ed7300b8707bdf87dc789c294520bbb7dc371741a00605d9c535adc16ec0000000000ffffffffb5da4da56cabc57097abb376af10e843c3f2c8427c612acfc88baaa39d2d021c0200000000ffffffff01c8a901000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c9870247304402207ec2960e148af81ac1bf570e59a9e17566c9db539826fe6edec622e4378da203022051e4c877ef6ef67700cc9038b9969355f104b608f7b4ed4ee573f3608cc40b69012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86203004830450221009c74f5b89440665857f2c775f7c63eb208456aeda12ef9f4ba2c739474f3436202205a069c3bcb31a9fe751818920ae94db4087d432ebd2762741922281d205ac3620147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae00000000"
)
# Test corrupted signature in witness.
@ -423,14 +432,16 @@ def test_p2wsh_external_presigned(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_ec16dc),
request_input(0, TXHASH_ec16dc),
request_output(0, TXHASH_ec16dc),
request_output(1, TXHASH_ec16dc),
request_input(1),
request_meta(TXHASH_a345b8),
request_input(0, TXHASH_a345b8),
request_output(0, TXHASH_a345b8),
request_meta(TXHASH_1c022d),
request_input(0, TXHASH_1c022d),
request_output(0, TXHASH_1c022d),
request_output(1, TXHASH_1c022d),
request_output(2, TXHASH_1c022d),
messages.Failure(code=messages.FailureType.DataError),
]
)
@ -559,20 +570,20 @@ def test_p2wpkh_with_proof(client: Client):
),
)
inp2 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=10_000,
prev_hash=TXHASH_ec16dc,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=1_230_000,
amount=55_555,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
out2 = messages.TxOutputType(
address="mvbu1Gdy8SUjTenqerxUaZyYjmveZvt33q",
amount=100_000 + 7_289_000 - 11_000 - 1_230_000,
amount=100_000 + 10_000 - 11000 - 55_555,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -592,10 +603,10 @@ def test_p2wpkh_with_proof(client: Client):
request_output(0, TXHASH_e5b7e2),
request_output(1, TXHASH_e5b7e2),
request_input(1),
request_meta(TXHASH_65b811),
request_input(0, TXHASH_65b811),
request_output(0, TXHASH_65b811),
request_output(1, TXHASH_65b811),
request_meta(TXHASH_ec16dc),
request_input(0, TXHASH_ec16dc),
request_output(0, TXHASH_ec16dc),
request_output(1, TXHASH_ec16dc),
request_input(0),
request_input(1),
request_output(0),
@ -614,7 +625,7 @@ def test_p2wpkh_with_proof(client: Client):
assert (
serialized_tx.hex()
== "010000000001028abbd1cf69e00fbf60fa3ba475dccdbdba4a859ffa6bfd1ee820a75b1be2b7e50000000000ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff02b0c4120000000000160014a579388225827d9f2fe9014add644487808c695da0cf5d00000000001976a914a579388225827d9f2fe9014add644487808c695d88ac0002483045022100b17fe0eb21da96bdf9640bbe94f6198ff2ced183765753ee3d5119e661977cb20220121dfdc7a121afdcc08fae1389c7147a10bc58b2daea46799c6e6547c648ba1d012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
== "010000000001028abbd1cf69e00fbf60fa3ba475dccdbdba4a859ffa6bfd1ee820a75b1be2b7e50000000000ffffffff31223ed7300b8707bdf87dc789c294520bbb7dc371741a00605d9c535adc16ec0000000000ffffffff0203d9000000000000160014a579388225827d9f2fe9014add644487808c695db5a90000000000001976a914a579388225827d9f2fe9014add644487808c695d88ac000247304402204ab2dfe9eb1268c1cea7d997ae10070c67a26d1c52eb8af06d2e8a4f8befeee30220445294f1568782879c84bf216c80c0f01dc332569c2afd1be5381b0d5a8d6d69012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
)
# Test corrupted ownership proof.

View File

@ -21,44 +21,30 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
forge_prevtx,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_CACHE_MAINNET = TxCache("Bitcoin")
TX_CACHE_TESTNET = TxCache("Testnet")
TX_CACHE_BCASH = TxCache("Bcash")
TXHASH_8cc1f4 = bytes.fromhex(
"8cc1f4adf7224ce855cf535a5104594a0004cb3b640d6714fdb00b9128832dd5"
)
TXHASH_a5cd2a = bytes.fromhex(
"a5cd2a706d680587e572df16a8ce5233139a094ebbd148cc66a8004dcc88819c"
)
TXHASH_d5f65e = bytes.fromhex(
"d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882"
)
TXHASH_fa80a9 = bytes.fromhex(
"fa80a9949f1094119195064462f54d0e0eabd3139becd4514ae635b8c7fe3a46"
)
TXHASH_5dfd1b = bytes.fromhex(
"5dfd1b037633adc7f84a17b2df31c9994fe50b3ab3e246c44c4ceff3d326f62e"
)
# address at seed "all all all..." path m/44h/0h/0h/0/0
INPUT_ADDRESS = "1JAd7XCBzGudGpJQSDSfpmJhiygtLQWaGL"
PREV_HASH, PREV_TX = forge_prevtx([(INPUT_ADDRESS, 390_000)])
PREV_TXES = {PREV_HASH: PREV_TX}
# Adapted from TestMsgSigntx.test_one_one_fee,
# only changed the coin from Bitcoin to Litecoin.
# Litecoin does not have strong replay protection using SIGHASH_FORKID,
# spending from Bitcoin path should fail.
@pytest.mark.altcoin
def test_invalid_path_fail(client: Client):
# tx: d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882
# input 0: 0.0039 BTC
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/0h/0h/0/0"),
amount=390_000,
prev_hash=TXHASH_d5f65e,
prev_hash=PREV_HASH,
prev_index=0,
)
@ -70,25 +56,20 @@ def test_invalid_path_fail(client: Client):
)
with pytest.raises(TrezorFailure) as exc:
btc.sign_tx(client, "Litecoin", [inp1], [out1], prev_txes=TX_CACHE_MAINNET)
btc.sign_tx(client, "Litecoin", [inp1], [out1], prev_txes=PREV_TXES)
assert exc.value.code == messages.FailureType.DataError
assert exc.value.message.endswith("Forbidden key path")
# Adapted from TestMsgSigntx.test_one_one_fee,
# only changed the coin from Bitcoin to Litecoin and set safety checks to prompt.
# Litecoin does not have strong replay protection using SIGHASH_FORKID, but
# spending from Bitcoin path should pass with safety checks set to prompt.
@pytest.mark.altcoin
def test_invalid_path_prompt(client: Client):
# tx: d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882
# input 0: 0.0039 BTC
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/0h/0h/0/0"),
amount=390_000,
prev_hash=TXHASH_d5f65e,
prev_hash=PREV_HASH,
prev_index=0,
)
@ -103,22 +84,17 @@ def test_invalid_path_prompt(client: Client):
client, safety_checks=messages.SafetyCheckLevel.PromptTemporarily
)
btc.sign_tx(client, "Litecoin", [inp1], [out1], prev_txes=TX_CACHE_MAINNET)
btc.sign_tx(client, "Litecoin", [inp1], [out1], prev_txes=PREV_TXES)
# Adapted from TestMsgSigntx.test_one_one_fee,
# only changed the coin from Bitcoin to Bcash.
# Bcash does have strong replay protection using SIGHASH_FORKID,
# spending from Bitcoin path should work.
@pytest.mark.altcoin
def test_invalid_path_pass_forkid(client: Client):
# tx: 8cc1f4adf7224ce855cf535a5104594a0004cb3b640d6714fdb00b9128832dd5
# input 0: 0.0039 BTC
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/0h/0h/0/0"),
amount=390_000,
prev_hash=TXHASH_8cc1f4,
prev_hash=PREV_HASH,
prev_index=0,
)
@ -129,7 +105,7 @@ def test_invalid_path_pass_forkid(client: Client):
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
btc.sign_tx(client, "Bcash", [inp1], [out1], prev_txes=TX_CACHE_BCASH)
btc.sign_tx(client, "Bcash", [inp1], [out1], prev_txes=PREV_TXES)
def test_attack_path_segwit(client: Client):
@ -137,26 +113,43 @@ def test_attack_path_segwit(client: Client):
# avoid the path warning dialog, but in step6_sign_segwit_inputs() uses Bitcoin paths
# to get a valid signature.
# Generate keys
address_a = btc.get_address(
client,
"Testnet",
parse_path("m/84h/1h/0h/0/0"),
script_type=messages.InputScriptType.SPENDWITNESS,
)
address_b = btc.get_address(
client,
"Testnet",
parse_path("m/84h/1h/1h/0/1"),
script_type=messages.InputScriptType.SPENDWITNESS,
)
prev_hash, prev_tx = forge_prevtx(
[(address_a, 9_426), (address_b, 7_086)], network="testnet"
)
device.apply_settings(
client, safety_checks=messages.SafetyCheckLevel.PromptTemporarily
)
inp1 = messages.TxInputType(
# The actual input that the attcker wants to get signed.
# The actual input that the attacker wants to get signed.
address_n=parse_path("m/84h/0h/0h/0/0"),
amount=9_426,
prev_hash=TXHASH_fa80a9,
prev_hash=prev_hash,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp2 = messages.TxInputType(
# The actual input that the attcker wants to get signed.
# The actual input that the attacker wants to get signed.
# We need this one to be from a different account, so that the match checker
# allows the transaction to pass.
address_n=parse_path("m/84h/0h/1h/0/1"),
amount=7_086,
prev_hash=TXHASH_5dfd1b,
prev_index=0,
prev_hash=prev_hash,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
)
@ -194,15 +187,15 @@ def test_attack_path_segwit(client: Client):
messages.ButtonRequest(code=B.SignTx),
# Step: verify inputs
request_input(0),
request_meta(TXHASH_fa80a9),
request_input(0, TXHASH_fa80a9),
request_output(0, TXHASH_fa80a9),
request_output(1, TXHASH_fa80a9),
request_meta(prev_hash),
request_input(0, prev_hash),
request_output(0, prev_hash),
request_output(1, prev_hash),
request_input(1),
request_meta(TXHASH_5dfd1b),
request_input(0, TXHASH_5dfd1b),
request_output(0, TXHASH_5dfd1b),
request_output(1, TXHASH_5dfd1b),
request_meta(prev_hash),
request_input(0, prev_hash),
request_output(0, prev_hash),
request_output(1, prev_hash),
# Step: serialize inputs
request_input(0),
request_input(1),
@ -219,15 +212,17 @@ def test_attack_path_segwit(client: Client):
]
)
btc.sign_tx(client, "Testnet", [inp1, inp2], [out1], prev_txes=TX_CACHE_MAINNET)
btc.sign_tx(
client, "Testnet", [inp1, inp2], [out1], prev_txes={prev_hash: prev_tx}
)
@pytest.mark.skip_t1(reason="T1 only prevents using paths known to be altcoins")
def test_invalid_path_fail_asap(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/0"),
amount=4_977_040,
prev_hash=TXHASH_a5cd2a,
amount=1_000_000,
prev_hash=b"\x42" * 32,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
sequence=4_294_967_293,
@ -235,15 +230,18 @@ def test_invalid_path_fail_asap(client: Client):
out1 = messages.TxOutputType(
address_n=parse_path("m/84h/0h/0h/1/0"),
amount=4_977_040,
amount=1_000_000,
script_type=messages.OutputScriptType.PAYTOWITNESS,
)
with client:
client.set_expected_responses(
[request_input(0), messages.Failure(code=messages.FailureType.DataError)]
[
request_input(0),
messages.Failure(code=messages.FailureType.DataError),
]
)
try:
btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_CACHE_TESTNET)
btc.sign_tx(client, "Testnet", [inp1], [out1])
except TrezorFailure:
pass

View File

@ -19,20 +19,18 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from .signtx import assert_tx_matches
TX_API = TxCache("Testnet")
TXHASH_2bac7a = bytes.fromhex(
"2bac7ad1dec654579a71ea9555463f63ac7b7df9d8ba67b4682bba4e514d0f0c"
TXHASH_357728 = bytes.fromhex(
"3577280f334f5d0ffcf994c2e346d307046dec4ba2aaa9ababb7b96c54b27cc1"
)
TXHASH_65b811 = bytes.fromhex(
"65b811d3eca0fe6915d9f2d77c86c5a7f19bf66b1b1253c2c51cb4ae5f0c017b"
TXHASH_7afc31 = bytes.fromhex(
"7afc31334c88840b295eedba9bffce93ba142577867cdde199fec03545e49eb9"
)
TXHASH_e5040e = bytes.fromhex(
"e5040e1bc1ae7667ffb9e5248e90b2fb93cd9150234151ce90e14ab2f5933bcd"
)
TXHASH_31bc1c = bytes.fromhex(
"31bc1c88ce6ae337a6b3057a16d5bad0b561ad1dfc047d0a7fbb8814668f91e5"
TXHASH_cf52d7 = bytes.fromhex(
"cf52d7ece8f614a70e0da43eaf9fa1bb9e7ebdd14feca3278d8899071ac44948"
)
@ -40,21 +38,23 @@ def test_non_segwit_segwit_inputs(client: Client):
# First is non-segwit, second is segwit.
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=31_000_000,
prev_hash=TXHASH_e5040e,
address_n=parse_path("m/44h/1h/0h/0/7"), # mgV9Z3YuSbxGb2b2Y1T6VCqtU2osui7vhG
amount=10_000,
prev_hash=TXHASH_cf52d7,
prev_index=0,
script_type=messages.InputScriptType.SPENDADDRESS,
)
inp2 = messages.TxInputType(
# tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
amount=10_000,
prev_hash=TXHASH_7afc31,
prev_index=4,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=31_000_000 + 7_289_000 - 1_000,
amount=10_000 + 10_000 - 1000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -64,17 +64,10 @@ def test_non_segwit_segwit_inputs(client: Client):
)
assert len(signatures) == 2
assert (
signatures[0].hex()
== "3045022100b9b1002dfaa8aa6e658e37726dc526f145bac3715a933d40f8dacadff2cede560220197691c6bfc55ff260f5a48e9e94d9db73aff0400d79600f8ca63b7c0c7b3701"
)
assert (
signatures[1].hex()
== "3044022013dd59fb2e22da981a528b155e25e3ce360001c275408ea649b34cd51b509e68022030febb79bbb3e75263cdb68d9b9e08ab0ebe85d1986eb4fa5ce2f668b40a2a2c"
)
assert (
serialized_tx.hex()
== "01000000000102cd3b93f5b24ae190ce5141235091cd93fbb2908e24e5b9ff6776aec11b0e04e5000000006b483045022100b9b1002dfaa8aa6e658e37726dc526f145bac3715a933d40f8dacadff2cede560220197691c6bfc55ff260f5a48e9e94d9db73aff0400d79600f8ca63b7c0c7b37010121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff01803a480200000000160014a579388225827d9f2fe9014add644487808c695d0002473044022013dd59fb2e22da981a528b155e25e3ce360001c275408ea649b34cd51b509e68022030febb79bbb3e75263cdb68d9b9e08ab0ebe85d1986eb4fa5ce2f668b40a2a2c012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/e4b3150748dfaad0df9b55aadf13a231a0c84baf0f5be56a704375c0ee5f873b",
tx_hex="010000000001024849c41a0799888d27a3ec4fd1bd7e9ebba19faf3ea40d0ea714f6e8ecd752cf000000006a473044022003ecf52d057d7a1d16b246fa13aa5bac893cf3cd46dc7fb832d1dc5e68279c4802201026004b05c0774ddb552968f4394cf144272fa387fd728e0b7a4e7d7be131200121035169c4d6a36b6c4f3e210f46d329efa1cb7a67ffce7d62062d4a8a17c23756e1ffffffffb99ee44535c0fe99e1dd7c86772514ba93ceff9bbaed5e290b84884c3331fc7a0400000000ffffffff01384a000000000000160014a579388225827d9f2fe9014add644487808c695d00024830450221009d5c89cc9d0e878583564f10f4ce1400a3239096581474be05e703c098cfadad02201ad115ce2ce6dea9c2df4bbba95385fd5f687673089a6ceeba5daea473f65d5d012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000",
)
@ -82,21 +75,22 @@ def test_segwit_non_segwit_inputs(client: Client):
# First is segwit, second is non-segwit.
inp1 = messages.TxInputType(
# tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
amount=10_000,
prev_hash=TXHASH_7afc31,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp2 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=31_000_000,
prev_hash=TXHASH_e5040e,
prev_index=0,
address_n=parse_path("m/44h/1h/0h/0/7"), # mgV9Z3YuSbxGb2b2Y1T6VCqtU2osui7vhG
amount=10_000,
prev_hash=TXHASH_cf52d7,
prev_index=1,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=31_000_000 + 7_289_000 - 1_000,
amount=10_000 + 10_000 - 1000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -106,17 +100,10 @@ def test_segwit_non_segwit_inputs(client: Client):
)
assert len(signatures) == 2
assert (
signatures[0].hex()
== "3045022100d9bde6725e682080bfdb4fca6cf839999cd149aeac06c98983a65ec3576440880220692c7385c528ecb3780aadd85c900a4631cab88ec1db5d08391702f75aa3ddd6"
)
assert (
signatures[1].hex()
== "3045022100e485b07ec517994a436c631966060aeddc7f34acf8e818b8262de8686bfbbb04022030f04f4facab8e4a21f9849dcdfc86cd781faec98e782b4a137ca8b20c88f98d"
)
assert (
serialized_tx.hex()
== "010000000001027b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffffcd3b93f5b24ae190ce5141235091cd93fbb2908e24e5b9ff6776aec11b0e04e5000000006b483045022100e485b07ec517994a436c631966060aeddc7f34acf8e818b8262de8686bfbbb04022030f04f4facab8e4a21f9849dcdfc86cd781faec98e782b4a137ca8b20c88f98d0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff01803a480200000000160014a579388225827d9f2fe9014add644487808c695d02483045022100d9bde6725e682080bfdb4fca6cf839999cd149aeac06c98983a65ec3576440880220692c7385c528ecb3780aadd85c900a4631cab88ec1db5d08391702f75aa3ddd6012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0000000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/15611ef30e38a23620462ef0199003c3cbc5902216b0150420fb63ec094e8fe7",
tx_hex="01000000000102b99ee44535c0fe99e1dd7c86772514ba93ceff9bbaed5e290b84884c3331fc7a0100000000ffffffff4849c41a0799888d27a3ec4fd1bd7e9ebba19faf3ea40d0ea714f6e8ecd752cf010000006a47304402204aa76f35f07621bb336b9cd91808b47a4a55aaa1e9841077ba5397e50c0024e502200256916e8a2a3792745089817953b163a8b8a7af10264ea5f9250ce0b8b327640121035169c4d6a36b6c4f3e210f46d329efa1cb7a67ffce7d62062d4a8a17c23756e1ffffffff01384a000000000000160014a579388225827d9f2fe9014add644487808c695d0247304402206b927741e6616ddf78e47b28f321aaecfc0b72c9a0a1e479d89d2af690e7277a02207f95a427c56ba79ed3974697fdc0b3a91a60cb455ad70ba58ac8061585ed5fb5012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0000000000",
)
@ -124,28 +111,30 @@ def test_segwit_non_segwit_segwit_inputs(client: Client):
# First is segwit, second is non-segwit and third is segwit again.
inp1 = messages.TxInputType(
# tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
amount=10_000,
prev_hash=TXHASH_7afc31,
prev_index=2,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp2 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=31_000_000,
prev_hash=TXHASH_e5040e,
prev_index=0,
address_n=parse_path("m/44h/1h/0h/0/7"), # mgV9Z3YuSbxGb2b2Y1T6VCqtU2osui7vhG
amount=10_000,
prev_hash=TXHASH_cf52d7,
prev_index=2,
)
inp3 = messages.TxInputType(
# tb1qkvwu9g3k2pdxewfqr7syz89r3gj557l3uuf9r9
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=1_603_000,
prev_hash=TXHASH_31bc1c,
amount=10_000,
prev_hash=TXHASH_7afc31,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=31_000_000 + 7_289_000 - 1_000,
amount=10_000 + 10_000 + 10_000 - 1000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -155,21 +144,10 @@ def test_segwit_non_segwit_segwit_inputs(client: Client):
)
assert len(signatures) == 3
assert (
signatures[0].hex()
== "3044022001187697b2ae95206eb18751701b6a3efd4c2da89cc9d8f0365e8ede7582c8ff0220282a2c127da57e82aecf0f421f7b8d5781205232b3429dd25d2b85aa1e48b741"
)
assert (
signatures[1].hex()
== "30440220566602a3794e29a5082feb2efd9ce0299455d0c4a31f76d4abafdcc0fed1cde502200ae36cb0563cf4792fd8a10026ec7c94028ca61a5b6903108af3343278ad29bb"
)
assert (
signatures[2].hex()
== "3045022100f2d398ac6bc702cfa4f7eb3d2579a233f1d7c920c45a14329a741db6c24fde8f02203b1f6aed5671eece8ba5b5c05ec0330a43c0914b8ff606945cb8cf9e164ec88f"
)
assert (
serialized_tx.hex()
== "010000000001037b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffffcd3b93f5b24ae190ce5141235091cd93fbb2908e24e5b9ff6776aec11b0e04e5000000006a4730440220566602a3794e29a5082feb2efd9ce0299455d0c4a31f76d4abafdcc0fed1cde502200ae36cb0563cf4792fd8a10026ec7c94028ca61a5b6903108af3343278ad29bb0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffffe5918f661488bb7f0a7d04fc1dad61b5d0bad5167a05b3a637e36ace881cbc310000000000ffffffff01803a480200000000160014a579388225827d9f2fe9014add644487808c695d02473044022001187697b2ae95206eb18751701b6a3efd4c2da89cc9d8f0365e8ede7582c8ff0220282a2c127da57e82aecf0f421f7b8d5781205232b3429dd25d2b85aa1e48b741012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0002483045022100f2d398ac6bc702cfa4f7eb3d2579a233f1d7c920c45a14329a741db6c24fde8f02203b1f6aed5671eece8ba5b5c05ec0330a43c0914b8ff606945cb8cf9e164ec88f012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/5ff5ddaa28241353a714bbcc57ce86a6cf1caf31d33948c62da2f55dadb2533b",
tx_hex="01000000000103b99ee44535c0fe99e1dd7c86772514ba93ceff9bbaed5e290b84884c3331fc7a0200000000ffffffff4849c41a0799888d27a3ec4fd1bd7e9ebba19faf3ea40d0ea714f6e8ecd752cf020000006b483045022100d2610b791fcf72f2d2780781948e5129dcfaa738f92441c38102758cdea880fe02205b4314e1afd0270e93498c5a410a379f86a4b9b1ed47d9909284c31e10c380000121035169c4d6a36b6c4f3e210f46d329efa1cb7a67ffce7d62062d4a8a17c23756e1ffffffffb99ee44535c0fe99e1dd7c86772514ba93ceff9bbaed5e290b84884c3331fc7a0000000000ffffffff014871000000000000160014a579388225827d9f2fe9014add644487808c695d0248304502210082abb0696513b4a6582ad673ea99898fc3564ccb310bf5b6f32b338a54e6c481022009cb1404626fe381ed20ade6f0b3c367856584cc5da030360807a7a15f364816012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0002483045022100f886bc7abfdd12e5c0b27e61075bd9c5e1f2aaa9b87623024732217e7d482c2402205ae8ad88872d655593c205333075989841623e0a7a3b3062e7fcd18afa69868a012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000",
)
@ -177,27 +155,28 @@ def test_non_segwit_segwit_non_segwit_inputs(client: Client):
# First is non-segwit, second is segwit and third is non-segwit again.
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=31_000_000,
prev_hash=TXHASH_e5040e,
prev_index=0,
address_n=parse_path("m/44h/1h/0h/0/7"), # mgV9Z3YuSbxGb2b2Y1T6VCqtU2osui7vhG
amount=10_000,
prev_hash=TXHASH_cf52d7,
prev_index=3,
)
inp2 = messages.TxInputType(
# tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
amount=10_000,
prev_hash=TXHASH_7afc31,
prev_index=3,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp3 = messages.TxInputType(
address_n=parse_path("m/44h/1h/1h/0/0"),
amount=9_226_912,
prev_hash=TXHASH_2bac7a,
address_n=parse_path("m/44h/1h/1h/0/0"), # msUqRgCWS7ryuFcF34EaKTrsTe3xHra128
amount=10_000,
prev_hash=TXHASH_357728,
prev_index=0,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=31_000_000 + 7_289_000 - 1_000,
amount=10_000 + 10_000 + 10_000 - 1000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -207,19 +186,8 @@ def test_non_segwit_segwit_non_segwit_inputs(client: Client):
)
assert len(signatures) == 3
assert (
signatures[0].hex()
== "3045022100c9d0bad841a085b469c85794291989b6cd902f98abd5e0c6cab02f36461e4a3d022031298c4a1c36aa87abcf58f1f0991bba0afca98af8acf1dca73cd922cd85fccf"
)
assert (
signatures[1].hex()
== "30440220164615767205a8fd7acf924a224c4c01476a5e545cd9033eba7d63dc4b4e200b02201cbf837c8e98014e7170568546f430bb8e3d7e3071fe53e7cff20a7b90778553"
)
assert (
signatures[2].hex()
== "3045022100baebd59a19048836ac733a177935bb093214fa106d192952d6651e989b634c620220708355edb1ca0e96f6ba1c6db3a84a5c960905db044443b038f70206427d889e"
)
assert (
serialized_tx.hex()
== "01000000000103cd3b93f5b24ae190ce5141235091cd93fbb2908e24e5b9ff6776aec11b0e04e5000000006b483045022100c9d0bad841a085b469c85794291989b6cd902f98abd5e0c6cab02f36461e4a3d022031298c4a1c36aa87abcf58f1f0991bba0afca98af8acf1dca73cd922cd85fccf0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff0c0f4d514eba2b68b467bad8f97d7bac633f465595ea719a5754c6ded17aac2b000000006b483045022100baebd59a19048836ac733a177935bb093214fa106d192952d6651e989b634c620220708355edb1ca0e96f6ba1c6db3a84a5c960905db044443b038f70206427d889e012103bae960983f83e28fcb8f0e5f3dc1f1297b9f9636612fd0835b768e1b7275fb9dffffffff01803a480200000000160014a579388225827d9f2fe9014add644487808c695d00024730440220164615767205a8fd7acf924a224c4c01476a5e545cd9033eba7d63dc4b4e200b02201cbf837c8e98014e7170568546f430bb8e3d7e3071fe53e7cff20a7b90778553012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0000000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/af4b1333244958e380cdd50f8fbb11530bc80208ddb8e8d5b35ebd51c0f486be",
tx_hex="010000000001034849c41a0799888d27a3ec4fd1bd7e9ebba19faf3ea40d0ea714f6e8ecd752cf030000006b48304502210082d5f5568a131bfbc19757a28916c645b7eeb0943f8fec2ca3a0083019f87526022057cb783bf3d57103a352d0cfeed4fa4a400785d03684c03a3a1475dc70829e450121035169c4d6a36b6c4f3e210f46d329efa1cb7a67ffce7d62062d4a8a17c23756e1ffffffffb99ee44535c0fe99e1dd7c86772514ba93ceff9bbaed5e290b84884c3331fc7a0300000000ffffffffc17cb2546cb9b7ababa9aaa24bec6d0407d346e3c294f9fc0f5d4f330f287735000000006a47304402207b65dc4bafca0195cdbac0f29cd59a9c30811b7a9f668285a2f28a5aed3f222302204dfc3338fbe68ade24a4eed5c9fbafd1a75f2ccb722d5834851425103b111759012103bae960983f83e28fcb8f0e5f3dc1f1297b9f9636612fd0835b768e1b7275fb9dffffffff014871000000000000160014a579388225827d9f2fe9014add644487808c695d000247304402204ec4c1b7a0f7b98571d294fdf2ed0312eeff8ee01869d2b49b683bc61092cca70220381c11cff198611f2986e52fc697f570be255a0194117aef110f73b8e265d44c012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f0000000000",
)

View File

@ -23,14 +23,13 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from .payment_req import CoinPurchaseMemo, RefundMemo, TextMemo, make_payment_request
from .signtx import forge_prevtx
TX_API = TxCache("Testnet")
TXHASH_091446 = bytes.fromhex(
"09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a"
)
# address at seed "all all all..." path m/84h/1h/0h/0/0
INPUT_ADDRESS = "tb1qkvwu9g3k2pdxewfqr7syz89r3gj557l3uuf9r9"
PREV_HASH, PREV_TX = forge_prevtx([(INPUT_ADDRESS, 12_300_000)], network="testnet")
PREV_TXES = {PREV_HASH: PREV_TX}
pytestmark = pytest.mark.skip_t1
@ -48,7 +47,7 @@ inputs = [
messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
prev_hash=PREV_HASH,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
@ -103,7 +102,7 @@ PaymentRequestParams = namedtuple(
"PaymentRequestParams", ["txo_indices", "memos", "get_nonce"]
)
SERIALIZED_TX = "010000000001018a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff03404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c98780841e0000000000160014d16b8c0680c61fc6ed2e407455715055e41052f528b4500000000000160014b31dc2a236505a6cb9201fa0411ca38a254a7bf10247304402204adea8ae600878c5912310f546d600359f6cde8087ebd23f20f8acc7ecb2ede70220603334476c8fb478d8c539f027f9bff5f126e4438df757f9b4ba528adcb56c48012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
SERIALIZED_TX = "01000000000101e29305e85821ea86f2bca1fcfe45e7cb0c8de87b612479ee641e0d3d12a723b20000000000ffffffff03404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c98780841e0000000000160014d16b8c0680c61fc6ed2e407455715055e41052f528b4500000000000160014b31dc2a236505a6cb9201fa0411ca38a254a7bf10247304402203ca28fc86a8947ccd11af2d80febfb592d3a29abcb0a8e0fc4924615a1307d89022051c1b41e0db900d90883c030da14f26a34b2bef6d2b289c5aac3097f3501005f012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
@pytest.mark.parametrize(
@ -158,7 +157,7 @@ def test_payment_request(client: Client, payment_request_params):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=payment_reqs,
)
@ -171,7 +170,7 @@ def test_payment_request(client: Client, payment_request_params):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=payment_reqs,
)
@ -219,7 +218,7 @@ def test_payment_request_details(client: Client):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=payment_reqs,
)
@ -247,7 +246,7 @@ def test_payment_req_wrong_amount(client: Client):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=[payment_req],
)
@ -277,7 +276,7 @@ def test_payment_req_wrong_mac_refund(client: Client):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=[payment_req],
)
@ -313,7 +312,7 @@ def test_payment_req_wrong_mac_purchase(client: Client):
"Testnet",
inputs,
outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=[payment_req],
)
@ -348,6 +347,6 @@ def test_payment_req_wrong_output(client: Client):
"Testnet",
inputs,
fake_outputs,
prev_txes=TX_API,
prev_txes=PREV_TXES,
payment_reqs=[payment_req],
)

View File

@ -1,3 +1,4 @@
from copy import copy
from hashlib import sha256
from io import BytesIO
@ -7,11 +8,12 @@ from trezorlib import btc, messages, tools
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from ...tx_cache import TxCache
from .signtx import forge_prevtx
TXHASH_157041 = bytes.fromhex(
"1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6"
)
# address at seed "all all all..." path m/44h/0h/0h/0/0
INPUT_ADDRESS = "1JAd7XCBzGudGpJQSDSfpmJhiygtLQWaGL"
PREV_HASH, PREV_TX = forge_prevtx([(INPUT_ADDRESS, 100_000_000)])
PREV_TXES = {PREV_HASH: PREV_TX}
def write_prefixed_bytes(io, data) -> None:
@ -102,7 +104,7 @@ def test_invalid_prev_hash_attack(client: Client, prev_hash):
inp1 = messages.TxInputType(
address_n=tools.parse_path("m/44h/0h/0h/0/0"),
amount=100_000_000,
prev_hash=TXHASH_157041,
prev_hash=PREV_HASH,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
@ -131,7 +133,7 @@ def test_invalid_prev_hash_attack(client: Client, prev_hash):
with client, pytest.raises(TrezorFailure) as e:
client.set_filter(messages.TxAck, attack_filter)
btc.sign_tx(client, "Bitcoin", [inp1], [out1], prev_txes=TxCache("Bitcoin"))
btc.sign_tx(client, "Bitcoin", [inp1], [out1], prev_txes=PREV_TXES)
# check that injection was performed
assert counter == 0
@ -140,8 +142,7 @@ def test_invalid_prev_hash_attack(client: Client, prev_hash):
@with_bad_prevhashes
def test_invalid_prev_hash_in_prevtx(client: Client, prev_hash):
cache = TxCache("Bitcoin")
prev_tx = cache[TXHASH_157041]
prev_tx = copy(PREV_TX)
# smoke check: replace prev_hash with all zeros, reserialize and hash, try to sign
prev_tx.inputs[0].prev_hash = b"\x00" * 32

View File

@ -22,7 +22,7 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import (
from .signtx import (
request_finished,
request_input,
request_meta,

View File

@ -22,19 +22,23 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
forge_prevtx,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_API = TxCache("Testnet")
TX_API_TESTNET = TxCache("Testnet")
TXHASH_20912f = bytes.fromhex(
"20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337"
)
TXHASH_9c3192 = bytes.fromhex(
"9c31922be756c06d02167656465c8dc83bb553bf386a3f478ae65b5c021002be"
)
TXHASH_dee13c = bytes.fromhex(
"dee13c469e7ab28108a1ce470d74cb40896d9bb459951bdf590ca6a495293a02"
TXHASH_338e2d = bytes.fromhex(
"338e2d02e0eaf8848e38925904e51546cf22e58db5b1860c4a0e72b69c56afe5"
)
TXHASH_e5040e = bytes.fromhex(
"e5040e1bc1ae7667ffb9e5248e90b2fb93cd9150234151ce90e14ab2f5933bcd"
@ -82,9 +86,10 @@ def test_send_p2sh(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
# Transaction does not exist on the blockchain, not using assert_tx_matches()
assert (
serialized_tx.hex()
== "0100000000010137c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff02e0aebb00000000001976a91414fdede0ddc3be652a0ce1afbc1b509a55b6b94888ac3df39f060000000017a91458b53ea7f832e8f096e896b8713a8c6df0e892ca8702483045022100ccd253bfdf8a5593cd7b6701370c531199f0f05a418cd547dfc7da3f21515f0f02203fa08a0753688871c220648f9edadbdb98af42e5d8269364a326572cf703895b012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7900000000"
@ -131,9 +136,10 @@ def test_send_p2sh_change(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
# Transaction does not exist on the blockchain, not using assert_tx_matches()
assert (
serialized_tx.hex()
== "0100000000010137c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff02e0aebb00000000001976a91414fdede0ddc3be652a0ce1afbc1b509a55b6b94888ac3df39f060000000017a91458b53ea7f832e8f096e896b8713a8c6df0e892ca8702483045022100ccd253bfdf8a5593cd7b6701370c531199f0f05a418cd547dfc7da3f21515f0f02203fa08a0753688871c220648f9edadbdb98af42e5d8269364a326572cf703895b012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7900000000"
@ -142,11 +148,19 @@ def test_send_p2sh_change(client: Client):
def test_testnet_segwit_big_amount(client: Client):
# This test is testing transaction with amount bigger than fits to uint32
address_n = parse_path("m/49h/1h/0h/0/0")
address = btc.get_address(
client,
"Testnet",
address_n,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
prev_hash, prev_tx = forge_prevtx([(address, 2 ** 32 + 1)], network="testnet")
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/0h/0/0"),
address_n=address_n,
amount=2 ** 32 + 1,
prev_hash=TXHASH_dee13c,
prev_hash=prev_hash,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
@ -163,8 +177,9 @@ def test_testnet_segwit_big_amount(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_dee13c),
request_output(0, TXHASH_dee13c),
request_meta(prev_hash),
request_input(0, prev_hash),
request_output(0, prev_hash),
request_input(0),
request_output(0),
request_input(0),
@ -172,89 +187,81 @@ def test_testnet_segwit_big_amount(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client, "Testnet", [inp1], [out1], prev_txes={prev_hash: prev_tx}
)
assert (
serialized_tx.hex()
== "01000000000101023a2995a4a60c59df1b9559b49b6d8940cb740d47cea10881b27a9e463ce1de00000000171600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5cffffffff01010000000100000017a914097c569095163e84475d07aa95a1f736df895b7b8702483045022100965aa8897c7cd5f0bff830481ed5259bf662ed0415ab497a6a152a3c335eb0a1022060acbbbada909b6575ac6f19382a6bdf4cab2fa1c5421aa66677806f380ddb870121033add1f0e8e3c3136f7428dd4a4de1057380bd311f5b0856e2269170b4ffa65bf00000000"
== "010000000001019e64f9a7d1af8c06e9d04362e6bd6ac1970f8be5321982ad1ce25a65eec3ae5500000000171600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5cffffffff01010000000100000017a914097c569095163e84475d07aa95a1f736df895b7b87024830450221009d87f574f4b73d1f1114b6a053cb4e1e4f223e495bf5ba2c2f9e47eaf3aabb8c022033eaeb7fa07ab9948ed0180ca166e9d3209cc6f598dff7bfc61ea32ad3d995840121033add1f0e8e3c3136f7428dd4a4de1057380bd311f5b0856e2269170b4ffa65bf00000000"
)
@pytest.mark.multisig
def test_send_multisig_1(client: Client):
# input: 338e2d02e0eaf8848e38925904e51546cf22e58db5b1860c4a0e72b69c56afe5
nodes = [
btc.get_public_node(
client, parse_path(f"m/49h/1h/{i}h"), coin_name="Testnet"
).node
for i in range(1, 4)
]
# address: 2MuqUo9axjz6FfHjSqNMu8kbF1tCjisMrbt
multisig = messages.MultisigRedeemScriptType(
nodes=nodes, address_n=[1, 0], signatures=[b"", b"", b""], m=2
)
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/1h/1/0"),
prev_hash=TXHASH_9c3192,
prev_index=1,
prev_hash=TXHASH_338e2d,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
multisig=multisig,
amount=1_610_436,
amount=100_000,
)
out1 = messages.TxOutputType(
address="mhRx1CeVfaayqRwq5zgRQmD7W5aWBfD5mC",
amount=1_605_000,
address="mu85iAHLpF16VyijB2wn5fcZrjT2bvrhnL",
amount=100_000 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_338e2d),
request_input(0, TXHASH_338e2d),
request_output(0, TXHASH_338e2d),
request_output(1, TXHASH_338e2d),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_9c3192),
request_input(0, TXHASH_9c3192),
request_output(0, TXHASH_9c3192),
request_output(1, TXHASH_9c3192),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
signatures, _ = btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_9c3192),
request_input(0, TXHASH_9c3192),
request_output(0, TXHASH_9c3192),
request_output(1, TXHASH_9c3192),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client.set_expected_responses(expected_responses)
signatures, _ = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "01000000000101be0210025c5be68a473f6a38bf53b53bc88d5c46567616026dc056e72b92319c0100000023220020cf28684ff8a6dda1a7a9704dde113ddfcf236558da5ce35ad3f8477474dbdaf7ffffffff01887d1800000000001976a91414fdede0ddc3be652a0ce1afbc1b509a55b6b94888ac040047304402203fc3fbe6cd6250d82ace4a585debc07587c07d2efc8bb56558c91e1f810fe65402206025bd9a4e80960f617b6e5bfdd568e34aa085d093471b7976e6b14c2a2402a7014730440220327abf491a57964d75c67fad204eb782fa74aa4abde40e5ad30fb0b7696102b7022049e31f2302417be0a87e2f818b93a862a7e67d4178b7cbeee680264f0882113f0169522103d54ab3c8b81cb7f8f8088df4c62c105e8acaa2fb53b180f6bc6f922faecf3fdc21036aa47994f3f18f0976d6073ca79997003c3fa29c4f93907998fefc1151b4529b2102a092580f2828272517c402da9461425c5032860ab40180e041fbbb88ea2a520453ae00000000"
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
with client:
client.set_expected_responses(expected_responses)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/0d5d04bffd49287d122f509bebd196b1ecba7cbc5f945c28bf8a26dea66e65de",
tx_hex="01000000000101e5af569cb6720e4a0c86b1b58de522cf4615e5045992388e84f8eae0022d8e330000000023220020cf28684ff8a6dda1a7a9704dde113ddfcf236558da5ce35ad3f8477474dbdaf7ffffffff01905f0100000000001976a914953e62552a88c235c0691ec74b362a6803a7d93e88ac040047304402203aba48b0a98194a505420633eeca5acd8244061899e0a414f1b0d2de1d721b0f022001b32486e7c443e25cdfdfb14dc183ba31f5329d0078a25f7eb74f7209f347bb014830450221009cbdf84db2585abddf79165340cc0b54037f13bbe5318ec3619d0de680ebbf5d02206a2ef69e154700202ac72330e936c073f8a86cec9443273f4d8739db1019d55a0169522103d54ab3c8b81cb7f8f8088df4c62c105e8acaa2fb53b180f6bc6f922faecf3fdc21036aa47994f3f18f0976d6073ca79997003c3fa29c4f93907998fefc1151b4529b2102a092580f2828272517c402da9461425c5032860ab40180e041fbbb88ea2a520453ae00000000",
)
@ -301,7 +308,7 @@ def test_attack_change_input_address(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
@ -340,14 +347,16 @@ def test_attack_change_input_address(client: Client):
]
)
with pytest.raises(TrezorFailure) as exc:
btc.sign_tx(client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API)
btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert exc.value.code == messages.FailureType.ProcessError
assert exc.value.message.endswith("Transaction has changed during signing")
def test_attack_mixed_inputs(client: Client):
TRUE_AMOUNT = 123456789
FAKE_AMOUNT = 120000000
TRUE_AMOUNT = 123_456_789
FAKE_AMOUNT = 120_000_000
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
@ -410,7 +419,7 @@ def test_attack_mixed_inputs(client: Client):
"Testnet",
[inp1, inp2],
[out1],
prev_txes=TX_API,
prev_txes=TX_API_TESTNET,
)
# In Phase 1 make the user confirm a lower value of the segwit input.
@ -433,7 +442,7 @@ def test_attack_mixed_inputs(client: Client):
"Testnet",
[inp1, inp2],
[out1],
prev_txes=TX_API,
prev_txes=TX_API_TESTNET,
)
assert e.value.failure.message.endswith("Invalid amount specified")

View File

@ -22,44 +22,46 @@ from trezorlib.tools import H_, parse_path
from ...bip32 import deserialize
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import (
assert_tx_matches,
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TX_API = TxCache("Testnet")
TX_API_TESTNET = TxCache("Testnet")
TXHASH_20912f = bytes.fromhex(
"20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337"
)
TXHASH_091446 = bytes.fromhex(
"09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a"
)
TXHASH_65b811 = bytes.fromhex(
"65b811d3eca0fe6915d9f2d77c86c5a7f19bf66b1b1253c2c51cb4ae5f0c017b"
)
TXHASH_e5040e = bytes.fromhex(
"e5040e1bc1ae7667ffb9e5248e90b2fb93cd9150234151ce90e14ab2f5933bcd"
)
TXHASH_9c3192 = bytes.fromhex(
"9c31922be756c06d02167656465c8dc83bb553bf386a3f478ae65b5c021002be"
)
TXHASH_f41cbe = bytes.fromhex(
"f41cbedd8becee05a830f418d13aa665125464547db5c7a6cd28f21639fe1228"
)
TXHASH_c93480 = bytes.fromhex(
"c9348040bbc2024e12dcb4a0b4806b0398646b91acf314da028c3f03dd0179fc"
)
TXHASH_31bc1c = bytes.fromhex(
"31bc1c88ce6ae337a6b3057a16d5bad0b561ad1dfc047d0a7fbb8814668f91e5"
)
TXHASH_a345b8 = bytes.fromhex(
"a345b85759b385c6446055e4c3baa77e8161a65009dc009489b48aa6587ce348"
)
TXHASH_ec16dc = bytes.fromhex(
"ec16dc5a539c5d60001a7471c37dbb0b5294c289c77df8bd07870b30d73e2231"
)
TXHASH_b36780 = bytes.fromhex(
"b36780ceb86807ca6e7535a6fd418b1b788cb9b227d2c8a26a0de295e523219e"
)
TXHASH_fcb3f5 = bytes.fromhex(
"fcb3f5436224900afdba50e9e763d98b920dfed056e552040d99ea9bc03a9d83"
)
TXHASH_d159fd = bytes.fromhex(
"d159fd2fcb5854a7c8b275d598765a446f1e2ff510bf077545a404a0c9db65f7"
)
TXHASH_65047a = bytes.fromhex(
"65047a2b107d6301d72d4a1e49e7aea9cf06903fdc4ae74a4a9bba9bc1a414d2"
)
TXHASH_b9abfa = bytes.fromhex(
"b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6"
)
TXHASH_1c022d = bytes.fromhex(
"1c022d9da3aa8bc8cf2a617c42c8f2c343e810af76b3ab9770c5ab6ca54ddab5"
)
def test_send_p2sh(client: Client):
# input tx: 20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/0h/1/0"),
# 2N1LGaGg836mqSQqiuUBLfcyGBhyZbremDX
@ -100,16 +102,19 @@ def test_send_p2sh(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "0100000000010137c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff02e0aebb00000000001600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5c3df39f060000000017a91458b53ea7f832e8f096e896b8713a8c6df0e892ca8702483045022100bd3d8b8ad35c094e01f6282277300e575f1021678fc63ec3f9945d6e35670da3022052e26ef0dd5f3741c9d5939d1dec5464c15ab5f2c85245e70a622df250d4eb7c012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7900000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a",
tx_hex="0100000000010137c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff02e0aebb00000000001600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5c3df39f060000000017a91458b53ea7f832e8f096e896b8713a8c6df0e892ca8702483045022100bd3d8b8ad35c094e01f6282277300e575f1021678fc63ec3f9945d6e35670da3022052e26ef0dd5f3741c9d5939d1dec5464c15ab5f2c85245e70a622df250d4eb7c012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7900000000",
)
def test_send_p2sh_change(client: Client):
# input tx: 20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/0h/1/0"),
# 2N1LGaGg836mqSQqiuUBLfcyGBhyZbremDX
@ -149,9 +154,10 @@ def test_send_p2sh_change(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
# Transaction does not exist on the blockchain, not using assert_tx_matches()
assert (
serialized_tx.hex()
== "0100000000010137c361fb8f2d9056ba8c98c5611930fcb48cacfdd0fe2e0449d83eea982f91200000000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff02e0aebb00000000001600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5c3df39f060000000017a91458b53ea7f832e8f096e896b8713a8c6df0e892ca8702483045022100bd3d8b8ad35c094e01f6282277300e575f1021678fc63ec3f9945d6e35670da3022052e26ef0dd5f3741c9d5939d1dec5464c15ab5f2c85245e70a622df250d4eb7c012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7900000000"
@ -159,22 +165,25 @@ def test_send_p2sh_change(client: Client):
def test_send_native(client: Client):
# input tx: b36780ceb86807ca6e7535a6fd418b1b788cb9b227d2c8a26a0de295e523219e
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
# tb1qajr3a3y5uz27lkxrmn7ck8lp22dgytvagr5nqy
address_n=parse_path("m/84h/1h/0h/0/87"),
amount=100_000,
prev_hash=TXHASH_b36780,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp",
amount=5_000_000,
amount=40_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
out2 = messages.TxOutputType(
address="tb1q694ccp5qcc0udmfwgp692u2s2hjpq5h407urtu",
address="tb1qe48wz5ysk9mlzhkswcxct9tdjw6ejr2l9e6j8q",
script_type=messages.OutputScriptType.PAYTOADDRESS,
amount=12_300_000 - 11_000 - 5_000_000,
amount=100_000 - 40_000 - 10_000,
)
with client:
client.set_expected_responses(
@ -186,10 +195,10 @@ def test_send_native(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_b36780),
request_input(0, TXHASH_b36780),
request_output(0, TXHASH_b36780),
request_output(1, TXHASH_b36780),
request_input(0),
request_output(0),
request_output(1),
@ -198,16 +207,19 @@ def test_send_native(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "010000000001018a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff02404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987a8386f0000000000160014d16b8c0680c61fc6ed2e407455715055e41052f502473044022073ce72dcf2f6e42eeb44adbe7d5038cf3763f168d1c04bd8b873a19b53331f51022016b051725731e7f53a567021bcd9c370727f551c81e857ebae7c128472119652012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/65047a2b107d6301d72d4a1e49e7aea9cf06903fdc4ae74a4a9bba9bc1a414d2",
tx_hex="010000000001019e2123e595e20d6aa2c8d227b2b98c781b8b41fda635756eca0768b8ce8067b30000000000ffffffff02409c00000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c98750c3000000000000160014cd4ee15090b177f15ed0760d85956d93b5990d5f0247304402200c734ed16a9226162a29133c14fad3565332c60346050ceb9246e73a2fc8485002203463d40cf78eb5cc9718d6617d9f251b987e96cb58525795a507acb9b91696c7012103f60fc56bf7b5326537c7e86e0a63b6cd008eeb87d39af324cee5bcc3424bf4d000000000",
)
def test_send_to_taproot(client: Client):
# input tx: ec16dc5a539c5d60001a7471c37dbb0b5294c289c77df8bd07870b30d73e2231
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=10_000,
@ -227,32 +239,36 @@ def test_send_to_taproot(client: Client):
)
with client:
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "0100000000010131223ed7300b8707bdf87dc789c294520bbb7dc371741a00605d9c535adc16ec0000000000ffffffff02581b0000000000002251206b1bf9065ef5634d34368ab0ab41e4033c0f62a929c26534b9f6a1e8b03c684df00a000000000000160014c62b932e83874e1103aadbe2f95b5e7bb73a275502473044022008ce0e893e91935ada9a31fe6b2f6228070dd2a5bdebc413429e658be761901502207086e0d3aa6abbad29c966444d3b791e43c174f88154381d07c92a84fec7c527012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/4f7ad10322f7d1be86ac03997cb6bcad852b8937e504de5779dfcf313edf300e",
tx_hex="0100000000010131223ed7300b8707bdf87dc789c294520bbb7dc371741a00605d9c535adc16ec0000000000ffffffff02581b0000000000002251206b1bf9065ef5634d34368ab0ab41e4033c0f62a929c26534b9f6a1e8b03c684df00a000000000000160014c62b932e83874e1103aadbe2f95b5e7bb73a275502473044022008ce0e893e91935ada9a31fe6b2f6228070dd2a5bdebc413429e658be761901502207086e0d3aa6abbad29c966444d3b791e43c174f88154381d07c92a84fec7c527012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000",
)
def test_send_native_change(client: Client):
# input tx: fcb3f5436224900afdba50e9e763d98b920dfed056e552040d99ea9bc03a9d83
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
# tb1qajr3a3y5uz27lkxrmn7ck8lp22dgytvagr5nqy
address_n=parse_path("m/84h/1h/0h/0/87"),
amount=100_000,
prev_hash=TXHASH_fcb3f5,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp",
amount=5_000_000,
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp", # m/49h/1h/0h/0/0
amount=40_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
out2 = messages.TxOutputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
address_n=parse_path("m/84h/1h/0h/1/87"),
script_type=messages.OutputScriptType.PAYTOWITNESS,
amount=12_300_000 - 11_000 - 5_000_000,
amount=100_000 - 40_000 - 10_000,
)
with client:
client.set_expected_responses(
@ -263,10 +279,11 @@ def test_send_native_change(client: Client):
request_output(1),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_fcb3f5),
request_input(0, TXHASH_fcb3f5),
request_input(1, TXHASH_fcb3f5),
request_output(0, TXHASH_fcb3f5),
request_output(1, TXHASH_fcb3f5),
request_input(0),
request_output(0),
request_output(1),
@ -275,46 +292,47 @@ def test_send_native_change(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "010000000001018a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff02404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987a8386f0000000000160014cc8067093f6f843d6d3e22004a4290cd0c0f336b024730440220067675423ca6a0be3ddd5e13da00a9433775041e5cebc838873d2686f1d2840102201a5819e0312e6451d6b6180689101bce995685a51524cc4c3a5383f7bdab979a012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86200000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/2161a89815814c3866f5953c1e59a977f7cd5432c731cd5633378cfc3fb87fdd",
tx_hex="01000000000101839d3ac09bea990d0452e556d0fe0d928bd963e7e950bafd0a90246243f5b3fc0000000000ffffffff02409c00000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c98750c3000000000000160014cc3e33b1eb529cea8b34af5d2c5d6e6e332de9040247304402207413e26bf9eff16513f5ed1db710aa6f766b51f6c6f23ad5e9e8ddf5c67e8aba02204e09b0755ec173f6beeb8ddfa515d36afb25f046d0c851d48fdbc2e0ad3b9f13012103f60fc56bf7b5326537c7e86e0a63b6cd008eeb87d39af324cee5bcc3424bf4d000000000",
)
def test_send_both(client: Client):
# input 1 tx: 65047a2b107d6301d72d4a1e49e7aea9cf06903fdc4ae74a4a9bba9bc1a414d2
# input 2 tx: d159fd2fcb5854a7c8b275d598765a446f1e2ff510bf077545a404a0c9db65f7
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/0h/1/0"),
# 2N1LGaGg836mqSQqiuUBLfcyGBhyZbremDX
amount=111_145_789,
prev_hash=TXHASH_091446,
prev_index=1,
address_n=parse_path("m/49h/1h/0h/0/0"), # 2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp
amount=40_000,
prev_hash=TXHASH_65047a,
prev_index=0,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
)
inp2 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/1/0"),
amount=7_289_000,
prev_hash=TXHASH_65b811,
prev_index=1,
address_n=parse_path("m/84h/1h/0h/0/87"),
amount=100_000,
prev_hash=TXHASH_d159fd,
prev_index=0,
script_type=messages.InputScriptType.SPENDWITNESS,
)
out1 = messages.TxOutputType(
address="tb1q54un3q39sf7e7tlfq99d6ezys7qgc62a6rxllc",
amount=12_300_000,
amount=25_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
out2 = messages.TxOutputType(
# address_n=parse_path("44'/1'/0'/0/0"),
# script_type=messages.OutputScriptType.PAYTOP2SHWITNESS,
address="2N6UeBoqYEEnybg4cReFYDammpsyDw8R2Mc",
script_type=messages.OutputScriptType.PAYTOADDRESS,
amount=45_600_000,
amount=35_000,
)
out3 = messages.TxOutputType(
address="mvbu1Gdy8SUjTenqerxUaZyYjmveZvt33q",
amount=111_145_789 + 7_289_000 - 11_000 - 12_300_000 - 45_600_000,
amount=100_000 + 40_000 - 25_000 - 35_000 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -331,15 +349,16 @@ def test_send_both(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_65047a),
request_input(0, TXHASH_65047a),
request_output(0, TXHASH_65047a),
request_output(1, TXHASH_65047a),
request_input(1),
request_meta(TXHASH_65b811),
request_input(0, TXHASH_65b811),
request_output(0, TXHASH_65b811),
request_output(1, TXHASH_65b811),
request_meta(TXHASH_d159fd),
request_input(0, TXHASH_d159fd),
request_output(0, TXHASH_d159fd),
request_output(1, TXHASH_d159fd),
request_output(2, TXHASH_d159fd),
request_input(0),
request_input(1),
request_output(0),
@ -351,23 +370,31 @@ def test_send_both(client: Client):
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1, inp2], [out1, out2, out3], prev_txes=TX_API
client,
"Testnet",
[inp1, inp2],
[out1, out2, out3],
prev_txes=TX_API_TESTNET,
)
assert (
serialized_tx.hex()
== "010000000001028a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090100000017160014d16b8c0680c61fc6ed2e407455715055e41052f5ffffffff7b010c5faeb41cc5c253121b6bf69bf1a7c5867cd7f2d91569fea0ecd311b8650100000000ffffffff03e0aebb0000000000160014a579388225827d9f2fe9014add644487808c695d00cdb7020000000017a91491233e24a9bf8dbb19c1187ad876a9380c12e787870d859b03000000001976a914a579388225827d9f2fe9014add644487808c695d88ac02483045022100ead79ee134f25bb585b48aee6284a4bb14e07f03cc130253e83450d095515e5202201e161e9402c8b26b666f2b67e5b668a404ef7e57858ae9a6a68c3837e65fdc69012103e7bfe10708f715e8538c92d46ca50db6f657bbc455b7494e6a0303ccdb868b7902463043021f585c54a84dc7326fa60e22729accd41153c7dd4725bd4c8f751aa3a8cd8d6a0220631bfd83fc312cc6d5d129572a25178696d81eaf50c8c3f16c6121be4f4c029d012103505647c017ff2156eb6da20fae72173d3b681a1d0a629f95f49e884db300689f00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/9012ec5daf9f09d79ab7ed63d1881f1e114a4ecc3754208d9254300bbdd8812e",
tx_hex="01000000000102d214a4c19bba9b4a4ae74adc3f9006cfa9aee7491e4a2dd701637d102b7a046500000000171600140099a7ecbd938ed1839f5f6bf6d50933c6db9d5cfffffffff765dbc9a004a4457507bf10f52f1e6f445a7698d575b2c8a75458cb2ffd59d10000000000ffffffff03a861000000000000160014a579388225827d9f2fe9014add644487808c695db88800000000000017a91491233e24a9bf8dbb19c1187ad876a9380c12e7878770110100000000001976a914a579388225827d9f2fe9014add644487808c695d88ac024730440220109f615c54b409fde8292ff27529dea51497ac6c72d83e555146cfb817e64cda02203b06c0d5ca3529ab56e0ad5fae44184f56afe1fec187ba00e2cb0da387ea7f7e0121033add1f0e8e3c3136f7428dd4a4de1057380bd311f5b0856e2269170b4ffa65bf0248304502210097f6be59665df66777e9804c92ac7c770089f532ce3668be9abc687f6a6f60290220634433824ad8dca5f20a3907d6e370312fdcb652434f6398f1bebe61858cf1cb012103f60fc56bf7b5326537c7e86e0a63b6cd008eeb87d39af324cee5bcc3424bf4d000000000",
)
@pytest.mark.multisig
def test_send_multisig_1(client: Client):
# input tx: b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6
nodes = [
btc.get_public_node(
client, parse_path(f"m/49h/1h/{index}h"), coin_name="Testnet"
)
for index in range(1, 4)
]
# 2NFe7UAaccZxavBstpqDPkDasTGR154uvzT
multisig = messages.MultisigRedeemScriptType(
nodes=[deserialize(n.xpub) for n in nodes],
address_n=[0, 0],
@ -377,77 +404,73 @@ def test_send_multisig_1(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/1h/0/0"),
prev_hash=TXHASH_9c3192,
prev_index=1,
prev_hash=TXHASH_b9abfa,
prev_index=4,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
multisig=multisig,
amount=1_610_436,
amount=100_000,
)
out1 = messages.TxOutputType(
address="tb1qch62pf820spe9mlq49ns5uexfnl6jzcezp7d328fw58lj0rhlhasge9hzy",
amount=1_605_000,
amount=100_000 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_b9abfa),
request_input(0, TXHASH_b9abfa),
request_output(0, TXHASH_b9abfa),
request_output(1, TXHASH_b9abfa),
request_output(2, TXHASH_b9abfa),
request_output(3, TXHASH_b9abfa),
request_output(4, TXHASH_b9abfa),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_9c3192),
request_input(0, TXHASH_9c3192),
request_output(0, TXHASH_9c3192),
request_output(1, TXHASH_9c3192),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
signatures, _ = btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_9c3192),
request_input(0, TXHASH_9c3192),
request_output(0, TXHASH_9c3192),
request_output(1, TXHASH_9c3192),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client.set_expected_responses(expected_responses)
signatures, _ = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "01000000000101be0210025c5be68a473f6a38bf53b53bc88d5c46567616026dc056e72b92319c01000000232200208d398cfb58a1d9cdb59ccbce81559c095e8c6f4a3e64966ca385078d9879f95effffffff01887d180000000000220020c5f4a0a4ea7c0392efe0a9670a73264cffa90b19107cd8a8e9750ff93c77fdfb0400483045022100dd6342c65197af27d7894d8b8b88b16b568ee3b5ebfdc55fdfb7caa9650e3b4c02200c7074a5bcb0068f63d9014c7cd2b0490aba75822d315d41aad444e9b86adf5201483045022100e7e6c2d21109512ba0609e93903e84bfb7731ac3962ee2c1cad54a7a30ff99a20220421497930226c39fc3834e8d6da3fc876516239518b0e82e2dc1e3c46271a17c01695221021630971f20fa349ba940a6ba3706884c41579cd760c89901374358db5dd545b92102f2ff4b353702d2bb03d4c494be19d77d0ab53d16161b53fbcaf1afeef4ad0cb52103e9b6b1c691a12ce448f1aedbbd588e064869c79fbd760eae3b8cd8a5f1a224db53ae00000000"
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
with client:
client.set_expected_responses(expected_responses)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/3ec03ab3487655f88e13063b71882af5f52d1db6f622b50190035d7260517d50",
tx_hex="01000000000101a660b551efbe3f6e79b181d3c4445a7c3ffc4b970f6c1f5ef2f6284a0dfaabb904000000232200208d398cfb58a1d9cdb59ccbce81559c095e8c6f4a3e64966ca385078d9879f95effffffff01905f010000000000220020c5f4a0a4ea7c0392efe0a9670a73264cffa90b19107cd8a8e9750ff93c77fdfb040047304402203f3309fce4beab5131917615996ae79308a36043d46a52865f39d22e2f2b7abd02207d7f2e1cf1e0029192c33a5466e7717f906b8bfd512ba8c1264490691dc0d94601483045022100a154ab8162ef7328d82fc70b288ce422752bf4635626d30b467eb08985025441022065636e0537e10493dd82c0385252bde81d161236b092fcae8de359b253da41fd01695221021630971f20fa349ba940a6ba3706884c41579cd760c89901374358db5dd545b92102f2ff4b353702d2bb03d4c494be19d77d0ab53d16161b53fbcaf1afeef4ad0cb52103e9b6b1c691a12ce448f1aedbbd588e064869c79fbd760eae3b8cd8a5f1a224db53ae00000000",
)
@pytest.mark.multisig
def test_send_multisig_2(client: Client):
# input tx: b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6
nodes = [
btc.get_public_node(
client, parse_path(f"m/84h/1h/{index}h"), coin_name="Testnet"
)
for index in range(1, 4)
]
# tb1qauuv4e2pwjkr4ws5f8p20hu562jlqpe5h74whxqrwf7pufsgzcms9y8set
multisig = messages.MultisigRedeemScriptType(
nodes=[deserialize(n.xpub) for n in nodes],
address_n=[0, 1],
@ -457,75 +480,73 @@ def test_send_multisig_2(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/2h/0/1"),
prev_hash=TXHASH_f41cbe,
prev_index=0,
prev_hash=TXHASH_b9abfa,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
multisig=multisig,
amount=1_605_000,
amount=100_000,
)
out1 = messages.TxOutputType(
address="tb1qr6xa5v60zyt3ry9nmfew2fk5g9y3gerkjeu6xxdz7qga5kknz2ssld9z2z",
amount=1_604_000,
amount=100_000 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_b9abfa),
request_input(0, TXHASH_b9abfa),
request_output(0, TXHASH_b9abfa),
request_output(1, TXHASH_b9abfa),
request_output(2, TXHASH_b9abfa),
request_output(3, TXHASH_b9abfa),
request_output(4, TXHASH_b9abfa),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_f41cbe),
request_input(0, TXHASH_f41cbe),
request_output(0, TXHASH_f41cbe),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
signatures, _ = btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)
# store signature
inp1.multisig.signatures[1] = signatures[0]
# sign with first key
inp1.address_n[2] = H_(1)
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_f41cbe),
request_input(0, TXHASH_f41cbe),
request_output(0, TXHASH_f41cbe),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client.set_expected_responses(expected_responses)
signatures, _ = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "010000000001012812fe3916f228cda6c7b57d5464541265a63ad118f430a805eeec8bddbe1cf40000000000ffffffff01a0791800000000002200201e8dda334f11171190b3da72e526d441491464769679a319a2f011da5ad312a10400473044022001b7f4f21a8ddcd5e0faaaee3b95515bf8b84f2a7cbfdf66996c64123617a5cf02202fc6a776a7225420dbca759ad4ac83a61d15bf8d2883b6bf1aa31de7437f9b6e0147304402206c4125c1189a3b3e93a77cdf54c60c0538b80e5a03ec74e6ac776dfa77706ee4022035be14de76259b9d8a24863131a06a65b95df02f7d3ace90d52b37e8d94b167f0169522103bab8ecdd9ae2c51a0dc858f4c751b27533143bf6013ba1725ba8a4ecebe7de8c21027d5e55696c875308b03f2ca3d8637f51d3e35da9456a5187aa14b3de8a89534f2103b78eabaea8b3a4868be4f4bb96d6f66973f7081faa7f1cafba321444611c241e53ae00000000"
# store signature
inp1.multisig.signatures[1] = signatures[0]
# sign with first key
inp1.address_n[2] = H_(1)
with client:
client.set_expected_responses(expected_responses)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/2aad59bad0dd1ad3e9b2a4019bbb47c16111d5a2eddde50997e4199c26ee5882",
tx_hex="01000000000101a660b551efbe3f6e79b181d3c4445a7c3ffc4b970f6c1f5ef2f6284a0dfaabb90100000000ffffffff01905f0100000000002200201e8dda334f11171190b3da72e526d441491464769679a319a2f011da5ad312a10400483045022100ab35a9f9f915ed4d2017237c12d4676545bdf124c5b1c552e9e23777e601372b02202aee125c86a4255102ccba2ea0c5e7d42bb16f4b183a4cde3e707379574d61500147304402204ab0b571d1f4a37cf94cb3644f261483bcfa387d6a9f3631720d0966bf9248cf0220650b1f928343600b7eedc929902c9b16bf0f00431643b05642fdcf1ae1fd72af0169522103bab8ecdd9ae2c51a0dc858f4c751b27533143bf6013ba1725ba8a4ecebe7de8c21027d5e55696c875308b03f2ca3d8637f51d3e35da9456a5187aa14b3de8a89534f2103b78eabaea8b3a4868be4f4bb96d6f66973f7081faa7f1cafba321444611c241e53ae00000000",
)
@pytest.mark.multisig
def test_send_multisig_3_change(client: Client):
# input tx: b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6
nodes = [
btc.get_public_node(
client, parse_path(f"m/84h/1h/{index}h"), coin_name="Testnet"
)
for index in range(1, 4)
]
# tb1ql8zsl5jvpvue4xuf2dqc2w73ejcthuyrjxasuwm9z58fsxwkut9sw3trx9
multisig = messages.MultisigRedeemScriptType(
nodes=[deserialize(n.xpub) for n in nodes],
address_n=[1, 0],
@ -541,75 +562,74 @@ def test_send_multisig_3_change(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/84h/1h/1h/1/0"),
prev_hash=TXHASH_c93480,
prev_index=0,
prev_hash=TXHASH_b9abfa,
prev_index=2,
script_type=messages.InputScriptType.SPENDWITNESS,
multisig=multisig,
amount=1_604_000,
amount=100_000,
)
out1 = messages.TxOutputType(
address_n=parse_path("m/84h/1h/1h/1/1"),
amount=1_603_000,
amount=100_000 - 10_000,
multisig=multisig2,
script_type=messages.OutputScriptType.PAYTOP2SHWITNESS,
)
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_b9abfa),
request_input(0, TXHASH_b9abfa),
request_output(0, TXHASH_b9abfa),
request_output(1, TXHASH_b9abfa),
request_output(2, TXHASH_b9abfa),
request_output(3, TXHASH_b9abfa),
request_output(4, TXHASH_b9abfa),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_c93480),
request_input(0, TXHASH_c93480),
request_output(0, TXHASH_c93480),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
signatures, _ = btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
out1.address_n[2] = H_(3)
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_c93480),
request_input(0, TXHASH_c93480),
request_output(0, TXHASH_c93480),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client.set_expected_responses(expected_responses)
signatures, _ = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "01000000000101fc7901dd033f8c02da14f3ac916b6498036b80b4a0b4dc124e02c2bb408034c90000000000ffffffff01b87518000000000017a914536250d41937e5b641082447580ff6a8e46c122a870400473044022003c26107a5a47f1f900ef8aa758977530cd13ea37a33971abae8d75cac2f9f34022039e2b8c2c1d0c24ff4fc026652e1f27ad8e3ed6c9bf485f61d9aa691cb57830801483045022100963b0dc0ab46e963a66ab6e69e5e41bac6c4fedc127cac12c560b029d54fe87402205b3bcdcf313dccd78e5dce0540e7d3c8cc1bf83f13c1f9f01811eb791fd35c8101695221039dba3a72f5dc3cad17aa924b5a03c34561465f997d0cb15993f2ca2c0be771c42103cd39f3f08bbd508dce4d307d57d0c70c258c285878bfda579fa260acc738c25d2102cd631ba95beca1d64766f5540885092d0bb384a3c13b6c3a5334d0ebacf51b9553ae00000000"
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
out1.address_n[2] = H_(3)
with client:
client.set_expected_responses(expected_responses)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/16bfb04cd202a9aab41dcc3c73504f5a342345b1e1420d934a91b49c2447029d",
tx_hex="01000000000101a660b551efbe3f6e79b181d3c4445a7c3ffc4b970f6c1f5ef2f6284a0dfaabb90200000000ffffffff01905f01000000000017a914536250d41937e5b641082447580ff6a8e46c122a8704004730440220020e4bd3e7173769e82ddb10c101f612d5ef91197983015de9d20f556992bdb4022019f6e3774d1b96d6e82605f3919e5b306035c58c8f3023d12dfdfc9ececebdbe01483045022100e9175e1032d03761740f36c336f38b0b586659d74d57f89a301df551f934f29c02207a52b5a24a85a6344f4fd0b1d51f37a61408b75f3f21a7df5727196cbd2513d701695221039dba3a72f5dc3cad17aa924b5a03c34561465f997d0cb15993f2ca2c0be771c42103cd39f3f08bbd508dce4d307d57d0c70c258c285878bfda579fa260acc738c25d2102cd631ba95beca1d64766f5540885092d0bb384a3c13b6c3a5334d0ebacf51b9553ae00000000",
)
@pytest.mark.multisig
def test_send_multisig_4_change(client: Client):
# input tx: b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6
nodes = [
btc.get_public_node(
client, parse_path(f"m/49h/1h/{index}h"), coin_name="Testnet"
)
for index in range(1, 4)
]
# 2MxuPZQqtLTPJQWcLL9oLVZAKRAGy6mq4Po
multisig = messages.MultisigRedeemScriptType(
nodes=[deserialize(n.xpub) for n in nodes],
address_n=[1, 1],
@ -625,70 +645,67 @@ def test_send_multisig_4_change(client: Client):
inp1 = messages.TxInputType(
address_n=parse_path("m/49h/1h/1h/1/1"),
prev_hash=TXHASH_31bc1c,
prev_index=0,
prev_hash=TXHASH_b9abfa,
prev_index=3,
script_type=messages.InputScriptType.SPENDP2SHWITNESS,
multisig=multisig,
amount=1_603_000,
amount=100_000,
)
out1 = messages.TxOutputType(
address_n=parse_path("m/49h/1h/1h/1/2"),
amount=1_602_000,
amount=100_000 - 10_000,
multisig=multisig2,
script_type=messages.OutputScriptType.PAYTOWITNESS,
)
expected_responses = [
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_b9abfa),
request_input(0, TXHASH_b9abfa),
request_output(0, TXHASH_b9abfa),
request_output(1, TXHASH_b9abfa),
request_output(2, TXHASH_b9abfa),
request_output(3, TXHASH_b9abfa),
request_output(4, TXHASH_b9abfa),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
with client:
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_31bc1c),
request_input(0, TXHASH_31bc1c),
request_output(0, TXHASH_31bc1c),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
signatures, _ = btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
out1.address_n[2] = H_(3)
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_31bc1c),
request_input(0, TXHASH_31bc1c),
request_output(0, TXHASH_31bc1c),
request_input(0),
request_output(0),
request_input(0),
request_finished(),
]
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API
client.set_expected_responses(expected_responses)
signatures, _ = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "01000000000101e5918f661488bb7f0a7d04fc1dad61b5d0bad5167a05b3a637e36ace881cbc310000000023220020fa6c73de618ec134eeec0c16f6dd04d46d4347e9a4fd0a95fd7938403a4949f9ffffffff01d071180000000000220020bcea2324dacbcde5a9db90cc26b8df9cbc72010e05cb68cf034df6f0e05239a2040047304402206bbddb45f12e31e77610fd85b50a83bad4426433b1c4860b1c5ddc0a69f803720220087b0607daab14830f4b4941f16b953b38e606ad70029bac24af7267f93c4242014730440220551a0cb6b0d5b3fa0cfd0b07bb5d751494b827b1c6a08702186696cfbc18278302204f37c382876c4117cca656654599b508f2d55fc3b083dc938e3cd8491b29719601695221036a5ec3abd10501409092246fe59c6d7a15fff1a933479483c3ba98b866c5b9742103559be875179d44e438db2c74de26e0bc9842cbdefd16018eae8a2ed989e474722103067b56aad037cd8b5f569b21f9025b76470a72dc69457813d2b76e98dc0cd01a53ae00000000"
# store signature
inp1.multisig.signatures[0] = signatures[0]
# sign with third key
inp1.address_n[2] = H_(3)
out1.address_n[2] = H_(3)
with client:
client.set_expected_responses(expected_responses)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1], [out1], prev_txes=TX_API_TESTNET
)
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/b006619cf84ff4f36cfbd9a4f77a77678cc1b040d81b118c745dce5bbfe255d5",
tx_hex="01000000000101a660b551efbe3f6e79b181d3c4445a7c3ffc4b970f6c1f5ef2f6284a0dfaabb90300000023220020fa6c73de618ec134eeec0c16f6dd04d46d4347e9a4fd0a95fd7938403a4949f9ffffffff01905f010000000000220020bcea2324dacbcde5a9db90cc26b8df9cbc72010e05cb68cf034df6f0e05239a20400473044022046de6458d0e1d7fcc1945d6ee027d5900c7ba18183416813a9b841c5b57b7417022011cfaa89ce7f60c876d569f51080e0f9e07c09ec34fbdbc3b0e26f1028e23e2501473044022027909365f0c3d2743ba2970e74ef2c375d0ae00243e2d75d206c075d6a0f219202206a429e7e6355f8a6e957d539add1d6a24533a20f5023d19e7c2aaf25221024c501695221036a5ec3abd10501409092246fe59c6d7a15fff1a933479483c3ba98b866c5b9742103559be875179d44e438db2c74de26e0bc9842cbdefd16018eae8a2ed989e474722103067b56aad037cd8b5f569b21f9025b76470a72dc69457813d2b76e98dc0cd01a53ae00000000",
)
# Ensure that if there is a non-multisig input, then a multisig output
# will not be identified as a change output.
def test_multisig_mismatch_inputs_single(client: Client):
# Ensure that if there is a non-multisig input, then a multisig output
# will not be identified as a change output.
# m/84'/1'/0' for "alcohol woman abuse ..." seed.
node_int = deserialize(
"Vpub5kFDCYhiYuAzjk7TBQPNFffbexHF7iAd8AVVgHQKUany7e6NQvthgk86d7DfH57DY2dwBK4PyVTDDaS1r2gjkdyJyUYGoV9qNujGSrW9Dpe"
@ -709,25 +726,26 @@ def test_multisig_mismatch_inputs_single(client: Client):
)
inp1 = messages.TxInputType(
# tb1qkvwu9g3k2pdxewfqr7syz89r3gj557l3uuf9r9
address_n=parse_path("m/84h/1h/0h/0/0"),
amount=12_300_000,
prev_hash=TXHASH_091446,
prev_index=0,
amount=100_000,
prev_hash=TXHASH_1c022d,
prev_index=1,
script_type=messages.InputScriptType.SPENDWITNESS,
)
inp2 = messages.TxInputType(
address_n=parse_path("m/84h/1h/0h/0/0"),
prev_hash=TXHASH_a345b8,
prev_index=0,
prev_hash=TXHASH_1c022d,
prev_index=2,
script_type=messages.InputScriptType.SPENDWITNESS,
multisig=multisig_in,
amount=100,
amount=100_000,
)
out1 = messages.TxOutputType(
address="2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp",
amount=5_000_000,
amount=50_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -735,7 +753,7 @@ def test_multisig_mismatch_inputs_single(client: Client):
address_n=parse_path("m/84h/1h/0h/1/0"),
script_type=messages.OutputScriptType.PAYTOWITNESS,
multisig=multisig_out,
amount=12_300_000 + 100 - 5_000_000 - 10_000,
amount=100_000 + 100_000 - 50_000 - 10_000,
)
with client:
@ -750,14 +768,17 @@ def test_multisig_mismatch_inputs_single(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_091446),
request_input(0, TXHASH_091446),
request_output(0, TXHASH_091446),
request_output(1, TXHASH_091446),
request_meta(TXHASH_1c022d),
request_input(0, TXHASH_1c022d),
request_output(0, TXHASH_1c022d),
request_output(1, TXHASH_1c022d),
request_output(2, TXHASH_1c022d),
request_input(1),
request_meta(TXHASH_a345b8),
request_input(0, TXHASH_a345b8),
request_output(0, TXHASH_a345b8),
request_meta(TXHASH_1c022d),
request_input(0, TXHASH_1c022d),
request_output(0, TXHASH_1c022d),
request_output(1, TXHASH_1c022d),
request_output(2, TXHASH_1c022d),
request_input(0),
request_input(1),
request_output(0),
@ -769,10 +790,11 @@ def test_multisig_mismatch_inputs_single(client: Client):
)
_, serialized_tx = btc.sign_tx(
client, "Testnet", [inp1, inp2], [out1, out2], prev_txes=TX_API
client, "Testnet", [inp1, inp2], [out1, out2], prev_txes=TX_API_TESTNET
)
assert (
serialized_tx.hex()
== "010000000001028a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff48e37c58a68ab4899400dc0950a661817ea7bac3e4556044c685b35957b845a30000000000ffffffff02404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987f43c6f0000000000220020733ecfbbe7e47a74dde6c7645b60cdf627e90a585cde7733bc7fdaf9fe30b37402473044022037dc98b16be542a6e3e1ab32007a74192c43f2498170cc5e1dffb6847e3663e402206715102d0eb59e6461a97c78eb40a8679a04a8921fdafef25f0d3d16cc65de39012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f8620300473044022070a24bcb00041cbed465f1f546bc59e1e353a6e182393932d5ba96e20bc32ef702202ddc76a97c01465692d5b0a0a61d653f64b9ea833af1810022110fd4d505ff950147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae00000000"
assert_tx_matches(
serialized_tx,
hash_link="https://tbtc1.trezor.io/api/tx/d3b2ec2a540363ffbb231c6cf0a311ec84c8404c7ec2819c146dfb90a69c593a",
tx_hex="01000000000102b5da4da56cabc57097abb376af10e843c3f2c8427c612acfc88baaa39d2d021c0100000000ffffffffb5da4da56cabc57097abb376af10e843c3f2c8427c612acfc88baaa39d2d021c0200000000ffffffff0250c300000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987e022020000000000220020733ecfbbe7e47a74dde6c7645b60cdf627e90a585cde7733bc7fdaf9fe30b3740247304402207076385a688713bd380d7e01858254161c11981a0f549098c77ab8afbaec38b40220713854182527e3f32e6910b7a4c5154969039e665bdec0ab4e12e2d3a9543e65012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86203004730440220096cf4bff1590e005ff86cf10462b320b9b0eccfc45b8ea4badd276ad9cc536702207502c0dc037f64c58fde74925b4593dcd842d76085538083b6450bf9e73384420147512103505f0d82bbdd251511591b34f36ad5eea37d3220c2b81a1189084431ddb3aa3d2103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86252ae00000000",
)

View File

@ -22,7 +22,7 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import H_, parse_path
from ...tx_cache import TxCache
from ..signtx import request_finished, request_input, request_meta, request_output
from .signtx import request_finished, request_input, request_meta, request_output
B = messages.ButtonRequestType
TX_API = TxCache("Testnet")
@ -366,20 +366,27 @@ def test_attack_script_type(client: Client):
"tb1pllllllllllllllllllllllllllllllllllllllllllllallllscqgl4zhn",
),
)
def test_send_invalid_address(client, address):
def test_send_invalid_address(client: Client, address):
inp1 = messages.TxInputType(
# tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c
address_n=parse_path("86'/1'/0'/1/0"),
amount=4600,
address_n=parse_path("m/86h/1h/0h/1/0"),
amount=4_600,
prev_hash=TXHASH_7956f1,
prev_index=1,
script_type=messages.InputScriptType.SPENDTAPROOT,
)
out1 = messages.TxOutputType(
address=address,
amount=4450,
amount=4_450,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
with pytest.raises(TrezorFailure):
with client, pytest.raises(TrezorFailure):
client.set_expected_responses(
[
request_input(0),
request_output(0),
messages.Failure,
]
)
btc.sign_tx(client, "Testnet", [inp1], [out1], prev_txes=TX_API)

View File

@ -22,7 +22,7 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...tx_cache import TxCache
from ..signtx import (
from .signtx import (
request_extra_data,
request_finished,
request_input,
@ -40,17 +40,17 @@ TXHASH_e38206 = bytes.fromhex(
"e3820602226974b1dd87b7113cc8aea8c63e5ae29293991e7bfa80c126930368"
)
TXHASH_v1 = bytes.fromhex(
"fb91ae741b120125b6d5c33a62f50a201b6ffd1cdc470c378c1ac8c654808246"
FAKE_TXHASH_v1 = bytes.fromhex(
"8d800c64061967e480efbf3b19139d9136e586e9e3aaca65b9791e13cde4051b"
)
TXHASH_v2 = bytes.fromhex(
"03d30e19959d46d62ac796b8b23497b8c5700c59c4c75e1dbce7b8de49e242ef"
FAKE_TXHASH_v2 = bytes.fromhex(
"6a9e8a6c36d6e33962b204d5942ddf62ed42f969cbf77f3075e298af926b056e"
)
TXHASH_v3 = bytes.fromhex(
"f9418829d18140815f961c3f968b08700c283b616f3cb0f43413ae89e68ab76c"
FAKE_TXHASH_v3 = bytes.fromhex(
"158640a6a19d771c34596cd1272b00f3ce95efe16dc1cedc496d40260fef0025"
)
TXHASH_v4 = bytes.fromhex(
"5d8de67264b08eecc8e3bee19a11a7f54a2bce1dc4f2a699538e372ae92e9c0f"
FAKE_TXHASH_v4 = bytes.fromhex(
"cb3c1190798dc7909f182ae9ae23e7c473d849ba5b933eb34538b9957fa87975"
)
pytestmark = [pytest.mark.altcoin, pytest.mark.zcash]
@ -169,29 +169,30 @@ def test_version_group_id_missing(client: Client):
def test_spend_old_versions(client: Client):
# inputs are NOT OWNED by this seed
# NOTE: fake input tx used
input_v1 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/0"),
amount=123_000_000,
prev_hash=TXHASH_v1,
prev_hash=FAKE_TXHASH_v1,
prev_index=0,
)
input_v2 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/1"),
amount=49_990_000,
prev_hash=TXHASH_v2,
prev_hash=FAKE_TXHASH_v2,
prev_index=0,
)
input_v3 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/2"),
amount=300_000_000,
prev_hash=TXHASH_v3,
prev_hash=FAKE_TXHASH_v3,
prev_index=1,
)
input_v4 = messages.TxInputType(
address_n=parse_path("m/44h/1h/0h/0/3"),
amount=100_000,
prev_hash=TXHASH_v4,
prev_hash=FAKE_TXHASH_v4,
prev_index=0,
)
@ -221,7 +222,7 @@ def test_spend_old_versions(client: Client):
assert (
serialized_tx.hex()
== "0400008085202f890446828054c6c81a8c370c47dc1cfd6f1b200af5623ac3d5b62501121b74ae91fb000000006b483045022100d40e85efbadd378fc603dc8b11c70774086de631fe5b1418ac2b95a478f86507022072e999d8ddd75a0b33bd2adcc88e7234e6251b9e73c9223e7c59e0d1f8d1ff220121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffffef42e249deb8e7bc1d5ec7c4590c70c5b89734b2b896c72ad6469d95190ed303000000006b483045022100917d96445d64c80f9569cb9ca45c04c9b6d7b0fda6b9fd0b1d311837366c699202202cd6140489cf38b5d97ed271ba28603f4693c2a36113cc6ec423301f077c5a8e01210294e3e5e77e22eea0e4c0d30d89beb4db7f69b4bf1ae709e411d6a06618b8f852ffffffff6cb78ae689ae1334f4b03c6f613b280c70088b963f1c965f814081d1298841f9010000006a473044022058768c74c9b1698070636388d7d2ae8223748f13b0a5f402716e4d49fc5bc5f30220658d1e6095dcfbe66669b4141d23af28c9ed5bae73480889429b41742be85f32012103f5008445568548bd745a3dedccc6048969436bf1a49411f60938ff1938941f14ffffffff0f9c2ee92a378e5399a6f2c41dce2b4af5a7119ae1bee3c8ec8eb06472e68d5d000000006b483045022100e64853d86bed039c4edce4abaf80d41486cd21c63bec79c0308ea05a351663e302206732aa22a5dee7bd7f3cc8268faebe31a08abadb4b7e3a4257509bc7baa052b60121029ad0b9519779c540b34fa8d11d24d14a5475546bfa28c7de50573d22a503ce21ffffffff01d0c7321c000000001976a91490ede9de4bed6e39008375eace793949de9a533288ac00000000000000000000000000000000000000"
== "0400008085202f89041b05e4cd131e79b965caaae3e986e536919d13193bbfef80e4671906640c808d000000006b483045022100cdfe9b6d122fafafd379b6475db67d4db3f79d77a648961a647a73f4a9561a3702201f4838467ac2a9bbbbb1067d24101fc46cbfa403f8c1258ec46d3d3ef00a72fb0121030e669acac1f280d1ddf441cd2ba5e97417bf2689e4bbec86df4f831bf9f7ffd0ffffffff6e056b92af98e275307ff7cb69f942ed62df2d94d504b26239e3d6366c8a9e6a000000006b4830450221009e6523a7c0e2ad691f45f8529ae609117b4441cdbc17b0b3800901cb89118cdd0220746c051a8cd213efcf8da34aea538ec6c31a5e3362733a724f88d7029a07954e01210294e3e5e77e22eea0e4c0d30d89beb4db7f69b4bf1ae709e411d6a06618b8f852ffffffff2500ef0f26406d49dccec16de1ef95cef3002b27d16c59341c779da1a6408615010000006a47304402205bf0e3316d2bcf8e97cb7f1fd8556858bc212c28621b2f6741faee83191abf73022015d56d65f7a5860c464f7540f279b28d7dedbbdbb13f4bc562dff42083d0ed40012103f5008445568548bd745a3dedccc6048969436bf1a49411f60938ff1938941f14ffffffff7579a87f95b93845b33e935bba49d873c4e723aee92a189f90c78d7990113ccb000000006a47304402200740dff2e8dc0ed6d44d0a0104e79bd668387508c93cfde75f1aa1094e63816b02207ecb432fdbf6e05d6b97a489575d62a7ff6e1a885205d33eeac08d9656597e640121029ad0b9519779c540b34fa8d11d24d14a5475546bfa28c7de50573d22a503ce21ffffffff01d0c7321c000000001976a91490ede9de4bed6e39008375eace793949de9a533288ac00000000000000000000000000000000000000"
)

View File

@ -25,12 +25,17 @@ from trezorlib.tools import parse_path
from ..common import EXTERNAL_ENTROPY, MNEMONIC12, get_test_address
from ..tx_cache import TxCache
from .signtx import request_finished, request_input, request_meta, request_output
from .bitcoin.signtx import (
request_finished,
request_input,
request_meta,
request_output,
)
B = messages.ButtonRequestType
TXHASH_d5f65e = bytes.fromhex(
"d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882"
TXHASH_50f6f1 = bytes.fromhex(
"50f6f1209ca92d7359564be803cb2c932cde7d370f7cee50fd1fad6790f6206d"
)
PIN4 = "1234"
@ -346,19 +351,18 @@ def test_verify_message_t2(client: Client):
def test_signtx(client: Client):
# tx: d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882
# input 0: 0.0039 BTC
# input tx: 50f6f1209ca92d7359564be803cb2c932cde7d370f7cee50fd1fad6790f6206d
inp1 = messages.TxInputType(
address_n=parse_path("m/44h/0h/0h/0/0"),
amount=390_000,
prev_hash=TXHASH_d5f65e,
prev_index=0,
address_n=parse_path("m/44h/0h/0h/0/5"), # 1GA9u9TfCG7SWmKCveBumdA1TZpfom6ZdJ
amount=50_000,
prev_hash=TXHASH_50f6f1,
prev_index=1,
)
out1 = messages.TxOutputType(
address="1MJ2tj2ThBE62zXbBYA5ZaN3fdve5CPAz1",
amount=390_000 - 10_000,
amount=50_000 - 10_000,
script_type=messages.OutputScriptType.PAYTOADDRESS,
)
@ -374,10 +378,10 @@ def test_signtx(client: Client):
messages.ButtonRequest(code=B.ConfirmOutput),
messages.ButtonRequest(code=B.SignTx),
request_input(0),
request_meta(TXHASH_d5f65e),
request_input(0, TXHASH_d5f65e),
request_input(1, TXHASH_d5f65e),
request_output(0, TXHASH_d5f65e),
request_meta(TXHASH_50f6f1),
request_input(0, TXHASH_50f6f1),
request_output(0, TXHASH_50f6f1),
request_output(1, TXHASH_50f6f1),
request_input(0),
request_output(0),
request_output(0),

View File

@ -2,11 +2,11 @@
"bin_outputs": [
{
"amount": 24000,
"script_pubkey": "76a91400741952f6a6eab5394f366db5cc5a54b0c2429f88ac"
"script_pubkey": "a914756c06d7e77de3950a6124f026d8e1a2464b3ecf87"
},
{
"amount": 24000,
"script_pubkey": "a914756c06d7e77de3950a6124f026d8e1a2464b3ecf87"
"script_pubkey": "a914dfc8c2dda26f7151ed7df8aeeca24089e6410fdd87"
}
],
"inputs": [

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 48490,
"script_pubkey": "a91411c1566006ab2b8e8c8d981055b090ecdefa977187"
"script_pubkey": "a91485bf22b8248850a3a4c2e2d74361980d5335804a87"
}
],
"inputs": [

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 390000,
"script_pubkey": "a9147f844bdb0b8fd54b64e3d16c85dc1170f1ff97c187"
}
],
"inputs": [
{
"prev_hash": "54aa5680dea781f45ebb536e53dffc526d68c0eb5c00547e323b2c32382dfba3",
"prev_index": 1,
"script_sig": "4830450221009e020b0390ccad533b73b552f8a99a9d827212c558e4f755503674d07c92ad4502202d606f7316990e0461c51d4add25054f19c697aa3e3c2ced4d568f0b2c57e62f0121023230848585885f63803a0a8aecdd6538792d5c539215c91698e315bf0253b43d",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 1995344,
"script_pubkey": "76a9145acea1f2118ed4dc146d5eaa85f8fcfb697230d688ac"
}
],
"inputs": [
{
"prev_hash": "8d566ad80d5f1d3887d3acddb35b980641919e6efa7c3a3a78413e56f95ea516",
"prev_index": 1,
"script_sig": "483045022100860b4c43649f86ee603c13791646af4736c50b532e1fc905c53d73ddd3754f3902206a301113f27b0d10622b333eb914751eed8af7f5534e0e4ee01176668674f259412102e227a30cc2aa732090af6667086b1665cbe6dbde71aab95ada5a518a4c2fdb6e",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 1252382934,
"script_pubkey": "76a9140cb60a52559620e5de9a297612d49f55f7fd14ea88ac"
"script_pubkey": "76a914add8fe074376dab3b46cdc59bc827b61bc2a8c4988ac"
},
{
"amount": 0,

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 1252382934,
"script_pubkey": "a914aff5582b588169b3298442e34c340f6b5bc5249387"
},
{
"amount": 0,
"script_pubkey": "6a24aa21a9eddb3ac2bba12721c8db157ba6b522196093d3a27a8083591a2b785a230a1d254f"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "03b4e407005a2d4e4f4d50212068747470733a2f2f6769746875622e636f6d2f6a6f7368756179616275742f7a2d6e6f6d70",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 1252382934,
"script_pubkey": "a9144a4957845e51adfd83528d2af4c2357c3b9cdb5e87"
},
{
"amount": 0,
"script_pubkey": "6a24aa21a9eddb3ac2bba12721c8db157ba6b522196093d3a27a8083591a2b785a230a1d254f"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "03b4e407005a2d4e4f4d50212068747470733a2f2f6769746875622e636f6d2f6a6f7368756179616275742f7a2d6e6f6d70",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 58456,
"script_pubkey": "a914aee37ad448e17438cabfee1756f2a08e33ed3ce887"
"script_pubkey": "76a9147c5edda9b293db2c8894b9d81efd77764910c44588ac"
},
{
"amount": 18752841785,

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 38448607,
"script_pubkey": "76a914b79bbff2766286a99129642d70912c6a4223c62b88ac"
"script_pubkey": "76a914eefe66fb81953676ef3eceae11334be7836530ab88ac"
}
],
"inputs": [

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 1252382934,
"script_pubkey": "a9140cd03822b799a452c106d1b3771844a067b17f1187"
},
{
"amount": 0,
"script_pubkey": "6a24aa21a9eddb3ac2bba12721c8db157ba6b522196093d3a27a8083591a2b785a230a1d254f"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "03b4e407005a2d4e4f4d50212068747470733a2f2f6769746875622e636f6d2f6a6f7368756179616275742f7a2d6e6f6d70",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 7086,
"script_pubkey": "0014f6740e521befc61400662d9489a5f744883ca681"
},
{
"amount": 20120,
"script_pubkey": "001404278d66e85ad1073d6f7a8eeee8b96ca633e6e8"
}
],
"inputs": [
{
"prev_hash": "939cda2b4b609be5f5772dea5885431e18a61834bcbe5e0f895d6dfa05d2cc70",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 126491535,
"script_pubkey": "76a91495783804d28e528fbc4b48c7700471e6845804eb88ac"
},
{
"amount": 20000,
"script_pubkey": "a914fb0670971091da8248b5c900c6515727a20e866287"
}
],
"inputs": [
{
"prev_hash": "55d079ca797fee81416b71b373abedd8722e33c9f73177be0166b5d5fdac478b",
"prev_index": 0,
"script_sig": "483045022100d82e57d4d11d3b811d07f2fa4ded2fb8a3b7bb1d3e9f293433de5c0d1093c3bd02206704ccd2ff437e2f7716b5e9f2502a9cbb41f1245a18b2b10296980f1ae38253012102be9919a5ba373b1af58ad757db19e7c836116bb8138e0c6d99599e4db96568f4",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 9890000,
"script_pubkey": "76a9146970a648bb72eedba08c2d72eb47b8b704bf5ae388ac"
},
{
"amount": 100000,
"script_pubkey": "a91488376dc8232dbafd959cba5b370be6629506cb1c87"
}
],
"inputs": [
{
"prev_hash": "1f5512d3b04ce460e0855aa0e58a3e58656daea3f1abe3f8e7b9bf4bcf5b65f1",
"prev_index": 0,
"script_sig": "4730440220644d26019da3fdeed5258ee625e96873c87a5ec1e36eac25447482b5a7fceacf02202b0ccf16e9907f7f18c38033452e0ca70e233f139dc23893f90a06228a7fd147012103a641ba46e07563a0231090a208a222a8e750bf119fb49f4086b0526dbdfb50b2",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,24 +0,0 @@
{
"bin_outputs": [
{
"amount": 390000,
"script_pubkey": "76a91424a56db43cf6f2b02e838ea493f95d8d6047423188ac"
}
],
"inputs": [
{
"prev_hash": "c16a03f1cf8f99f6b5297ab614586cacec784c2d259af245909dedb0e39eddcf",
"prev_index": 1,
"script_sig": "483045022072ba61305fe7cb542d142b8f3299a7b10f9ea61f6ffaab5dca8142601869d53c0221009a8027ed79eb3b9bc13577ac2853269323434558528c6b6a7e542be46e7e9a820141047a2d177c0f3626fc68c53610b0270fa6156181f46586c679ba6a88b34c6f4874686390b4d92e5769fbb89c8050b984f4ec0b257a0e5c4ff8bd3b035a51709503",
"sequence": 4294967295
},
{
"prev_hash": "1ae39a2f8d59670c8fc61179148a8e61e039d0d9e8ab08610cb69b4a19453eaf",
"prev_index": 1,
"script_sig": "48304502200fd63adc8f6cb34359dc6cca9e5458d7ea50376cbd0a74514880735e6d1b8a4c0221008b6ead7fe5fbdab7319d6dfede3a0bc8e2a7c5b5a9301636d1de4aa31a3ee9b101410486ad608470d796236b003635718dfc07c0cac0cfc3bfc3079e4f491b0426f0676e6643a39198e8e7bdaffb94f4b49ea21baa107ec2e237368872836073668214",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 9426,
"script_pubkey": "0014ece6935b2a5a5b5ff997c87370b16fa10f164410"
},
{
"amount": 309896,
"script_pubkey": "a914dfe58cc93d35fb99e15436f47d3bbfce8203280687"
}
],
"inputs": [
{
"prev_hash": "86a6e02943dcd057cfbe349f2c2274478a3a1be908eb788606a6950e727a0d36",
"prev_index": 0,
"script_sig": "16001495f41f5c0e0ec2c7fe27f0ac4bd59a5632a40b5f",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,23 +0,0 @@
{
"bin_outputs": [
{
"amount": 1000000,
"script_pubkey": "76a914369df3cc0eb7acd7f0e0491a225a2ddad5ce3d4a88ac"
},
{
"amount": 49452200,
"script_pubkey": "76a91452546e612e890e3028ee4b3d8b6333bb6912bfae88ac"
}
],
"inputs": [
{
"prev_hash": "915340ecc7466d287596f1f5b1fa0c1fa78c5b76ede0dff978fd6a1ca31eee24",
"prev_index": 0,
"script_sig": "483045022100c48a9689e2fc28c354d567390c15b94b86923f3c94b7674a69c20113cc83d16102202d0b12d451a4c28fd6c092bb46bf64e242a0c5898420e59c8d7799261ae449a9012103b3a1b0304d81f5a8366281c9a5516d8b3f1cfe6a720f3bf7a222e3a46a87f2c3",
"sequence": 4294967295
}
],
"lock_time": 0,
"timestamp": 1540315430,
"version": 1
}

View File

@ -1,23 +0,0 @@
{
"bin_outputs": [
{
"amount": 47440250,
"script_pubkey": "76a91483259afffb250f9dee12cd0240956ae5e0f351e088ac"
},
{
"amount": 2000000,
"script_pubkey": "76a914369df3cc0eb7acd7f0e0491a225a2ddad5ce3d4a88ac"
}
],
"inputs": [
{
"prev_hash": "3bf506c81ce84eda891679ddc797d162c17c60b15d6c0ac23be5e31369e7235f",
"prev_index": 1,
"script_sig": "473044022064cc095beb149568f08d4f0b42fea2c41d5864a7c71e5770467c6e07dc03bc5702201ff7f2654ad7a09efca5483b7a7584fffccda9f79b6e9cdb77e407e66e07f71e012103e8d2aee7293fa37e85692b9f41d2fda52787f10cbe486642a0a7543cc478160b",
"sequence": 4294967295
}
],
"lock_time": 0,
"timestamp": 1540315682,
"version": 1
}

View File

@ -3,7 +3,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "a914a62092ecdce9c68f7375c9fbb9e408b373d5e17587"
"script_pubkey": "a914057a0fe3b1b67a3a4c4c7cc620787e1e97a8665787"
},
{
"amount": 371345633,

View File

@ -8,7 +8,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "76a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac"
"script_pubkey": "76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac"
}
],
"expiry": 0,

View File

@ -3,7 +3,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "bc76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac",
"script_pubkey": "76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac",
"decred_tree": 1
}
],

View File

@ -1,21 +0,0 @@
{
"bin_outputs": [
{
"amount": 190000000,
"decred_script_version": 0,
"script_pubkey": "76a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac"
}
],
"expiry": 0,
"inputs": [
{
"decred_tree": 0,
"prev_hash": "e16248f0b39a0a0c0e53d6f2f84c2a944f0d50e017a82701e8e02e46e979d5ed",
"prev_index": 1,
"script_sig": "483045022100bad68486491e449a731513805c129201d7f65601d6f07c97fda0588453c97d22022013e9ef59657ae4f344ac4f0db2b7a23dbfcdb51ebeb85277146ac189e547d3f7012102f5a745afb96077c071e4d19911a5d3d024faa1314ee8688bc6eec39751d0818f",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -3,7 +3,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "76a914d9dabd8d92a93da3244096f6fea327ba441fe6d088ac"
"script_pubkey": "76a914d1f3241c3cf479ae670ab43a6d3162010252aa6488ac"
},
{
"amount": 418687331,

View File

@ -8,7 +8,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "a914711ca153e46a64e78ff51220bc27c88b159072d387"
"script_pubkey": "a914c1672f865eeee9cf9db4803467175cb403e4812d87"
}
],
"expiry": 0,

View File

@ -8,7 +8,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "76a914819d291a2f7fbf770e784bfd78b5ce92c58e95ea88ac"
"script_pubkey": "76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac"
}
],
"expiry": 0,

View File

@ -13,7 +13,7 @@
{
"amount": 200000000,
"decred_script_version": 0,
"script_pubkey": "bb76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac"
"script_pubkey": "76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac"
}
],
"expiry": 0,

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 2500278230,
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "0352bf03062f503253482f04f919855308f8000001c7000000092f7374726174756d2f",
"sequence": 0
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 12300000,
"script_pubkey": "00140099a7ecbd938ed1839f5f6bf6d50933c6db9d5c"
},
{
"amount": 111145789,
"script_pubkey": "a91458b53ea7f832e8f096e896b8713a8c6df0e892ca87"
}
],
"inputs": [
{
"prev_hash": "20912f98ea3ed849042efed0fdac8cb4fc301961c5988cba56902d8ffb61c337",
"prev_index": 0,
"script_sig": "160014d16b8c0680c61fc6ed2e407455715055e41052f5",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 1476278,
"script_pubkey": "a914f33acad613fdb0754ae5cbdb876cd345d7e1108d87"
}
],
"inputs": [
{
"prev_hash": "4123415574c16899b4bb5b691f9b65643dbe566a9b68e4e2e7a8b29c79c83f2b",
"prev_index": 0,
"script_sig": "483045022100ecd289f9acf502057be034c10fcede570f2386dd2bbbdbf05c69cfb6a7455dd9022039c7b415ac71c64a5c722a20cd312ecf447f0d750c8566effdc2258a88a319b701210344e14b3da8f5fe77a5465d0f8fe089d64ed5517d1f1f989edd00f530938a2c22",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,26 @@
{
"bin_outputs": [
{
"amount": 70066,
"script_pubkey": "512051501db4babdd09f3a4a641f1c77c6518d12a0ebd65e1a52ea6d210042a9848e"
},
{
"amount": 100000,
"script_pubkey": "0014b31dc2a236505a6cb9201fa0411ca38a254a7bf1"
},
{
"amount": 100000,
"script_pubkey": "002008b681071cd896cd879102bce735080758ad48ad45a05505939e55f115391991"
}
],
"inputs": [
{
"prev_hash": "e5c8a7dda953ba9aeed6b4879001d48ddd3a994c9b0ab031fb95464397b72fc3",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 9226912,
"script_pubkey": "76a914ed510ecb8a6e8aea8e34b44dfea4f0a30ae2a88788ac"
},
{
"amount": 411102528330,
"script_pubkey": "a914713134226fb873dcef4826ad826bbf1e7b005d1387"
}
],
"inputs": [
{
"prev_hash": "7cc9463285e06dd464357c9775c1666078b04da914270c224640023cbd9d663b",
"prev_index": 0,
"script_sig": "1600149872cad5fa80293ad1f2faf1ceb238830fa01404",
"sequence": 4294967294
}
],
"lock_time": 1442661,
"version": 2
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 1603000,
"script_pubkey": "a914a8655acf68f785125561158b0f4db9b5d004404787"
}
],
"inputs": [
{
"prev_hash": "c9348040bbc2024e12dcb4a0b4806b0398646b91acf314da028c3f03dd0179fc",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 100000,
"script_pubkey": "a9141c6ac16064f481c6557a6d5af6b380e99af3e25087"
},
{
"amount": 1172793,
"script_pubkey": "76a914dfede3c2069fd8e890d09a6cdb36414b284a02ab88ac"
}
],
"inputs": [
{
"prev_hash": "12ac3c4f8573a2613c259eecfabcc9b646c556f5e22b6ae3ec99593a73a2a468",
"prev_index": 1,
"script_sig": "473044022039b32e0440dfaae6abc96aa75c7a7d586996b3f4d345df62a93dc01e80ad13ec02202cfb99f12920fcf9e2f5cf1320795b4bb970af08911e90405c2e81641556f514012102ee4d2da0ea83cfe4e9f3e8b3630e0a5ef8737c9e3c19c09b869c556d74c5090b",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,64 @@
{
"bin_outputs": [
{
"amount": 10000,
"script_pubkey": "76a914833af1a25e63456bf032ba032cc2788122f44d5288ac"
},
{
"amount": 10000,
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914b31dc2a236505a6cb9201fa0411ca38a254a7bf188ac"
},
{
"amount": 10000,
"script_pubkey": "76a914cc8067093f6f843d6d3e22004a4290cd0c0f336b88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914cc8067093f6f843d6d3e22004a4290cd0c0f336b88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914cc8067093f6f843d6d3e22004a4290cd0c0f336b88ac"
},
{
"amount": 10000,
"script_pubkey": "76a914cc8067093f6f843d6d3e22004a4290cd0c0f336b88ac"
},
{
"amount": 49482,
"script_pubkey": "00140000980a5f4432fcd12e20fd67b43cb7bcab12d6"
}
],
"inputs": [
{
"prev_hash": "2161a89815814c3866f5953c1e59a977f7cd5432c731cd5633378cfc3fb87fdd",
"prev_index": 1,
"script_sig": "",
"sequence": 4294967293
},
{
"prev_hash": "d159fd2fcb5854a7c8b275d598765a446f1e2ff510bf077545a404a0c9db65f7",
"prev_index": 1,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 6456,
"script_pubkey": "51203b82b2b2a9185315da6f80da5f06d0440d8a5e1457fa93387c2d919c86ec8786"
}
],
"inputs": [
{
"prev_hash": "afde2d41702948e922150825742cda3294d80d43b8e508865c1e2d648f6d4dae",
"prev_index": 1,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 89581,
"script_pubkey": "76a914c2af6b4fc10292dab1fb02d7c07275807c22dec988ac"
}
],
"inputs": [
{
"prev_hash": "d5df2ab8af03c518a1385ff87b21cf4ca723f43befd274dbd1d4b3f787fb40b0",
"prev_index": 0,
"script_sig": "4730440220114a5e7443a578e3cc00e28f62dfac8cdc231090f7c8390ceba44a4091021d29022026b1e476e453597adfa21d14c3d30e778f95237cb6fda6b3da5b648abfc0f0830121022a3984e6a868429fda4119d82b36bcdfe7c8b9329277594d97910c299eef22a8",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 61093,
"script_pubkey": "a914ed056d7496cc5186ced28118cf7f9d794e40edc487"
}
],
"inputs": [
{
"prev_hash": "b9abfa0d4a28f6f25e1f6c0f974bfc3f7c5a44c4d381b1796e3fbeef51b560a6",
"prev_index": 0,
"script_sig": "483045022100d974e64f4a6eadf73abb3930ddc68af2885f1404bd013157688b5ca2e630da4302207aa5fe3017b31ec8aca0f82982335c78086f3734f218d2382799c727ebb7aeef012103e1f65ed391c21c5c5fc477458b12d11e418590d923f81e34765b5cd774035f91",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 40000,
"script_pubkey": "a9147a55d61848e77ca266e79a39bfc85c580a6426c987"
},
{
"amount": 50000,
"script_pubkey": "0014cd4ee15090b177f15ed0760d85956d93b5990d5f"
}
],
"inputs": [
{
"prev_hash": "b36780ceb86807ca6e7535a6fd418b1b788cb9b227d2c8a26a0de295e523219e",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,18 @@
{
"bin_outputs": [
{
"amount": 1496278,
"script_pubkey": "a914b8f771de8bbdcfee76e0dbf76f1005f2028bf3e787"
}
],
"inputs": [
{
"prev_hash": "95cff04e6b19210c5fb14e7c7c089a94fdef7e657dc93109658065841a69dd38",
"prev_index": 0,
"script_sig": "473044022065bc4c95419d402add2ecf18c2a3381c9c3179e656836e80be375c099afda39102205e4d8ae6b99e3a319d5909a8c6ee9085a3f087e32959b73560b934c56559c37101210344e14b3da8f5fe77a5465d0f8fe089d64ed5517d1f1f989edd00f530938a2c22",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,38 @@
{
"bin_outputs": [
{
"amount": 10000,
"script_pubkey": "0014b31dc2a236505a6cb9201fa0411ca38a254a7bf1"
},
{
"amount": 10000,
"script_pubkey": "0014cc8067093f6f843d6d3e22004a4290cd0c0f336b"
},
{
"amount": 10000,
"script_pubkey": "0014cc8067093f6f843d6d3e22004a4290cd0c0f336b"
},
{
"amount": 10000,
"script_pubkey": "0014cc8067093f6f843d6d3e22004a4290cd0c0f336b"
},
{
"amount": 10000,
"script_pubkey": "0014cc8067093f6f843d6d3e22004a4290cd0c0f336b"
},
{
"amount": 3914216,
"script_pubkey": "0014385a158b52a8bd62532ad5612c24b8aa35c85d9f"
}
],
"inputs": [
{
"prev_hash": "050b1583c495b266a673d00641b727e92005af12b2ed7734fea346167eeb2f07",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 11924164,
"script_pubkey": "76a914b6fc54e2f7c490ba20c686f532bfb02230656dbf88ac"
},
{
"amount": 1610436,
"script_pubkey": "a91463ff81a0110ab929bd1d44befa32b081839bbece87"
}
],
"inputs": [
{
"prev_hash": "fbbf0824193fc4e4bb410276345cc235d530563d0da63ecc8d0fecf483c01e5e",
"prev_index": 1,
"script_sig": "47304402206d881393370f90ed0d74121b840794c62701a3fb98f2b14c45cbdc3869f7085802201a884b10eb1a5af026635d266e9b4514a9639b78d0a25cf7ebc579bca254fc7301210307c080981397c49589f3a8eb61e58d654ed1c2aa2fe049149c9757e4ba2a6ba8",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 100,
"script_pubkey": "002008b681071cd896cd879102bce735080758ad48ad45a05505939e55f115391991"
}
],
"inputs": [
{
"prev_hash": "5a67c3318c1636e192924c30ca849dec057892acdce5931b504dc453248d681e",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 1583125,
"version": 2
}

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 4977040,
"script_pubkey": "0014820d4a343a44e915c36494995c2899abe3741893"
},
{
"amount": 0,
"script_pubkey": "6a24aa21a9ed6edfd0a9431aad16549cf318c0d1d237e6a0a87a6403f177caa74fe05546a98f"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "030c15203a205468697320626c6f636b20776173206d696e65642077697468206120636172626f6e206e6567617469766520706f77657220736f75726365201209687a200909200901b34d00641f8d000000",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,32 +0,0 @@
{
"bin_outputs": [
{
"amount": 0,
"script_pubkey": "6a0d61686f6a20746170726f6f7465"
},
{
"amount": 6700,
"script_pubkey": "00145258d3b3544267f4baaa1e9e68651344c0c55888"
},
{
"amount": 100892,
"script_pubkey": "5120272393e4c1de4919d3771f755c17f711cfaa0d2bdf72d777cd6b4c3fd97c66b9"
}
],
"inputs": [
{
"prev_hash": "40d6800280e1aac808978fb1e85a62bf725de507ea0e3d224239f855efc2771b",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967295
},
{
"prev_hash": "6f1b399a2f0291ed7383c9110a886194126f465279d65b0da20f8ce14cbf5f12",
"prev_index": 1,
"script_sig": "",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,22 @@
{
"bin_outputs": [
{
"amount": 100000,
"script_pubkey": "0014ec871ec494e095efd8c3dcfd8b1fe1529a822d9d"
},
{
"amount": 1072570,
"script_pubkey": "76a914c6f2998ea98ce79b750288124ec2b381a8f1745688ac"
}
],
"inputs": [
{
"prev_hash": "338e2d02e0eaf8848e38925904e51546cf22e58db5b1860c4a0e72b69c56afe5",
"prev_index": 1,
"script_sig": "47304402202b09991327f3734d1a50ff8ce1df2f57d19c97009a65f24a26828ce717f8df6302205d653b0f704cd8162e467b6c465496d2b94d04eeeb51d34ad4679bbf01b8a4a0012103685ff9491738f67ae75d0a0c2b9f8527df44d9add4fa23bd5f3cdb66b8a36876",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,34 @@
{
"bin_outputs": [
{
"amount": 61283,
"script_pubkey": "76a914687d46a330c851c8a0ffcf29fc9422b7ab708b7388ac"
},
{
"amount": 100000,
"script_pubkey": "0020ef38cae54174ac3aba1449c2a7df94d2a5f00734bfaaeb9803727c1e26081637"
},
{
"amount": 100000,
"script_pubkey": "0020f9c50fd24c0b399a9b895341853bd1ccb0bbf08391bb0e3b65150e9819d6e2cb"
},
{
"amount": 100000,
"script_pubkey": "a9143e106cd1f1f0dcdb3e7400bed645ac3a21b406d987"
},
{
"amount": 100000,
"script_pubkey": "a914f5a6e470de83ea66acb496a496593060444eaa7287"
}
],
"inputs": [
{
"prev_hash": "d7d0188c694c9e0e234edc432d777cd9c98d87e5204d356ac11b33bcb54aa776",
"prev_index": 4,
"script_sig": "4830450221009956ef8aa270914d14ad7459eab6c70e2b969f75ad6358814e84c929fd00939c022064e3611017959a2a3908bae2e459560a4c415349c8b228316ed9192de4f21325012102fa58839f1597665847186079737beffca362794c2e784bca9799ba9151ca219a",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 1604000,
"script_pubkey": "00201e8dda334f11171190b3da72e526d441491464769679a319a2f011da5ad312a1"
}
],
"inputs": [
{
"prev_hash": "f41cbedd8becee05a830f418d13aa665125464547db5c7a6cd28f21639fe1228",
"prev_index": 0,
"script_sig": "",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,34 @@
{
"bin_outputs": [
{
"amount": 10000,
"script_pubkey": "76a9140aa0b123ab23de2bc6f04f440142252c67f99fcc88ac"
},
{
"amount": 10000,
"script_pubkey": "76a9140aa0b123ab23de2bc6f04f440142252c67f99fcc88ac"
},
{
"amount": 10000,
"script_pubkey": "76a9140aa0b123ab23de2bc6f04f440142252c67f99fcc88ac"
},
{
"amount": 10000,
"script_pubkey": "76a9140aa0b123ab23de2bc6f04f440142252c67f99fcc88ac"
},
{
"amount": 3873970,
"script_pubkey": "00140d520ee3cb06d7037329f411c695e6fc882ea929"
}
],
"inputs": [
{
"prev_hash": "7afc31334c88840b295eedba9bffce93ba142577867cdde199fec03545e49eb9",
"prev_index": 5,
"script_sig": "",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -0,0 +1,26 @@
{
"bin_outputs": [
{
"amount": 100000,
"script_pubkey": "0014ec871ec494e095efd8c3dcfd8b1fe1529a822d9d"
},
{
"amount": 100000,
"script_pubkey": "0014ec871ec494e095efd8c3dcfd8b1fe1529a822d9d"
},
{
"amount": 861945,
"script_pubkey": "76a914d919c35ad9af848342a17a8e3e1cd44f0489215388ac"
}
],
"inputs": [
{
"prev_hash": "fcb3f5436224900afdba50e9e763d98b920dfed056e552040d99ea9bc03a9d83",
"prev_index": 1,
"script_sig": "483045022100e6af015915447d4b900f5fffd47c569eea6c1f51b35d64771357bed6d20c393402203c567b5992d3d22781f7cebf2b34f69d5c022c4b32c890a19bd1798c5a049b42012103d890fb21cfc62762da26d224fb3384b044ef2773062e9aab9e843f5ce9a248ab",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 2500278230,
"script_pubkey": "76a9140223b1a09138753c9cb0baf95a0a62c82711567a88ac"
}
],
"inputs": [
{
"prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"prev_index": 4294967295,
"script_sig": "0352bf03062f503253482f04f919855308f8000001c7000000092f7374726174756d2f",
"sequence": 0
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,10 +0,0 @@
{
"bin_outputs": [
{
"amount": 4294967297,
"script_pubkey": "4d7920686f76657263726166742069732066756c6c206f662065656c732e"
}
],
"lock_time": 0,
"version": 1
}

View File

@ -1,18 +0,0 @@
{
"bin_outputs": [
{
"amount": 1605000,
"script_pubkey": "0020c5f4a0a4ea7c0392efe0a9670a73264cffa90b19107cd8a8e9750ff93c77fdfb"
}
],
"inputs": [
{
"prev_hash": "9c31922be756c06d02167656465c8dc83bb553bf386a3f478ae65b5c021002be",
"prev_index": 1,
"script_sig": "2200201e8dda334f11171190b3da72e526d441491464769679a319a2f011da5ad312a1",
"sequence": 4294967295
}
],
"lock_time": 0,
"version": 1
}

View File

@ -6,7 +6,7 @@
},
{
"amount": 7289000,
"script_pubkey": "0014d16b8c0680c61fc6ed2e407455715055e41052f5"
"script_pubkey": "0014cc8067093f6f843d6d3e22004a4290cd0c0f336b"
}
],
"inputs": [

View File

@ -1,22 +0,0 @@
{
"bin_outputs": [
{
"amount": 3199834,
"script_pubkey": "a9146794cf0b05c69d8e1942a8f9eeaf59a0847dafda87"
},
{
"amount": 1000000,
"script_pubkey": "a914bbc6a47c8984cf60fd1f0eb753291458b5b42aa687"
}
],
"inputs": [
{
"prev_hash": "0e4194441d68c26d3bbc3646d7ad7bc0435cc7c85ac7f39d22587cb4f6959a69",
"prev_index": 15,
"script_sig": "160014e09c199e2cbcd552f0e58acfb933b3f4f426781f",
"sequence": 4294967294
}
],
"lock_time": 1667005,
"version": 2
}

View File

@ -0,0 +1,28 @@
{
"bin_outputs": [
{
"amount": 100000,
"script_pubkey": "0014ec871ec494e095efd8c3dcfd8b1fe1529a822d9d"
},
{
"amount": 1062199,
"script_pubkey": "76a914d919c35ad9af848342a17a8e3e1cd44f0489215388ac"
}
],
"inputs": [
{
"prev_hash": "0d5d04bffd49287d122f509bebd196b1ecba7cbc5f945c28bf8a26dea66e65de",
"prev_index": 0,
"script_sig": "47304402205622f5398e9f431afce154cece3eea635ac4ff877ff4c8fa6ba86c71db0ae3bb022035faf2bf8cee793cf17ad9b4444d58bf962d14ef3bb8a5a46c4e5b63d0e3eea5012102d83bf667bad85e533790d8c30656dec165a1b662310458be0219b4f2a9d84a30",
"sequence": 4294967293
},
{
"prev_hash": "b36780ceb86807ca6e7535a6fd418b1b788cb9b227d2c8a26a0de295e523219e",
"prev_index": 1,
"script_sig": "48304502210096093de2c32a418c7aa735e841d88aca50819ffcb6591c8854b4a57e07438e82022041e06bb7054fd6222301744ee4a068f38ee80571eef684aa0c62f836b5f78a1c0121027f66fac81a9c518fc9375e62f4d7827682b90b18d0a949cc9d2c23bd144cfcf2",
"sequence": 4294967293
}
],
"lock_time": 0,
"version": 1
}

View File

@ -6,7 +6,7 @@
},
{
"amount": 300000000,
"script_pubkey": "76a914837451e69716a2dac13b6f98ace4d9405f64374488ac"
"script_pubkey": "76a9140ef03659a93ae1f10644e975a253e8108ee8b0a788ac"
}
],
"expiry": 208963,

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 49990000,
"script_pubkey": "76a914e41d2725ac1a94bede7a3fc22bc947868d256b0388ac"
"script_pubkey": "76a9145b157a678a10021243307e4bb58f36375aa80e1088ac"
}
],
"extra_data": "0180f0fa0200000000000000000000000066e62d5418432ebcbeaeeaeeb15e94722f2ce3173cb8b43ee5a0f2bb46f18b2f3605fc432aee5015c2c60572243cb2bf8e77b8ce8813d08f48edaf8791df1353f6ed6c64dcf85d4cd0d4414f8531fc863b9948a6fb9a369a6e7c40906bca6fdb6b1f4f9bdebbd822e4370096643bd7861150d60b8dc12312a10dd6fb44cbb5764c51344af3e86d62325aa74145aac20bfd953ea1cc17bfefb1b8e4d530d9b15885191ecd9fc987d7238695ef7d0d38d2b64ed24186775aa3dfe543719b0b7e14bfc671ed1164f3bbd9a4e267bde1755b4225ca4633e0eedc61c4e2248a30ed80b24918cb5ec731a6f1bfbe23425028dfb1f850457f11489759eb58de1a06b451fd2582297374f22ae9b1461fc43ba79ac8e627406089abc1f4438d4bd603abce02124acd18e700ea56a4f3f58d00b58382a1927f2fd01ee5cd17207b3b0bfe00420304dc301df522a86848e675de19c66d4bc9759a653d1247a702366bbfc4ba81870b019d7378d397e6641f16c59c1d4b5da05721adea8563cfc79b3d23976548d37364fa88491593486e7877eb12ccf059b7aed248da9466c18d38dd1609163be9390215c7b3f51f82a126ecb8e6d358b413d836a7850f76044bacb04723081749e78b032249746dfb23dd24ed0d8a21185891483271b60de85ef1bf30b22c7c73ca737a0310405169f78ac0781a15b746cf47c97ce741949d31abaf41f3c6500bcb0dfe0f022b133298b4b11f2be2c12e6f0f622259c46eca07dd57df13c9720da8d5253094020c9a6fc4140831e99c57acc7b52cda69170dd58ceb60841c7e826503d0580c227bf438fd2925094b9545d60d048c2b65e7d8895fb2dda28a38a6460b2b8344186e177cc3f8d00277795728caeed3331a11ac4bdceddd77afeabb4d2e6570b7e3a3d7dfd4c645921f4bf2316054dbfe919d25cecda56ee049667a1edb8b4e24fe067de6f90a9a232a0ec2921c445fca7d208e656e3ab439b42dc81c278bd068bebb97ec2732635d88af856198a9ae9aa0e4ac26b0b8110c1c2ed67152ef40694cc565a83e39962a56ada4a355371632cc10b8aa8c2cfb076a6ea704db19bec85ddfec66454f70bd79b395108f8cd0db287d8f60fdb0d901debc5a5d9fffedc7780e22553f7c450fc148ccddb24b889d75a53e705c7604ae8167641a6e0f1e2a62706cf3b97f8c31b58f85cd20dd956bd8249085f5fa17c9f48361146ae92bf5814dc17e3b55a860be4812390fb6c6188e46f52cfdcf8e7124bd13a7a893b3cd938606c62e83e06ee41cc88c1c402dd8680f37bd328aa84771aa1f9507ab8be11409c7b9af1eb7ff56fd3c271f7590cf7369f57c899c190d22bdaed445e0149a53f8c2cf36d4c038b76a57841d583d100701a8eae12339d997d43b2e2f1ee3bfedcb63818f93461eaf60265f2e511075452ac2c93503b455cbbf0f7ade7eb5fe762f58af97e15b90c79793ee7d6b6dc13a84a5ae21066d4f658aa011247eccf4da44a720dcf6a07c48f67c36259189d93fe63e75cf01a5da0ae856c1c92e1aa9ede062e173c204ae9a7de52c2a2f177da8be275b6b06aad158c12e9c561fbd00dfe576637423edfa1ce0089ef924431f97867c94650cd1760dc64b0e03783c24ad786fa1182d883a77f33d615fe515d8ec7960ebb6dc135b65964a8dae67d9f358eef343dbb2d010f143828234fd351bd8cc4f4d5a06be3c0469428d3d17dd99d565a450057ad6782765e0b4116b54c2de545dc7737849ef0d6a1fc07401b7346ce8c3c46e8d34e17221ba9244da866d9dc5a1e89d9ef1a536a925990c40e0d7bff27a7f2c673cd157ce95178107f3db887d5aaef29aed158a7267bc636fe0fd0c1767c5f70b7ac87a7593fbf6201dd0fa2037e35b5d2ea57ebbba1c72148a6b307b72ab0f449e492d0b36ba6a349163b7e2f7570e71bc068de097d3fff3f30eb0014ad4357fcc8eb99a9a144ecf53d85cc1edc100f22429c70679afd4d08e4d0f4b9008a3c7f360d99851308633fa36bffe608c01e008756611d193bd6a07b47453e4cc7b7c499741ae9703c433c87216976c52f4b656090d2b3988ba6ec625c2047e1e1e19a7a0b7e0dbb17af290b23d8d74f55149353425eb6be85e492272669842673bb5e7b91a68c8eaaba9ca8bf84769b82d127f0a555b328e6b2001488d0d9e812656320610f5210e31349ce056d0294e6afda9532aaa1620e55cbf7e2a292ce53a47ea0f35fee219e666f78628d0efd238a8f128e5f0e668f6fcbc5b214c69c0adfa072f3fba8f9d1150473e539e12dceb72615b04e99ff2d68e5491228edbe893f6218a1b0634ac1b5368dddb64d7979a2e07c62422add5c92731d261c83f584333525c2f7294b5d1ad5e68d952e0748228feb9695a6d20acdb26b7ad44c1860a519ce040dc2e154ef0d03c09a55da09094746cd2b8ad04e625090155bb838e1b6941919b38054e75e4dfc9042efed1353d7eaafa0f566ea092d6d2c0075cf5009763ab1e38f6239d54f85b4fcd25726b9aa98f4f1a05b672a7012ed603d0e14bbe8bf2456c630c8e7709799911eb736a48517dabcb3709a2986616c156e8f87244c523dd44314cacb70a74c743a447214c66e2bf862c0ea5270ec9f9e564f6632045ab74a9905fe93a292abe7500",

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 123000000,
"script_pubkey": "76a9149062b916fd17c35adb105b79e6ae78f4d02db1fb88ac"
"script_pubkey": "76a914a579388225827d9f2fe9014add644487808c695d88ac"
},
{
"amount": 744857242,

View File

@ -2,7 +2,7 @@
"bin_outputs": [
{
"amount": 100000,
"script_pubkey": "76a9149b3169e886c51e1fa9e44e3d6d1ab6716e32849c88ac"
"script_pubkey": "76a9145a9452b8db22e7fb606adafc731f5d4b482f9e8d88ac"
},
{
"amount": 729179223,

View File

@ -17,7 +17,7 @@
"T1_bitcoin-test_dash.py::test_send_dash_dip2_input": "4be4f7fbf2e7717d58c35b64c65b1b1c2ef4a285d71461d03bf39ab8b5a8a27c",
"T1_bitcoin-test_decred.py::test_decred_multisig_change": "9b797e632fd598f11c4c0c65df69ac1b796f7d0ed268d31ff29dd62f265369fd",
"T1_bitcoin-test_decred.py::test_send_decred": "24a0435d64914a67a7add95222c53935547d3d7508b2b4ab405f72c6cb0922ab",
"T1_bitcoin-test_decred.py::test_send_decred_change": "8085c3e48a85ded76a2819379d5aa6ff31c954ca9a5ea6ed88aae010c4bdd957",
"T1_bitcoin-test_decred.py::test_send_decred_change": "1156dd99983e8b99180f46806e6301b024c38823d46a1a2be10b17e1f39bfd5b",
"T1_bitcoin-test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDADDRESS-pkh([5-7a80e3db": "9b30c98b35338d933fe992e4a47fb259a54f0f6f204610f63c6e6cbff427dbb9",
"T1_bitcoin-test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDP2SHWITNESS-sh-03d56ac2": "09d1f2688240677ac55f2677b62973ee7fe4ca788e9e139b9f6de5a1a66d6205",
"T1_bitcoin-test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDTAPROOT-tr([5c-22751b2f": "f71944d71edb2531faef0a177c2eda4f88bcb0ef77883db18f655d706759b5b0",
@ -135,9 +135,9 @@
"T1_bitcoin-test_grs.py::test_send_segwit_p2sh_change": "ee2a4d0f3de9f702598947c8e5a20340d96220729360fe97744803ef277b2a6f",
"T1_bitcoin-test_komodo.py::test_one_one_fee_sapling": "799c2884e35c767e505ccb3be9d3a424af3c113bee94f23ae68c50b0adc60d8b",
"T1_bitcoin-test_komodo.py::test_one_one_rewards_claim": "d6ba8441ad5e4bbdb191eef24fd679637e468cf1e7317b290bf89d2588bea214",
"T1_bitcoin-test_multisig.py::test_15_of_15": "2dbca788d09502713288163e5716324d49d8498efb6e6153c01b0a1412c8fc01",
"T1_bitcoin-test_multisig.py::test_2_of_3": "c82e0796639d348fbcf358e9993b01690b3a274ad40200f535298229f5b5d063",
"T1_bitcoin-test_multisig.py::test_attack_change_input": "80d22397742b2cdf0411bc77a8447fc60d45fba5aaafa0dddcf2deb62bd14116",
"T1_bitcoin-test_multisig.py::test_15_of_15": "ba0a7e6d6a6f37bf553130acc7aa2471d9d7d804f1564837f149b3b5ecec0461",
"T1_bitcoin-test_multisig.py::test_2_of_3": "4ece08d5a19590a521e22aae038a492796922f26bb8ba70614211a6ade5bce18",
"T1_bitcoin-test_multisig.py::test_attack_change_input": "f4f75000bfc3af0006a767e9afbc7f3930bc6bad864ca0d31656735d4103bddc",
"T1_bitcoin-test_multisig.py::test_missing_pubkey": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1_bitcoin-test_multisig_change.py::test_external_external": "b31515c4102fe602ed1e951bf67db483ffb8874dacc4b0359e9ef67d16999178",
"T1_bitcoin-test_multisig_change.py::test_external_internal": "ceef2445ab95ec10543e320224b13febef2428d240cb01c58dd7ce878b121997",
@ -182,7 +182,7 @@
"T1_bitcoin-test_nonstandard_paths.py::test_signtx_multisig[paths5-address_index5]": "5c310bb0a73dc35ae1f2910b47ba319893b9039f1ed9762e67e9a97ebf1b6079",
"T1_bitcoin-test_nonstandard_paths.py::test_signtx_multisig[paths6-address_index6]": "5c310bb0a73dc35ae1f2910b47ba319893b9039f1ed9762e67e9a97ebf1b6079",
"T1_bitcoin-test_op_return.py::test_nonzero_opreturn": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1_bitcoin-test_op_return.py::test_opreturn": "c22c9b421b831dec275e473a6833642e3f93e6455fb776d6282f03b8bad4561b",
"T1_bitcoin-test_op_return.py::test_opreturn": "8a1c17c2e9f0b0caaaf7536b800336c84330a36ba34fe883c8efadb4273c2e7a",
"T1_bitcoin-test_op_return.py::test_opreturn_address": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1_bitcoin-test_peercoin.py::test_timestamp_included": "f3454a363ccbf9d8e814a617a4850d0ab6e94e61eb412603b7cb9005e15986ad",
"T1_bitcoin-test_peercoin.py::test_timestamp_missing": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@ -244,19 +244,19 @@
"T1_bitcoin-test_signtx.py::test_testnet_one_two_fee": "6d4d21d4c5f3bf4a480e39286a7a33ff86e74cc6d28ff413779b0d936f6ee28e",
"T1_bitcoin-test_signtx.py::test_two_changes": "3e3318b5e68c1866962479a8106ba0ad9ed6c8660eb6365a101be7040729214f",
"T1_bitcoin-test_signtx.py::test_two_two": "1dc531b298df9930f4003afe2836ac4bbfca8a8084e523de9a26032ff95846b8",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.BITCOIN]": "a202257373a9b58369f0916c3f9361ed10ad4e1119c9e1d3b72d8ca601715e4f",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MICROBITCOIN]": "a59649f571517282ee5ee49fc893670b19233ca7dc35eba0eeda51c2ca238e54",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MILLIBITCOIN]": "3c39a3ba593e3f547001388e395265180729f708a0c98fb21b9300828fdb2f99",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.SATOSHI]": "3c4a141ac64c4b3456ce0625cca425593ba51bfe807355bf35fe8534eea5dbd8",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[None]": "a202257373a9b58369f0916c3f9361ed10ad4e1119c9e1d3b72d8ca601715e4f",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.BITCOIN]": "367fd3c75f30f7224435e3309562d210d9ac6809ce2fae392f7fe75070fda094",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MICROBITCOIN]": "7160b1f30adb583b70e4de20cd418054db32181c74baae0d476f8fa6b669784d",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MILLIBITCOIN]": "8081910bd937c704fb65226dc85e8fc58a7331102aa036a5a97652638a0bde20",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.SATOSHI]": "a565b50e63776aad284c42c71bf53e5844dff12f159cbd00679b97d2fb74fd20",
"T1_bitcoin-test_signtx_amount_unit.py::test_signtx[None]": "367fd3c75f30f7224435e3309562d210d9ac6809ce2fae392f7fe75070fda094",
"T1_bitcoin-test_signtx_invalid_path.py::test_attack_path_segwit": "01e5defbadae9662efd5dc3a042264c78ea03176f9377ca627dd49301063b820",
"T1_bitcoin-test_signtx_invalid_path.py::test_invalid_path_fail": "75e45c0b6039244afae5cb138aeb4eec2c01e71b91a3ce0d73797ca3b04ca94a",
"T1_bitcoin-test_signtx_invalid_path.py::test_invalid_path_pass_forkid": "9c35bfcc194afff453802147f5b4a2d033492e564835be649c3293a62857de59",
"T1_bitcoin-test_signtx_invalid_path.py::test_invalid_path_prompt": "57b20ea95e26ee7f675cbb177b9c781389ef36a02f2815f7939ab83c2d0f8f36",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_inputs": "9081b6a9880a834989120b1858e7a1383e5a330401f3db87d06d4604fd0fe064",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_non_segwit_inputs": "0a06652b3f6f0e80e40f316bb9cd208e78cca076a8400117e6544e6677fd374a",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_inputs": "9081b6a9880a834989120b1858e7a1383e5a330401f3db87d06d4604fd0fe064",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_segwit_inputs": "f223928a079d64069f45b140e62c27863434129887b172b71140215888bfb24b",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_inputs": "5b980d57e7d1707d8802bff0665e0460fe5c594c91d758b05ee59020b72e3941",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_non_segwit_inputs": "704181fd5aa2ff33a9e5a27874187585ef946f7cdf6e690a7316a33921f25602",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_inputs": "5b980d57e7d1707d8802bff0665e0460fe5c594c91d758b05ee59020b72e3941",
"T1_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_segwit_inputs": "704181fd5aa2ff33a9e5a27874187585ef946f7cdf6e690a7316a33921f25602",
"T1_bitcoin-test_signtx_prevhash.py::test_invalid_prev_hash[]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1_bitcoin-test_signtx_prevhash.py::test_invalid_prev_hash[hello world]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"T1_bitcoin-test_signtx_prevhash.py::test_invalid_prev_hash[x]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@ -281,18 +281,18 @@
"T1_bitcoin-test_signtx_replacement.py::test_p2wpkh_op_return_fee_bump": "897291942225c61f9b641c7a1287960e7c21d80ada6c75414399d76edc41054c",
"T1_bitcoin-test_signtx_segwit.py::test_attack_change_input_address": "fb82fd6c801028181ea89cc517c1401ca78d319b1b9d60e19e5b1cc0107a083f",
"T1_bitcoin-test_signtx_segwit.py::test_attack_mixed_inputs": "614206bc232bf0a07846361bd21a2a0520c8384f052ba362d227e17c33013270",
"T1_bitcoin-test_signtx_segwit.py::test_send_multisig_1": "84bfd97300301e61adf2beb6580df4f6a66d5cb79725ac2150bf0559368ea2df",
"T1_bitcoin-test_signtx_segwit.py::test_send_multisig_1": "ef1b4df6ac3e37d1770d2126fb60df2d4c51fcda9181b24d157dbfbc4bf5aa89",
"T1_bitcoin-test_signtx_segwit.py::test_send_p2sh": "3e7fa3df71dd433cfd7d95dd7f2009140c62b030404d1dcc76fb93d864bfad46",
"T1_bitcoin-test_signtx_segwit.py::test_send_p2sh_change": "622a4c2aa2d3601805a873fb99239154827332807405283a1f9d30d961e36b0b",
"T1_bitcoin-test_signtx_segwit.py::test_testnet_segwit_big_amount": "757708d7fcb2add811bd9889d235ba0ea3dca47bbf404dec4d68ccae5cd80b8d",
"T1_bitcoin-test_signtx_segwit_native.py::test_multisig_mismatch_inputs_single": "297b90f2d67335cb228328ff7fa44753ce2d198c243a736907ee4c079e887faf",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_both": "613666de3db14d7f4a3ef4be7db756347cbb335234654e710658298506892718",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_1": "da2cd1ad15187d6a31098b76dc0379ac36c3a6b0522f2ec7f838e9e5c732f9d9",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_2": "6202dc7aece5b6754152e727514f8aa1e025bd0af637ec66d98c73ad60b34280",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_3_change": "8b4669b1b78c8e11d6779f7727a95b4a9669d6d3cf694dc57c2286852429fc12",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_4_change": "8b4669b1b78c8e11d6779f7727a95b4a9669d6d3cf694dc57c2286852429fc12",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_native": "a202257373a9b58369f0916c3f9361ed10ad4e1119c9e1d3b72d8ca601715e4f",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_native_change": "ea76212dbc6a50e7acc86092e36538bbdc9b69f78625bf010dcf3f80a5396322",
"T1_bitcoin-test_signtx_segwit_native.py::test_multisig_mismatch_inputs_single": "5d60efa3669af08b35690141f1fbdeb4ce8904d6dbc550262046f27c7881c5b6",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_both": "e52219c8f2975757aae7bf346c60cf5e2ca14fe94ee7fc47a998bf08b6f66532",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_1": "8ffc5c4bcef1b51635cace2cb17654fc7673130fa042cd9dae609329a15a86f9",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_2": "5a21305ab43d290d59d7426c0d575b41d620c07657d23cecf85c056fddf59088",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_3_change": "1c672667742c4501048d0bb5f75042d092e9cbdc63841990e870c49a4f1c582e",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_multisig_4_change": "1c672667742c4501048d0bb5f75042d092e9cbdc63841990e870c49a4f1c582e",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_native": "367fd3c75f30f7224435e3309562d210d9ac6809ce2fae392f7fe75070fda094",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_native_change": "5184dbffd919a2fd9844a693a49a51cb2f939c7e6fc697086d0744937e7cee04",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_p2sh": "1179ebbe996d4ecb8f4feffee729013fa51b69c2df3dede5348c399145ea5f69",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_p2sh_change": "62853b14987405610260944666186026073949bd77778c71df8126f4d4748cd0",
"T1_bitcoin-test_signtx_segwit_native.py::test_send_to_taproot": "c1611998c9d82dd50b470020c5b1407da0af05f83cab6b85edaa12cf09f92095",
@ -571,7 +571,7 @@
"T1_test_protection_levels.py::test_recovery_device": "9bcc413cf3e44af03f2dbb038c4df43bf503805447b71dd5713ab34335f9341b",
"T1_test_protection_levels.py::test_reset_device": "b76ab8da407423d61c605a6c1a5851885ea0aa0fe81b23a7bdb6f9f39492aed0",
"T1_test_protection_levels.py::test_sign_message": "c0ffb0307822ff7327b23e0e7db6a9396cacca93880afe8960d1b0469978a49d",
"T1_test_protection_levels.py::test_signtx": "5a4ca520e896a1c2388706913f2854c88287803dff0b289a8d667ca35471002e",
"T1_test_protection_levels.py::test_signtx": "89e63404e7f65e0f019b8ea024c770f311676b94ae54cd8886e34e976648a0de",
"T1_test_protection_levels.py::test_unlocked": "4c32aa18ecc83cd6c642784ff825246e09ed8bc4b17f23a6127dac7c8b36bccf",
"T1_test_protection_levels.py::test_verify_message_t1": "d4f8be1019f13604e2ceec12e65a0eccc8825ed07072479b355dd30e2ea83219",
"T1_test_protection_levels.py::test_wipe_device": "71f454265675d5884e5419569ea85cc5fcb579de2dae23630fc3c9877b7e00be",
@ -623,7 +623,7 @@
"TT_bitcoin-test_decred.py::test_decred_multisig_change": "2df75d68bbce95a07f6b3cb5717d15bb4826923f8ec6b30919eb3aab0eb22368",
"TT_bitcoin-test_decred.py::test_purchase_ticket_decred": "177228072dd801153d7352d38f5e88999c63431a04d7af6a55b3b1643754d83a",
"TT_bitcoin-test_decred.py::test_send_decred": "672aa6c17b1b59abc497e83fda716c38d2a4f37107a731e40eba7d8a3a020ce4",
"TT_bitcoin-test_decred.py::test_send_decred_change": "c97e701fc4d8f92bb1384b1a7d1440a0c44285589ab63c7fbb86a3bd1cfd9d4e",
"TT_bitcoin-test_decred.py::test_send_decred_change": "dbc8e309533e92be0098b6f25b8545611d8b6d28a9a2c46b0d71dfa004750b3b",
"TT_bitcoin-test_decred.py::test_spend_from_stake_generation_and_revocation_decred": "a8a1451c9ab4dea8228665b6e008a4aa806007898b1b45ab0ef47df33501c705",
"TT_bitcoin-test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDADDRESS-pkh([5-7a80e3db": "24290396b20f26b49204a5551676d6f3c831009e30582d92d5b44fcc3c12fdb7",
"TT_bitcoin-test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDP2SHWITNESS-sh-03d56ac2": "8977c539f5680a5196ad0a4c6e16c44ca1bbdb79235dbf97e33aad8d47fe5d0c",
@ -758,9 +758,9 @@
"TT_bitcoin-test_grs.py::test_send_segwit_p2sh_change": "08251e3b7e509264dbd89a5ded2deba51544d0fcfce1dc7466b553b73298d423",
"TT_bitcoin-test_komodo.py::test_one_one_fee_sapling": "6286409ed3e62a896c101112f6d1c59559dde677331d08f55ed7d2d43e6dd3b9",
"TT_bitcoin-test_komodo.py::test_one_one_rewards_claim": "b3c056df25d639927faaf16dc18c281c1a36b790ea4e77f954f681fb27d3fa1a",
"TT_bitcoin-test_multisig.py::test_15_of_15": "a935a45dc2f7cbcacbd8d5331f11ed3d79c9a2e90694f71cd0b1192e63d9b886",
"TT_bitcoin-test_multisig.py::test_2_of_3": "1054ef77e83e09409d53b7de1298f0b9b3e2a74475d8d14ec56a43795a06a49c",
"TT_bitcoin-test_multisig.py::test_attack_change_input": "72c8fb344eacd11df86bca62d7aa2566c192b8d0c0ca2ec828c6da443a7f2d2e",
"TT_bitcoin-test_multisig.py::test_15_of_15": "230fd7974beb81c3824cb89f373336be80bfc62954220e63f0321e13d57ae8db",
"TT_bitcoin-test_multisig.py::test_2_of_3": "49fea8705e96436830613412daad4f87f5b940dc4674aec23e0fd013a81afc68",
"TT_bitcoin-test_multisig.py::test_attack_change_input": "4c689fde3fcfa29d34d0889e995f0a5b7c784d6eb5d814dd51aa0624a179e2ac",
"TT_bitcoin-test_multisig.py::test_missing_pubkey": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_multisig_change.py::test_external_external": "e8a36ea9a3abeca8d7ac862f384c6ad49929b00e8c291ef49807d6b0c7798c5e",
"TT_bitcoin-test_multisig_change.py::test_external_internal": "f6397edb70e13528fb2821b9097f72300bc76460deb32649b5bff9f76707d5b3",
@ -805,7 +805,7 @@
"TT_bitcoin-test_nonstandard_paths.py::test_signtx_multisig[paths5-address_index5]": "8a444c8c07335eed4cc8d6fa2f20d172b086102e339445856472dae23b4ac396",
"TT_bitcoin-test_nonstandard_paths.py::test_signtx_multisig[paths6-address_index6]": "8a444c8c07335eed4cc8d6fa2f20d172b086102e339445856472dae23b4ac396",
"TT_bitcoin-test_op_return.py::test_nonzero_opreturn": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_op_return.py::test_opreturn": "592e849159d5e02fed1c353030089106213951876221bd1d67e12b6ac8c3d077",
"TT_bitcoin-test_op_return.py::test_opreturn": "8a937e46437786346ebca907a41759caff8cbcf5d28979432347e1c004e9a0f9",
"TT_bitcoin-test_op_return.py::test_opreturn_address": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_peercoin.py::test_timestamp_included": "0e76606dba98b8389ef587f48c2ce65b66457d9b206eaecdda56a4e115e0c829",
"TT_bitcoin-test_peercoin.py::test_timestamp_missing": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
@ -879,30 +879,30 @@
"TT_bitcoin-test_signtx.py::test_testnet_one_two_fee": "72b96c639ac76ecccbe5d710a1c84eba6711879c329952b18ffab385ca79bafd",
"TT_bitcoin-test_signtx.py::test_two_changes": "6b88a8a56b117e420a4aa8f89314c2b3ced13d1d7ac5495ea23c41f5e6b150c6",
"TT_bitcoin-test_signtx.py::test_two_two": "43f201ab6186a8c6329d97b8cf869e56377313d16f4b03eec54f263543c68139",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.BITCOIN]": "9124a24c38e752d27fad8a1acd74f5a23943844ea6cc72d76c32e0484270c945",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MICROBITCOIN]": "e043bbbfc173382bea1021b5aa9842fc4064b2c707b6dc405af68a856ecd5499",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MILLIBITCOIN]": "5da50579f1b8508af311d9ea6285c3deff6936403bebb72bc4575d5dcfce9cf4",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.SATOSHI]": "229b89f8bae1ccda224b804a7537541d02189e13be92074269532823da798b37",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[None]": "9124a24c38e752d27fad8a1acd74f5a23943844ea6cc72d76c32e0484270c945",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.BITCOIN]": "eabc5aa960d50e47a98583556700b26377f9a9259ad92a3008a6de98d5e31c7a",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MICROBITCOIN]": "4153edebb93b6232793c18faab63d0519572f523ae735e3750feb1965c159006",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.MILLIBITCOIN]": "92f539126515265e33d9c97b946d95d5b43b0b9b423132361d4733e15c0a6c63",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[AmountUnit.SATOSHI]": "b229b175ccd7eea81b7cfc851bb26aa4639fbfa2f58f62754490797f10ce4499",
"TT_bitcoin-test_signtx_amount_unit.py::test_signtx[None]": "eabc5aa960d50e47a98583556700b26377f9a9259ad92a3008a6de98d5e31c7a",
"TT_bitcoin-test_signtx_external.py::test_p2pkh_presigned": "8dd8089941ceb0d82c9425c69d54240f99e3ae7932ef24acd49313d28389b683",
"TT_bitcoin-test_signtx_external.py::test_p2pkh_with_proof": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
"TT_bitcoin-test_signtx_external.py::test_p2tr_external_presigned": "d4855cb0ec8bbb713d3bb27d2b08cf42e2128bae06b2be385f44a107d457ad6d",
"TT_bitcoin-test_signtx_external.py::test_p2tr_with_proof": "d6723e2243bc38231ec4eb9ed63afd39610460c0d859b4c576b12db1f7915d02",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_in_p2sh_presigned": "a5a48f7d133331109339d1dbd417d31f64e58859742263d472cdff8c3ea8e7e1",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_in_p2sh_presigned": "8313bff77e41aef142c3b25818ab58dcc7e9d658d38e2e8fc50629ebbe05869b",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_in_p2sh_with_proof": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_presigned": "4608478b1d61415cf0ec93a0ea4397c35d17a91d4b6d25e9c024b77330e398eb",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_with_false_proof": "ca3bdc82d0ddd668d50635ddbc91019095311e0c165094a89b9ae6eda53abdd6",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_with_proof": "42cd0f5d700519154f417176625282d5054c1068f39dcc61c2c0be6c26c31a89",
"TT_bitcoin-test_signtx_external.py::test_p2wsh_external_presigned": "864fb0b756bef195c9140dc9d1d4878a801c709b880fa38c703ca8438adfedb8",
"TT_bitcoin-test_signtx_external.py::test_p2wpkh_with_proof": "f5f2f9bc3c50908ce41046096586387b0db86796c54cb70216e4fedbb68995c6",
"TT_bitcoin-test_signtx_external.py::test_p2wsh_external_presigned": "cd1a603df8ce086697c290aa63b9d922f8360ee5b34ff0dbe5eec4f9c4dd8636",
"TT_bitcoin-test_signtx_invalid_path.py::test_attack_path_segwit": "3feaa01d47aa9757e9d74f668927fd1445493c367adff94215405eb8e0a2749b",
"TT_bitcoin-test_signtx_invalid_path.py::test_invalid_path_fail": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_signtx_invalid_path.py::test_invalid_path_fail_asap": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_signtx_invalid_path.py::test_invalid_path_pass_forkid": "ef98eb752ec5fa948c952def7599f57a2bc5240b2d6b1eec0e02cc9be5c3040f",
"TT_bitcoin-test_signtx_invalid_path.py::test_invalid_path_prompt": "12e137210397357ed754af0f4618ef03312b3e884930f55727d1b034f969bfd5",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_inputs": "34cbf0075c03f13db8285b0ca9fd3e32dc3380ef95116d873754ec10c9801b99",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_non_segwit_inputs": "6bbb1dc3e786d7ccc05fa62405d979d768b36753d8e4b18159e0bc9638d43596",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_inputs": "34cbf0075c03f13db8285b0ca9fd3e32dc3380ef95116d873754ec10c9801b99",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_segwit_inputs": "75b7f389048ad2f3124a60dd541e62718b38c079cee2aa76dfcb00cf2e31ae69",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_inputs": "77ee4c0c509ca4153fb78cfec0a02efeb738b20d6c9408933b41669e9e66eb55",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_non_segwit_segwit_non_segwit_inputs": "380823ef5cec4ba653e1e2fac2ecd77377654e445950aef4f2fb38da6fc883e1",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_inputs": "77ee4c0c509ca4153fb78cfec0a02efeb738b20d6c9408933b41669e9e66eb55",
"TT_bitcoin-test_signtx_mixed_inputs.py::test_segwit_non_segwit_segwit_inputs": "380823ef5cec4ba653e1e2fac2ecd77377654e445950aef4f2fb38da6fc883e1",
"TT_bitcoin-test_signtx_payreq.py::test_payment_req_wrong_amount": "1d0da9c044d6aa5523f94e91e882f8839457d51097093fc2e5938285341a1949",
"TT_bitcoin-test_signtx_payreq.py::test_payment_req_wrong_mac_purchase": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
"TT_bitcoin-test_signtx_payreq.py::test_payment_req_wrong_mac_refund": "1c100ce4b7c1e47e72428f390de0846c1ff933e9f07894872644a369a9422738",
@ -947,18 +947,18 @@
"TT_bitcoin-test_signtx_replacement.py::test_tx_meld": "1a5221c169069689cd038a1b493932e42f0c740efad52e3c77bb636786af594e",
"TT_bitcoin-test_signtx_segwit.py::test_attack_change_input_address": "d264378d091b56e319ecdf0c35b0b4b83b4200c6c382ad307289584c24df27cc",
"TT_bitcoin-test_signtx_segwit.py::test_attack_mixed_inputs": "8ddd81c70770b094301549b7b410c4503bfc81cd290fa1f9429a9d7e406f91bb",
"TT_bitcoin-test_signtx_segwit.py::test_send_multisig_1": "eedd2ea46992786bbdaabc63dd0a2ccbcc66df6be7de2321ce46fb168160e003",
"TT_bitcoin-test_signtx_segwit.py::test_send_multisig_1": "5caa220ebc0b8d555c32b778dbb8b8366d43907e3cb3d43fbf896eef9448a564",
"TT_bitcoin-test_signtx_segwit.py::test_send_p2sh": "05fa65a1ba3191fba8b4c1b4aa155f679c40182d4494ca42c3dace8f25b003c8",
"TT_bitcoin-test_signtx_segwit.py::test_send_p2sh_change": "b33349d6faed9edd0ba7ad49d43f82385a822b8f86cf9792997bbd3520071c17",
"TT_bitcoin-test_signtx_segwit.py::test_testnet_segwit_big_amount": "d9a499890d529edcbe30cf483b7e9e5fd856ece6f15f1c2a9485cb2678fb8ba3",
"TT_bitcoin-test_signtx_segwit_native.py::test_multisig_mismatch_inputs_single": "6c8ef287c6bf2fad3e2c267c8b8ec13a235ec64a4dbb60b85847dbcfea136a5b",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_both": "a3bf0e7880c3da3018736e38f6730eebd1c29182ad6e257eb222db8e5b3a118a",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_1": "7900c1df5d97b345f573896bca40fdcd1d87ef705ea028afc1109080b1125d53",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_2": "4cce7985b74a8b8d26fbcf65ccc6098fb62514ee92a650f68d906218be9ccd06",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_3_change": "aefa1feb097731590550fb585a99f9f63f951dacea58496ddd62711e7c8886b1",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_4_change": "aefa1feb097731590550fb585a99f9f63f951dacea58496ddd62711e7c8886b1",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_native": "9124a24c38e752d27fad8a1acd74f5a23943844ea6cc72d76c32e0484270c945",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_native_change": "cf1268fac91067b38d28ae1288c14211dd11e993e4e0dec38d8c144871adb1da",
"TT_bitcoin-test_signtx_segwit_native.py::test_multisig_mismatch_inputs_single": "63723f49f77e6ab710091034987d5a1314463bbdbe5b2eee8dfb8e42dcd2d760",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_both": "95764fafb3799b5fb7aa82c6afc99eb15802f614ca51c6d7cda0f1f67a119909",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_1": "3f5b4f47e021a15dbf2f99f3972f8c8c75b76b6c205680e87dbf4ba0d3882821",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_2": "b8e4fa59c711274ea2e487137531060f642a1357878151266402f1663f405db8",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_3_change": "d2f4c02b2125f5a40a7844843980fc0d7a0468beaa3c1cf5c0e05b2e519343c3",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_multisig_4_change": "d2f4c02b2125f5a40a7844843980fc0d7a0468beaa3c1cf5c0e05b2e519343c3",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_native": "eabc5aa960d50e47a98583556700b26377f9a9259ad92a3008a6de98d5e31c7a",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_native_change": "c95378471d7531592438c502fd1ecd750682197cdbba53c6447f4d5f2882779b",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_p2sh": "a61bf07f8f254b6c8386ae5462ea3688b307abce563a61c9c91f5908b0dcaf2a",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_p2sh_change": "8288ac83c0e6d5924780ee3b1278e36063ad6c86a288d0b8abbb52eaaf0cc4e7",
"TT_bitcoin-test_signtx_segwit_native.py::test_send_to_taproot": "9a138b34e18e310617cc7d79cf2efa1c180948d1a4d3647f6de1e48d94a441b8",
@ -1496,7 +1496,7 @@
"TT_test_protection_levels.py::test_passphrase_reporting[True]": "d9e9bdb39d15d6737ed6234f16c36bb7ad95ca54067ff8f10cffccaa3caa96cb",
"TT_test_protection_levels.py::test_ping": "5551c263e8e09c8ae683f4dec3dd9d7ecc05ebbd3f2556604b27479c8f1fbc82",
"TT_test_protection_levels.py::test_sign_message": "045d2faee841a79441683a6fdc912c3c69ecc0289b6c9801580942d47af7f0de",
"TT_test_protection_levels.py::test_signtx": "f13f1687e062bd407dc781ae93ebb6619eee5ea3d37ee031ffdc98d5bd7aea33",
"TT_test_protection_levels.py::test_signtx": "aeb8f3d1b37c8c73916487e45f607813dd87409721fc209739bb167e6d28dc38",
"TT_test_protection_levels.py::test_unlocked": "f2be4c8c13c6a201770966438ffa9bcfe0eb031683920f93a55fa92921a28b51",
"TT_test_protection_levels.py::test_verify_message_t2": "0cf43552a15684fbf506cd56871ca07795f62ec5f57176705aa968c9f97ef3d8",
"TT_test_protection_levels.py::test_wipe_device": "a30d958dda50b06e8bfc1c861c0ff2c0eb4acd0656bdf1dcd6474660882e3cd5",