Skip to main content

Create an Alias

Just like a Basic Output, an Alias Output also must have:

  • Amount to hold base token.
  • Unlock Conditions that define how the output can be unlocked.
  • Features that don't modify the unlocking.

On top of these, it also defines:

  • State Index that has to be incremented in every transaction initiated by the State Controller.
  • State Metadata that may hold binary data.
  • Foundry Counter that defines how many foundries the alias has created.
  • Immutable Features that are regular Features defined upon creation which can never be modified afterward.

Available Unlock Conditions

Alias outputs only support two type of unlock conditions:

  • State Controller Address Unlock Condition that defines the state controller.
  • Governor Address Unlock Condition that defines the governor of the alias.

Example Transaction

Transaction A shows the process of creating a new alias output and hence an alias account. Notice the creation constraints enforced by the protocol:

  • Alias ID must be zeroed out. This signals to the protocol that the alias account is new and when the transaction confirms, a unique Alias ID must be generated.
  • State Index must be zero as this is the first possible state the alias represents.
  • Foundry Counter must be zero as the alias doesn't control any foundries yet.
  • Issuer and Sender addresses must be unlocked in the transaction if present.

Transaction A - Creating an Alias

When Alias Output #1 from Transaction A is consumed in a subsequent transaction, the Alias ID field in the transitioned alias must be set to the protocol generated unique identifier, which is the Blake2b-256 hash of the Output ID of Alias Output #1.