Documentation
¶
Index ¶
- Constants
- Variables
- func Base58CheckEncode(b58Prefix Base58CheckPrefix, input []byte) (string, error)
- func ComputeMinimumFee(gasLimit, operationSizeBytes *big.Int) *big.Int
- func VerifyMessage(message string, signature Signature, publicKey crypto.PublicKey) error
- type AccountType
- type Base58CheckPrefix
- type BranchID
- type ContentsTag
- type ContractID
- type ContractIDTag
- type Delegation
- type Operation
- type OperationContents
- type OperationHash
- type Origination
- type PrivateKey
- type PrivateKeySeed
- type PubKeyHashTag
- type PubKeyTag
- type PublicKey
- type Revelation
- type Signature
- type SignedOperation
- type Transaction
- type Watermark
Constants ¶
const ( // StorageCostPerByte is the amount of mutez burned per byte of storage used. // Reference: https://gitlab.com/tezos/tezos/blob/f5c50c8ba1670b7a2ee58bed8a7806f00c43340c/src/proto_alpha/lib_protocol/constants_repr.ml#L126 StorageCostPerByte = int64(1000) // NewAccountStorageLimitBytes is the storage needed to create a new // account, either implicit or originated. NewAccountStorageLimitBytes = int64(257) // NewAccountCreationBurn is the cost in mutez burned from an account that signs // an operation creating a new account, either by a transferring to a new implicit address // or by originating a KT1 address. The value is equal to ꜩ0.257 NewAccountCreationBurn = NewAccountStorageLimitBytes * StorageCostPerByte // DefaultMinimalFees is a flat fee that represents the cost of broadcasting // an operation to the network. This flat fee is added to the variable minimal // fees for gas spent and storage used. // Reference: https://gitlab.com/tezos/tezos/blob/f5c50c8ba1670b7a2ee58bed8a7806f00c43340c/src/proto_alpha/lib_client/client_proto_args.ml#L251 DefaultMinimalFees = int64(100) // DefaultMinimalMutezPerGasUnit is the default fee rate in mutez that nodes expect // per unit gas spent by an operation (and all its contents). // Reference: https://gitlab.com/tezos/tezos/blob/f5c50c8ba1670b7a2ee58bed8a7806f00c43340c/src/proto_alpha/lib_client/client_proto_args.ml#L252 DefaultMinimalNanotezPerGasUnit = int64(100) // DefaultMinimalMutezPerByte is the default fee rate in mutez that nodes expect per // byte of a serialized, signed operation -- including header and all contents. // Reference: https://gitlab.com/tezos/tezos/blob/f5c50c8ba1670b7a2ee58bed8a7806f00c43340c/src/proto_alpha/lib_client/client_proto_args.ml#L253 DefaultMinimalNanotezPerByte = int64(1000) // OriginationGasLimit is the gas consumed by a simple origination. // reference: http://tezos.gitlab.io/mainnet/protocols/003_PsddFKi3.html#more-details-on-fees-and-cost-model OriginationGasLimit = int64(10000) // MinimumOriginationSizeBytes is the smallest size in bytes of a serialized, // signed origination operation MinimumOriginationSizeBytes = int64(152) // OriginationMinimumFee is the minimum amount to be paid to a baker for an // operation with one origination OriginationMinimumFee = DefaultMinimalFees + DefaultMinimalNanotezPerByte*MinimumOriginationSizeBytes/int64(1000) + DefaultMinimalNanotezPerGasUnit*OriginationGasLimit/int64(1000) // OriginationStorageLimitBytes is the storage limit required for originations OriginationStorageLimitBytes = NewAccountStorageLimitBytes // OriginationStorageBurn is the amount of mutez burned by an account as a consequence // of signing an origination. OriginationStorageBurn = OriginationStorageLimitBytes * StorageCostPerByte // reference: http://tezos.gitlab.io/mainnet/protocols/003_PsddFKi3.html#more-details-on-fees-and-cost-model MinimumOriginatedAccountTransferGasLimit = int64(10100) MinimumOriginatedAccountTransferSizeBytes = int64(215) // OriginatedAccountTransferMinimumFee is the minimum amount to be paid to a baker // for a transfer from an originated account OriginatedAccountTransferMinimumFee = DefaultMinimalFees + DefaultMinimalNanotezPerByte*MinimumOriginatedAccountTransferSizeBytes/int64(1000) + DefaultMinimalNanotezPerGasUnit*MinimumOriginatedAccountTransferGasLimit/int64(1000) // RevelationGasLimit is the gas consumed by a revelation RevelationGasLimit = int64(10000) // RevelationStorageLimitBytes is the storage limit required for revelations. Note that // it is zero. RevelationStorageLimitBytes = int64(0) // RevelationStorageBurn is the amount burned by an account as a consequence // of signing a revelation. Note that it is zero. RevelationStorageBurn = RevelationStorageLimitBytes * StorageCostPerByte // MinimumTransactionGasLimit is the gas consumed by a transaction with no parameters // that does not result in any Michelson code execution. MinimumTransactionGasLimit = int64(10200) // DelegationGasLimit is the gas consumed by a delegation DelegationGasLimit = int64(10000) // DelegationStorageLimitBytes is the storage limit required for delegations. Note that // it is zero. DelegationStorageLimitBytes = int64(0) // DelegationStorageBurn is the amount burned by an account as a consequence // of signing a delegation. Note that it is zero. DelegationStorageBurn = DelegationStorageLimitBytes * StorageCostPerByte )
Common values for fees
const ( // PubKeyHashLen is the length in bytes of a serialized public key hash PubKeyHashLen = 20 // TaggedPubKeyHashLen is the length in bytes of a serialized, tagged public key hash TaggedPubKeyHashLen = PubKeyHashLen + 1 // PubKeyLenEd25519 is the length in bytes of a serialized Ed25519 public key PubKeyLenEd25519 = 32 // PubKeyLenSecp256k1 is the length in bytes of a serialized Secp256k1 public key PubKeyLenSecp256k1 = 33 // PubKeyLenP256 is the length in bytes of a serialized P256 public key PubKeyLenP256 = 33 // ContractHashLen is the length in bytes of a serialized contract hash ContractHashLen = 20 // ContractIDLen is the length in bytes of a serialized contract ID ContractIDLen = 22 // BlockHashLen is the length in bytes of a serialized block hash BlockHashLen = 32 // OperationHashLen is the length in bytes of a serialized operation hash OperationHashLen = 32 // OperationSignatureLen is the length in bytes of a serialized operation signature OperationSignatureLen = 64 )
Field lengths
Variables ¶
var ( // AllBase58CheckPrefixes is the list of all defined base58check prefixes AllBase58CheckPrefixes = []Base58CheckPrefix{} PrefixBlockHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{1, 52}, }) PrefixOperationHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{5, 116}, }) PrefixOperationListHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{133, 233}, }) PrefixOperationListListHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{29, 159, 109}, }) PrefixProtocolHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{2, 170}, }) PrefixContextHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{79, 199}, }) PrefixEd25519PublicKeyHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 20, prefixBytes: []byte{6, 161, 159}, }) PrefixSecp256k1PublicKeyHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 20, prefixBytes: []byte{6, 161, 161}, }) PrefixP256PublicKeyHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 20, prefixBytes: []byte{6, 161, 164}, }) PrefixCryptoboxPublicKeyHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 16, prefixBytes: []byte{153, 103}, }) PrefixEd25519Seed = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{13, 15, 58, 7}, }) PrefixEd25519PublicKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{13, 15, 37, 217}, }) PrefixSecp256k1SecretKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{17, 162, 224, 201}, }) PrefixP256SecretKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 32, prefixBytes: []byte{16, 81, 238, 189}, }) PrefixEd25519EncryptedSeed = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 56, prefixBytes: []byte{7, 90, 60, 179, 41}, }) PrefixSecp256k1EncryptedSecretKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 56, prefixBytes: []byte{9, 237, 241, 174, 150}, }) PrefixP256EncryptedSecretKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 56, prefixBytes: []byte{9, 48, 57, 115, 171}, }) PrefixSecp256k1PublicKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 33, prefixBytes: []byte{3, 254, 226, 86}, }) PrefixP256PublicKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 33, prefixBytes: []byte{3, 178, 139, 127}, }) PrefixSecp256k1Scalar = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 33, prefixBytes: []byte{38, 248, 136}, }) PrefixSecp256k1Element = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 33, prefixBytes: []byte{5, 92, 0}, }) PrefixEd25519SecretKey = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 64, prefixBytes: []byte{43, 246, 78, 7}, }) PrefixEd25519Signature = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 64, prefixBytes: []byte{9, 245, 205, 134, 18}, }) PrefixSecp256k1Signature = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 64, prefixBytes: []byte{13, 115, 101, 19, 63}, }) PrefixP256Signature = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 64, prefixBytes: []byte{54, 240, 44, 52}, }) PrefixGenericSignature = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 64, prefixBytes: []byte{4, 130, 43}, }) PrefixChainID = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 4, prefixBytes: []byte{87, 82, 0}, }) // PrefixContractHash is referenced from https://gitlab.com/tezos/tezos/blob/master/src/proto_alpha/lib_protocol/contract_hash.ml#L26 PrefixContractHash = registerBase58CheckPrefix(base58CheckPrefixInfo{ payloadLength: 20, prefixBytes: []byte{2, 90, 121}, }) )
Base58Check prefixes
Functions ¶
func Base58CheckEncode ¶
func Base58CheckEncode(b58Prefix Base58CheckPrefix, input []byte) (string, error)
Base58CheckEncode encodes the given binary payload to base58check. Prefix must be a valid tezos base58check prefix.
func ComputeMinimumFee ¶
ComputeMinimumFee returns the minimum fee required according to the constraint:
fees >= (minimal_fees + minimal_nanotez_per_byte * size + minimal_nanotez_per_gas_unit * gas)
Amount returned is in units of mutez. Reference: http://tezos.gitlab.io/mainnet/protocols/003_PsddFKi3.html#baker
Types ¶
type AccountType ¶
type AccountType string
AccountType is either an implicit account or an originated account
const ( // AccountTypeImplicit indicates an implicit account AccountTypeImplicit AccountType = "implicit" // AccountTypeOriginated indicates an originated account AccountTypeOriginated AccountType = "originated" )
type Base58CheckPrefix ¶
type Base58CheckPrefix int
Base58CheckPrefix in an enum that models a base58check prefix used specifically by tezos
func Base58CheckDecode ¶
func Base58CheckDecode(input string) (Base58CheckPrefix, []byte, error)
Base58CheckDecode decodes the given base58check string and returns the payload and prefix. Errors if the given string does not include a tezos prefix, or if the checksum does not match.
func (Base58CheckPrefix) PayloadLength ¶
func (b Base58CheckPrefix) PayloadLength() int
PayloadLength is the number of bytes expected to be in the base58 encoded payload
func (Base58CheckPrefix) PrefixBytes ¶
func (b Base58CheckPrefix) PrefixBytes() []byte
PrefixBytes are the bytes to append as a prefix before base58 encoding
func (Base58CheckPrefix) String ¶
func (b Base58CheckPrefix) String() string
String prints a human regodnizable string representation of this prefix
type BranchID ¶
type BranchID string
BranchID encodes a tezos branch ID in base58check encoding
func (BranchID) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*BranchID) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
type ContentsTag ¶
type ContentsTag byte
ContentsTag captures the possible tag values for operation contents
const ( // ContentsTagRevelation is the tag for revelations ContentsTagRevelation ContentsTag = 7 // ContentsTagTransaction is the tag for transactions ContentsTagTransaction ContentsTag = 8 // ContentsTagOrigination is the tag for originations ContentsTagOrigination ContentsTag = 9 // ContentsTagDelegation is the tag for delegations ContentsTagDelegation ContentsTag = 10 )
type ContractID ¶
type ContractID string
ContractID encodes a tezos contract ID (either implicit or originated) in base58check encoding.
func NewContractIDFromOrigination ¶
func NewContractIDFromOrigination(operationHash OperationHash, nonce uint32) (ContractID, error)
NewContractIDFromOrigination returns the address (contract ID) of an account that would be originated by this operation. Nonce disambiguates which account in the case that multiple accounts would be originated by this same operation. Nonce starts at 0 for the first account. AccountType is "originated."
func NewContractIDFromPublicKey ¶
func NewContractIDFromPublicKey(pubKey PublicKey) (ContractID, error)
NewContractIDFromPublicKey creates a new contract ID from a public key. AccountType is "implicit."
func (ContractID) AccountType ¶
func (c ContractID) AccountType() (AccountType, error)
AccountType returns the account type represented by this contract ID
func (ContractID) EncodePubKeyHash ¶
func (c ContractID) EncodePubKeyHash() ([]byte, error)
EncodePubKeyHash returns the public key hash corresponding to this contract ID. This is only possible for implicit addresses, which are themselves just a base58check encoding of a public key hash. Method returns an error for originated addresses, whose public key hashes are not inferrable from their contract ID.
func (ContractID) MarshalBinary ¶
func (c ContractID) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler. Reference: http://tezos.gitlab.io/mainnet/api/p2p.html#contract-id-22-bytes-8-bit-tag
func (*ContractID) UnmarshalBinary ¶
func (c *ContractID) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type ContractIDTag ¶
type ContractIDTag byte
ContractIDTag captures the possible tag values for $contract_id
const ( // ContractIDTagImplicit is the tag for implicit accounts ContractIDTagImplicit ContractIDTag = 0 // ContractIDTagOriginated is the tag for originated accounts ContractIDTagOriginated ContractIDTag = 1 )
type Delegation ¶
type Delegation struct { Source ContractID Fee *big.Int Counter *big.Int GasLimit *big.Int StorageLimit *big.Int Delegate *ContractID }
Delegation models the tezos delegation operation type
func (*Delegation) GetSource ¶
func (d *Delegation) GetSource() ContractID
GetSource returns the operation's source
func (*Delegation) GetTag ¶
func (d *Delegation) GetTag() ContentsTag
GetTag implements OperationContents
func (*Delegation) MarshalBinary ¶
func (d *Delegation) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*Delegation) String ¶
func (d *Delegation) String() string
func (*Delegation) UnmarshalBinary ¶
func (d *Delegation) UnmarshalBinary(data []byte) (err error)
UnmarshalBinary implements encoding.BinaryUnmarshaler
type Operation ¶
type Operation struct { Branch BranchID Contents []OperationContents }
Operation models a tezos operation with variable length contents.
func (*Operation) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler. It encodes the operation unsigned, in the format suitable for signing and transmission.
func (*Operation) SignatureHash ¶
SignatureHash returns the hash of the operation to be signed, including watermark
func (*Operation) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
type OperationContents ¶
type OperationContents interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler fmt.Stringer GetTag() ContentsTag }
OperationContents models one of multiple contents of a tezos operation. Reference: http://tezos.gitlab.io/mainnet/api/p2p.html#operation-alpha-contents-determined-from-data-8-bit-tag
type OperationHash ¶
type OperationHash string
OperationHash encodes an operation hash in base58check encoding
func (OperationHash) MarshalBinary ¶
func (o OperationHash) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
func (*OperationHash) UnmarshalBinary ¶
func (o *OperationHash) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type Origination ¶
type Origination struct { Source ContractID Fee *big.Int Counter *big.Int GasLimit *big.Int StorageLimit *big.Int Manager ContractID Balance *big.Int Spendable bool Delegatable bool Delegate *ContractID }
Origination models the tezos origination operation type.
func (*Origination) GetSource ¶
func (o *Origination) GetSource() ContractID
GetSource returns the operation's source
func (*Origination) GetTag ¶
func (o *Origination) GetTag() ContentsTag
GetTag implements OperationContents
func (*Origination) MarshalBinary ¶
func (o *Origination) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*Origination) String ¶
func (o *Origination) String() string
func (*Origination) UnmarshalBinary ¶
func (o *Origination) UnmarshalBinary(data []byte) (err error)
UnmarshalBinary implements encoding.BinaryUnmarshaler
type PrivateKey ¶
type PrivateKey string
PrivateKey encodes a tezos private key in base58check encoding
func NewPrivateKeyFromCryptoPrivateKey ¶
func NewPrivateKeyFromCryptoPrivateKey(cryptoPrivateKey crypto.PrivateKey) (PrivateKey, error)
NewPrivateKeyFromCryptoPrivateKey creates a new PrivateKey from a crypto.PrivateKey
func (PrivateKey) CryptoPrivateKey ¶
func (p PrivateKey) CryptoPrivateKey() (crypto.PrivateKey, error)
CryptoPrivateKey returns a crypto.PrivateKey
func (PrivateKey) MarshalBinary ¶
func (p PrivateKey) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler.
type PrivateKeySeed ¶
type PrivateKeySeed string
PrivateKeySeed encodes a tezos private key seed in base58check encoding.
func (PrivateKeySeed) PrivateKey ¶
func (p PrivateKeySeed) PrivateKey() (PrivateKey, error)
PrivateKey returns the private key derived from this private key seed.
type PubKeyHashTag ¶
type PubKeyHashTag byte
PubKeyHashTag captures the possible tag values for $public_key_hash
const ( // PubKeyHashTagEd25519 is the tag for Ed25519 pubkey hashes PubKeyHashTagEd25519 PubKeyHashTag = 0 // PubKeyHashTagSecp256k1 is the tag for Secp256k1 pubkey hashes PubKeyHashTagSecp256k1 PubKeyHashTag = 1 // PubKeyHashTagP256 is the tag for P256 pubkey hashes PubKeyHashTagP256 PubKeyHashTag = 2 )
type PublicKey ¶
type PublicKey string
PublicKey encodes a tezos public key in base58check encoding
func NewPublicKeyFromCryptoPublicKey ¶
NewPublicKeyFromCryptoPublicKey creates a new PublicKey from a crypto.PublicKey
func (PublicKey) CryptoPublicKey ¶
CryptoPublicKey returns a crypto.PublicKey
func (PublicKey) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler. Reference: http://tezos.gitlab.io/mainnet/api/p2p.html#public-key-determined-from-data-8-bit-tag
func (*PublicKey) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
type Revelation ¶
type Revelation struct { Source ContractID Fee *big.Int Counter *big.Int GasLimit *big.Int StorageLimit *big.Int PublicKey PublicKey }
Revelation models the revelation operation type
func (*Revelation) GetSource ¶
func (r *Revelation) GetSource() ContractID
GetSource returns the operation's source
func (*Revelation) GetTag ¶
func (r *Revelation) GetTag() ContentsTag
GetTag implements OperationContents
func (*Revelation) MarshalBinary ¶
func (r *Revelation) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*Revelation) String ¶
func (r *Revelation) String() string
func (*Revelation) UnmarshalBinary ¶
func (r *Revelation) UnmarshalBinary(data []byte) (err error)
UnmarshalBinary implements encoding.BinaryUnmarshaler
type Signature ¶
type Signature string
Signature is a tezos base58check encoded signature. It may be in either the generic or non-generic format.
func SignMessage ¶
func SignMessage(message string, privateKey PrivateKey) (Signature, error)
SignMessage signs the given text based message using the provided signing key. It returns the base58check-encoded signature which does not include the message. It uses the 0x04 non-standard watermark.
func (Signature) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler
type SignedOperation ¶
SignedOperation represents a signed operation
func SignOperation ¶
func SignOperation(operation *Operation, privateKey PrivateKey) (SignedOperation, error)
SignOperation signs the given tezos operation using the provided signing key. The returned bytes are the signed operation, encoded as (operation bytes || signature bytes).
func (SignedOperation) GetHash ¶
func (s SignedOperation) GetHash() (OperationHash, error)
GetHash returns the hash of a signed operation.
func (SignedOperation) MarshalBinary ¶
func (s SignedOperation) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*SignedOperation) UnmarshalBinary ¶
func (s *SignedOperation) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler. In cases where the signature type cannot be inferred, PrefixGenericSignature is used instead.
type Transaction ¶
type Transaction struct { Source ContractID Fee *big.Int Counter *big.Int GasLimit *big.Int StorageLimit *big.Int Amount *big.Int Destination ContractID }
Transaction models the tezos transaction type
func (*Transaction) GetSource ¶
func (t *Transaction) GetSource() ContractID
GetSource returns the operation's source
func (*Transaction) GetTag ¶
func (t *Transaction) GetTag() ContentsTag
GetTag implements OperationContents
func (*Transaction) MarshalBinary ¶
func (t *Transaction) MarshalBinary() ([]byte, error)
MmarshalBinary implements encoding.BinaryMarshaler
func (*Transaction) String ¶
func (t *Transaction) String() string
func (*Transaction) UnmarshalBinary ¶
func (t *Transaction) UnmarshalBinary(data []byte) (err error)
UnmarshalBinary implements encoding.BinaryUnmarshaler
type Watermark ¶
type Watermark byte
Watermark is the first byte of a signable payload that indicates the type of data represented.
const ( // BlockHeaderWatermark is the special byte prepended to serialized block headers before signing BlockHeaderWatermark Watermark = 1 // EndorsementWatermark is the special byte prepended to serialized endorsements before signing EndorsementWatermark Watermark = 2 // OperationWatermark is the special byte prepended to serialized operations before signing OperationWatermark Watermark = 3 // CustomWatermark is for custom purposes CustomWatermark Watermark = 4 // TextWatermark is the special byte prepended to plaintext messages before signing. It is not // yet part of the standard but has some precedent here: // https://tezos.stackexchange.com/questions/1177/whats-the-easiest-way-for-an-account-holder-to-verify-sign-that-they-are-the-ri/1178#1178 TextWatermark Watermark = 5 )
References: https://gitlab.com/tezos/tezos/blob/master/src/lib_crypto/signature.ml#L43