Submit a block.
POST/api/core/v2/blocks
Submit a block. The node takes care of missing fields and tries to build the block. On success, the block will be stored in the Tangle. This endpoint will return the identifier of the built block. The node will try to auto-fill the following fields in case they are missing: parents
, nonce
. If payload
is missing, the block will be built without a payload. protocolVersion
is always required!
Request
- application/json
- application/vnd.iota.serializer-v1
Body
required
- TransactionPayload
- MilestonePayload
- TaggedDataPayload
- TreasuryTransactionPayload
- ReceiptPayload
- TransactionEssence
- Array [
- UTXOInput
- ]
- Array [
- BasicOutput
- AliasOutput
- FoundryOutput
- NFTOutput
- Array [
- NativeToken
- ]
- Array [
- AddressUnlockCondition
- StorageDepositReturnUnlockCondition
- TimelockUnlockCondition
- ExpirationUnlockCondition
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- SenderFeature
- MetadataFeature
- TagFeature
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- NativeToken
- ]
- Array [
- StateControllerAddressUnlockCondition
- GovernorAddressUnlockCondition
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- SenderFeature
- MetadataFeature
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- IssuerFeature
- MetadataFeature
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- NativeToken
- ]
- Array [
- SimpleTokenScheme
- ]
- Array [
- ImmutableAliasAddressUnlockCondition
- AliasAddress
- ]
- Array [
- MetadataFeature
- ]
- Array [
- MetadataFeature
- ]
- Array [
- NativeToken
- ]
- Array [
- AddressUnlockCondition
- StorageDepositReturnUnlockCondition
- TimelockUnlockCondition
- ExpirationUnlockCondition
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- SenderFeature
- IssuerFeature
- MetadataFeature
- TagFeature
- Ed25519Address
- AliasAddress
- NFTAddress
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- Array [
- IssuerFeature
- MetadataFeature
- Ed25519Address
- AliasAddress
- NFTAddress
- ]
- ]
- TaggedDataPayload
- Array [
- SignatureUnlock
- ReferenceUnlock
- AliasUnlock
- NFTUnlock
- Ed25519Signature
- ]
- Array [
- ReceiptPayload
- ProtocolParamsMilestoneOpt
- Array [
- Ed25519Address
- ]
- ]
- Array [
- Ed25519Signature
- ]
- Array [
- Ed25519Address
- ]
Protocol version number of the block. It also tells which protocol rules apply to the block.
The identifiers of the blocks this block references. Hex-encoded with 0x prefix.
payload object
Set to value 6 to denote a Transaction Payload.
essence objectrequired
Set to value 1 to denote a Transaction Essence.
Network identifier. Plain string encoded number. This field signals for which network the block is meant for. It is computed out of the first 8 bytes of the BLAKE2b-256
hash of the concatenation of the network name and protocol version string.
BLAKE2b-256 hash of the BLAKE2b-256 hashes of the serialized outputs referenced in Inputs by their outputIds (transactionId || outputIndex). Hex-encoded data with 0x prefix.
inputs object[]required
The inputs of this transaction.
Set to value 0 to denote an UTXO Input.
The BLAKE2b-256 hash of the transaction from which the UTXO comes from. Hex-encoded data with 0x prefix.
The index of the output on the referenced transaction to consume.
outputs object[]required
The outputs of this transaction.
Set to value 3 to denote a Basic Output.
The amount of IOTA tokens to deposit with this BasicOutput output. Plain string encoded number.
nativeTokens object[]
Native tokens held by the otuput.
Hex-encoded identifier with 0x prefix of the native token. Same as foundryId of the controlling foundry.
Amount of native tokens (up to uint256). Hex-encoded number with 0x prefix.
unlockConditions object[]required
Unlock condtions that define how the output an be unlocked in a transaction.
Set to value 0 to denote an Address Unlock Condition.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 1 to denote an Dust Deposit Return Unlock Condition.
returnAddress objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Amount of IOTA tokens the consuming transaction should deposit to the address defined in Return Address. Plain string encoded number.
Set to value 2 to denote an Timelock Unlock Condition.
Unix time (seconds since Unix epoch) starting from which the output can be consumed.
Set to value 3 to denote an Expiration Unlock Condition.
returnAddress objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Before this unix time, Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address.
features object[]
Features that add utility to the output but do not impose unlocking conditions.
Set to value 0 to denote a Sender Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
Set to value 3 to denote a Tag Feature.
Hex-encoded binary indexation tag with 0x prefix.
Set to value 4 to denote an Alias Output.
The amount of IOTA tokens to deposit with this output. Plain string encoded number.
nativeTokens object[]
Native tokens held by the otuput.
Hex-encoded identifier with 0x prefix of the native token. Same as foundryId of the controlling foundry.
Amount of native tokens (up to uint256). Hex-encoded number with 0x prefix.
Unique identifier of the alias, which is the BLAKE2b-256 hash of the Output ID that created it. Alias Address = Alias Address Type || Alias ID. Hex-encoded data with 0x prefix.
A counter that must increase by 1 every time the alias is state transitioned.
Hex-encoded metadata with 0x prefix that can only be changed by the state controller.
A counter that denotes the number of foundries created by this alias account.
unlockConditions object[]required
Unlock condtions that define how the output an be unlocked in a transaction.
Set to value 4 to denote an Sate Controller Address Unlock Condition.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 5 to denote an Governor Address Unlock Condition.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
features object[]
Features that add utility to the output but do not impose unlocking conditions.
Set to value 0 to denote a Sender Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
immutableFeatures object[]
Immutable features that add utility to the output but do not impose unlocking conditions. These features need to be kept in future transitions of the UTXO state machine.
Set to value 1 to denote an Issuer Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
Set to value5 to denote a Foundry Output.
The amount of IOTA tokens to deposit with this output. Plain string encoded number.
nativeTokens object[]
Native tokens held by the otuput.
Hex-encoded identifier with 0x prefix of the native token. Same as foundryId of the controlling foundry.
Amount of native tokens (up to uint256). Hex-encoded number with 0x prefix.
The serial number of the foundry with respect to the controlling alias.
tokenScheme object[]required
Defines the supply control scheme of the tokens controlled by the foundry.
Set to value 0 to denote an Simple Token Scheme.
Minted tokens controlled by this foundry. Hex-encoded number with 0x prefix.
Melted tokens controlled by this foundry. Hex-encoded number with 0x prefix.
Maximum supply of tokens controlled by this foundry. Hex-encoded number with 0x prefix.
unlockConditions object[]required
Unlock condtions that define how the output an be unlocked in a transaction.
Set to value 6 to denote an Immutable Alias Address Unlock Condition.
address objectrequired
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
features object[]
Features that add utility to the output but do not impose unlocking conditions.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
immutableFeatures object[]
Immutable features that add utility to the output but do not impose unlocking conditions. These features need to be kept in future transitions of the UTXO state machine.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
Set to value 6 to denote a NFT Output.
The amount of IOTA tokens to deposit with this output. Plain string encoded number.
nativeTokens object[]
Native tokens held by the otuput.
Hex-encoded identifier with 0x prefix of the native token. Same as foundryId of the controlling foundry.
Amount of native tokens (up to uint256). Hex-encoded number with 0x prefix.
Unique identifier of the NFT, which is the BLAKE2b-256 hash of the Output ID that created it. NFT Address = NFT Address Type || NFT ID. Hex-encoded data with 0x prefix.
unlockConditions object[]required
Unlock condtions that define how the output an be unlocked in a transaction.
Set to value 0 to denote an Address Unlock Condition.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 1 to denote an Dust Deposit Return Unlock Condition.
returnAddress objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Amount of IOTA tokens the consuming transaction should deposit to the address defined in Return Address. Plain string encoded number.
Set to value 2 to denote an Timelock Unlock Condition.
Unix time (seconds since Unix epoch) starting from which the output can be consumed.
Set to value 3 to denote an Expiration Unlock Condition.
returnAddress objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Before this unix time, Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address.
features object[]
Features that add utility to the output but do not impose unlocking conditions.
Set to value 0 to denote a Sender Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 1 to denote an Issuer Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
Set to value 3 to denote a Tag Feature.
Hex-encoded binary indexation tag with 0x prefix.
immutableFeatures object[]
Immutable features that add utility to the output but do not impose unlocking conditions. These features need to be kept in future transitions of the UTXO state machine.
Set to value 1 to denote an Issuer Feature.
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
Set to value 8 to denote an Alias Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the alias.
Set to value 16 to denote an NFT Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the outputId that created the NFT.
Set to value 2 to denote a Metadata Feature.
Hex-encoded binary data with 0x prefix.
payload object
The optional embedded payload.
Set to value 5 to denote a Tagged Data Payload.
The tag to allow external tools to find/look up this block. It has a size between 0 and 64 bytes and must be encoded as a hex-string with 0x prefix. Network nodes do not index blocks with Tagged Data Payload by the tag field by default.
The optional data to attach. This may have a length of 0. Hex-encoded with 0x prefix.
unlocks object[]required
Denotes a Signature Unlock.
signature objectrequired
Set to value 0 to denote an Ed25519 Signature.
The public key of the Ed25519 keypair which is used to verify the signature. Hex-encoded with 0x prefix.
The signature signing the serialized Transaction Essence. Hex-encoded with 0x prefix.
Set to value 1 to denote a Reference Unlock.
Represents the index of a previous unlock.
Set to value 2 to denote an Alias Unlock.
Represents the index of a previous unlock.
Set to value 3 to denote an NFT Unlock.
Represents the index of a previous unlock.
Set to value 7 to denote a Milestone Payload.
The index of the milestone.
The Unix timestamp at which the milestone was issued. The unix timestamp is specified in seconds.
Protocol version of the Milestone Payload and its encapsulating block.
The Milestone ID of the milestone with Index Number - 1.
The identifiers of the blocks this milestone references. Hex-encoded values with 0x prefix.
The merkle root of all directly/indirectly referenced blocks (their IDs) which are newly confirmed by this milestone. Hex-encoded with 0x prefix.
The merkle root of all blocks (their IDs) carrying ledger state mutating transactions. Hex-encoded with 0x prefix.
options object[]
Type identifier of a receipt payload (3).
funds MigratedFundsEntry[]required
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
transaction TreasuryTransactionPayloadrequired
Set to value 4 to denote a Treasury Payload.
input TreasuryInput
Set to value 1 to denote a TreasuryInput.
Hex-encoded with 0x prefix.
output TreasuryOutput
Set to value 2 to denote a TreasuryOutput.
Amount of IOTA tokens in the treasury. Plain string encoded number.
Defines the type of MilestoneOpt.
The milestone index at which these protocol parameters become active.
The to be applied protocol version.
The protocol parameters in binary form. Hex-encoded with 0x prefix.
Hex-encoded binary data with 0x prefix.
signatures object[]required
An array of signatures signing the serialized Milestone Essence. Hex-encoded with 0x prefix.
Set to value 0 to denote an Ed25519 Signature.
The public key of the Ed25519 keypair which is used to verify the signature. Hex-encoded with 0x prefix.
The signature signing the serialized Transaction Essence. Hex-encoded with 0x prefix.
Set to value 5 to denote a Tagged Data Payload.
The tag to allow external tools to find/look up this block. It has a size between 0 and 64 bytes and must be encoded as a hex-string with 0x prefix. Network nodes do not index blocks with Tagged Data Payload by the tag field by default.
The optional data to attach. This may have a length of 0. Hex-encoded with 0x prefix.
Set to value 4 to denote a Treasury Payload.
input TreasuryInput
Set to value 1 to denote a TreasuryInput.
Hex-encoded with 0x prefix.
output TreasuryOutput
Set to value 2 to denote a TreasuryOutput.
Amount of IOTA tokens in the treasury. Plain string encoded number.
Type identifier of a receipt payload (3).
funds MigratedFundsEntry[]required
address objectrequired
Set to value 0 to denote an Ed25519 Address.
The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key
transaction TreasuryTransactionPayloadrequired
Set to value 4 to denote a Treasury Payload.
input TreasuryInput
Set to value 1 to denote a TreasuryInput.
Hex-encoded with 0x prefix.
output TreasuryOutput
Set to value 2 to denote a TreasuryOutput.
Amount of IOTA tokens in the treasury. Plain string encoded number.
The nonce which lets this block fulfill the Proof-of-Work requirement. Hex-encoded with 0x prefix.
Body
required
- string binary
block in raw binary format
Responses
- 201
- 400
- 403
- 500
- 503
Successful operation.
Response Headers
Location string
The blockId of the newly created block.
- application/json
- Schema
- Example (from schema)
- default
Schema
The block identifier of the submitted block. Hex-encoded with 0x prefix.
{
"blockId": "string"
}
{
"blockId": "0xa4dd36465af63d495d35a05f592d42a51511c153e1bae8fad00453c8cbb48727"
}
Unsuccessful operation: indicates that the provided data is invalid.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 400,
"message": "invalid data provided"
}
}
Unsuccessful operation: indicates that the endpoint is not available for public use.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 403,
"message": "not available for public use"
}
}
Unsuccessful operation: indicates that an unexpected, internal server error happened which prevented the node from fulfilling the request.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 500,
"message": "internal server error"
}
}
Unsuccessful operation: indicates that the node can´t auto-fill the parents or perform Proof-of-Work.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 503,
"message": "service unavailable"
}
}