Skip to main content

Protocol RPC

Protocol RPC indexes public chain events into protocol data an application can query: ordinary Note outputs, Credit states, roots, membership paths, registry records, and settlement operations. It accepts no transactions, holds no wallet keys, and does not decrypt outputs or generate spending proofs.

Role in the system​

ComponentResponsibility
Chain RPCEVM blocks, receipts, contract reads, and native safe/finalized tags
Protocol RPCIndex, organize, and paginate public data for one pinned Core deployment
SDK / walletLocal detection, decryption, commitment recomputation, authorization, proving, and private inventory
BroadcasterOptional quoting, validation, and transaction relay

Protocol RPC is not a general EVM proxy. It has no eth_*, wallet signing, transaction submission, WebSocket, or subscription interface. The restricted invisi_readChainState gateway permits specific chain reads rather than arbitrary EVM calls.

Bind the deployment before reading state​

The API path version v1, Protocol version 1, and server software version are separate concepts. Obtain the chain ID, Core instance address, runtime code hash, and deployment start block from trusted configuration, then compare them with invisi_getDeployment. Discovery lists active routes; it does not authenticate the service or establish index freshness.

These read-only examples require a POSIX shell and curl. Set PROTOCOL_RPC_BASE_URL to the operator-provided service root URL without /v1, and CHAIN_ID to the expected canonical positive decimal chain ID. Use HTTPS for remote services; the examples supply no production deployment.

: "${PROTOCOL_RPC_BASE_URL:?Set the trusted service root URL}"
: "${CHAIN_ID:?Set the expected decimal chain ID}"
PROTOCOL_RPC_BASE_URL="${PROTOCOL_RPC_BASE_URL%/}"
PROTOCOL_RPC_URL="$PROTOCOL_RPC_BASE_URL/v1/chains/$CHAIN_ID"
curl --fail-with-body -sS "$PROTOCOL_RPC_BASE_URL/v1"
curl --fail-with-body -sS "$PROTOCOL_RPC_URL" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"invisi_getDeployment","params":[]}'
curl --fail-with-body -sS "$PROTOCOL_RPC_URL" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":2,"method":"invisi_getStatus","params":[]}'

Inspect JSON-RPC error even when HTTP is 200. After checking deployment identity, record indexedHead and finality separately: the index head is not the finality head. Before the first checkpoint, indexedHead can be null while deployment and version queries remain available.

Choose the trust model explicitly​

With independent verification, the client authenticates canonical blocks and roots through an independent Chain RPC, verifies membership paths, and matches outputs to local private materials. A membership path alone proves neither spending authority nor unspent status.

Trusted confirmation uses invisi_getNote(commitment, {finality:"finalized"}) or safe. The service checks receipts, canonical blocks, paths, and recorded roots and returns confirmed/pending evidence. This explicitly trusts the selected Protocol RPC and its upstream; it is not independent light-client verification. The restricted chain-read gateway requires the same explicit trust decision.

Both paths require local binding of the expected commitment to the business order and protection against repeated redemption. Null results, unobserved outputs, and index lag do not prove payment absence.

Keep ordinary Notes and Credit distinct​

An ordinary Note is a funds output; Credit is spending-authority state. Creating Credit generally deposits no principal. A draw produces successor Credit states and an ordinary receiver Note. Credit consumption and the revocation bitmap are separate facts: an unconsumed state can still be revoked.

Recovery decrypts public ciphertext locally and recomputes commitments. Credit day/month usage follows the canonical transition block's UTC timestamp, never the browser's local date.

Continue integration​