_Docs/
Get StartedModulesPlatformDeployCookbookChangelogReference
_Stack
_Modules
  • Ledger
    • Quick Start
    • Core Concepts
      • Accounts
      • Transactions
      • Constraints
      • Source/destination
      • Designing a Chart of Accounts
    • Working with the Ledger
      • Assets & Currency conversion
      • Bi-temporality
      • Bulk processing
      • Filtering queries
      • Idempotency
      • Data isolation with buckets
      • From credit/debit to source/destination
      • Streaming to analytics systems
      • Ledger Schema
    • Advanced Topics
      • Architecting for scale
      • Events Publishers
      • Performance model
  • Numscript
  • Connectivity
  • WalletsEE
  • FlowsEE
  • ReconciliationEE
  1. Modules
  2. Ledger
  3. Quick Start
Ledger

Quick Start

Get from zero to your first transactions in 5 minutes. By the end, you'll have funded an account, split a payment, and checked balances — all using Numscript.

This guide assumes you have fctl installed and a sandbox running. If not, start with the Platform Quick Start.

Your First Transaction#

Create a ledger

fctl ledger create main
POST/api/ledger/v2/main

This creates a ledger named main. All accounts and transactions will live here.

Fund a user account

Send $100 from @world (an infinite funding source) to a user account:

Numscript
send [USD/2 10000] (
  source = @world
  destination = @user:alice
)
fctl ledger send main --numscript '{script}'
POST/api/ledger/v2/main/transactions

USD/2 means US dollars with 2 decimal places. 10000 = $100.00. Accounts are created automatically on first use.

Split a payment

Alice buys something for $30. The merchant gets 90%, the platform takes 10% as a fee:

Numscript
send [USD/2 3000] (
  source = @user:alice
  destination = {
    90% to @merchant:bob
    remaining to @platform:fees
  }
)
fctl ledger send main --numscript '{script}'
POST/api/ledger/v2/main/transactions

The ledger enforces that Alice has sufficient funds. If she doesn't, the transaction is rejected — no partial execution, no overdraft.

Check balances

fctl ledger accounts list --ledger=main
GET/api/ledger/v2/main/accounts

You should see:

AccountBalance (USD/2)Meaning
user:alice7000$70.00 remaining
merchant:bob2700$27.00 (90% of $30)
platform:fees300$3.00 (10% of $30)

Every cent is accounted for. The sum of all non-world balances equals the total funded.

What Just Happened#

  • Double-entry: every send creates balanced movements — what leaves one account enters another
  • @world: a special infinite source/sink for money entering and exiting the ledger
  • USD/2: Universal Monetary Notation — the asset type and precision, no floating-point
  • Splits: Numscript natively handles percentage splits with remaining catching rounding
  • Scarcity: the ledger rejects transactions when the source account has insufficient funds
LedgerCore Concepts
On This Page
  • Your First Transaction
  • What Just Happened