Skip to main content

Create Alias Output

An Alias Output is a specific implementation of a UTXO state machine. The Alias ID, the unique identifier of an instance of the deployed state machine, is generated deterministically by the protocol and is not allowed to change in future state transitions.

An Alias Output represents an alias account in the ledger with two control levels and a permanent Alias Address. The account owns other outputs that are locked under the Alias Address. The account keeps track of state transitions (State Index counter) and controlled foundries (Foundry Counter) and anchors the layer 2 state as metadata into the UTXO ledger.

Example Code

The following example will:

  1. Instantiate a Wallet, get Alice's Account which was created in the first guide.
  2. Create an Alias Output transaction by calling the Account.create_alias_output() function.
sdk/examples/how_tos/alias/create.rs
loading...
  1. Retry the Transaction until included.
sdk/examples/how_tos/alias/create.rs
loading...

Full Example Code

sdk/examples/how_tos/alias_wallet/request_funds.rs
loading...

Expected Output

Aliases BEFORE:
[
...
]
Sending the create-alias transaction...
Transaction sent: 0x7ce05ab09bc562c7b383067b774edd780e3a9235e9c76a5cccabdd9744b6a719
Block included: https://explorer.shimmer.network/testnet/block/0x603c0e010b4e7665913c04729aad692a1c7557234185e98c821e1142fa49823d
Aliases AFTER:
[
...
]