Hedera.PublicKey (Hedera v0.1.0)

Copy Markdown View Source

A Hedera public key — Ed25519 (32-byte point) or ECDSA secp256k1 (stored as the uncompressed point for crypto operations, serialized as the 33-byte compressed form for the Hedera wire protocol).

Summary

Functions

Raw public-key bytes in Hedera wire form: Ed25519 → 32 bytes; ECDSA → 33-byte compressed point.

Encode as a Hedera Key protobuf message: Ed25519 in field 2, ECDSA secp256k1 (compressed) in field 7. Used wherever a transaction body expects a Key (admin/supply/kyc/freeze/wipe keys, etc.).

Lowercase hex of the wire-form public key.

Verify a signature produced by the matching private key.

Types

t()

@type t() :: %Hedera.PublicKey{point: binary(), type: Hedera.PrivateKey.key_type()}

Functions

to_bytes(public_key)

@spec to_bytes(t()) :: binary()

Raw public-key bytes in Hedera wire form: Ed25519 → 32 bytes; ECDSA → 33-byte compressed point.

to_key_proto(key)

@spec to_key_proto(t()) :: binary()

Encode as a Hedera Key protobuf message: Ed25519 in field 2, ECDSA secp256k1 (compressed) in field 7. Used wherever a transaction body expects a Key (admin/supply/kyc/freeze/wipe keys, etc.).

to_string(key)

@spec to_string(t()) :: binary()

Lowercase hex of the wire-form public key.

verify(public_key, message, signature)

@spec verify(t(), binary(), binary()) :: boolean()

Verify a signature produced by the matching private key.