mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-16 02:10:55 +00:00
app.lisk: Add lisk_get_public_key
This commit is contained in:
parent
a2a861a688
commit
a37493a861
@ -1,11 +1,18 @@
|
|||||||
from trezor.wire import register, protobuf_workflow
|
from trezor.wire import register, protobuf_workflow
|
||||||
from trezor.messages.wire_types import \
|
from trezor.messages.wire_types import \
|
||||||
LiskGetAddress
|
LiskGetAddress, LiskGetPublicKey
|
||||||
|
|
||||||
|
|
||||||
def dispatch_LiskGetAddress(*args, **kwargs):
|
def dispatch_LiskGetAddress(*args, **kwargs):
|
||||||
from .get_address import layout_lisk_get_address
|
from .get_address import layout_lisk_get_address
|
||||||
return layout_lisk_get_address(*args, **kwargs)
|
return layout_lisk_get_address(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def dispatch_LiskGetPublicKey(*args, **kwargs):
|
||||||
|
from .get_public_key import lisk_get_public_key
|
||||||
|
return lisk_get_public_key(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def boot():
|
def boot():
|
||||||
|
register(LiskGetPublicKey, protobuf_workflow, dispatch_LiskGetPublicKey)
|
||||||
register(LiskGetAddress, protobuf_workflow, dispatch_LiskGetAddress)
|
register(LiskGetAddress, protobuf_workflow, dispatch_LiskGetAddress)
|
||||||
|
20
src/apps/lisk/get_public_key.py
Normal file
20
src/apps/lisk/get_public_key.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from apps.wallet.get_public_key import _show_pubkey
|
||||||
|
from .helpers import LISK_CURVE
|
||||||
|
|
||||||
|
|
||||||
|
async def lisk_get_public_key(ctx, msg):
|
||||||
|
from trezor.messages.LiskPublicKey import LiskPublicKey
|
||||||
|
from trezor.crypto.curve import ed25519
|
||||||
|
from ..common import seed
|
||||||
|
|
||||||
|
address_n = msg.address_n or ()
|
||||||
|
|
||||||
|
node = await seed.derive_node(ctx, address_n, LISK_CURVE)
|
||||||
|
|
||||||
|
seckey = node.private_key()
|
||||||
|
public_key = ed25519.publickey(seckey)
|
||||||
|
|
||||||
|
if msg.show_display:
|
||||||
|
await _show_pubkey(ctx, public_key)
|
||||||
|
|
||||||
|
return LiskPublicKey(public_key=public_key)
|
Loading…
Reference in New Issue
Block a user