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.
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.
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.
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.
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.
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.
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
The loan's vital signs
Silence (dead-man's switch)
The emergency stop (cut)
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.
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.
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.
| Rule | Value | Where it lives in the source | Who can change it |
|---|---|---|---|
| Guarantors per loan | 6, exactly | miner_registry.h · P2P_MAX_SPONSORS | Fixed constant — not votable |
| Smallest / largest request | 100 / 50,000 ES | governance_params.h · p2p_min_request_es, p2p_max_request_es | Community vote (10–1,000 / 100–500,000 ES) |
| Rate corridor | 6% – 25% / year | governance_params.h · p2p_interest_floor_permille, p2p_max_rate_dpermille | Community vote (floor 0–20%, ceiling 15–25%) |
| The one rate = median of six | (3rd + 4th) ÷ 2 | miner_registry.cpp · sponsor_p2p_request_v2 (6th-sponsor branch) | Consensus logic — not votable |
| Interest formula | amount × rate × months ÷ 12 | miner_registry.cpp · accept_p2p_request (simple interest, months rounded up) | Consensus logic |
| Guarantor eligibility | credit score ≥ 3 (of 20) | miner_registry.cpp · sponsor_p2p_request_v2 | Consensus logic (offer-publishers need ≥ 8) |
| Loans one person may back | 3 at once | governance_params.h · p2p_max_sponsors_per_miner | Community vote (1–10) |
| Guarantor funding drip | 5% of community share, per block found, per loan | blockchain.cpp · P2P auto-prelevement; governance_params.h · p2p_sponsor_prelev_permille | Community vote (1%–20%) |
| Per-guarantor funding cap | (principal + interest) ÷ 6 | miner_registry.cpp · credit_p2p_wallet (per_sponsor_cap) | Consensus logic |
| Backing at acceptance | EGL = amount ÷ rate, rounded up, into reserve | miner_registry.cpp · accept_p2p_request (mint + 333% coverage check) | Consensus logic |
| Repayment order | principal first, then interest | miner_registry.cpp · p2p_repay_v2, p2p_repay_from_external (waterfall) | Consensus logic |
| Interest split | 90% to guarantors equally · 10% to cushion | cryptonote_config.h · EGALCHAIN_P2P_PROTOCOL_FEE_PERMILLE (100‰) | Fixed constant — not votable |
| Automatic collection at each due date | escrow first, then her own balance | miner_registry.cpp · p2p_collect_floor; blockchain.cpp block loop | Consensus logic |
| Missed payment | only if both sources were empty | miner_registry.cpp · increment_missed_repayment (after collection ran) | Consensus logic |
| Cut: votes needed | 3 of 6 | governance_params.h · p2p_cut_threshold_count | Community vote (2–5) |
| Cut: hard conditions (all three) | ≥3 missed · fed ≥ half the amount · wallet < 10% of it | miner_registry.cpp · p2p_cut_vote (C1 · C2 · C4) | Consensus logic |
| Silence alert / automatic cut | ~30 days / ~60 days | miner_registry.cpp · p2p_dead_man_scan; governance_params.h · p2p_terminal_alert_blocks, p2p_terminal_cut_blocks | Community vote (~3–90 d / ~6–180 d) |
| Default settlement | guarantors get wallet remainder + min(⅓ of what they fed, cushion) | miner_registry.cpp · execute_p2p_v2_default | Consensus logic |
| Default: borrower penalty | score −3 · ~90-day cooldown | miner_registry.cpp · execute_p2p_v2_default; governance_params.h · p2p_default_cooldown | Cooldown: community vote (~3 d – 1 yr) |
| Default: guarantor penalty | sponsor score −3 each | miner_registry.cpp · execute_p2p_v2_default (risk-bearing rule) | Consensus logic |
| Success | borrower +1, each guarantor +1 (caps at 30) | miner_registry.cpp · p2p_close_v2 | Consensus logic |
| Messages | participants only · 512 bytes · resets the silence clock | miner_registry.cpp · post_p2p_message | Consensus logic |
| EGL → ES conversion | 1 EGL = 100 ES (genesis default) | cryptonote_config.h · EGALCHAIN_EGL_TO_ES_RATE; miner_registry.cpp · get_conversion_rate | Constitutional (75% supermajority + 30-day timelock) |
| Block cadence | 60 seconds · 43,200 per month | cryptonote_config.h · DIFFICULTY_TARGET_V2, EGALCHAIN_BLOCKS_PER_MONTH | Fixed 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).
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:
- 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.