cosmos/crypto

Table of Contents

cosmos/crypto/ed25519/keys.proto

Top

PrivKey

Deprecated: PrivKey defines a ed25519 private key.

NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context.

FieldTypeLabelDescription
key bytes

PubKey

PubKey is an ed25519 public key for handling Tendermint keys in SDK.

It's needed for Any serialization and SDK compatibility.

It must not be used in a non Tendermint key context because it doesn't implement

ADR-28. Nevertheless, you will like to use ed25519 in app user level

then you must create a new proto message and follow ADR-28 for Address construction.

FieldTypeLabelDescription
key bytes

cosmos/crypto/multisig/v1beta1/multisig.proto

Top

CompactBitArray

CompactBitArray is an implementation of a space efficient bit array.

This is used to ensure that the encoded data takes up a minimal amount of

space after proto encoding.

This is not thread safe, and is not intended for concurrent usage.

FieldTypeLabelDescription
extra_bits_stored uint32

elems bytes

MultiSignature

MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.

See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers

signed and with which modes.

FieldTypeLabelDescription
signatures bytes repeated

cosmos/crypto/multisig/keys.proto

Top

LegacyAminoPubKey

LegacyAminoPubKey specifies a public key type

which nests multiple public keys and a threshold,

it uses legacy amino address rules.

FieldTypeLabelDescription
threshold uint32

public_keys google.protobuf.Any repeated

cosmos/crypto/secp256k1/keys.proto

Top

PrivKey

PrivKey defines a secp256k1 private key.

FieldTypeLabelDescription
key bytes

PubKey

PubKey defines a secp256k1 public key

Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte

if the y-coordinate is the lexicographically largest of the two associated with

the x-coordinate. Otherwise the first byte is a 0x03.

This prefix is followed with the x-coordinate.

FieldTypeLabelDescription
key bytes

cosmos/crypto/secp256r1/keys.proto

Top

Since: cosmos-sdk 0.43

PrivKey

PrivKey defines a secp256r1 ECDSA private key.

FieldTypeLabelDescription
secret bytes

secret number serialized using big-endian encoding

PubKey

PubKey defines a secp256r1 ECDSA public key.

FieldTypeLabelDescription
key bytes

Point on secp256r1 curve in a compressed representation as specified in section 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998

Scalar Value Types

.proto Type Notes Python Type
double float
float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int/long
uint32 Uses variable-length encoding. int/long
uint64 Uses variable-length encoding. int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. int/long
sfixed32 Always four bytes. int
sfixed64 Always eight bytes. int/long
bool boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. str/unicode
bytes May contain any arbitrary sequence of bytes. str