7
votes
Accepted
base58 prefixes
Base58 encodes characters by appending a prefix, treating the bytes as a big endian number and writing that big endian number in base 58.
Therefore, specific prefixes can pin down the most ...
5
votes
Accepted
How do I base58 encode the chain ID using Python?
Your magicbyte seems to be wrong. If you take the decimal byte values from the original, convert them to hex, then pad it with a leading zero, you get
>>> struct.unpack('>L', b'\x00\x57\...
4
votes
How do I base58 encode the chain ID using Python?
It looks like you are only actually grabbing 2 bytes of data (4 hex chars). I verified this by decoding the result you got, and it only returning two bytes of data for the given magic byte.
Try ...
3
votes
base58 prefixes
Base58 prefixes will always produce a prefixed output for a set length of output. So the input address is 20 bytes + the 3 byte prefix gives a 36 char long address with tz1.
You calculate these ...
3
votes
Which hash function is used when converting an address from raw bytes?
It’s not hashed. You simply need to compute the base58 translation with the right prefix.
Proof that it’s not hashed: this process is reversible.
3
votes
Accepted
How to convert ed25519 bytes to Tezos public key
You can find those bytes at the bottom of this file
https://gitlab.com/tezos/tezos/blob/master/src/lib_crypto/base58.ml
In your case, "\013\015\037\217"
3
votes
Accepted
Decode a Tezos hexadecimal operation
You can use the tezos-codec binary from the latest mainnet-staging branch to parse these bytes. So, signing request are indeed prefixed by the tag 1 + <chain_id> for the block cases. The ...
2
votes
How do I base58 encode the chain ID using Python?
First of all, many thanks! You've helped me with solving the block signature mystery :)
You can use pytezos.encoding package:
from pytezos.encoding import base58_encode
def get_chain_id(self):
...
2
votes
Encoding ed25519 issues
Try pytezos:
>>> from pytezos import Key
>>> public_key = 'edpku976gpuAD2bXyx1XGraeKuCo1gUZ3LAJcHM12W1ecxZwoiu22R'
>>> pytezos.Key.from_public_point(public_key.encode())....
1
vote
Understanding base58check encoding of a Tezos public key
Have a look at this library for Tezos, written in Go. This function in particular generates a new wallet from random bytes (mnemonic and password can both be considered as random bytes) and creates an ...
Only top scored, non community-wiki answers of a minimum length are eligible