Skip to main content
Share Your Experience: Take the 2024 Developer Survey
8 votes

How to hash a Tezos public key

Heres how to do it in python, where the variable pubkey is the bytes array of the public key P2HASH_MAGIC = bytes.fromhex('06a1a4') blake2bhash = blake2b(pubkey, digest_size=20).digest() shabytes = ...
Bo Byrd's user avatar
  • 879
5 votes

How to hash a Tezos public key

Do you have the tezos repo built? If yes, you can run the ocaml CLI with tezos-crypto: $ dune utop src/lib_crypto and then: ocaml# open Tezos_crypto;; ocaml# Ed25519.Public_key.of_b58check_exn ...
Seb Mondet's user avatar
4 votes

How to hash a Tezos public key

In python, using the git version of pytezos: from pytezos.crypto import Key public_key = 'edpkuoK2J2UVbDcSTdJgP85JmDN3gxBCswcgApbtY5d7zHVunwCKNR' hash = Key(public_key).public_key_hash() print(hash)
arvidj's user avatar
  • 2,378
3 votes

why Inject an operation need latest block?

You can use the hash of the last known block head as branch. But it need to be injected within 64 blocks. This is to protect the operation from being executed on an alternative head (fork).
Klassare's user avatar
  • 1,345
2 votes

Operation injected to node, but not added to blockchain | Wallet counter error

TLDR: the first operation you injected in your node is valid but will be never be injected by other nodes/bakers because it has too low fees. It is then stuck in the mempool and make the the next ...
vbot's user avatar
  • 86
1 vote

How to hash a Tezos public key

In NodeJS it is also possible to do it using sotez: import {Key} from 'sotez'; const sotezKey = new Key({ key: 'edpktx799pgw7M4z8551URER52VcENNCSZwE9f9cst4v6h5vCrQmJE' }); await sotezKey.ready; ...
K SS's user avatar
  • 95

Only top scored, non community-wiki answers of a minimum length are eligible