Skip to main content
For the complete documentation index, see llms.txt

Decode 1010 transaction rejection errors

Resolve 1010 Invalid Transaction responses by decoding the inner Custom error: N value into a Midnight ledger error variant.

Understand the cause of the error

When you submit a transaction to a Midnight node, the JSON-RPC layer may reject it with code 1010:

{
"code": 1010,
"message": "Invalid Transaction",
"data": "Custom error: 155"
}

Code 1010 itself is a Substrate envelope, not a Midnight-specific error. It signals that the node's transaction pool rejected the extrinsic. The actionable signal is the N in Custom error: N, which is a u8 (0–255) corresponding to a LedgerApiError variant defined by the Midnight node.

Two layers, one error

The 1010 is inherited from Substrate. The inner u8 is Midnight's. To diagnose the problem, you must decode the u8.

Extract the inner u8

The inner u8 is embedded in the data field of the RPC error response. Use the steps below to extract it from common client environments.

1

Capture the full RPC response

Capture the complete error response, not just the message string. Many wallet libraries and CLI wrappers truncate the data field by default.

try {
await api.tx.someCall().signAndSend(account);
} catch (err) {
console.error(JSON.stringify(err, null, 2));
}
2

Read the trailing integer in the data field

The data field ends with Custom error: N where N is the variant code:

"data": "Custom error: 155"

In this example, N is 155.

3

Look up the variant

Use the variant tables below to map the u8 to its ledger error name and category.

Variant codes change between releases

Variant numbering is defined by the Midnight node and may change across releases. For example, 168 FeeCalculation was retired and replaced by 155 FeeCalculationError. Always cross-reference the variant against the release notes for the node version your network is running.

Look up the variant

The tables below list every LedgerApiError variant currently emitted by the Midnight node, grouped by category. Each row shows the u8, the variant name, and the meaning. Use the Custom error: N value extracted in the previous step to find the corresponding row.

Deserialization errors (0–11)

The node could not decode an input from its serialized form. The transaction is rejected before any ledger logic runs.

Show full table
CodeVariant
0NetworkId
1Transaction
2LedgerState
3ContractAddress
4PublicKey
5VersionedArenaKey
6UserAddress
7TypedArenaKey
8SystemTransaction
9DustPublicKey
10CNightGeneratesDustActionType
11CNightGeneratesDustEvent

Serialization errors (50–63)

The node could not encode a value to its serialized form. These typically indicate an internal inconsistency rather than a client error.

Show full table
CodeVariant
50TransactionIdentifier
51LedgerState
52LedgerParameters
53ContractAddress
54ContractState
55ContractStateToJson
56ZswapState
57UnknownType
58MerkleTreeDigest
59VersionedArenaKey
60TypedArenaKey
61CNightGeneratesDustEvent
62SystemTransaction
63ArenaHash

Invalid transactions (100–109, 193–200, 239–250)

The transaction is structurally valid but conflicts with current ledger state. These are the most common rejections in production traffic.

Show full table
CodeVariant
100EffectsMismatch
101ContractAlreadyDeployed
102ContractNotPresent
103Zswap
104Transcript
105InsufficientClaimable
106VerifierKeyNotFound
107VerifierKeyAlreadyPresent
108ReplayCounterMismatch
109UnknownError
193ReplayProtectionViolation (Retired)
194BalanceCheckOutOfBounds
195InputNotInUtxos
196DustDoubleSpend
197DustDeregistrationNotRegistered
198GenerationInfoAlreadyPresent
199InvariantViolation
200RewardTooSmall
239Zswap.Invalid.NullifierAlreadyPresent
240Zswap.Invalid.CommitmentAlreadyPresent
241Zswap.Invalid.UnknownMerkleRoot
242ReplayProtectionViolation.IntentTtlExpired
243ReplayProtectionViolation.IntentTtlTooFarInFuture
244ReplayProtectionViolation.IntentAlreadyExists
248DivideByZero
249Invalid.MerkleTreeError
250Zswap.Invalid.MerkleTreeError

Malformed transactions (110–139, 166–192, 212–238)

The transaction failed structural or cryptographic validation. The submitting client should treat these as bugs in transaction construction or signing.

