05 sdk guide

05 / SDK Guide: The Validator’s Handbook

The Sovereign SDK (v3.0.2) is the technical interface for the Synthesis Ledger. It is the tool used by businesses, entrepreneurs, and the Genesis 90 Council to perform quality audits. It bridges the gap between raw AI output and the immutable Base Mainnet Ledger.

1. Technical Requirements

To run a quality audit, your environment must meet these specifications:

  • Node.js: Version 18.0.0 or higher.
  • Network: Access to Base Mainnet (via RPC).
  • Storage: Access to Arweave (public gateways).
  • AI Engine: Valid xAI API Key (for the Deterministic Brain Phase).

2. Installation

The SDK is distributed via the global NPM registry. Install the Zero-Fluff CLI tools by executing:

npm install -g synthesis-ledger-sdk

3. Production Environment Configuration

The SDK requires a .env file in your project root to anchor the tool to the V42 Granite production addresses.

File: .env

# V42 GRANITE PRODUCTION ANCHORS
NEXT_PUBLIC_REGISTRY_ADDRESS="0x3fB0a9a5755f43A044ff0A9E9aC4B55f96220ECa"
NEXT_PUBLIC_SYNL_TOKEN_ADDRESS="0x77c4E6919241d6D36e35626F02336D6d4605bfa4"
NEXT_PUBLIC_BASE_RPC_URL="https://mainnet.base.org"

# OPERATIONAL KEYS
XAI_API_KEY="xai-..."     # Required for Brain Phase
PRIVATE_KEY="0x..."       # Required for Integrity Sealing (Must hold $SYNL)

4. CLI Command Reference: Initiating an Audit

The run command requires two specific arguments: the Logic ID and the Input Data.

CRITICAL: You must wrap your data in double quotes ". If your data includes internal quotes, escape them or use single quotes. Failure to use outer quotes will cause the CLI to fragment your input and fail the audit.

A. Interrogate the Ledger

Verify the protocol health, check the 1B $SYNL supply, and view Atomic status.

synl interrogate

B. Sandbox Audit (Test with Data)

Test your business logic without spending $SYNL gas. You must provide the business data you want analyzed.

# Format: synl run [LOGIC_ID] "[YOUR_DATA_STRING]" --sandbox

# Example: Auditing a retail solvency case
synl run A-CFO-SolvencyAudit "Revenue: 5M, Debt: 2M, Cash: 500k, Inventory_Value: 1.2M" --sandbox

C. Live Sealing (Commit to Ledger)

Anchors the result permanently to the Base blockchain. This consumes the USD equivalent of $0.10 in $SYNL.

# Format: synl run [LOGIC_ID] "[YOUR_DATA_STRING]"

# Example: Sealing marketing pulse data
synl run A-CMO-PulseHarvester "Campaign_ID: 42, Reach: 50k, CTR: 3.4%, Sentiment: 0.88"

5. Error Handling & Failure Scenarios

Scenario A: Audit Failure (BPS Below Floor)

If an audit falls below the 7,800 survival floor (due to model drift or bad data):

❌ Audit Failed
BPS Score: 7,234 / 10,000 (Target: > 7,800)
Status: Quality Strike Issued
Reason: Logic Drift detected in 'liquidity_ratio' field.
Action: Atomic ID 93 strikes increased (1/3).

Scenario B: Insufficient Fuel

If your wallet lacks the required $SYNL for a live seal:

❌ Transaction Error: Insufficient $SYNL Balance
Required: ~1.25 $SYNL ($0.10 USD equivalent)
Available: 0.12 $SYNL
Action: Deposit $SYNL to your wallet address or use --sandbox mode.

6. Troubleshooting: Windows .js File Association

If running synl opens a code editor instead of executing the audit, Windows has incorrectly associated .js files with a text editor. To fix this, open PowerShell as Administrator and run:

# Re-associate .js files with the Node.js engine
cmd /c "assoc .js=JSFile"
cmd /c 'ftype JSFile="C:\Program Files\nodejs\node.exe" "%1" %*'