SIMULATOR · RUNS ENTIRELY IN YOUR BROWSER · TOUCHES NO CHAIN

Cooperative credit, in your hands. Drive a six-guarantor loan from request to repayment — every rule below mirrors the consensus code.

WHY THIS PAGE EXISTS

The loan a bank would never make — run it yourself.

EgalChain's cooperative credit lets someone who doesn't mine — a seamstress, a village cooperative, a migrant — borrow because six miners vouch for them, peer to peer, with no risk committee in between. It runs on the test network today. But there is an honest catch: the loan is fed from the mining earnings of its six guarantors, and on the test network almost nobody mines enough for that flow to be reachable in practice. Real, but out of arm's reach.

So this page extracts the mechanism itself and lets you drive it. Everything runs in your browser's memory: you play the borrower and her six guarantors, blocks advance when you say so, and the arithmetic at every step — the rate corridor, the median, the drip, the repayment waterfall, the default settlement — is the same arithmetic the consensus code applies. Where this model simplifies, it says so plainly.

What this page is notNothing here creates money, moves money, or touches any chain — test network or otherwise. No account, no wallet, no tracking; close the tab and it is gone. It teaches the mechanism. To touch the real (test) protocol, use the application.
THE MECHANISM · SIX MOVES

How a cooperative loan actually works.

The lifecycle below is not a diagram someone drew for this page — it is the state machine the consensus enforces, move by move. The simulator further down walks the same moves in the same order, because no other order is possible.

  • 1 · The request A person with a verified identity publishes a request: an amount between 100 and 50,000 ES, and a repayment schedule they choose themselves — so much per installment, so often. One open request at a time per person; a borrower who defaulted recently must wait out a cooldown first.
  • 2 · Six guarantors Miners with a repayment record of their own (a credit score of at least 3 out of 20) can vouch — at most three loans each, so nobody stakes everything on one person. Each proposes an interest rate, freely, inside a corridor the community votes: today 6% to 25%.
  • 3 · The middle rate The moment the sixth guarantor signs, the protocol takes the median of the six proposals — the average of the 3rd and 4th when sorted — and that becomes the loan's one rate. No single lender can dictate the price; an outlier bid simply doesn't count.
  • 4 · The acceptance The borrower accepts, and only then is money created: the protocol takes EGL from the community pool — the 52% share of every block that funds cooperative credit — sets it in reserve, and mints the ES into a transparent escrow wallet. Every ES lent is backed; the six see the wallet in full.
  • 5 · The living loan Each block a guarantor finds, the protocol diverts 5% of that block's community share into the wallet — automatically, up to each guarantor's sixth of what is owed. Every spend the borrower makes leaves the escrow logged for the six to see, with whatever justification she attaches — or the visible absence of one. Repayment erases principal first, then interest: of the interest, 90% returns to the six equally, 10% feeds a shared guarantee cushion. When an installment falls due, the protocol collects it by itself — from the wallet, then from the borrower's own balance; only a truly empty account counts as a missed payment.
  • 6 · The end Fully repaid: everyone's reputation rises a notch — slowly, and it can't be bought. Default is deliberately hard to trigger: it takes 3 of the 6 voting to cut and three hard conditions all true at once — or, separately, a borrower who has gone completely silent for about two months. Then the wallet's remainder plus a slice of the cushion returns to the guarantors; the rest is a loss they knowingly bore. The borrower's score drops and they wait ~90 days before asking again. The guarantors' own reputation drops too — vouching is a real risk, never a safe investment.

Two variants ride the same rails: a donation (same six-guarantor flow, nothing to repay) and an offer — a seasoned miner (score 8+) publishes credit looking for whoever needs it, standing as its own first guarantor. The simulator below runs the central case, the loan.

THE SIMULATOR · YOU PLAY ALL SEVEN PEOPLE

Run one loan, end to end.

Awa is a seamstress in Abidjan. She doesn't mine — her capital is a sewing machine and three years of regular clients. She needs stock for January. You will publish her request, vouch for her, let five more miners answer, watch the loan fill from mined blocks, spend, repay, and choose how it ends.

Block0
Statusno request
Escrow wallet
Fed by guarantors
Still owed
Awa's own balance
Community pool
Guarantee cushion
ACT 1The request

