From 3971f4bf13725a2a35f09c607a65ad56832f3c9b Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 7 Mar 2018 14:22:35 +0100 Subject: [PATCH] src/apps/wallet: fix ed25519 pubkey prefix --- src/apps/wallet/get_public_key.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/apps/wallet/get_public_key.py b/src/apps/wallet/get_public_key.py index 34dd69589..1c2fd7963 100644 --- a/src/apps/wallet/get_public_key.py +++ b/src/apps/wallet/get_public_key.py @@ -20,15 +20,18 @@ async def get_public_key(ctx, msg): coin = coins.by_name(coin_name) node_xpub = node.serialize_public(coin.xpub_magic) + pubkey = node.public_key() + if pubkey[0] == 1: + pubkey = b'\x00' + pubkey[1:] node_type = HDNodeType( depth=node.depth(), child_num=node.child_num(), fingerprint=node.fingerprint(), chain_code=node.chain_code(), - public_key=node.public_key()) + public_key=pubkey) if msg.show_display: - await _show_pubkey(ctx, node.public_key()) + await _show_pubkey(ctx, pubkey) return PublicKey(node=node_type, xpub=node_xpub)