Create a Dynamic Notarization
Create a Dynamic Notarization
This guide will walk you through the process of creating a Dynamic Notarization and publishing it to an IOTA network. Dynamic notarizations are mutable, allowing you to update their state and metadata after creation, and they can be transferred between addresses.
1. Get Funded Notarization Client
To create a Dynamic Notarization, you need access to an IOTA network or run a local IOTA network.
In test networks as well as local ones, you can use a faucet to request funds. In the IOTA mainnet you will need an address with enough funds to cover the gas cost of the whole procedure.
If you want to use the main IOTA network, you will need an address with actual IOTA funds to create a new Dynamic Notarization.
The example code below demonstrates using a faucet to receive funds before the example code is run.
This is how to create a notarization client and call a utility function explained below to fund the test account.
The utility function to fund the test account is implemented this way:
Note:
- The TypeScript implementation uses the TypeScript SDK function requestIotaFromFaucetV0
- The Rust implementation uses the local installed IOTA client via std::process::Command.
2. Create a Simple Dynamic Notarization
The simplest form of a Dynamic Notarization can be created without any locks, making it fully mutable and transferable.
- The
build_and_execute()(resp.buildAndExecute()) method is called to publish the Dynamic Notarization. - The
finish()method is called to build the transaction which will create the Dynamic Notarization when being processed by an IOTA node.
3. Create a Dynamic Notarization with Transfer Lock
You can also create a Dynamic Notarization with a transfer lock to prevent transfers until a specified time.
End Result
The end result will be a Dynamic Notarization object that is published to the IOTA network. Unlike locked notarizations, dynamic notarizations can be:
- Updated: State and metadata can be modified after creation
- Transferred: Ownership can be transferred to other addresses (unless transfer-locked)
- Versioned: Each state update increments the version counter
Transfer Lock Types
Dynamic notarizations support optional transfer locks:
- None: No transfer restrictions (default)
- UnlockAt(timestamp): Locked until specified timestamp
- UntilDestroyed: Locked until notarization is destroyed
Full Example Code
- Rust
- Typescript (Node.js)
loading...
loading...
Running Examples Locally
In order to run the examples, you will need to run an IOTA network locally.
If you want to use something different, you will need to modify the API and faucet endpoints in the examples to match your setup.