Show full table
CodeVariant
110VerifierKeyNotSet
111TransactionTooLarge
112VerifierKeyTooLarge
113VerifierKeyNotPresent
114ContractNotPresent
115InvalidProof
116BindingCommitmentOpeningInvalid
117NotNormalized
118FallibleWithoutCheckpoint
119ClaimReceiveFailed
120ClaimSpendFailed
121ClaimNullifierFailed
122ClaimCallFailed
123InvalidSchnorrProof
124UnclaimedCoinCom
125UnclaimedNullifier
126Unbalanced
127Zswap
128BuiltinDecode
129GuaranteedLimit
130MergingContracts
131CantMergeTypes
132ClaimOverflow
133ClaimCoinMismatch
134KeyNotInCommittee
135InvalidCommitteeSignature
136ThresholdMissed
137TooManyZswapEntries
138BalanceCheckOverspend
139UnknownError
166InvalidNetworkId
167IllegallyDeclaredGuaranteed
168FeeCalculation (Retired)
169InvalidDustRegistrationSignature
170InvalidDustSpendProof
171OutOfDustValidityWindow
172MultipleDustRegistrationsForKey
173InsufficientDustForRegistrationFee
174MalformedContractDeploy
175IntentSignatureVerificationFailure
176IntentSignatureKeyMismatch
177IntentSegmentIdCollision
178IntentAtGuaranteedSegmentId
179UnsupportedProofVersion
180GuaranteedTranscriptVersion
181FallibleTranscriptVersion
182TransactionApplicationError (Retired)
183BalanceCheckOutOfBounds
184BalanceCheckConversionFailure
185PedersenCheckFailure
186EffectsCheckFailure (Retired)
187DisjointCheckFailure (Retired)
188SequencingCheckFailure (Retired)
189InputsNotSorted
190OutputsNotSorted
191DuplicateInputs
192InputsSignaturesLengthMismatch
212EffectsCheck.RealCallsSubsetCheckFailure
213EffectsCheck.AllCommitmentsSubsetCheckFailure
214EffectsCheck.RealUnshieldedSpendsSubsetCheckFailure
215EffectsCheck.ClaimedUnshieldedSpendsUniquenessFailure
216EffectsCheck.ClaimedCallsUniquenessFailure
217EffectsCheck.NullifiersNeqClaimedNullifiers
218EffectsCheck.CommitmentsNeqClaimedShieldedReceives
219SequencingCheck.CallSequencingViolation
220SequencingCheck.SequencingCorrelationViolation
221SequencingCheck.GuaranteedInFallibleContextViolation
222SequencingCheck.FallibleInGuaranteedContextViolation
223SequencingCheck.CausalityConstraintViolation
224SequencingCheck.CallHasEmptyTranscripts
225DisjointCheck.ShieldedInputsDisjointFailure
226DisjointCheck.ShieldedOutputsDisjointFailure
227DisjointCheck.UnshieldedInputsDisjointFailure
228TransactionApplication.IntentTtlExpired
229TransactionApplication.IntentTtlTooFarInFuture
230TransactionApplication.IntentAlreadyExists
231FeeCalculation.OutsideTimeToDismiss
232FeeCalculation.BlockLimitExceeded
233MalformedContractDeploy.NonZeroBalance
234MalformedContractDeploy.IncorrectChargedState
235Zswap.Malformed.InvalidProof
236Zswap.Malformed.ContractSentCiphertext
237Zswap.Malformed.NonDisjointCoinMerge
238Zswap.Malformed.NotNormalized

Infrastructure errors (150–157, 165)

The node could not complete an internal operation, such as a ledger lookup or fee calculation. These are not caused by the submitted transaction.

Show full table
CodeVariant
150LedgerCacheError
151NoLedgerState
152LedgerStateScaleDecodingError
153ContractCallCostError
154BlockLimitExceededError
155FeeCalculationError
156ContractNotPresent
157BeneficiaryNotFound
165GetTransactionContextError

System transactions (201–211, 245–247)

The node rejected a system-level transaction such as a payout or treasury operation. These are typically only seen by validators or block producers.

Show full table
CodeVariant
201IllegalPayout
202InsufficientTreasuryFunds
203CommitmentAlreadyPresent
204UnknownError
205ReplayProtectionFailure (Retired)
206IllegalReserveDistribution
207GenerationInfoAlreadyPresent
208InvalidBasisPoints
209InvariantViolation
210TreasuryDisabled
211MerkleTreeError
245SystemTransaction.ReplayProtectionFailure.IntentTtlExpired
246SystemTransaction.ReplayProtectionFailure.IntentTtlTooFarInFuture
247SystemTransaction.ReplayProtectionFailure.IntentAlreadyExists

Host API error (255)

A reserved variant indicating that the node's host API surfaced an error not covered by the categories above.

Show full table
CodeVariant
255HostApiError

Common causes and fixes

The following variants account for the majority of 1010 errors.

155 FeeCalculationError — fee calculation failed for the submitted transaction

Most often caused by stale fee estimates or an outdated runtime client. Refresh the client's view of network fees and resubmit. If the error persists, verify that your runtime packages match the values in the release compatibility matrix.

154 BlockLimitExceededError — the transaction would exceed the block resource limits

Reduce the number of intents, calls, or similar in the transaction. For batched operations, split the work across multiple transactions.

108 ReplayCounterMismatch / 193 ReplayProtectionViolation — replay protection rejected the transaction

Either the replay counter is stale or the intent's TTL window has elapsed. Re-fetch the current counter and rebuild the transaction. Variants 242244 and 228230 give finer-grained reasons (TTL expired, TTL too far in the future, intent already exists).

115 InvalidProof / 235 Zswap.Malformed.InvalidProof — a zero-knowledge proof failed verification

Confirm that the proof server is running a version compatible with the node and SDK. See run a proof server and the release compatibility matrix.

166 InvalidNetworkId — the transaction was constructed for a different network

Verify that the SDK and wallet are configured for the same network ID as the node you are submitting to (for example, Preprod vs TestNet02).

126 Unbalanced / 138 BalanceCheckOverspend — the transaction's inputs and outputs do not balance

The wallet attempted to spend more than the available coin set permits, or change outputs were miscalculated. Re-sync the wallet and rebuild the transaction.

When 1010 has no inner u8

If the response contains code: 1010 but no Custom error: N substring, the rejection happened in upstream Substrate validation rather than Midnight ledger logic. The most common causes are:

  • Bad signature: the signing key does not match the sender, or the payload was altered after signing.
  • Stale era: the mortal era window has passed. Re-fetch the current block hash and rebuild the transaction.
  • Wrong nonce: the account nonce on the node does not match the value used when signing. Query the current nonce and resubmit.

These rejections are not represented in the LedgerApiError tables because they never reach the ledger.

Verify the fix

After identifying and addressing the variant, resubmit the transaction and confirm it is accepted:

# Re-submit and observe the response
curl -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"author_submitExtrinsic","params":["0x..."]}' \
http://localhost:9944

A successful submission returns a transaction hash rather than an error envelope.

Get help

If you cannot identify the variant or the rejection persists after applying the fixes above:

  • Confirm the node version: Variant numbering changes across releases. Check the node release notes for the version your network is running.
  • Check the compatibility matrix: Verify the proof server, runtime, and SDK match the supported set in the release compatibility matrix.