Skip to main content
Token locks allow DAG holders to lock their tokens on-chain for a specified or indefinite period. They are a prerequisite for delegated staking (via Global L0) and node collateral. An indefinite lock (unlockEpoch: null) is required for use as a delegated stake backing.
All endpoints return the following response headers:
  • X-Id — The node’s public key identifier
  • X-Session-Token — The current cluster session token
  • Request-Signature — Cryptographic signature of the response for verification
Building a valid token lock: Use GET /token-locks/last-reference/{address} to retrieve the parent values before creating a new token lock. The parent.ordinal of a new lock must be lastOrdinal + 1.

POST /token-locks

Submits a signed token lock transaction. If accepted, the lock enters the mempool and will be included in the next block, eventually appearing in a global snapshot.
curl -X POST https://<node-host>:9010/token-locks \
  -H "Content-Type: application/json" \
  -d '{
    "value": {
      "source": "DAG3hZTBgtb2iH9ZdLNvaKqPT4ZncCuW6uYxZack",
      "amount": 25000000000,
      "fee": 0,
      "parent": {
        "ordinal": 0,
        "hash": ""
      },
      "currencyId": null,
      "unlockEpoch": null,
      "replaceTokenLockRef": null
    },
    "proofs": [
      { "id": "<public-key-hex>", "signature": "<ecdsa-der-hex>" }
    ]
  }'
Request bodySignedTokenLock
value
object
required
The token lock transaction payload
proofs
array
required
Array of cryptographic signature proofs from the source address owner
Response 200 OK
hash
string
Hash of the accepted token lock transaction. Use this hash as tokenLockRef when creating a delegated stake or node collateral on the Global L0.
Example response:
{
  "hash": "a1b2c3d4e5f6789012345678901234567890123456789012345678901234567890"
}
Response 400 Bad Request The token lock transaction was rejected.
errors
array
Array of error cause objects with message fields describing the rejection reason

GET /token-locks/

Returns the view of a token lock transaction currently in the L1 mempool. Once the transaction has been processed into a block and included in a global snapshot, this endpoint returns 404.
curl https://<node-host>:9010/token-locks/a1b2c3d4e5f6789012345678901234567890
hash
string
required
The token lock transaction hash
Response 200 OK
transaction
object
The full token lock data (see TokenLock schema in POST /token-locks)
hash
string
The transaction hash
status
string
Current status in the mempool. Currently: Waiting
Example response:
{
  "transaction": {
    "source": "DAG3hZTBgtb2iH9ZdLNvaKqPT4ZncCuW6uYxZack",
    "amount": 25000000000,
    "fee": 0,
    "parent": { "ordinal": 0, "hash": "" },
    "currencyId": null,
    "unlockEpoch": null,
    "replaceTokenLockRef": null
  },
  "hash": "a1b2c3d4e5f6...",
  "status": "Waiting"
}
Response 404 Not Found No token lock with the given hash was found in the mempool. The transaction has either been processed into a block or was rejected.

GET /token-locks/last-reference/

Returns the last token lock reference for a given address. Call this before creating a new token lock to obtain the correct parent values.
curl https://<node-host>:9010/token-locks/last-reference/DAG3hZTBgtb2iH9ZdLNvaKqPT4ZncCuW6uYxZack
address
string
required
DAG wallet address
Response 200 OK
ordinal
integer
Ordinal of the last token lock transaction. Use ordinal + 1 as the new lock’s parent ordinal.
hash
string
Hash of the last token lock transaction. Use as the new lock’s parent.hash. Returns empty string "" if no prior token locks exist for this address.
Example response:
{
  "ordinal": 2,
  "hash": "a1b2c3d4e5f6789012345678901234567890"
}

Build docs developers (and LLMs) love