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:
- IntentScope (what the type of the message is)
- IntentVersion
- 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 Object → Intent
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
Scope()
Get the scope of the signing intent.
public IntentScope Scope()
Returns
ToBytes()
Convert the signing intent to bytes.
public Byte[] ToBytes()
Returns
Version()
Get the version of the signing intent.
public IntentVersion Version()
Returns
Equals(Intent)
public bool Equals(Intent? other)
Parameters
other Intent?
Returns
Equals(Object)
public override bool Equals(object? obj)
Parameters
obj Object?
Returns
GetHashCode()
public override int GetHashCode()
Returns
FromBytes(Byte[])
Create a signing intent from bytes.
public static Intent FromBytes(Byte[] bytes)
Parameters
bytes Byte[]
Returns
Exceptions
FromHex(String)
Create a signing intent from a hex string.
public static Intent FromHex(string hex)
Parameters
hex String
Returns
Exceptions
NewConsensusApp(IntentScope)
Create a new Consensus app signing intent.
public static Intent NewConsensusApp(IntentScope scope)
Parameters
scope IntentScope
Returns
NewIotaApp(IntentScope)
Create a new IOTA app signing intent.
public static Intent NewIotaApp(IntentScope scope)
Parameters
scope IntentScope
Returns
NewIotaTransaction()
Create a new IOTA transaction signing intent.
public static Intent NewIotaTransaction()
Returns
NewPersonalMessage()
Create a new IOTA personal message signing intent.
public static Intent NewPersonalMessage()