Skip to main content
Version: Next (unstable)

Errors and Limits

The Miden RPC API uses standard gRPC status codes. Individual methods may also return structured details defined by the protobuf schema or encoded by the server implementation.

Structured Error Details​

Some methods encode a method-specific error enum in addition to the conventional gRPC error code. This error enum is encoded in the gRPC status details field, allowing clients to branch on more detailed error conditions.

When present, the detail payload contains the method-specific error code as a single raw byte. This byte can be interpreted as per the per-method tables below.

if status.details is not empty:
error_code = status.details[0]
# Interpret error_code using the failed method's table.
else:
# Fall back to the gRPC status code and message.

Only method-specific failures with documented additional codes set the details byte. Other errors, including request limits, unsupported content negotiation, missing genesis data, and failed proof checks, can return gRPC statuses without a Miden error detail code. The error message remains applicable in all cases. Do not match on the error message because it can change.

If you are missing specific error information that could be useful, please open an issue in the Node Repository.

Method-Specific Error Codes​

The following codes apply to methods on miden.node.v1.NodeService. Code 0 identifies an internal failure with the INTERNAL gRPC status. This code applies to all methods in the table, GetBlockByNumber, and GetBlockHeaderByNumber.

MethodErrorValuegRPC status
GetAccountDeserializationFailed1INVALID_ARGUMENT
AccountNotFound2INVALID_ARGUMENT
AccountNotPublic3INVALID_ARGUMENT
UnknownBlock4INVALID_ARGUMENT
BlockPruned5INVALID_ARGUMENT
StorageSlotNotFound6INVALID_ARGUMENT
StorageSlotNotMap7INVALID_ARGUMENT
GetNotesByIdDeserializationFailed1INVALID_ARGUMENT
GetNoteScriptByRootDeserializationFailed1INVALID_ARGUMENT
SyncNotesInvalidBlockRange1INVALID_ARGUMENT
FutureBlock2INVALID_ARGUMENT
DeserializationFailed3INVALID_ARGUMENT
SyncNullifiersInvalidBlockRange1INVALID_ARGUMENT
InvalidPrefixLength2INVALID_ARGUMENT
DeserializationFailed3INVALID_ARGUMENT
FutureBlock4INVALID_ARGUMENT
SyncAccountVaultInvalidBlockRange1INVALID_ARGUMENT
DeserializationFailed2INVALID_ARGUMENT
AccountNotPublic3INVALID_ARGUMENT
FutureBlock4INVALID_ARGUMENT
SyncAccountStorageMapsInvalidBlockRange1INVALID_ARGUMENT
DeserializationFailed2INVALID_ARGUMENT
AccountNotPublic4INVALID_ARGUMENT
FutureBlock5INVALID_ARGUMENT
SyncTransactionsInvalidBlockRange1INVALID_ARGUMENT
DeserializationFailed2INVALID_ARGUMENT
FutureBlock5INVALID_ARGUMENT
SyncChainMmrFutureBlock2INVALID_ARGUMENT
SubmitProvenTx / SubmitProvenTxBatchInternal0INTERNAL
Expired1INVALID_ARGUMENT
StateConflict2INVALID_ARGUMENT
CapacityExceeded3INVALID_ARGUMENT
MissingFee4INVALID_ARGUMENT
InvalidFeeAsset6INVALID_ARGUMENT
AuthenticationFailed8INVALID_ARGUMENT

InvalidBlockRange means that the start of the range exceeds its end. For SyncAccountVault and SyncAccountStorageMaps, it also means that block_to is more than 50 blocks behind the chain tip, because the node does not keep the account history for older blocks. SyncNotes, SyncNullifiers, SyncAccountVault, SyncAccountStorageMaps, and SyncTransactions return FutureBlock when the range extends beyond the chain tip. SyncChainMmr returns FutureBlock when the client height exceeds the requested chain tip. SyncNullifiers returns DeserializationFailed for a prefix that exceeds 16 bits.

GetAccount returns StorageSlotNotFound when a storage map request names a slot that the account does not have at the requested block. It returns StorageSlotNotMap when the named slot is a value slot.

Unused values remain reserved. Clients must accept unknown detail codes and fall back to the gRPC status code.

Transaction Submission Errors​

SubmitProvenTx and SubmitProvenTxBatch share the submission codes in the table above. These codes identify failures during submission validation or in the sequencer's mempool.

Expired means the transaction or batch has expired, or will expire too soon for the sequencer to consider accepting it.

