Getting Started

Go from zero to a verified operation record in under five minutes.

1. Create an Account

Register your organization to get API credentials.

bash
curl -X POST https://api.elydora.com/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@acme.com",
    "password": "your-secure-password",
    "orgName": "Acme Corp"
  }'

2. Install an SDK

Choose your language and install the Elydora client library.

bash
# Node.js
npm install @elydora/sdk

# Python
pip install elydora

# Go
go get github.com/elydora/sdk-go

3. Initialize the Client

Configure the client with your organization ID, agent ID, and private key.

typescript
import { ElydoraClient } from '@elydora/sdk';

const client = new ElydoraClient({
  orgId: 'org_acme',
  agentId: 'agent_underwriter',
  privateKey: process.env.ELYDORA_KEY,
});

4. Register an Agent

Before submitting operations, register the agent with its Ed25519 public key.

typescript
const agent = await client.registerAgent({
  agentId: 'agent_underwriter',
  publicKey: publicKeyBase64,
  label: 'Loan Underwriter v2',
});

5. Submit an Operation

Create and submit a signed operation record. The SDK handles signing, chain-hashing, and nonce generation automatically.

typescript
const record = client.createOperation({
  type: 'loan.approve',
  payload: { loanId: 'LN-2026-001', amount: 50000 },
});

const receipt = await client.submitOperation(record);
// receipt.ear → Elydora Acknowledgement Receipt
// receipt.ech → Elydora Chain Hash

6. Verify the Record

Verify that a submitted operation is intact and correctly chain-linked.

typescript
const verification = await client.verifyOperation(receipt.operationId);
console.log(verification.valid); // true

Complete Example: Logging an AI Agent Decision

This end-to-end Node.js script demonstrates the full lifecycle: creating a client, constructing an EOR with real fields, signing and submitting the operation, receiving an EAR, and verifying the record.

complete-example.ts
import { ElydoraClient } from '@elydora/sdk';

async function main() {
  // 1. Create the client with your org, agent, and private key
  const client = new ElydoraClient({
    orgId: 'org_acme',
    agentId: 'agent_underwriter',
    privateKey: process.env.ELYDORA_KEY,
  });

  // 2. Construct an operation record for a loan approval decision
  //    The SDK auto-generates: operation_id, issued_at, nonce,
  //    payload_hash, prev_chain_hash, and signature.
  const record = client.createOperation({
    type: 'loan.approve',
    subject: 'borrower:BRW-2026-0042',
    action: 'approve',
    payload: {
      loanId: 'LN-2026-001',
      borrowerId: 'BRW-2026-0042',
      amount: 50000,
      currency: 'USD',
      term: '30y',
      interestRate: 6.25,
      riskScore: 'A2',
      approvalReason: 'Debt-to-income ratio within threshold',
    },
  });

  // The full EOR that gets submitted contains all 15 fields:
  //   op_version, operation_id, org_id, agent_id, issued_at,
  //   ttl_ms, nonce, operation_type, subject, action, payload,
  //   payload_hash, prev_chain_hash, agent_pubkey_kid, signature

  // 3. Submit the signed EOR to Elydora (POST /v1/operations)
  const receipt = await client.submitOperation(record);

  console.log('Operation submitted successfully');
  console.log('  operation_id:', receipt.operationId);
  console.log('  receipt_id:  ', receipt.receiptId);
  console.log('  seq_no:      ', receipt.seqNo);
  console.log('  chain_hash:  ', receipt.chainHash);

  // 4. Verify the operation (POST /v1/operations/:id/verify)
  const verification = await client.verifyOperation(receipt.operationId);

  console.log('Verification result:', verification.valid);
  console.log('  signature_valid: ', verification.checks.signatureValid);
  console.log('  chain_hash_valid:', verification.checks.chainHashValid);
  console.log('  ttl_valid:       ', verification.checks.ttlValid);
  console.log('  replay_check:    ', verification.checks.replayCheck);
  console.log('  agent_status:    ', verification.checks.agentStatus);
}

main().catch(console.error);

What Gets Sent to the API

The SDK constructs the following EOR and sends it to POST https://api.elydora.com/v1/operations:

Full EOR Payload
{
  "op_version": 1,
  "operation_id": "550e8400-e29b-41d4-a716-446655440000",
  "org_id": "org_acme",
  "agent_id": "agent_underwriter",
  "issued_at": "2026-02-28T14:00:00Z",
  "ttl_ms": 30000,
  "nonce": "a1b2c3d4e5f6",
  "operation_type": "loan.approve",
  "subject": "borrower:BRW-2026-0042",
  "action": "approve",
  "payload": {
    "loanId": "LN-2026-001",
    "borrowerId": "BRW-2026-0042",
    "amount": 50000,
    "currency": "USD",
    "term": "30y",
    "interestRate": 6.25,
    "riskScore": "A2",
    "approvalReason": "Debt-to-income ratio within threshold"
  },
  "payload_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb924...",
  "prev_chain_hash": "sha256:d7a8fbb307d7809469ca9abcb0082e4f...",
  "agent_pubkey_kid": "kid_abc123",
  "signature": "base64:ed25519-signature-bytes..."
}

The EAR Response

Elydora responds with an Elydora Acknowledgement Receipt confirming the operation was received and sequenced:

EAR Response
{
  "receipt_id": "rcpt_xyz789",
  "operation_id": "550e8400-e29b-41d4-a716-446655440000",
  "seq_no": 42,
  "chain_hash": "sha256:ghi789...",
  "server_received_at": "2026-02-28T14:00:01Z",
  "elydora_signature": "base64-elydora-sig..."
}

Next Steps