Implement the state store
read returns null for a key that was never written. write must complete durable persistence before its promise resolves. A store that resolves on a buffered write, or on a replica that has not yet committed, can lose a credential or a nonce that OMS has already seen.
Encrypt credentials
Wrap your store so credentials are encrypted at rest:encryptionKey is 32 random bytes, base64 encoded. Any other length raises CONFIGURATION.
Choose the namespace
The namespace is the encryption context. It must be stable for the lifetime of the wallet, unique to one identity, and identical across every instance serving that identity:STORAGE_INTEGRITY. When you see it, check that the key and namespace match the ones used to write, and that the database and its records are intact. Do not clear the record to clear the error.
Provide exclusive execution
run must hold exclusive ownership of the identity’s state for the entire async task, including its remote calls. The SDK advances each RPC nonce durably before dispatching the request, so two concurrent tasks will consume the same nonce and one request will fail verification.
Every instance that touches one identity’s state must share that ownership.
A clustered backend needs a coordinator that provides exclusive ownership across processes, including recovery when a process crashes mid-task. Allocating nonces centrally is not sufficient on its own: the lock must span the whole operation, because the SDK’s remote calls happen inside it.
Attestation
Every OMS response passes Nitro root, certificate, COSE, PCR0, freshness, nonce, and body-binding verification before the SDK returns it. There is no bypass and no option to weaken it. A response that fails any check raisesATTESTATION_FAILED.
The transport bounds response sizes, times requests out after 20 seconds, and refuses redirects.
An unsigned gateway error can surface as an attestation failure, so check your publishable key and allowed origin before assuming an enclave problem.
Continue with transfers to move funds, or balances for reads that need none of this state.