DEVELOPER PLATFORM · CLIENT SDK & APIS
Build private onchain workflows.
Integrate deterministic client note generation, shielded commitments, and verifiable settlement routing on Robinhood Chain.
INTEGRATION
Quickstart
npm install @robtrade/sdk ethers
Client-Side Usage Example
Create client notes, shield assets, and attach encrypted recovery payloads to your authenticated wallet.
import { makeNote, encryptNote, api, sendPreparedTx, signIn } from '/app/common.js';
// 1. Sign in with Ethereum (SIWE)
const address = await signIn();
console.log('Connected wallet:', address);
// 2. Generate a client-side note for 0.01 ETH (10^16 wei)
// Secrets are generated in the browser via Web Crypto API
const note = await makeNote('10000000000000000');
console.log('Deterministic Commitment:', note.commitment);
// 3. Encrypt note locally with user password before sending
const encryptedNote = await encryptNote(note, 'user-secret-passphrase-1234');
// 4. Prepare shield transaction on Robinhood Chain
const prep = await api('/vault/shield/prepare', {
method: 'POST',
body: JSON.stringify({ commitment: note.commitment, amountWei: note.amountWei })
});
// 5. Send transaction with wallet and attach encrypted payload
const txHash = await sendPreparedTx(prep.tx);
await api('/vault/notes/attach', {
method: 'POST',
body: JSON.stringify({ commitment: note.commitment, txHash, encryptedNote })
});
console.log('Successfully shielded assets! TX:', txHash);
REST ENDPOINTS
Backend API Surface
All backend routes are validated, protected by rate limiting, and use EIP-4361 SIWE tokens for authenticated endpoints.
Issue an EIP-4361 SIWE challenge nonce bound to the requesting address.
{ "address": "0x123...abc" }
→ { "nonce": "a9f3b18c..." }
Verify SIWE personal signature and issue authenticated JWT bearer token.
{ "message": "...", "signature": "0x..." }
→ { "token": "eyJhbG...", "address": "0x..." }
Prepare transaction calldata to deposit assets into the commitment pool.
{ "commitment": "0x...", "amountWei": "1000000" }
→ { "tx": { "to": "0x...", "data": "0x...", "value": "1000000" } }
Store ciphertext note associated with your authenticated wallet.
{ "commitment": "0x...", "txHash": "0x...", "encryptedNote": "{...}" }
→ { "ok": true, "note": { "id": 1 } }
Fetch all encrypted notes stored for the authenticated caller.
Header: Authorization: Bearer <token>
→ { "notes": [ { "id": 1, "commitment": "0x...", "encryptedNote": "..." } ] }
Get user's shielded and unshielded transaction ledger history.
Header: Authorization: Bearer <token>
→ { "history": [ { "type": "shield", "txHash": "0x...", "amountWei": "..." } ] }
Query 0x protocol routing quote for token swaps on Robinhood Chain.
{ "tokenIn": "0x...", "tokenOut": "0x...", "amountIn": "1000" }
→ { "quoteId": "q_123", "price": "...", "buyAmount": "..." }
Lock executable calldata and prepare swap transaction order.
{ "quoteId": "q_123" }
→ { "order": { "id": "ord_1", "expectedTo": "0x...", "expectedData": "0x..." } }
Verify submitted swap hash onchain and mark transaction completed.
{ "txHash": "0x..." }
→ { "ok": true, "status": "CONFIRMED" }
List confirmed settlement transactions with public proof receipts.
→ { "settlements": [ { "txHash": "0x...", "blockNumber": 149204 } ] }
SECURITY BOUNDARIES
Protocol Architecture
RobTrade uses strict cryptographic boundary separation. Secrets and private keys never leave client memory.
SHA-256 deterministic commitment is calculated locally. Plaintext note is encrypted using PBKDF2 (150,000 iterations) with AES-256-GCM.
Backend prepares non-custodial EVM transactions. The backend never holds custody of funds or private keys.
Transactions settle on Robinhood Chain. Public explorer witnesses proof execution, without exposing trading size or account balance.
Next Protocol Upgrades
Full ZK-SNARK verifier circuit, viewing-key protocol for audited compliance, and private relayer execution network.