mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-02 12:52:34 +00:00
22 lines
710 B
Python
22 lines
710 B
Python
from trezor.messages import TezosPublicKey
|
|
from trezor.ui.layouts import show_pubkey
|
|
|
|
from apps.common import paths, seed
|
|
from apps.common.keychain import with_slip44_keychain
|
|
|
|
from . import CURVE, PATTERNS, SLIP44_ID, helpers
|
|
|
|
|
|
@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE)
|
|
async def get_public_key(ctx, msg, keychain):
|
|
await paths.validate_path(ctx, keychain, msg.address_n)
|
|
|
|
node = keychain.derive(msg.address_n)
|
|
pk = seed.remove_ed25519_prefix(node.public_key())
|
|
pk_prefixed = helpers.base58_encode_check(pk, prefix=helpers.TEZOS_PUBLICKEY_PREFIX)
|
|
|
|
if msg.show_display:
|
|
await show_pubkey(ctx, pk_prefixed)
|
|
|
|
return TezosPublicKey(public_key=pk_prefixed)
|