Skip to content

Commit

Permalink
chore(cardano): update voting public key bech32 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmisiak committed Oct 7, 2022
1 parent a559a72 commit cd333a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/apps/cardano/auxiliary_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def _show_governance_registration(
) -> None:
for delegation in parameters.delegations:
encoded_public_key = bech32.encode(
bech32.HRP_JORMUN_PUBLIC_KEY, delegation.voting_public_key
bech32.HRP_GOVERNANCE_PUBLIC_KEY, delegation.voting_public_key
)
await layout.confirm_governance_registration_delegation(
ctx, encoded_public_key, delegation.weight
Expand All @@ -147,7 +147,7 @@ async def _show_governance_registration(
encoded_public_key: str | None = None
if parameters.voting_public_key:
encoded_public_key = bech32.encode(
bech32.HRP_JORMUN_PUBLIC_KEY, parameters.voting_public_key
bech32.HRP_GOVERNANCE_PUBLIC_KEY, parameters.voting_public_key
)

reward_address = addresses.derive_human_readable(
Expand Down
3 changes: 1 addition & 2 deletions core/src/apps/cardano/helpers/bech32.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
HRP_TESTNET_ADDRESS = "addr_test"
HRP_REWARD_ADDRESS = "stake"
HRP_TESTNET_REWARD_ADDRESS = "stake_test"
# Jormungandr public key prefix - https://github.com/input-output-hk/voting-tools-lib/blob/18dae637e80db72444476606ab264b973bcf1a9d/src/Cardano/API/Extended.hs#L226
HRP_JORMUN_PUBLIC_KEY = "ed25519_pk"
HRP_GOVERNANCE_PUBLIC_KEY = "gov_vk"
HRP_SCRIPT_HASH = "script"
HRP_KEY_HASH = "addr_vkh"
HRP_SHARED_KEY_HASH = "addr_shared_vkh"
Expand Down

0 comments on commit cd333a8

Please sign in to comment.