Repository navigation
Description
Summary
Ryan Fugger's original Ripple (2004) was a web of bilateral trust lines and IOUs — payments routed through chains of mutual credit between real people. No blockchain, no native token, no consensus. Just trust relationships.
This maps directly to a web contract profile.
Background
Fugger's insight: trust relationships between people are the network. If Alice trusts Bob for $1000 and Bob trusts Carol for $500, Alice can pay Carol $500 by routing through Bob. No intermediary token needed.
XRP/XRPL replaced this with a blockchain and native token — neither of which the original design required. A web contract brings back the original vision with modern primitives: Bitcoin anchoring, nostr identity, agent participation.
Profile: trustline.v1
State
{
"contract": "community-credit",
"seq": 42,
"prev": "abc123...",
"trustlines": {
"did:nostr:alice": {
"did:nostr:bob": { "currency": "USD", "limit": 1000, "balance": 250 }
},
"did:nostr:bob": {
"did:nostr:carol": { "currency": "USD", "limit": 500, "balance": 0 }
}
}
}Transitions
| Transition | Params | Description |
|---|---|---|
create-trustline |
peer, currency, limit | "I trust you for up to X units" |
update-trustline |
peer, currency, limit | Adjust trust limit |
remove-trustline |
peer, currency | Remove trust relationship |
send-payment |
to, currency, amount | Route through trust chain (pathfinding) |
settle |
peer, currency, amount | Reduce balance via external payment |
Ledger effects
send-paymentadjusts balances along the route — each hop debits one side, credits the othersettlereduces outstanding balance (e.g. Bob pays Alice in sats, clearing the IOU)- Webledger tracks net positions; blocktrail anchors each transition
Pathfinding
The key algorithm: given sender, receiver, and amount, find a path through the trust graph where every hop has sufficient remaining credit. This is a breadth-first or Dijkstra search over the trustline state.
export function sendPayment(state, params, ledger) {
const { sender, to, currency, amount } = params
const path = findPath(state.trustlines, sender, to, currency, amount)
if (!path) throw new Error('No route with sufficient credit')
const effects = []
for (let i = 0; i < path.length - 1; i++) {
const from = path[i], next = path[i + 1]
// Adjust bilateral balance
state.trustlines[from][next].balance += amount
state.trustlines[next][from].balance -= amount
effects.push(
{ op: 'debit', who: from, currency, amount },
{ op: 'credit', who: next, currency, amount },
)
}
return { state, effects }
}Why this fits web contracts
- No blockchain needed — trust is bilateral, not global consensus
- Pod-native — each person hosts their own trust state on their pod
- Bitcoin-anchored — blocktrails prove the history without a separate chain
- Agent-friendly — an agent can manage trust lines, route payments, and settle automatically
- Multi-currency — webledgers already support multi-currency balances
- Federated — pods can sync trust state via Nostr relays (Nostr transport — discover and interact with contracts via relays #2)
What Fugger didn't have in 2004
- Bitcoin anchoring for tamper-proof history
- Nostr keypairs for self-sovereign identity
- AI agents as autonomous participants
- Solid pods for self-hosted data
- A formal contract spec to define the rules
References
- Original Ripple: https://classic.ripplepay.com/
- Ryan Fugger's paper: "Money as IOUs in Social Trust Networks"
- Web Contracts spec: https://webcontracts.org
- Web Ledgers: https://webledgers.org
- Blocktrails: https://blocktrails.org
Activity