Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit ca989f7

Browse files
committed
Add Segwit address support for GET WALLET PUBLIC KEY (requires app >= 1.1.10 for native)
1 parent 869287a commit ca989f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

btchip/btchip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ def getVerifyPinRemainingAttempts(self):
114114
return e.sw - 0x63c0
115115
raise e
116116

117-
def getWalletPublicKey(self, path, showOnScreen=False):
117+
def getWalletPublicKey(self, path, showOnScreen=False, segwit=False, segwitNative=False):
118118
result = {}
119119
donglePath = parse_bip32_path(path)
120120
if self.needKeyCache:
121121
self.resolvePublicKeysInPath(path)
122-
apdu = [ self.BTCHIP_CLA, self.BTCHIP_INS_GET_WALLET_PUBLIC_KEY, 0x01 if showOnScreen else 0x00, 0x00, len(donglePath) ]
122+
apdu = [ self.BTCHIP_CLA, self.BTCHIP_INS_GET_WALLET_PUBLIC_KEY, 0x01 if showOnScreen else 0x00, 0x02 if segwitNative else 0x01 if segwit else 0x00, len(donglePath) ]
123123
apdu.extend(donglePath)
124124
response = self.dongle.exchange(bytearray(apdu))
125125
offset = 0

0 commit comments

Comments
 (0)