Skip to main content

Intent

Namespace: IotaSdk

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 for this type is defined by the following ABNF:

intent = intent-scope intent-version intent-app-id
public class Intent : IIntent, System.IEquatable`1[[IotaSdk.Intent, IotaSdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.IDisposable

Inheritance ObjectIntent
Implements IIntent, IEquatable<Intent>, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Constructors

Intent(UInt64)

public Intent(ulong pointer)

Parameters

pointer UInt64

Intent(IntentScope, IntentVersion, IntentAppId)

Create a new signing intent.

public Intent(IntentScope scope, IntentVersion version, IntentAppId appId)

Parameters

scope IntentScope

version IntentVersion

appId IntentAppId

Methods

Destroy()

public void Destroy()

Dispose()

public void Dispose()

AppId()

Get the app id of the signing intent.

public IntentAppId AppId()

Returns

IntentAppId

Scope()

Get the scope of the signing intent.

public IntentScope Scope()

Returns

IntentScope

ToBytes()

Convert the signing intent to bytes.

public Byte[] ToBytes()

Returns

Byte[]

Version()

Get the version of the signing intent.

public IntentVersion Version()

Returns

IntentVersion

Equals(Intent)

public bool Equals(Intent? other)

Parameters

other Intent?

Returns

Boolean

Equals(Object)

public override bool Equals(object? obj)

Parameters

obj Object?

Returns

Boolean

GetHashCode()

public override int GetHashCode()

Returns

Int32

FromBytes(Byte[])

Create a signing intent from bytes.

public static Intent FromBytes(Byte[] bytes)

Parameters

bytes Byte[]

Returns

Intent

Exceptions

IntentException

FromHex(String)

Create a signing intent from a hex string.

public static Intent FromHex(string hex)

Parameters

hex String

Returns

Intent

Exceptions

IntentException

NewConsensusApp(IntentScope)

Create a new Consensus app signing intent.

public static Intent NewConsensusApp(IntentScope scope)

Parameters

scope IntentScope

Returns

Intent

NewIotaApp(IntentScope)

Create a new IOTA app signing intent.

public static Intent NewIotaApp(IntentScope scope)

Parameters

scope IntentScope

Returns

Intent

NewIotaTransaction()

Create a new IOTA transaction signing intent.

public static Intent NewIotaTransaction()

Returns

Intent

NewPersonalMessage()

Create a new IOTA personal message signing intent.

public static Intent NewPersonalMessage()

Returns

Intent