A Deterministic, Reserve-Constrained Dollar Tender
Governed by the FIDES Protocol
- Overview
- Quick Start
- Installation
- Getting Started
- Usage Examples
- Design Principles
- What USD-N Is
- What USD-N Is Not
- Reserve & Issuance Model
- Counter-Cyclical Supply Control
- The FIDES Protocol
- The Constraint Triangle
- API Reference
- Deployment
- Development
- Architecture
- Documentation
- Troubleshooting
- Status
- Philosophy
- Acknowledgements
- License
USD-N is a digitally native monetary system that defines, enforces, and audits U.S. dollar–denominated tender under explicit, rule-based constraints.
USD-N is not a retail currency, not a discretionary monetary authority, and not a custodial system. It defines a programmable dollar rail whose issuance, redemption, and contraction are derivable from verifiable reserves and deterministic policy rules, rather than human judgment.
USD-N is governed by the FIDES Protocol, an invariant-driven fiscal engine that enforces monetary discipline, replayable auditability, and counter-cyclical behavior through code.
Protocol definition and core implementation only. Custody, deployment, distribution, and user interfaces are explicitly out of scope.
Execute the following commands to initialize and build USD-N locally:
# 1. Clone the repository
git clone https://github.com/dfeen87/USD-N.git
cd USD-N
# 2. Install dependencies
npm install
# 3. Build the project
npm run build
# 4. Run a simulation
npm run verify
# 5. Start the web interface and API
npm run serveAccess the local interface at http://localhost:3000.
- Node.js 20.x or higher (Download)
- npm 9.x or higher (included with Node.js)
- TypeScript 5.6+ (installed automatically)
npm installUSD-N is written in TypeScript and must be compiled before use:
npm run buildThis compiles all TypeScript files in src/ to JavaScript in dist/.
Run the test suite to ensure everything is working:
npm testYou should see output confirming all invariant tests pass.
USD-N can be used in several ways depending on your needs:
Execute a deterministic simulation of monetary policy scenarios:
npm run verifyThis executes a 12-step monetary policy simulation demonstrating:
- Policy-driven issuance based on CPI, GDP, and unemployment
- Reserve coverage enforcement
- Counter-cyclical supply adjustments
- Stress-based issuance multipliers
Example output:
2024-01-01T00:00:00.000Z MINT $250.00 :: FIDES: Expansion (CPI below target)
2024-01-01T00:00:00.000Z ALIGNMENT coverage=100.00% btc_share=30.00% stress_mult=0.85
...
Final supply: $3,000.00
Start the interactive web interface:
npm run serveAccess the local interface at http://localhost:3000. Key features include:
- Interactive protocol simulation
- Real-time event logging
- Live supply and reserve metrics
- Visual demonstration of deterministic issuance logic
The web server also exposes a REST API for programmatic access:
# Check node status
curl http://localhost:3000/api/status
# Get current supply
curl http://localhost:3000/api/ledger/supply
# Execute a policy step
curl -X POST http://localhost:3000/api/fides/step \
-H "Content-Type: application/json" \
-d '{
"telemetry": {
"at": "2024-01-01T00:00:00.000Z",
"cpi_yoy_bps": 250,
"gdp_qoq_bps": 200,
"unemployment_bps": 450
},
"reserves": {
"at": "2024-01-01T00:00:00.000Z",
"total_value_usd": "100000000",
"by_asset_usd": { "BTC": "100000000" },
"attestation_id": "example-1"
},
"stress": {
"btc_drawdown_pct": 5,
"btc_volatility_pct": 3,
"timestamp": 1704067200000
}
}'See API.md for complete API documentation.
Create your own monetary policy scenarios programmatically.
Note: The following examples assume you're running from the project root directory after building with npm run build.
import { Ledger } from './dist/src/engine/ledger.js';
import { FIDES } from './dist/src/engine/fides.js';
import { makeReserveSnapshot } from './dist/src/engine/reserves.js';
// Create a new ledger and FIDES instance
const ledger = new Ledger();
const fides = new FIDES(ledger);
// Define economic telemetry
const telemetry = {
at: new Date().toISOString(),
cpi_yoy_bps: 250, // 2.50% inflation
gdp_qoq_bps: 200, // 2.00% GDP growth
unemployment_bps: 450 // 4.50% unemployment
};
// Create reserve snapshot ($1M USD, 30% in BTC)
const reserves = makeReserveSnapshot(
telemetry.at,
100_000_000n, // $1,000,000 in cents
30_000_000n // $300,000 in BTC
);
// Define stress metrics
const stress = {
btc_drawdown_pct: 5,
btc_volatility_pct: 3,
timestamp: Date.now()
};
// Execute policy step
const events = fides.step(telemetry.at, telemetry, reserves, stress);
// Check results
console.log('New supply:', ledger.getSupply().toString(), 'cents');
console.log('Events:', events.length);USD-N includes a built-in simulation tool that demonstrates how the protocol responds to changing economic conditions:
npm run verifySimulation Overview:
- Runs 12 policy steps
- Simulates varying CPI (high → stable → low)
- Demonstrates expansion during low inflation
- Shows contraction during high inflation
- Applies stress multipliers based on BTC volatility
Example Output:
2024-01-01T00:00:00.000Z POLICY EXPANSION :: CPI below target (1.20% vs 2.00%)
2024-01-01T00:00:00.000Z MINT $500.00 :: FIDES: Expansion (CPI below target)
2024-01-01T00:01:00.000Z ALIGNMENT coverage=100.00% btc_share=30.00% stress_mult=0.65
2024-01-01T00:02:00.000Z POLICY CONTRACTION :: CPI above target (4.20% vs 2.00%)
2024-01-01T00:02:00.000Z BURN $250.00 :: FIDES: Contraction (CPI above target)
...
Final supply: $2,750.00
The web interface provides an interactive way to explore USD-N:
npm run serveFeatures:
- Interactive Controls: Adjust CPI, GDP, unemployment, and stress metrics
- Real-time Visualization: See supply changes as they happen
- Event Log: View all ledger events with timestamps and hashes
- Metrics Dashboard: Monitor reserve coverage, BTC allocation, stress multipliers
Workflow:
- Initialize server:
npm run serve - Navigate to
http://localhost:3000 - Select "Execute Policy Step"
- Modulate the CPI parameter to observe expansion or contraction
- Inspect the event log for deterministic policy decisions
curl http://localhost:3000/api/statusResponse:
{
"status": "online",
"supply": "0",
"totalEvents": 0,
"latestEventHash": "GENESIS"
}curl -X POST http://localhost:3000/api/fides/btc-issue \
-H "Content-Type: application/json" \
-d '{
"reserves": {
"at": "2024-01-01T00:00:00.000Z",
"total_value_usd": "200000000",
"by_asset_usd": { "BTC": "200000000" },
"attestation_id": "reserve-proof-1",
"btc": {
"asset": "BTC",
"amount_btc": 20.0,
"value_usd": "200000000",
"price_snapshot": {
"price_usd": 100000,
"timestamp": 1704067200000,
"source": "coinbase"
}
}
},
"btc_amount": 5.0,
"price_snapshot": {
"price_usd": 100000,
"timestamp": 1704067200000,
"source": "coinbase"
},
"proof": {
"btc_address": "bc1q...",
"message": "USD-N Reserve Proof",
"signature": "..."
},
"memo": "Initial BTC-backed issuance"
}'Response:
{
"success": true,
"newSupply": "50000000",
"events": [
{
"type": "BTC_ISSUE",
"amount": "50000000",
"at": "2024-01-01T00:00:00.000Z"
}
]
}curl -X POST http://localhost:3000/api/fides/step \
-H "Content-Type: application/json" \
-d '{
"telemetry": {
"at": "2024-01-01T00:00:00.000Z",
"cpi_yoy_bps": 120,
"gdp_qoq_bps": 200,
"unemployment_bps": 450
},
"reserves": {
"at": "2024-01-01T00:00:00.000Z",
"total_value_usd": "100000000",
"by_asset_usd": { "BTC": "100000000" },
"attestation_id": "reserve-snapshot-1"
},
"stress": {
"btc_drawdown_pct": 5,
"btc_volatility_pct": 3,
"timestamp": 1704067200000
}
}'curl http://localhost:3000/api/ledger/eventsResponse:
{
"events": [
{
"event": {
"type": "MINT",
"amount": "50000000",
"at": "2024-01-01T00:00:00.000Z",
"memo": "FIDES: Expansion (CPI below target)"
},
"hash": "a1b2c3d4...",
"prevHash": "GENESIS"
}
],
"count": 1
}import { Ledger } from './dist/src/engine/ledger.js';
import { FIDES } from './dist/src/engine/fides.js';
import { makeReserveSnapshot } from './dist/src/engine/reserves.js';
const ledger = new Ledger();
const fides = new FIDES(ledger);
// Simulate 6 months of economic data
for (let month = 0; month < 6; month++) {
const at = new Date(2024, month, 1).toISOString();
const telemetry = {
at,
cpi_yoy_bps: 250 - (month * 20), // Inflation declining
gdp_qoq_bps: 200 + (month * 10), // Growth improving
unemployment_bps: 500 - (month * 50) // Unemployment falling
};
const reserves = makeReserveSnapshot(at, 1_000_000_00n, 300_000_00n);
const stress = {
btc_drawdown_pct: 10 - month,
btc_volatility_pct: 8 - month,
timestamp: Date.parse(at)
};
const events = fides.step(at, telemetry, reserves, stress);
console.log(`Month ${month + 1}:`);
console.log(` CPI: ${telemetry.cpi_yoy_bps / 100}%`);
console.log(` Supply: $${Number(ledger.getSupply()) / 100}`);
console.log(` Events: ${events.length}`);
}import { Ledger } from './dist/src/engine/ledger.js';
import { makeReserveSnapshot } from './dist/src/engine/reserves.js';
import { buildAlignmentReport } from './dist/src/engine/alignment.js';
const ledger = new Ledger();
const at = new Date().toISOString();
const reserves = makeReserveSnapshot(at, 1_000_000_00n, 300_000_00n);
const report = buildAlignmentReport(
ledger.getSupply(),
reserves,
{
btc_drawdown_pct: 5,
btc_volatility_pct: 3,
timestamp: Date.now()
}
);
console.log('Reserve Coverage:', report.reserve_coverage_bps / 100, '%');
console.log('BTC Reserve Share:', report.btc_reserve_share_bps / 100, '%');
console.log('Stress Multiplier:', report.stress_multiplier_bps / 100, '%');// examples/custom-client.js
class USDNClient {
constructor(baseUrl = 'http://localhost:3000/api') {
this.baseUrl = baseUrl;
}
async getStatus() {
const res = await fetch(`${this.baseUrl}/status`);
return res.json();
}
async getSupply() {
const res = await fetch(`${this.baseUrl}/ledger/supply`);
return res.json();
}
async executeStep(telemetry, reserves, stress) {
const res = await fetch(`${this.baseUrl}/fides/step`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ telemetry, reserves, stress })
});
return res.json();
}
}
// Usage
const client = new USDNClient();
const status = await client.getStatus();
console.log('Node status:', status);USD-N is built on a small set of non-negotiable principles:
-
Determinism First Monetary outcomes are derived from explicit inputs and replay identically across time.
-
Constraint Over Discretion Supply is limited by reserves and policy invariants, not committees or ad-hoc decisions.
-
Auditability by Construction Every state transition is ledgered, hash-stable, and independently replayable.
-
Counter-Cyclical Discipline Issuance tightens automatically during stress and relaxes only under defined conditions.
-
Interoperability Without Custody External assets and signals may constrain supply without introducing trusted intermediaries.
- A deterministic U.S. dollar tender
- Reserve-constrained rather than trust-based
- Replay-verifiable down to individual issuance decisions
- Counter-cyclical by design
- Ledger-driven, not account-driven
- Governed by code, not discretion
- ❌ Not a speculative cryptocurrency
- ❌ Not a privately issued stablecoin
- ❌ Not a CBDC or surveillance system
- ❌ Not a bank, custodian, or payment app
- ❌ Not a discretionary monetary authority
USD-N defines monetary validity rules and invariants, not financial products or custodial services.
USD-N supply is constrained by explicit reserve snapshots and policy invariants.
As of v4.1.0, the reference implementation supports:
- BTC-denominated reserve accounting
- BTC/USD price snapshots for deterministic valuation
- Minimal, non-custodial BTC ownership proofs
- Explicit BTC-backed issuance and burn events
- Hard rejection of issuance when reserve coverage fails
No issuance occurs without:
- A validated reserve snapshot
- A validated price snapshot
- Invariant enforcement
- A ledgered policy action
All failures emit explicit POLICY_REJECTED events.
import { makeReserveSnapshot } from './dist/src/engine/reserves.js';
// Create a reserve snapshot: $1M total, $300K in BTC
const reserves = makeReserveSnapshot(
new Date().toISOString(),
100_000_000n, // $1,000,000 in cents
30_000_000n // $300,000 in BTC (30% allocation)
);
console.log('Total reserves:', reserves.total_value_usd.toString(), 'cents');
console.log('BTC allocation:', reserves.by_asset_usd.BTC.toString(), 'cents');curl -X POST http://localhost:3000/api/fides/btc-issue \
-H "Content-Type: application/json" \
-d '{
"reserves": {
"at": "2024-01-01T00:00:00.000Z",
"total_value_usd": "100000000",
"by_asset_usd": { "BTC": "100000000" },
"attestation_id": "proof-1",
"btc": {
"asset": "BTC",
"amount_btc": 10.0,
"value_usd": "100000000",
"price_snapshot": {
"price_usd": 100000,
"timestamp": 1704067200000,
"source": "exchange"
}
}
},
"btc_amount": 2.5,
"price_snapshot": {
"price_usd": 100000,
"timestamp": 1704067200000,
"source": "exchange"
},
"proof": {
"btc_address": "bc1q...",
"message": "Reserve proof",
"signature": "..."
},
"memo": "BTC-backed USD-N issuance"
}'USD-N incorporates deterministic stress telemetry to encode real-world monetary tightening.
The protocol supports:
- Explicit stress snapshots (e.g. drawdown and volatility inputs)
- A monotonic issuance multiplier bounded in
(0, 1] - Automatic issuance tightening under stress
- Unrestricted burns and redemptions
This ensures USD-N becomes scarcer during market stress, mirroring strong-dollar behavior without discretionary intervention.
// High stress scenario
const highStress = {
btc_drawdown_pct: 35, // 35% drawdown
btc_volatility_pct: 18, // 18% volatility
timestamp: Date.now()
};
// Low stress scenario
const lowStress = {
btc_drawdown_pct: 4, // 4% drawdown
btc_volatility_pct: 6, // 6% volatility
timestamp: Date.now()
};
// Execute steps with different stress levels
const highStressEvents = fides.step(at, telemetry, reserves, highStress);
const lowStressEvents = fides.step(at, telemetry, reserves, lowStress);
// High stress results in tighter issuance (lower amounts)
// Low stress allows normal issuanceFIDES (Fiscal Integrity via Deterministic Economic Systems)
FIDES is the policy engine that governs USD-N.
It enforces:
- Reserve-constrained issuance
- Deterministic mint and burn semantics
- Counter-cyclical supply modulation
- Explicit rejection on invariant violation
- Full replay and audit of economic validity
FIDES does not decide outcomes — it derives them.
import { FIDES } from './dist/src/engine/fides.js';
import { Ledger } from './dist/src/engine/ledger.js';
const ledger = new Ledger();
const fides = new FIDES(ledger);
// Execute a FIDES policy step
const events = fides.step(
'2024-01-01T00:00:00.000Z',
{
at: '2024-01-01T00:00:00.000Z',
cpi_yoy_bps: 120, // 1.20% inflation (below 2% target)
gdp_qoq_bps: 200, // 2.00% GDP growth
unemployment_bps: 450 // 4.50% unemployment
},
reserves,
stress
);
// Check what actions were taken
events.forEach(event => {
if (event.type === 'POLICY_ACTION') {
console.log(`Action: ${event.action.kind}`);
console.log(`Reason: ${event.action.reason}`);
} else if (event.type === 'MINT') {
console.log(`Minted: $${Number(event.amount) / 100}`);
} else if (event.type === 'BURN') {
console.log(`Burned: $${Number(event.amount) / 100}`);
}
});USD-N is not a competing currency. It is a validity layer that sits between sovereign money and non-sovereign reality.
The system forms a constraint triangle:
┌──────────────┐
│ Bitcoin │
│ (BTC) │
│ │
│ External, │
│ Non-Sovereign
│ Constraint │
└──────▲───────┘
│
Price, Stress, │ Observable Reality
Scarcity │
│
┌──────────────┐ │ ┌──────────────┐
│ │───────┼──────▶│ │
│ USD │ │ │ USD-N │
│ │◀──────┼───────│ │
│ Unit of │ Validity & │ Deterministic
│ Account │ Discipline │ Validity Layer
│ │ │ │
└──────────────┘ └──────────────┘
-
USD (U.S. Dollar) The unit of account and settlement medium used by the real economy.
-
Bitcoin (BTC) An external, non-sovereign reference that provides observable scarcity, price signals, and stress indicators that cannot be manipulated by USD-N or USD issuance logic.
-
USD-N A deterministic validity layer that:
- derives issuance constraints from BTC-denominated reserves and stress telemetry
- enforces invariant-based discipline on USD-denominated supply
- records a fully replayable, hash-chained monetary history
- This is not a peg.
- This is not convertibility.
- This is not competition between USD and BTC.
USD-N does not force either side to change behavior. It simply makes invalid issuance observable and rejectable.
- USD retains its role as the unit of account.
- Bitcoin remains independent and non-sovereign.
- USD-N enforces discipline without discretion or custody.
When issuance is disciplined, USD-N is quiet. When it is not, USD-N shows exactly why.
USD-N exposes two APIs:
- Development API (
server.js) - Simple API for local development and testing - Production API (
main.ts) - Production-ready API with authentication, rate limiting, and more
Start the development server:
npm run serveEndpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/status |
Get node status and current state |
| GET | /api/ledger/supply |
Get current USD-N supply |
| GET | /api/ledger/events |
Get all ledger events (hash-chained) |
| POST | /api/ledger/reset |
Reset ledger (for testing) |
| POST | /api/fides/step |
Execute a policy step with telemetry |
| POST | /api/fides/btc-issue |
Issue BTC-backed USD-N |
| POST | /api/fides/btc-burn |
Burn BTC-backed USD-N |
Start the production server:
npm run serve:prodAdditional Features:
- ✅ JWT authentication (optional)
- ✅ Rate limiting (100 req/min per IP)
- ✅ CORS enabled
- ✅ Health checks
- ✅ OpenAPI compatible
- ✅ Docker optimized
Additional Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Basic health check |
| GET | /api/ledger/state |
Full ledger state snapshot |
| GET | /api/ledger/transactions |
Paginated transaction history |
| POST | /api/ledger/mint |
Mint USD-N (bounded: max $1M) |
| POST | /api/ledger/burn |
Burn USD-N (bounded: max $1M) |
| POST | /api/ledger/transfer |
Transfer USD-N (max $100K) |
| GET | /api/fides/score |
Compute FIDES trust score |
| GET | /api/btc/backing |
BTC backing ratio and reserve model |
Complete API documentation: API.md and API_PRODUCTION.md
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run development server
npm run serveAccess at http://localhost:3000
Build and run with Docker:
# Build the image
docker build -t usd-n-api .
# Run the container
docker run -p 8080:8080 \
-e USDN_ENV=production \
-e USDN_LOG_LEVEL=info \
usd-n-apiAccess the API at http://localhost:8080/api/health
Deploy to Railway's free tier:
# Install Railway CLI
npm install -g @railway/cli
# Login
railway login
# Initialize and deploy
railway init
railway up
# Set environment variables
railway variables set USDN_ENV=production
railway variables set USDN_LOG_LEVEL=info
railway variables set USDN_NODE_ID=railway-node-1Your API will be automatically deployed and accessible via Railway's provided URL.
Environment Variables:
| Variable | Description | Default | Required |
|---|---|---|---|
USDN_ENV |
Environment mode (production, development, test) |
development |
No |
USDN_JWT_SECRET |
JWT secret for authentication (leave empty to disable) | `` | No |
USDN_LOG_LEVEL |
Logging level (debug, info, warn, error) |
info |
No |
USDN_NODE_ID |
Unique node identifier | Auto-generated | No |
PORT |
Server port | 8080 |
No |
See .env.example for a complete template.
Deployment guides:
- DEPLOYMENT.md - Detailed deployment instructions
- Dockerfile - Docker configuration
USD-N/
├── src/
│ ├── engine/ # Core protocol engine
│ │ ├── ledger.ts # Ledger and event log
│ │ ├── fides.ts # FIDES policy engine
│ │ ├── reserves.ts # Reserve management
│ │ └── *.test.ts # Unit tests
│ ├── cli/ # Command-line tools
│ ├── types.ts # TypeScript type definitions
│ └── index.ts # Main entry point
├── api/ # API utilities
├── examples/ # Example code
├── public/ # Web interface assets
├── server.js # Development API server
├── main.ts # Production API server
└── docs/ # Documentation
Compile TypeScript to JavaScript:
npm run buildOutput is written to dist/.
Run the test suite:
npm testThis runs:
- Invariant tests
- Economic behavior tests
- Replay verification tests
- CI validation tests
Watch for changes and rebuild automatically:
npm run devUSD-N uses TypeScript's built-in type checking:
npx tsc --noEmitExecute the provided examples:
# Run the API example
npm run serve
node examples/api_example.js
# Run a production API test
node examples/production_api_test.jsCreate a new file in the project:
Note: Run this from the project root after building with npm run build.
// my-scenario.ts
import { Ledger } from './dist/src/engine/ledger.js';
import { FIDES } from './dist/src/engine/fides.js';
import { makeReserveSnapshot } from './dist/src/engine/reserves.js';
const ledger = new Ledger();
const fides = new FIDES(ledger);
// Your custom scenario here
const telemetry = { /* ... */ };
const reserves = makeReserveSnapshot(/* ... */);
const stress = { /* ... */ };
const events = fides.step(new Date().toISOString(), telemetry, reserves, stress);
console.log('Events:', events);Compile and run:
npx tsc my-scenario.ts
node my-scenario.jsLedger (src/engine/ledger.ts)
- Maintains append-only event log
- Tracks current supply
- Enforces non-negative supply invariant
- Provides hash-chained event history
FIDES (src/engine/fides.ts)
- Deterministic policy engine
- Evaluates macroeconomic telemetry
- Makes issuance/burn decisions
- Enforces reserve constraints
- Applies stress-based multipliers
Reserve Management (src/engine/reserves.ts)
- Creates reserve snapshots
- Validates BTC backing
- Computes coverage ratios
Alignment Reporting (src/engine/alignment.ts)
- Computes reserve coverage
- Calculates BTC reserve share
- Determines stress multipliers
Economic Telemetry (CPI, GDP, Unemployment)
↓
FIDES Policy Engine
↓
Policy Decision (MINT/BURN/HOLD)
↓
Reserve Constraint Check
↓
Stress Multiplier Application
↓
Ledger Event Recording
↓
Hash-Chained Event Log
USD-N is deterministic:
- Same inputs → same outputs
- No randomness
- No discretionary decisions
- Fully replayable
Verification:
npm run verifyThis runs a 12-step simulation and verifies:
- All invariants hold
- Events are properly hash-chained
- Supply is correctly calculated
- Reserve constraints are enforced
USD-N includes comprehensive documentation:
| Document | Description |
|---|---|
| README.md | This file - getting started and overview |
| SPEC.md | Formal protocol specification |
| API.md | Development API reference |
| API_PRODUCTION.md | Production API reference |
| DEPLOYMENT.md | Deployment guide |
| WHITEPAPER.md | Theoretical foundation and design rationale |
| IMPLEMENTATION_SUMMARY.md | Implementation details |
| THREAT_MODEL.md | Security analysis |
| FUTUREWORK.md | Planned features and improvements |
| NON_GOALS.md | Explicitly out-of-scope items |
| CHANGELOG.md | Version history |
- OpenAPI Specification - Machine-readable API spec
- Citation - Academic citation format
- Examples - Working code examples
Problem: TypeScript compilation fails
npm run build
# Error: Cannot find module...Solution: Ensure you're using Node.js 20+ and TypeScript 5.6+:
node --version # Should be v20.x or higher
npm install # Reinstall dependencies
npm run buildProblem: Module not found errors at runtime
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../dist/...'Solution: Make sure you've built the project first:
npm run buildProblem: Server won't start / port already in use
Error: listen EADDRINUSE: address already in use :::3000Solution: Either kill the existing process or use a different port:
# Kill existing process
pkill -f "node server.js"
# Or use a different port
PORT=3001 npm run serveProblem: API returns 500 errors
{"error": "Internal server error"}Solution: Check the server logs for details. Common issues:
- Missing required fields in request body
- Invalid data types (e.g., strings instead of numbers)
- BTC reserves specified without BTC details
Problem: Simulation shows only rejections
POLICY_REJECTED ISSUE :: POLICY_REJECT: stress-adjusted issue below minimum
Solution: This is expected behavior when:
- Supply is 0 and CPI triggers expansion, but stress multiplier makes the issuance too small
- CPI is high and triggers contraction, but supply is already 0
- This demonstrates the protocol's conservative approach under stress
Q: Why does the simulation result in $0 supply?
A: The simulation uses conservative stress parameters that may reject small issuances. This demonstrates the protocol's safety features. Try running with different parameters or check the detailed event log.
Q: How do I reset the ledger when using the API?
A: Use the reset endpoint:
curl -X POST http://localhost:3000/api/ledger/resetQ: Can I use this in production?
A: USD-N is experimental and designed for research, audit, and demonstration. See Status section for details.
Q: Where can I find more examples?
A: Check the examples/ directory for working code samples, including:
api_example.js- Full API workflowvalid_history.jsonl- Sample event logproduction_api_test.js- Production API examples
This repository defines the core specification and canonical implementation for USD-N.
- Experimental
- Dollar-denominated tender definition
- Open specification
- Designed for audit, simulation, and research
- Intended for institutional-grade review
- Now accessible via web interface and REST API
USD-N’s CI validates buildability, core invariants, and deterministic replay on every commit. It does not test economic outcomes, market behavior, or performance; those remain explicitly out of scope. The goal is to protect mechanical correctness and governance safety through reproducible checks.
Monetary trust should not be requested. It should be provable.
USD-N exists to demonstrate that monetary systems can be:
- Auditable without surveillance
- Disciplined without discretion
- Programmable without opacity
- Strong without coercion
This project was developed with a combination of original ideas, hands‑on coding, and support from advanced AI systems. I would like to acknowledge Microsoft Copilot, Anthropic Claude, and OpenAI ChatGPT for their meaningful assistance in refining concepts, improving clarity, and strengthening the overall quality of this work.
This project is licensed under the MIT License. See the LICENSE file for details. This license permits commercial use, modification, distribution, and private use.