diff --git a/core/src/apps/eos/get_public_key.py b/core/src/apps/eos/get_public_key.py index 9c60e31136..39a68b04cc 100755 --- a/core/src/apps/eos/get_public_key.py +++ b/core/src/apps/eos/get_public_key.py @@ -17,7 +17,7 @@ def _public_key_to_wif(pub_key: bytes) -> str: compressed_pub_key = pub_key else: raise wire.DataError("invalid public key") - return base58_encode("PUB", "K1", compressed_pub_key) + return base58_encode("EOS", "", compressed_pub_key) def _get_public_key(node): diff --git a/core/src/apps/eos/helpers.py b/core/src/apps/eos/helpers.py index 9248e7e38b..0fc6bac9be 100644 --- a/core/src/apps/eos/helpers.py +++ b/core/src/apps/eos/helpers.py @@ -7,9 +7,9 @@ from apps.common import HARDENED def base58_encode(prefix: str, sig_prefix: str, data: bytes) -> str: b58 = base58.encode(data + base58.ripemd160_32(data + sig_prefix.encode())) if sig_prefix: - return prefix + "_" + sig_prefix + "_" + b58 + return prefix + sig_prefix + "_" + b58 else: - return prefix + "_" + b58 + return prefix + b58 def eos_name_to_string(value) -> str: diff --git a/core/src/apps/eos/sign_tx.py b/core/src/apps/eos/sign_tx.py index 9c2b787ac9..f959da6864 100644 --- a/core/src/apps/eos/sign_tx.py +++ b/core/src/apps/eos/sign_tx.py @@ -36,7 +36,7 @@ async def sign_tx(ctx, msg: EosSignTx, keychain): node.private_key(), digest, True, secp256k1.CANONICAL_SIG_EOS ) - return EosSignedTx(signature=base58_encode("SIG", "K1", signature)) + return EosSignedTx(signature=base58_encode("SIG_", "K1", signature)) async def _init(ctx, sha, msg): diff --git a/core/tests/test_apps.eos.get_public_key.py b/core/tests/test_apps.eos.get_public_key.py index e5f5565444..91e4e95403 100755 --- a/core/tests/test_apps.eos.get_public_key.py +++ b/core/tests/test_apps.eos.get_public_key.py @@ -27,10 +27,10 @@ class TestEosGetPublicKey(unittest.TestCase): ] wif_keys = [ - 'PUB_K1_6zpSNY1YoLxNt2VsvJjoDfBueU6xC1M1ERJw1UoekL1NK2aD4t', - 'PUB_K1_62cPUiWnLqbUjiBMxbEU4pm4Hp5X3RGk4KMTadvZNygjZg9L9x', - 'PUB_K1_5dp8aCFoFwrKo6KuUfos1hwMfZGkiZUbaF2CyuD4chyBEdV3mU', - 'PUB_K1_7n7TXwR4Y3DtPt2ji6akhQi5uw4SruuPArvoNJso84vhxKpEz3', + 'EOS6zpSNY1YoLxNt2VsvJjoDfBueU6xC1M1ERJw1UoekL1NHn8KNA', + 'EOS62cPUiWnLqbUjiBMxbEU4pm4Hp5X3RGk4KMTadvZNygjX72yHW', + 'EOS5dp8aCFoFwrKo6KuUfos1hwMfZGkiZUbaF2CyuD4chyBEN2wQK', + 'EOS7n7TXwR4Y3DtPt2ji6akhQi5uw4SruuPArvoNJso84vhwPQt1G', ] for index, path in enumerate(derivation_paths): diff --git a/python/trezorlib/tests/device_tests/test_msg_eos_get_public_key.py b/python/trezorlib/tests/device_tests/test_msg_eos_get_public_key.py index 6ee28667fb..f7ff9f7556 100644 --- a/python/trezorlib/tests/device_tests/test_msg_eos_get_public_key.py +++ b/python/trezorlib/tests/device_tests/test_msg_eos_get_public_key.py @@ -14,7 +14,7 @@ class TestMsgEosGetpublickey(TrezorTest): public_key = get_public_key(self.client, parse_path("m/44'/194'/0'/0/0")) assert ( public_key.wif_public_key - == "PUB_K1_4u6Sfnzj4Sh2pEQnkXyZQJqH3PkKjGByDCbsqqmyq6PtxkQ9TE" + == "EOS4u6Sfnzj4Sh2pEQnkXyZQJqH3PkKjGByDCbsqqmyq6PttM9KyB" ) assert ( public_key.raw_public_key.hex() @@ -23,7 +23,7 @@ class TestMsgEosGetpublickey(TrezorTest): public_key = get_public_key(self.client, parse_path("m/44'/194'/0'/0/1")) assert ( public_key.wif_public_key - == "PUB_K1_5d1VP15RKxT4dSakWu2TFuEgnmaGC2ckfSvQwND7pZC1uLnJzD" + == "EOS5d1VP15RKxT4dSakWu2TFuEgnmaGC2ckfSvQwND7pZC1tXkfLP" ) assert ( public_key.raw_public_key.hex() @@ -32,7 +32,7 @@ class TestMsgEosGetpublickey(TrezorTest): public_key = get_public_key(self.client, parse_path("m/44'/194'/1'/0/0")) assert ( public_key.wif_public_key - == "PUB_K1_7UuNeTf13nfcG85rDB7AHGugZi4C4wJ4ft12QRotqNfxeNPmwo" + == "EOS7UuNeTf13nfcG85rDB7AHGugZi4C4wJ4ft12QRotqNfxdV2NvP" ) assert ( public_key.raw_public_key.hex()