Skip to main content

Intent

Intent Objects​

class Intent(IntentProtocol)

A Signing Intent

An intent is a compact struct that serves as the domain separator for a message that a signature commits to. It consists of three parts:

  1. IntentScope (what the type of the message is)
  2. IntentVersion
  3. IntentAppId (what application the signature refers to).

The serialization of an Intent is a 3-byte array where each field is represented by a byte and it is prepended onto a message before it is signed in IOTA.

BCS

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

from_bytes​

@classmethod
def from_bytes(cls, bytes: bytes) -> Intent

Create a signing intent from bytes.

from_hex​

@classmethod
def from_hex(cls, hex: str) -> Intent

Create a signing intent from a hex string.

new_consensus_app​

@classmethod
def new_consensus_app(cls, scope: IntentScope) -> Intent

Create a new Consensus app signing intent.

new_iota_app​

@classmethod
def new_iota_app(cls, scope: IntentScope) -> Intent

Create a new IOTA app signing intent.

new_iota_transaction​

@classmethod
def new_iota_transaction(cls) -> Intent

Create a new IOTA transaction signing intent.

new_personal_message​

@classmethod
def new_personal_message(cls) -> Intent

Create a new IOTA personal message signing intent.

app_id​

def app_id() -> IntentAppId

Get the app id of the signing intent.

scope​

def scope() -> IntentScope

Get the scope of the signing intent.

to_bytes​

def to_bytes() -> bytes

Convert the signing intent to 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.

version​

def version() -> IntentVersion

Get the version of the signing intent.