1

In the FA2.0 standard the sender and receiver is send as Bytes (vs. send as string for FA1.2).

Expected result: When decoding the addresses (string) to their public key hash representation I would assume that the P2P format is followed: https://tezos.gitlab.io/api/p2p.html#public-key-hash-21-bytes-8-bit-tag. E.g. tz1ij8gUYbMRUXa4xX3mNvKguhaWG9GGbURn would be '00fd41f8dd065c16d8bfe0d6aa932b765f5b23f5c0' (21 Bytes)

Seen result: When checking an existing transaction the bytes are length 22 with a '00' prefix '0000fd41f8dd065c16d8bfe0d6aa932b765f5b23f5c0' (https://better-call.dev/carthagenet/opg/oosHQxzosTdzizkPDvaDYDjjHeRCu4uG3MnfeH6SeceDoZJLNby/contents => rawJSON)

What is the extra byte used for? Should I expect it to always be '00'?

1 Answer 1

5

In the FA2.0 standard the sender and receiver is send as Bytes (vs. send as string for FA1.2).

Both token standards say that sender and receiver are Michelson addresses. Michelson addresses have two allowed representations, as strings (readable representation) and as bytes (optimized representation).

What is the extra byte used for?

The extra byte is used to distinguish implicit accounts from smart contracts.

Should I expect it to always be '00'?

No, it is only '00' for implicit accounts.

For a detailed description of the binary encoding schema of Tezos addresses, you can use the following command:

$ tezos-codec describe alpha.contract binary schema
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.