Awa chooses the amount and the schedule — the protocol only checks the bounds (100 to 50,000 ES). Blocks are the clock here: one block is about a minute, 1,440 a day, 43,200 a month. Her identity is passport-verified; that is assumed granted here.

bounds: 100 – 50,000
stored on-chain, 127 chars max
ACT 2Six guarantors, one middle rate

You are the first guarantor. Pick your rate anywhere in the community's corridor — then let five more miners answer. On the real chain each of them must hold a credit score of 3+, carry a verified identity, and be under their 3-loan limit; assumed granted here. Watch what the median does to the outliers.

corridor: 6.0% floor – 25.0% ceiling (community-voted)
ACT 3The acceptance — money is created, backed

Nothing was minted while guarantors signed. Only when Awa accepts does the protocol move EGL from the community pool into reserve and mint the ES into her escrow wallet — a wallet all six guarantors can read, every entry and every exit. This is the Bretton-Woods discipline: no lending unbacked money.

ACT 4The living loan

Time moves when you say so. Each block one of the six finds, 5% of that block's community share drips into the wallet. Installments fall due on Awa's chosen schedule — the protocol collects them by itself before ever counting a miss. And the loan listens for silence: no message from anyone for a month raises an alert; two months of silence cuts the loan on its own.

Awa acts

Spending moves ES from the escrow to her own balance, with a note the six can read. Income is what her work brings in — on the real chain, any ES transfer she receives.

The loan's vital signs

Silence (dead-man's switch)

Since last message
Alert past ~30 days of silence; automatic cut past ~60 days. Any participant's message resets the clock.

The emergency stop (cut)

A vote alone does nothing. Even at 3 of 6 votes, the cut only fires if all three conditions above are true — the protocol refuses a panic cut on a loan that is actually alive.
ACT 5The end
Assumptions you can change

The drip's size depends on two things the simulator cannot know: how much a block pays, and how often a guarantor actually finds one. Defaults model a young chain (like today's test network) with six small miners. Change either and re-run.

community share = 52% of it
on the real chain it builds from the 10% share of every interest payment

The community can also vote four of the dials this simulator uses. The ranges below are the real vote bounds — governance cannot go past them.

default 50‰ = 5% · votable 1%–20%
default 60‰ = 6% · votable 0%–20%
default 2500 = 25% · votable 15%–25%
default 3 of 6 · votable 2–5
VERIFY THIS PAGE

Every number here, against the code.

A simulator that drifts from its protocol is worse than none. This table is the page's contract: each value it uses, where that value lives in the EgalChain source, and who can change it. When the source opens with the public network, you can check every row yourself. The community-voted rows are also explained in plain words on the rules of your money.

