Tezos
Low-level types and encoding
Visit the GoDoc docu or read the source code on Github.
The Tezos package contains type definitions, constants, enums and encodings for elementary types used throughout the Tezos protocol. The main job of this package is to provide conversion functions for binary and text/JSON encoding which are utilized by all higher-level packages:
Typed hashes (e.g. BlockHash, OpHash, etc) and magic bytes for base58 encoded strings
Constants and enums for operations type/status, rights, voting, etc
Address type to represent all known Tezos address formats (tz1, tz2, tz3, KT1, bz1)
Public/private keys for Ed25519, Secp256k1 and P256 curves including support for generating and encrypting private keys
Signature type representing all Tezos signature schemes (edsig, spsig1, p2sig, sig)
Params to represent chain/protocol configuration parameters and perform basic math on cycles and voting periods
Zarith number types for signed (Z) and unsigned (N) numbers used in smart contracts, block headers and operations
Examples
Parsing a Tezos address
Parses/decodes an address and outputs its components. See examples/addr for more.
Generating and encrypting a private key
Creates an Ed25519 key and encrypts it with a password. See examples/key for more.
Signing and verifying an arbitrary message
Uses a private key to sign the digest (blake2b hash) of a message and then verifies the message signature with the corresponding public key. See examples/key for more.
Last updated