Skip to main content

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

Body

required
    protocolVersion integerrequired

    Protocol version number of the block. It also tells which protocol rules apply to the block.

    parents string[]

    The identifiers of the blocks this block references. Hex-encoded with 0x prefix.

    payload object
    oneOf
    type integerrequired

    Set to value 6 to denote a Transaction Payload.

    essence object required
    oneOf
    type integerrequired

    Set to value 1 to denote a Transaction Essence.

    networkId stringrequired

    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.

    inputsCommitment stringrequired

    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.

  • Array [
  • oneOf
    type integerrequired

    Set to value 0 to denote an UTXO Input.

    transactionId stringrequired

    The BLAKE2b-256 hash of the transaction from which the UTXO comes from. Hex-encoded data with 0x prefix.

    transactionOutputIndex integerrequired

    The index of the output on the referenced transaction to consume.

  • ]
  • outputs object[]required

    The outputs of this transaction.

  • Array [
  • anyOf
    type integerrequired

    Set to value 3 to denote a Basic Output.

    amount stringrequired

    The amount of IOTA tokens to deposit with this BasicOutput output. Plain string encoded number.

    nativeTokens object[]

    Native tokens held by the otuput.

  • Array [
  • anyOf
    id stringrequired

    Hex-encoded identifier with 0x prefix of the native token. Same as foundryId of the controlling foundry.

    amount stringrequired

    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.

  • Array [
  • anyOf
    type integerrequired

    Set to value 0 to denote an Address Unlock Condition.

    address object required
    oneOf
    type integerrequired

    Set to value 0 to denote an Ed25519 Address.

    pubKeyHash stringrequired

    The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key

  • ]
  • features object[]

    Features that add utility to the output but do not impose unlocking conditions.

  • Array [
  • anyOf
    type integerrequired

    Set to value 0 to denote a Sender Feature.

    address object required
    oneOf
    type integerrequired

    Set to value 0 to denote an Ed25519 Address.

    pubKeyHash stringrequired

    The hex-encoded, 0x prefixed BLAKE2b-256 hash of the Ed25519 public key

  • ]
  • ]
  • payload object

    The optional embedded payload.

    oneOf
    type integerrequired

    Set to value 5 to denote a Tagged Data Payload.

    tag string

    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.

    data string

    The optional data to attach. This may have a length of 0. Hex-encoded with 0x prefix.

    unlocks object[]required
  • Array [
  • oneOf
    type integerrequired

    Denotes a Signature Unlock.

    signature object required
    oneOf
    type integerrequired

    Set to value 0 to denote an Ed25519 Signature.

    publicKey stringrequired

    The public key of the Ed25519 keypair which is used to verify the signature. Hex-encoded with 0x prefix.

    signature stringrequired

    The signature signing the serialized Transaction Essence. Hex-encoded with 0x prefix.

  • ]
  • nonce string

    The nonce which lets this block fulfill the Proof-of-Work requirement. Hex-encoded with 0x prefix.

Responses

Successful operation.

Response Headers
  • Location string

    The blockId of the newly created block.

Schema
    blockId stringrequired

    The block identifier of the submitted block. Hex-encoded with 0x prefix.

Loading...