Transfer Funds to an Address
A simple transaction moves funds from one user account to another. On a high level, a transaction must define 3 things:
- Inputs: previously created unspent transaction outputs holding funds that the transaction consumes.
- Unlock Blocks: they hold the signatures authorizing the consumption of inputs.
- Outputs: newly created outputs holding transferred funds.
In Stardust, you can create a simple transfer using a Basic Output. Basic Outputs define the base token funds they hold in the Amount field.
Add the Recipient Address
Basic Outputs need to have at least one Unlock Condition: the Address Unlock Condition. This means that to unlock the output in a transaction, you have to present a valid signature for the recipient's address. The signature signs the whole transaction content, thereby authorizing the consumption of inputs and declaring the intention to create new outputs.
The figure below shows transaction A, which:
- Consumes as input a Basic Output with 100i locked under ownerAddress,
- Provides an Unlock, namely a Signature Unlock that contains a valid signature of the transaction content corresponding to the private key behind ownerAddress,
- Creates a new Basic Output with 100i locked under the recipient's address, namely recipientAddress.