mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 04:18:10 +00:00
feat(python): add support for Taproot descriptors
This commit is contained in:
parent
2035ff4569
commit
ba0879961c
1
python/.changelog.d/1710.added
Normal file
1
python/.changelog.d/1710.added
Normal file
@ -0,0 +1 @@
|
||||
Support for Taproot descriptors
|
@ -30,6 +30,7 @@ INPUT_SCRIPTS = {
|
||||
"pkh": messages.InputScriptType.SPENDADDRESS,
|
||||
"wpkh": messages.InputScriptType.SPENDWITNESS,
|
||||
"sh-wpkh": messages.InputScriptType.SPENDP2SHWITNESS,
|
||||
"tr": messages.InputScriptType.SPENDTAPROOT,
|
||||
}
|
||||
|
||||
OUTPUT_SCRIPTS = {
|
||||
@ -39,6 +40,7 @@ OUTPUT_SCRIPTS = {
|
||||
"pkh": messages.OutputScriptType.PAYTOADDRESS,
|
||||
"wpkh": messages.OutputScriptType.PAYTOWITNESS,
|
||||
"sh-wpkh": messages.OutputScriptType.PAYTOP2SHWITNESS,
|
||||
"tr": messages.OutputScriptType.PAYTOTAPROOT,
|
||||
}
|
||||
|
||||
DEFAULT_COIN = "Bitcoin"
|
||||
@ -206,6 +208,9 @@ def _get_descriptor(client, coin, account, script_type, show_display):
|
||||
elif script_type == messages.InputScriptType.SPENDWITNESS:
|
||||
acc_type = 84
|
||||
fmt = "wpkh({})"
|
||||
elif script_type == messages.InputScriptType.SPENDTAPROOT:
|
||||
acc_type = 86
|
||||
fmt = "tr({})"
|
||||
else:
|
||||
raise ValueError("Unsupported account type")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user