RuleValueWhere it lives in the sourceWho can change it
Guarantors per loan6, exactlyminer_registry.h · P2P_MAX_SPONSORSFixed constant — not votable
Smallest / largest request100 / 50,000 ESgovernance_params.h · p2p_min_request_es, p2p_max_request_esCommunity vote (10–1,000 / 100–500,000 ES)
Rate corridor6% – 25% / yeargovernance_params.h · p2p_interest_floor_permille, p2p_max_rate_dpermilleCommunity vote (floor 0–20%, ceiling 15–25%)
The one rate = median of six(3rd + 4th) ÷ 2miner_registry.cpp · sponsor_p2p_request_v2 (6th-sponsor branch)Consensus logic — not votable
Interest formulaamount × rate × months ÷ 12miner_registry.cpp · accept_p2p_request (simple interest, months rounded up)Consensus logic
Guarantor eligibilitycredit score ≥ 3 (of 20)miner_registry.cpp · sponsor_p2p_request_v2Consensus logic (offer-publishers need ≥ 8)
Loans one person may back3 at oncegovernance_params.h · p2p_max_sponsors_per_minerCommunity vote (1–10)
Guarantor funding drip5% of community share, per block found, per loanblockchain.cpp · P2P auto-prelevement; governance_params.h · p2p_sponsor_prelev_permilleCommunity vote (1%–20%)
Per-guarantor funding cap(principal + interest) ÷ 6miner_registry.cpp · credit_p2p_wallet (per_sponsor_cap)Consensus logic
Backing at acceptanceEGL = amount ÷ rate, rounded up, into reserveminer_registry.cpp · accept_p2p_request (mint + 333% coverage check)Consensus logic
Repayment orderprincipal first, then interestminer_registry.cpp · p2p_repay_v2, p2p_repay_from_external (waterfall)Consensus logic
Interest split90% to guarantors equally · 10% to cushioncryptonote_config.h · EGALCHAIN_P2P_PROTOCOL_FEE_PERMILLE (100‰)Fixed constant — not votable
Automatic collection at each due dateescrow first, then her own balanceminer_registry.cpp · p2p_collect_floor; blockchain.cpp block loopConsensus logic
Missed paymentonly if both sources were emptyminer_registry.cpp · increment_missed_repayment (after collection ran)Consensus logic
Cut: votes needed3 of 6governance_params.h · p2p_cut_threshold_countCommunity vote (2–5)
Cut: hard conditions (all three)≥3 missed · fed ≥ half the amount · wallet < 10% of itminer_registry.cpp · p2p_cut_vote (C1 · C2 · C4)Consensus logic
Silence alert / automatic cut~30 days / ~60 daysminer_registry.cpp · p2p_dead_man_scan; governance_params.h · p2p_terminal_alert_blocks, p2p_terminal_cut_blocksCommunity vote (~3–90 d / ~6–180 d)
Default settlementguarantors get wallet remainder + min(⅓ of what they fed, cushion)miner_registry.cpp · execute_p2p_v2_defaultConsensus logic
Default: borrower penaltyscore −3 · ~90-day cooldownminer_registry.cpp · execute_p2p_v2_default; governance_params.h · p2p_default_cooldownCooldown: community vote (~3 d – 1 yr)
Default: guarantor penaltysponsor score −3 eachminer_registry.cpp · execute_p2p_v2_default (risk-bearing rule)Consensus logic
Successborrower +1, each guarantor +1 (caps at 30)miner_registry.cpp · p2p_close_v2Consensus logic
Messagesparticipants only · 512 bytes · resets the silence clockminer_registry.cpp · post_p2p_messageConsensus logic
EGL → ES conversion1 EGL = 100 ES (genesis default)cryptonote_config.h · EGALCHAIN_EGL_TO_ES_RATE; miner_registry.cpp · get_conversion_rateConstitutional (75% supermajority + 30-day timelock)
Block cadence60 seconds · 43,200 per monthcryptonote_config.h · DIFFICULTY_TARGET_V2, EGALCHAIN_BLOCKS_PER_MONTHFixed constant

One mechanic this page explains but does not simulate: the community can endorse a request by voting on it, and enough upvotes top the loan up from the humanitarian matching pool — up to 10% of the amount, 100 votes per percent (miner_registry.cpp · accept_p2p_request, endorsement branch; both dials community-voted).

HONEST LIMITS

What this simulator simplifies.

The rules above are the protocol's. The frame around them is a model, and a model makes choices. Here they are, so you never mistake the sketch for the machine:

Simplifications, named
  • Whole ES. The chain counts in atomic units (12 decimal places); this page rounds to cents. At that scale the chain's integer arithmetic differs by dust — bounded and documented in the source, invisible here.
  • Time is a button. Real blocks arrive every ~60 seconds whether anyone clicks or not.
  • Mining is a dice roll. Who finds a block here is random at the hashrate share you set. Real mining is real work, and the drip only flows on blocks a guarantor actually finds.
  • Identity is assumed. On the real chain, borrower and guarantors must each hold a verified identity (the passport layer — dormant on the test network today), and each guarantor a real mining record.
  • Guarantors here carry no loan of their own. On the real chain, a guarantor's personal loan repayments come out of the same community share first; the 5% drip applies to what remains.
  • The endorsement bonus is not simulated — described above the fold of the table instead.
  • Two consensus gates are not modeled: a system-wide pause on new lending while the guarantee system recovers from stress, and a rule that a borrower cannot simultaneously hold staked savings (no borrowing cheap to earn yield on the same money).
  • The justification fingerprint shown is illustrative. The chain uses Keccak-256; this page uses a toy hash to show the principle without shipping a crypto library.
  • Messages here are plain text in memory. On-chain they are bytes posted by participants only, permanent, and public to the six.

If you find a place where this page contradicts the protocol, that is a bug in this page — tell us, and it will be corrected. The code is the truth; this is its portrait.