Double-entry ledger
A transaction is a set of postings with a source and a destination, and it is rejected unless it balances. Entries are immutable — a correction is another transaction, so history stays true.
A double-entry ledger for money moving inside your product
// A $100 order, split three ways, written once.
// Numscript refuses to run this if the amounts do not add up.
send [USD/2 10000] (
source = @users:001
destination = {
90% to @merchants:042
5% to @fees:processing
remaining to @platform:revenue
}
)
send [USD/2 10000] (
Multi-currency virtual wallets that can hold an amount and release it later. That is how you take money at checkout and pay a seller on delivery without the balance lying in between.
A ledger, a language for writing transactions, and the machinery around them.
A transaction is a set of postings with a source and a destination, and it is rejected unless it balances. Entries are immutable — a correction is another transaction, so history stays true.
Match what the ledger believes against what a payment provider reports, and show the rows that disagree. The breaks are the output; agreeing totals need no attention.
Hold balances per account and per currency, and move between them as ledger transactions. What an account settles against is configured per deployment.
Longer sequences — capture, split, pay out, retry — run as orchestrated flows, and every change of financial state is delivered as an event you can subscribe to.
10,000
Treasury management