RPC Node

Our RPC Node Proxy operates as a secure gateway that provides authenticated access to the StarkNet RPC node. It acts as an intermediary between your applications and StarkNet nodes, requiring cryptographic signatures for all authenticated requests to ensure security and privacy.

Overview

The RPC Node Proxy implements a signature-based authentication system using EIP-712 typed data for StarkNet. While non-authenticated requests are allowed, they return masked data for privacy.

When you authenticate with your account’s private key, you gain full access to your own account’s data, while other accounts’ data remains masked. This privacy-preserving approach ensures that users can access their own information while protecting sensitive data from other accounts on the network.

RPC Compatibility
  • Apart from the authentication layer and data masking, the proxy is fully compatible with standard StarkNet RPC nodes. It follows the JSON-RPC 2.0 specification and supports all StarkNet RPC API methods with identical input parameters and output formats.
  • Supports both v0.7 and v0.8 StarkNet RPC endpoints

Access Model

Authenticated Requests
  • Full access to your account data
  • All other account data masked
  • Public data fully accessible
Non-Authenticated Requests
  • All account data masked
  • Public data fully accessible

Authentication Flow

1

Request Preparation

Prepare your RPC request payload, as per StarkNet RPC specs

2

Request Hashing

Hash your json payload via Poseidon Hashing algorithm

3

Signature Generation

Sign the request using EIP-712 typed data

4

Request Submission

Send the signed request to the proxy including required headers

5

Signature Verification

Proxy verifies the signature and account ownership

6

RPC Forwarding

Valid requests are forwarded to the StarkNet RPC node

7

Response

Full response is returned for your account’s data, other accounts remain masked

API Endpoints

The RPC Node Proxy supports the following endpoints:

Signature Requirements

EIP-712 Typed Data Structure

All authenticated requests must be signed using the following EIP-712 typed data structure (version 1.0.0):

1{
2 "types": {
3 "StarkNetDomain": [
4 {"name": "name", "type": "felt"},
5 {"name": "chainId", "type": "felt"},
6 {"name": "version", "type": "felt"}
7 ],
8 "Request": [
9 {"name": "account", "type": "felt"},
10 {"name": "payload", "type": "felt"},
11 {"name": "timestamp", "type": "felt"},
12 {"name": "version", "type": "felt"}
13 ]
14 },
15 "primaryType": "Request",
16 "domain": {
17 "name": "Paradex",
18 "version": "1",
19 "chainId": "0x505249564154455f534e5f50415241434c4541525f4d41494e4e4554"
20 },
21 "message": {
22 "account": "0x1234567890abcdef...",
23 "payload": 3096312504809894877925894218655910104405544970396306324858916271221086864083,
24 "timestamp": 1710793629,
25 "version": "1.0.0"
26 }
27}

FieldDescription
nameService identifier (“Paradex”)
versionProtocol version (“1”)
chainIdStarkNet chain ID

FieldDescription
accountYour StarkNet account address used for signature verification
payloadThe Poseidon hash of your JSON-encoded RPC request payload
timestampUnix timestamp in seconds when the signature was created
versionSignature version (currently only “1.0.0” is supported)

Required Headers

All authenticated requests must include these headers.

If authentication headers are missing, the request proceeds in unauthenticated mode.

HeaderDescriptionFormatExample
PARADEX-STARKNET-ACCOUNTYour StarkNet account address0x + 1-64 hex characters0x1234567890abcdef...
PARADEX-STARKNET-SIGNATUREJSON array of signature values (r, s)JSON array of 2 strings["1234","5678"]
PARADEX-STARKNET-SIGNATURE-TIMESTAMPUnix timestamp when signature was createdUnix timestamp as string1710793629
PARADEX-STARKNET-SIGNATURE-VERSIONSignature version (currently only “1.0.0”)String1.0.0

Request Examples

$curl -X POST https://rpc.api.prod.paradex.trade/rpc/v0_7 \
> -H "Content-Type: application/json" \
> -H "PARADEX-STARKNET-ACCOUNT: 0x1234567890abcdef..." \
> -H "PARADEX-STARKNET-SIGNATURE: [\"1234\",\"5678\"]" \
> -H "PARADEX-STARKNET-SIGNATURE-TIMESTAMP: 1710793629" \
> -H "PARADEX-STARKNET-SIGNATURE-VERSION: 1.0.0" \
> -d '{"jsonrpc": "2.0", "method": "starknet_blockNumber", "params": [], "id": 1}'

Security Considerations

  • Private Key Security: Never expose your private keys in client-side code
  • Timestamp Validation: Ensure your system clock is synchronized to prevent timestamp-related errors
    • Future timestamps: Maximum 1 second tolerance
    • Past timestamps: Subject to configurable expiry time
  • Signature Uniqueness: Each request requires a fresh signature with a current timestamp
  • Network Security: Always use HTTPS when making requests to the proxy

Error Responses

ErrorDescription
Invalid StarkNet AddressThe account address is not a valid StarkNet address (must be 0x + 1-64 hexadecimal characters)
Invalid TimestampThe signature timestamp is not a valid Unix timestamp
Timestamp ExpiredThe signature timestamp is older than the allowed expiry time
Timestamp FutureThe signature timestamp is more than 1 second in the future
Invalid Signature VersionThe signature version is not supported (currently only “1.0.0” is supported)
Signature Verification FailedThe signature cannot be verified against the account’s public key
StarkNet Call ErrorError occurred while calling StarkNet RPC methods, typically due to malformed RPC request