Skip to main content

SimpleSignature

SimpleSignature Objects​

class SimpleSignature(SimpleSignatureProtocol)

A basic signature

This enumeration defines the set of simple or basic signature schemes supported by IOTA. Most signature schemes supported by IOTA end up comprising of a at least one simple signature scheme.

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

Note: Due to historical reasons, signatures are serialized slightly different from the majority of the types in IOTA. In particular if a signature is ever embedded in another structure it generally is serialized as bytes meaning it has a length prefix that defines the length of the completely serialized signature.

from_base64​

@classmethod
def from_base64(cls, base64: str) -> SimpleSignature

Decode a signature from the Base64 form produced by to_base64, i.e. base64 over the flag || sig || pubkey bytes.

from_bcs​

@classmethod
def from_bcs(cls, bcs: bytes) -> SimpleSignature

Create this type from BCS encoded bytes.

from_json​

@classmethod
def from_json(cls, json: str) -> SimpleSignature

Create this type from a JSON encoded string.

derive_address​

def derive_address() -> Address

Derive the Address of the public key that produced this signature.

signature_bytes​

def signature_bytes() -> bytes

The raw signature bytes, without the scheme flag or the public key.

to_base64​

def to_base64() -> str

Base64-encode this signature as its flag || sig || pubkey bytes.

to_bcs​

def to_bcs() -> bytes

Convert this type to BCS encoded bytes.

to_display_string​

def to_display_string() -> str

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.

to_json​

def to_json() -> str

Convert this type to a JSON encoded string.

to_public_key​

def to_public_key() -> PublicKey

The public key embedded in this signature.