StateConflict means the transaction conflicts with the chain or mempool state. It can represent spent nullifiers, duplicate output notes, missing unauthenticated input notes, or an account initial commitment mismatch. Use the status message for the specific conflict, and use the detail byte when a client needs stable branching between broad submission failure classes.

CapacityExceeded means the mempool capacity has been exhausted and is under load.

AuthenticationFailed means the transaction failed authentication against the chain state. For example, an input nullifier already exists. The status message includes the cause.

MissingFee means that a standalone transaction submitted through SubmitProvenTx does not contain an output note with the TX_FEE script when the reference block's verification base fee is nonzero. A transaction can omit the fee note when that base fee is zero. Each fee note must contain exactly one native asset, as specified by the reference block's protocol configuration, even when fees are zero. InvalidFeeAsset means that a fee note does not meet this asset requirement. The internal SubmitAuthenticatedTx endpoint applies the same checks. Transactions within user-submitted batches are exempt because those batches handle their own fee collection. These checks do not establish that the fee amount is sufficient. A fee note can contain a zero-valued native asset when the required fee is zero.

Encrypted input errors​

Rejections caused by the sealed transaction inputs happen before the mempool, so they carry no Miden detail code and fall into the ordinary-gRPC-status bucket described above:

  • INVALID_ARGUMENT when the sealed inputs are absent, empty, or fail to authenticate. Failing to authenticate is deliberately indistinguishable between a wrong key, tampered ciphertext, a blob sealed for a different transaction or network, and corrupt framing.
  • FAILED_PRECONDITION when the inputs were sealed against a key the validator does not hold. This is the one case a client can act on: re-fetch GetTransactionEncryptionKey and seal again. Treat it as non-retryable without re-sealing, and back off rather than retrying in a tight loop, since official endpoints may rate limit requests at the infrastructure level.

Historical account and chain reads​

V2 SyncChainMmr returns INVALID_ARGUMENT for a target below the starting height and OUT_OF_RANGE for a target above the requested finality tip. If the node has pruned account state at the authenticated height, select a newer authenticated block and repeat all account reads there.

Request Limits​

Use GetLimits to discover method-specific request limits before sending large sync requests. Methods such as GetAccount, SyncNotes, SyncNullifiers, and GetNotesById may reject requests that exceed the configured limit. Split larger requests into smaller batches.

The limits are returned in json format as follows:

{
"endpoints": {
"GetAccount": { "parameters": { "storage_map_key": 64, "storage_maps": 255, "vault_asset": 64 } },
"GetNotesById": { "parameters": { "note_id": 100 } },
"SyncNotes": { "parameters": { "note_tag": 1000 } },
"SyncNullifiers": { "parameters": { "nullifier_prefix": 1000 } },
"SyncTransactions": { "parameters": { "account_id": 1000 } }
}
}

GetAccount advertises separate limits for requested vault assets (vault_asset), total storage map keys across slots (storage_map_key), and explicitly requested storage map slots (storage_maps). The vault limit counts asset IDs whose inclusion or absence is proved, regardless of the total number of assets in the account. When splitting vault queries, set the same block_num for each batch so all proofs refer to the same account state.

A selective vault query may return proofs for the requested assets or the complete vault within the full-vault entry limit. Clients must verify a complete vault's root against the account header before deriving the requested witnesses, including proofs for assets absent from the vault.

Historical State Retention​

GetAccount can return the state of a public account as of a specific past block. The node keeps this history only for the most recent 50 blocks: vault assets, storage map values, and account code that can no longer affect any block inside that window are pruned as new blocks are applied. The window is a compile-time constant of the store (HISTORICAL_BLOCK_RETENTION) rather than a runtime option, and it is measured in blocks, so its wall-clock duration depends on the network's block time.

Requesting a block that has fallen outside the window fails with INVALID_ARGUMENT and the BlockPruned detail code (5). Use the detail code rather than matching on the error message. The effective boundary may also lag the chain tip by a few blocks while in-flight reads still pin older snapshots, so treat the window as approximate rather than exact.

Flows that execute against a captured reference block, such as collecting several signatures before submitting a transaction, must complete within this window or re-anchor to a newer block.

Content Negotiation​

The RPC server checks the Accept header for Miden-specific media parameters:

application/vnd.miden; genesis=<genesis-commitment>

The genesis parameter is optional for read requests. Write requests, including SubmitProvenTx and SubmitProvenTxBatch, require it so the client explicitly targets the intended network.

The RPC API is versioned by its protobuf package, currently miden.node.v1 and miden.node.v2. Legacy clients may still include a version parameter in the Accept header; the server ignores its value.