Skip to main content

Secp256k1PublicKey

type Secp256k1PublicKey​

A secp256k1 public key.

BCS​

The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).

type Secp256k1PublicKey struct {
// contains filtered or unexported fields
}

func LiftFromExternalSecp256k1PublicKey​

func LiftFromExternalSecp256k1PublicKey(handle uint64) *Secp256k1PublicKey

func Secp256k1PublicKeyFromBcs​

func Secp256k1PublicKeyFromBcs(bcs []byte) (*Secp256k1PublicKey, error)

Create this type from BCS encoded bytes.

func Secp256k1PublicKeyFromBytes​

func Secp256k1PublicKeyFromBytes(bytes []byte) (*Secp256k1PublicKey, error)

func Secp256k1PublicKeyFromJson​

func Secp256k1PublicKeyFromJson(json string) (*Secp256k1PublicKey, error)

Create this type from a JSON encoded string.

func Secp256k1PublicKeyFromStr​

func Secp256k1PublicKeyFromStr(s string) (*Secp256k1PublicKey, error)

func Secp256k1PublicKeyRandom​

func Secp256k1PublicKeyRandom() *Secp256k1PublicKey

func (*Secp256k1PublicKey) DeriveAddress​

func (_self *Secp256k1PublicKey) DeriveAddress() *Address

Derive an `Address` from this Public Key

An `Address` can be derived from a `Secp256k1PublicKey` by hashing the bytes of the public key prefixed with the Secp256k1 `SignatureScheme` flag (`0x01`).

`hash( 0x01 || 33-byte secp256k1 public key)`

func (*Secp256k1PublicKey) Destroy​

func (object *Secp256k1PublicKey) Destroy()

func (*Secp256k1PublicKey) Eq​

func (_self *Secp256k1PublicKey) Eq(other *Secp256k1PublicKey) bool

func (*Secp256k1PublicKey) Hash​

func (_self *Secp256k1PublicKey) Hash() uint64

func (*Secp256k1PublicKey) Ne​

func (_self *Secp256k1PublicKey) Ne(other *Secp256k1PublicKey) bool

func (*Secp256k1PublicKey) Scheme​

func (_self *Secp256k1PublicKey) Scheme() SignatureScheme

Returns the signature scheme for this public key.

func (*Secp256k1PublicKey) ToBcs​

func (_self *Secp256k1PublicKey) ToBcs() ([]byte, error)

Convert this type to BCS encoded bytes.

func (*Secp256k1PublicKey) ToBytes​

func (_self *Secp256k1PublicKey) ToBytes() []byte

func (*Secp256k1PublicKey) ToDisplayString​

func (_self *Secp256k1PublicKey) ToDisplayString() string

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

func (*Secp256k1PublicKey) ToFlaggedBytes​

func (_self *Secp256k1PublicKey) ToFlaggedBytes() []byte

Returns the bytes with signature scheme flag prepended.

func (*Secp256k1PublicKey) ToJson​

func (_self *Secp256k1PublicKey) ToJson() (string, error)

Convert this type to a JSON encoded string.