PHASE 1
Blocks, hashes and the Merkle treeBlocks, hash at Merkle tree
A blockchain is like a ledger notebook: each page (block) has a 'fingerprint' (hash) and records the fingerprint of the page before it. Change an old page and the chain breaks.Ang blockchain ay parang notebook ng utang: bawat pahina (block) ay may 'fingerprint' (hash) at nakasulat ang fingerprint ng nakaraang pahina. Kapag binago ang lumang pahina, masisira ang kadena.
- SHA-256: a tiny change in the content → a completely different hash.SHA-256: konting pagbabago sa laman → ibang-iba ang hash.
- prevHash: this is the 'chain' — every block points to the one before it.prevHash: ito ang 'kadena' — bawat block ay nakaturo sa nauna.
- Merkle root: a single hash for ALL the transactions in a block.Merkle root: iisang hash para sa LAHAT ng transaction sa block.
- To cheat, you would have to change every block after it (and convince the whole network).Para makapandaya, kailangang baguhin ang lahat ng kasunod na block (at kumbinsihin ang buong network).
WHERE IN THE CODESAAN SA CODE
- src/features/chain/hash.ts
- src/features/chain/merkle.ts
- src/features/chain/block.ts
- src/features/chain/chain.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 2
Wallets, signatures and the nonceWallets, pirma at nonce
A wallet is a pair of keys: a private key (secret, only YOU) and an address (safe to share). Every payment is signed with the private key — no signature, no movement of money.Ang wallet ay pares ng susi: private key (sikreto, IKAW lang) at address (pwedeng i-share). Bawat padala ay pinipirmahan ng private key — walang pirma, walang galaw ang pera.
- Ed25519: a modern signature scheme (used by the XRP Ledger and Solana).Ed25519: modernong signature (ginagamit ng XRP Ledger at Solana).
- The address comes from the public key. Safe to share; the private key is NOT.Address = galing sa public key. Ligtas i-share; ang private key, HINDI.
- Nonce: your count of payments → an old tx can't be replayed (replay attack).Nonce: bilang ng padala mo → hindi pwedeng ulitin ang lumang tx (replay attack).
- Account model: every address has a balance and a nonce, like a bank account.Account model: bawat address ay may balance at nonce, parang bank account.
⚠ Whoever holds your private key or seed phrase can empty your money. No real 'support' will ever ask for it.Sinumang may hawak ng private key o seed phrase mo ay kayang ubusin ang pera mo. Walang totoong 'support' na hihingi nito.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet/keys.ts
- src/features/chain/transaction.ts
- src/features/chain/state.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 3
Proof-of-Stake and instant finalityProof-of-Stake at instant finality
No mining. Validators lock up NEL (stake); the one who makes a block is drawn by stake, and more than 2/3 must vote before the block is FINAL.Walang mining. Ang mga validator ay may naka-lock na NEL (stake); bubunutin ang gagawa ng block ayon sa laki ng stake, at kailangang bumoto ang higit 2/3 bago maging FINAL ang block.
- Bigger stake → drawn more often (like a raffle).Mas malaki ang stake → mas madalas mabunot (parang raffle).
- More than 2/3 of the votes = final at once (BFT). No need to wait 6 blocks like Bitcoin.Higit 2/3 ng boto = final agad (BFT). Hindi na kailangang maghintay ng 6 blocks gaya ng Bitcoin.
- If fewer than 2/3 are online, the chain STOPS — safer than getting it wrong.Kapag kulang sa 2/3 ang online, HUMIHINTO ang chain — mas ligtas kaysa magkamali.
- Almost no electricity compared with mining.Halos walang kuryente kumpara sa mining.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/validators.ts
- src/features/consensus/committee.ts
- src/features/consensus/votes.ts
- src/features/consensus/consensus.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 4
Fees, rewards and slashingFees, rewards at slashing
Every payment has a base fee that is BURNED and a tip for the proposer (like EIP-1559 on Ethereum and Base). Honest validators earn; cheaters (double votes) lose stake and are removed.Bawat padala ay may base fee na SINUSUNOG at tip para sa proposer (gaya ng EIP-1559 sa Ethereum at Base). Kumikita ang tapat na validators; ang mandaraya (dobleng boto) ay nababawasan ng stake at tinatanggal.
- Full block → the base fee rises; few transactions → it falls.Puno ang block → tataas ang base fee; kaunti ang tx → bababa.
- maxFee: your protection when the fee suddenly jumps.maxFee: proteksyon mo kapag biglang tumaas ang fee.
- Supply = genesis + rewards − burned fees − slashing.Supply = genesis + rewards − nasunog na fees − slashing.
- Slashing: −50% stake and JAILED for signing two different blocks at the same height.Slashing: -50% stake at JAILED kapag pumirma sa dalawang magkaibang block sa parehong height.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/fees.ts
- src/features/chain/units.ts
- src/features/consensus/slashing.ts
- src/features/chain/state.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 5
nPHP: a digital peso (stablecoin)nPHP: digital na piso (stablecoin)
1 nPHP = ₱1 because there is ₱1 in the issuer's bank for each one. Only the issuer creates (mint) and destroys (redeem) them; the auditor signs how much the reserve really is.1 nPHP = ₱1 dahil may ₱1 sa bangko ng issuer para sa bawat isa. Ang issuer lang ang gumagawa (mint) at sumusunog (redeem); ang auditor ang pumipirma kung magkano talaga ang reserve.
- Minting beyond the audited reserve is FORBIDDEN — the chain itself blocks it.BAWAL mag-mint nang lampas sa na-audit na reserve — ang chain mismo ang humaharang.
- The chain can't see the bank → it needs an honest auditor and frequent audits.Hindi nakikita ng chain ang bangko → kailangan ng tapat na auditor at madalas na audit.
- Reserve ratio ≥ 100% = enough. Lower = dangerous (like the stablecoins that collapsed).Reserve ratio ≥ 100% = sapat. Mababa = delikado (gaya ng mga stablecoin na bumagsak).
- In real life, such an issuer needs a license from the BSP.Sa totoong buhay: kailangan ng lisensya ng BSP ang ganitong issuer.
⚠ Be careful with a 'stablecoin' that has no clear reserve or audit.Mag-ingat sa 'stablecoin' na walang malinaw na reserve o audit.
WHERE IN THE CODESAAN SA CODE
- src/features/stablecoin/issuer.ts
- src/features/stablecoin/rules.ts
- src/features/chain/accounts.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 6
Programmable money: escrow, allowance, paluwaganProgrammable money: escrow, allowance, paluwagan
Money with its own rules. The chain holds it and keeps watch — not a person. Nothing on a blockchain 'runs by itself': it only moves when there is a tx, but the rules are automatic.Pera na may sariling patakaran. Ang chain ang humahawak at nagbabantay — hindi ang tao. Walang 'kusang tumatakbo' sa blockchain: gumagalaw lang kapag may tx, pero ang patakaran ang awtomatiko.
- Escrow (instead of COD): the payment stays locked until 'it arrived'; there is a deadline for a refund.Escrow (pamalit sa COD): naka-lock ang bayad hanggang 'dumating na'; may deadline para sa refund.
- Allowance: the child can take up to ₱X per 'week'.Allowance: kukuha ang anak hanggang ₱X bawat 'linggo'.
- Paluwagan (rotating savings): the chain holds the pot; once everyone has paid, it goes to the right person automatically.Paluwagan: hawak ng chain ang pot; kapag kumpleto ang hulog, kusang napupunta sa tamang tao.
- Still missing: collateral for members who don't pay.Kulang pa: collateral para sa hindi naghuhulog.
WHERE IN THE CODESAAN SA CODE
- src/features/programs/types.ts
- src/features/programs/rules.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 7
Safety-first accountsSafety-first accounts
Protection built into the account: a daily limit, an undo window (a delay you can cancel), trusted addresses, a delay on changing settings, and recovery guardians if the key is lost.Proteksyon na built-in sa account: daily limit, undo window (palugit na pwedeng i-cancel), trusted addresses, delay sa pagbabago ng settings, at recovery guardians kapag nawala ang key.
- Undo window: a large payment to a stranger is held by the chain first — it can be cancelled.Undo window: ang malaking padala sa hindi kilala ay hawak muna ng chain — pwedeng i-cancel.
- Delay on settings: a thief can't remove the protection at once.Delay sa settings: hindi agad matatanggal ng magnanakaw ang proteksyon.
- Guardians: a majority of them can give the SAME address a new key.Guardians: karamihan sa kanila ang pwedeng magbigay ng bagong key sa PAREHONG address.
- Choose guardians you truly trust.Pumili ng guardians na tunay na mapagkakatiwalaan.
WHERE IN THE CODESAAN SA CODE
- src/features/safety/types.ts
- src/features/safety/rules.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 8
The network: many nodesNetwork: maraming node
Each node is a separate program with its own copy of the chain and its own validator key. They spread transactions, proposals and votes (gossip), and a node that falls behind catches up (sync).Bawat node ay hiwalay na programa na may sariling kopya ng chain at sariling validator key. Nagkakalat sila ng tx, proposal at boto (gossip), at sumasabay (sync) ang nahuli.
- Proposal → votes → more than 2/3 → FINAL on every node.Proposal → boto → higit 2/3 → FINAL sa lahat ng node.
- Double spend: the same money on two nodes at once → only one is accepted.Double spend: parehong pera sa dalawang node nang sabay → isa lang ang tatanggapin.
- Proposals and votes are repeated so a node that just came back can catch up.Inuulit ang proposals at boto para mahabol ng node na kababalik lang.
- Simplified: no encryption — don't expose it to the internet.Pinasimple: walang encryption — huwag ilantad sa internet.
WHERE IN THE CODESAAN SA CODE
- src/features/network/node.ts
- src/features/network/server.ts
- scripts/network.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 9
Post-quantum signatures (ML-DSA)Post-quantum signatures (ML-DSA)
In the future, a powerful quantum computer could break today's signatures (ECDSA, Ed25519). ML-DSA (NIST, 2024) resists that. On nel-chain you can upgrade the key without changing the address (crypto-agility).Sa hinaharap, kayang basagin ng malakas na quantum computer ang mga pirma ngayon (ECDSA, Ed25519). Ang ML-DSA (NIST, 2024) ay matibay laban dito. Sa nel-chain, pwedeng i-upgrade ang key nang hindi nagpapalit ng address (crypto-agility).
- Key rotate: a new key, the same address and money.Key rotate: bagong key, parehong address at pera.
- The cost: a 2,420-byte signature (38× Ed25519) → bigger blocks.Presyo: 2,420-byte na pirma (38× ng Ed25519) → mas malaking blocks.
- No quantum computer can break today's keys yet — this is preparation.Wala pang quantum computer na kayang bumasag nito ngayon — paghahanda ito.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet/keys.ts
- src/features/safety/rules.ts (rotateKey)
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 10
Wallet app and QR payWallet app at QR pay
The wallet app connects to a node (like MetaMask to an RPC). The QR holds 'nel:pay?to=…&amount=…&memo=…' — scan, check, sign.Ang wallet app ay kumokonekta sa node (gaya ng MetaMask sa RPC). Ang QR ay may laman na 'nel:pay?to=…&amount=…&memo=…' — i-scan, i-check, pirmahan.
- Always check the address and amount before signing.Laging i-check ang address at halaga bago pumirma.
- Not a valid link → do NOT pay.Hindi valid na link → HUWAG magbayad.
- Camera: works only on localhost or HTTPS.Camera: gumagana sa localhost o HTTPS lang.
⚠ A fake QR or 'promo link' is usually a scam. Our app only accepts nel:pay links.Ang pekeng QR o 'promo link' ay karaniwang scam. Ang app natin ay tumatanggap lang ng nel:pay na link.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet-app/pay-link.ts
- src/features/wallet-app/scan-qr.tsx
- src/features/node-client/node-client.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 11
Exchange (AMM): NEL ↔ nPHPExchange (AMM): NEL ↔ nPHP
No order book — one POOL of two currencies. The rule: NEL × nPHP = k. When many people buy NEL, its price rises. The 0.3% fee stays in the pool for whoever provided liquidity.Walang order book — isang POOL ng dalawang pera. Patakaran: NEL × nPHP = k. Kapag maraming bumili ng NEL, tataas ang presyo nito. Ang 0.3% fee ay naiiwan sa pool para sa nagbigay ng liquidity.
- Price impact: a bigger swap → a worse price.Price impact: mas malaking swap → mas masamang presyo.
- Slippage protection: a 'minimum received' — if the price moves, the swap doesn't go through.Slippage protection: 'minimum na matatanggap' — kapag gumalaw ang presyo, hindi itutuloy.
- Liquidity providers earn the fees, but face 'impermanent loss' when the price moves a lot.Liquidity provider: kumikita sa fees, pero may 'impermanent loss' kapag malaki ang galaw ng presyo.
- This is exactly the Uniswap used in wallet-lab (Base).Ito mismo ang Uniswap na ginamit sa wallet-lab (Base).
- Chart (like Binance): 1 candle = 1 block · green = up, red = down · volume is the ₱ swapped. The price comes ONLY from the pool — there is no 'official' price.Chart (gaya ng Binance): 1 candle = 1 block · berde = tumaas, pula = bumaba · ang volume ay ₱ na na-swap. Ang presyo ay galing LANG sa pool — walang 'opisyal' na presyo.
WHERE IN THE CODESAAN SA CODE
- src/features/exchange/amm.ts
- src/features/exchange/rules.ts
- src/features/exchange/price-history.ts
- src/features/exchange/price-chart.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 12
NelPay core: PIN, KYC and cash-in/outNelPay core: PIN, KYC at cash-in/out
An e-wallet is more than a blockchain: it needs a PIN that protects the key, KYC (knowing the user) with limits, and a partner for cash-in and cash-out. That's how e-wallets work — but the limits here are demo only.Ang e-wallet ay hindi lang blockchain: kailangan ng PIN na nagpoprotekta sa key, KYC (pagkilala sa user) na may limit, at partner para sa cash-in at cash-out. Ganito gumagana ang mga e-wallet — pero ang mga limit dito ay demo lang.
- PIN → PBKDF2 (600,000 rounds) → AES-GCM: the key is encrypted; 5 wrong PINs → a 30-second lock.PIN → PBKDF2 (600,000 ulit) → AES-GCM: naka-encrypt ang key; maling PIN nang 5 beses → 30 segundong lock.
- KYC: the issuer checks the ID OFF chain; only the TIER is on chain (privacy).KYC: ang issuer ang tumitingin ng ID SA LABAS ng chain; TIER LANG ang nasa chain (privacy).
- The chain enforces the limits: no KYC ₱1,000 · Basic ₱10,000 + cash-in · Verified ₱100,000 + cash-out.Ang chain ang nagpapatupad ng limit: walang KYC ₱1,000 · Basic ₱10,000 + cash-in · Verified ₱100,000 + cash-out.
- Cash-in/out: a reference number and a receipt; 'confirmed' once it is in a block.Cash-in/out: may reference number at resibo; 'confirmed' kapag nasa block na.
- In real life: a BSP license and AMLC registration are needed.Sa totoong buhay: kailangan ng lisensya ng BSP at registration sa AMLC.
⚠ A 6-digit PIN is weak if the encrypted file is stolen — real apps use secure hardware. Never give your PIN or OTP to anyone.Ang 6-digit PIN ay mahina kapag nanakaw ang naka-encrypt na file — ang totoong app ay gumagamit ng secure hardware. Huwag ibigay ang PIN o OTP kahit kanino.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet-app/secure-storage.ts
- src/features/kyc/rules.ts
- src/features/kyc/tiers.ts
- src/features/wallet-app/cash.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 13
The NelPay app: Bills, Load, Exchange and receiptsNelPay app: Bills, Load, Exchange at resibo
The whole e-wallet: every service is a tx on chain. Pay Bills and Buy Load = an nPHP payment to a biller (with the account no. or mobile no. in the data). Exchange = a swap in the AMM pool. Every tx has a receipt with a tx hash — you can check it in the explorer.Ang buong e-wallet: lahat ng serbisyo ay mga tx sa chain. Pay Bills at Buy Load = nPHP na padala sa biller (may account no. o mobile no. sa data). Exchange = swap sa AMM pool. Bawat tx ay may resibo na may tx hash — pwedeng i-check sa explorer.
- A biller is an address on chain; the payment is an ordinary transfer with 'BILL:…' or 'LOAD:…'.Biller = address sa chain; ang bayad ay ordinaryong transfer na may 'BILL:…' o 'LOAD:…'.
- Merchant onboarding: the biller is verified so there is no limit on what it receives.Merchant onboarding: verified ang biller para walang limit sa natatanggap niya.
- Receipt: pending → CONFIRMED once it is in a block; the tx hash is the proof.Resibo: pending → CONFIRMED kapag nasa block na; ang tx hash ay patunay.
- Exchange in the app = the same AMM (Phase 11): a preview of the price impact and the minimum received.Exchange sa app = parehong AMM (Phase 11): may preview ng price impact at minimum na matatanggap.
- Our own brand (NelPay) — NEVER copy the name or logo of a real e-wallet (that's what phishing looks like).Sariling brand (NelPay) — HUWAG gayahin ang pangalan o logo ng totoong e-wallet (ganito ang itsura ng phishing).
⚠ Real e-wallets are licensed by the BSP. An app that looks like a known e-wallet but has a different link is usually phishing — always check the URL.Ang totoong e-wallet ay may lisensya ng BSP. Ang app na kamukha ng kilalang e-wallet pero ibang link ay karaniwang phishing — i-check lagi ang URL.
WHERE IN THE CODESAAN SA CODE
- src/features/nelpay/nelpay-app.tsx
- src/features/nelpay/billers.ts
- src/features/nelpay/describe.ts
- src/features/nelpay/receipt-view.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 14
The chain on disk: nothing is lostChain sa disk: hindi na nawawala
Each node saves the chain to its own file after every FINAL block. When it starts again, it checks the WHOLE chain before accepting it — a damaged or tampered file is rejected, and the node copies the chain from another node (sync).Bawat node ay nagse-save ng chain sa sarili nitong file pagkatapos ng bawat FINAL block. Pagbukas ulit, iche-check ang BUONG chain bago tanggapin — ang sirang o dinayang file ay tinatanggihan, at kokopya ang node sa ibang node (sync).
- Atomic write: written to a .tmp file first, then renamed → the file can't break even if the node dies while writing.Atomic write: isinusulat muna sa .tmp, saka nire-rename → hindi masisira ang file kahit mamatay ang node habang nagsusulat.
- Don't trust your own file: a tampered amount → 'the Merkle root doesn't match' → rejected.Huwag pagkatiwalaan ang sariling file: dinaya ang amount → 'hindi tugma ang Merkle root' → tinanggihan.
- Self-healing: a node with a broken file copies the correct chain from others (like a real full node).Self-healing: ang node na may sirang file ay kumokopya ng tamang chain sa iba (gaya ng totoong full node).
- npm run network -- --fresh → start again from genesis.npm run network -- --fresh → magsimula ulit sa genesis.
WHERE IN THE CODESAAN SA CODE
- src/features/network/storage.ts
- src/features/network/server.ts
- scripts/node.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 15
Speed: snapshots and native cryptoBilis: snapshot at native crypto
Before, a node replayed EVERYTHING from genesis for every question ('what's my balance?') — so it got slower as blocks piled up (1,000 blocks = 7–13 seconds per question). Now there is a SNAPSHOT: the current balances and stakes; only the new block is applied.Dati, inuulit ng node ang LAHAT mula genesis sa bawat tanong ('magkano ang balance ko?') — kaya pabagal nang pabagal habang dumarami ang block (1,000 block = 7–13 segundo bawat tanong). Ngayon, may SNAPSHOT: ang kasalukuyang balances at stakes; ang bagong block lang ang ina-apply.
- Measured before → after: a balance query ~seconds → ~0.01 ms · a new block ~seconds → ~0.1 ms.Sukat bago → pagkatapos: tanong ng balance ~segundo → ~0.01 ms · bagong block ~segundo → ~0.1 ms.
- The full check from genesis happens ONCE (when the node starts or syncs) — and it is linear now, not quadratic.Buong check mula genesis: ISANG beses lang (pagbukas ng node o sync) — at linear na ito, hindi parisukat.
- Native Ed25519 (Node.js's OpenSSL): 14× faster than JS → 3,000 blocks: 20.7 s → 1.6 s on first start.Native Ed25519 (OpenSSL ng Node.js): 14× na mas mabilis kaysa JS → 3,000 block: 20.7 s → 1.6 s sa unang bukas.
- Signature cache: a signature already checked isn't checked again.Cache ng pirma: ang na-check na ay hindi na iche-check ulit.
- That's how real nodes work: a state database + checking only new blocks; Bitcoin has 'assumevalid' to speed up the first sync.Ganito ang totoong node: state database + pag-check ng bagong block lang; ang Bitcoin ay may 'assumevalid' para mas mabilis ang unang sync.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/snapshot.ts
- src/features/network/native-crypto.ts
- src/features/consensus/slashing.ts
- src/features/wallet/keys.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 16
Open staking: anyone can be a validatorOpen staking: kahit sino pwedeng maging validator
Before, only V1–V4 were validators (written in genesis) — closed. Now the validator list is IN THE STATE: any wallet can `stake` ≥ 50 NEL and become a validator from the next block. That's how Ethereum works (32 ETH).Dati, V1–V4 lang ang validator (nakasulat sa genesis) — sarado. Ngayon, NASA STATE na ang listahan ng validators: kahit sinong wallet ay pwedeng mag-`stake` ng ≥ 50 NEL at maging validator sa susunod na block. Ganito ang Ethereum (32 ETH).
- stake: lock NEL → a voice by stake size, a chance to be the proposer, and rewards.stake: i-lock ang NEL → may boses ayon sa laki ng stake, mabubunot bilang proposer, at kumikita ng rewards.
- unstake: it doesn't come back at once — 10 blocks of 'unbonding' so a cheater can't escape before being slashed.unstake: hindi agad bumabalik — 10 block na 'unbonding' para hindi makatakas ang mandaraya bago ma-slash.
- You can still be slashed (double vote) → −50% and jailed.Pwede ka pa ring ma-slash (dobleng boto) → −50% at jailed.
- Risk: an OFFLINE validator still counts in the votes — if more than 1/3 are offline, the chain STOPS. (Real chains also penalize long downtime.)Panganib: ang validator na OFFLINE ay kasama pa rin sa bilang ng boses — kapag higit 1/3 ang offline, HIHINTO ang chain. (Sa totoong chain: may parusa rin sa matagal na offline.)
- Ask of any blockchain: who are the validators, and how many? If there are few and they all know each other, it isn't really decentralized.Tanong sa kahit anong blockchain: sino ang mga validator, at ilan sila? Kapag iilan lang at magkakakilala, hindi ito talagang decentralized.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/staking.ts
- src/features/consensus/stakes.ts
- src/features/consensus/consensus.ts
- src/features/consensus/validators-panel.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 17
Soul ID: 1 person = 1 ID, and 2 kinds of keysSoul ID: 1 tao = 1 ID, at 2 klase ng key
The issuer verifies the person (ID + selfie) OFF chain. On chain: only the Soul ID #, a hash of the ID number and a masked name ('J*** D. C.'). It can't be transferred (soulbound). The identity key (root) signs a 'certificate' for everyday signing keys — like an HTTPS certificate.Ang issuer ang nagve-verify ng tao (ID + selfie) SA LABAS ng chain. Sa chain: Soul ID #, hash ng ID number at masked name ('J*** D. C.') LANG. Hindi ito naililipat (soulbound). Ang identity key (root) ang pumipirma ng 'certificate' para sa mga signing key na pang-araw-araw — parang HTTPS certificate.
- 1 person = 1 Soul ID: the same ID number → the same hash → the second one is rejected.1 tao = 1 Soul ID: parehong ID number → parehong hash → tinatanggihan ang pangalawa.
- Identity key: rarely used, kept hidden. Signing key: on the phone, for payments. Lost the phone → revoke, link a new one; the Soul ID does NOT change.Identity key: bihirang gamitin, nakatago. Signing key: nasa phone, pambayad. Nawala ang phone → revoke, link ng bago; HINDI nagbabago ang Soul ID.
- A link needs TWO signatures: the identity key (tx) + the signing key (consent) → no one can claim someone else's address.Ang link ay kailangan ng DALAWANG pirma: identity key (tx) + signing key (pahintulot) → walang makakaangkin ng address ng iba.
- Lookup: paste an address → ✅ verified + masked name, or ⚠️ not verified. Not the full name → useless to a robber or scammer.Lookup: i-paste ang address → ✅ verified + masked name, o ⚠️ hindi verified. Hindi buong pangalan → hindi magagamit ng holdaper o scammer.
- Death: the issuer closes it (death certificate) → the Soul ID is 'burned'; the person can never register again.Pumanaw: ang issuer ang nagsasara (death certificate) → 'nasunog' ang Soul ID; hindi na pwedeng magparehistro muli ang tao.
- No fingerprint or face is on chain — biometrics only unlock the key on the phone (Passkey, in a later phase).Hindi nasa chain ang fingerprint o mukha — ang biometrics ay pambukas lang ng key sa phone (Passkey, sa susunod na phase).
⚠ The hash of the ID number needs a SECRET salt held by the issuer — without it, anyone could guess the hash of every ID number and find out who owns an address.Ang hash ng ID number ay kailangang may LIHIM na salt ng issuer — kung wala, kayang hulaan ng kahit sino ang hash ng bawat ID number at malalaman kung sino ang may-ari ng address.
WHERE IN THE CODESAAN SA CODE
- src/features/soul-id/rules.ts
- src/features/soul-id/identity.ts
- src/features/soul-id/types.ts
- src/features/soul-id/soul-panel.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 18
ID lookup: who is receiving?ID lookup: sino ang tatanggap?
A new page, /id: paste an address → the node is asked → ✅ verified human (Soul ID # and masked name) or ⚠️ not verified. In NelPay it appears automatically under Send, before you press Pay.Bagong page na /id: i-paste ang address → tatanungin ang node → ✅ verified human (Soul ID # at masked name) o ⚠️ hindi verified. Sa NelPay, awtomatiko itong lumalabas sa Send bago pindutin ang Bayaran.
- A new node query: get-soul → the answer is a soul (or null). It includes what's pending in the mempool, like get-account.Bagong tanong sa node: get-soul → sagot na soul (o null). Kasama ang pending sa mempool, gaya ng get-account.
- Public view: Soul ID #, masked name, status and keys — NOT the person's hash or record.Publikong view: Soul ID #, masked name, status, at mga key — HINDI kasama ang hash ng tao o record.
- Masked name ('J*** D. C.'): enough to see you have the right recipient, not enough for a scammer or robber.Masked name ('J*** D. C.'): sapat para makita mong tama ang padadalhan, pero kulang para sa scammer o holdaper.
- E-wallets do the same today: they show a masked name before you send.Ganito rin sa mga e-wallet ngayon: ipinapakita ang masked name bago ka magpadala.
⚠ ✅ verified is NOT a guarantee against scams — it only means a real person owns it (possibly a 'money mule'). Still don't send to strangers or to 'too good to be true' offers.Ang ✅ verified ay HINDI garantiya na hindi scam — ibig sabihin lang ay tunay na tao ang may-ari (pwedeng 'money mule'). Huwag pa ring magpadala sa hindi mo kilala o sa 'sobrang gandang' alok.
WHERE IN THE CODESAAN SA CODE
- src/features/soul-id/lookup.ts
- src/features/soul-id/id-lookup-view.tsx
- src/features/scam-shield/recipient-check.tsx
- src/features/network/node.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 19
Scam shield: reports and warnings before you sendScam shield: report at babala bago magpadala
If you get scammed, you can report the address (scam-report). EVERYONE sees it before they send: '🚨 3 verified people reported this'. The node also says whether this is the FIRST time you pay the address. In NelPay, if the recipient has reports, you must tick 'I understand' before you can pay.Kapag na-scam ka, pwede mong i-report ang address (scam-report). Makikita ito ng LAHAT bago sila magpadala: '🚨 3 verified na tao ang nag-report'. Sinasabi rin ng node kung UNANG beses mong padadalhan ang address. Sa NelPay, kapag may report ang tatanggap, kailangan mo munang i-check ang 'naiintindihan ko' bago makapagbayad.
- Only Soul IDs can report → 1 person = 1 report per address. A bot or competitor can't make 1,000 fake reports.Soul ID lang ang pwedeng mag-report → 1 tao = 1 report bawat address. Ang bot o kakumpitensya ay hindi makakagawa ng 1,000 pekeng report.
- Reports count across ALL keys of the same person → a scammer can't escape with a new signing key.Binibilang ang report sa LAHAT ng key ng iisang tao → hindi makakatakas ang scammer gamit ang bagong signing key.
- You can withdraw your own report (scam-retract) — e.g. the item did arrive.Pwedeng bawiin ang sariling report (scam-retract) — hal. dumating din ang item.
- 'First time' = no payment from you to that address anywhere in the chain or mempool.'Unang beses' = walang padala mula sa iyo papunta sa address na iyan sa buong chain at mempool.
- It is only a WARNING — it doesn't block anyone's money. Freezing is for a court (next phase: court-order disclosure).Ito ay BABALA lang — hindi nito hinaharang ang pera ng iba. Ang pag-freeze ay para sa korte (susunod na phase: court-order disclosure).
⚠ Reports can be abused (e.g. a competitor smearing you). Hence: verified people only, 1 report per person, and you can see how many and why. In real life, also report to the police or to CICC (hotline 1326) — a report can't bring the money back.Pwedeng abusuhin ang report (hal. paninira ng kakumpitensya). Kaya: verified na tao lang, 1 report bawat tao, at nakikita kung ilan at bakit. Sa totoong buhay: mag-report din sa pulis o sa CICC (hotline 1326) — hindi maibabalik ng report ang pera.
WHERE IN THE CODESAAN SA CODE
- src/features/scam-shield/rules.ts
- src/features/scam-shield/check.ts
- src/features/scam-shield/recipient-check.tsx
- src/features/wallet-app/pay-form.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 20
Court orders: private to everyone, open only to a courtCourt order: pribado sa lahat, bukas lang sa korte
The full record (name + ID number) is ENCRYPTED (AES-GCM) inside the Soul ID. The key is split three ways: Court, Issuer and Auditor — it takes the court + one more. When there is a case: case-open (court, with a court order no.) → case-approve (issuer or auditor) → the court can read it → case-freeze if needed.Ang buong record (pangalan + ID number) ay NAKA-ENCRYPT (AES-GCM) sa loob ng Soul ID. Ang susi ay hinati sa 3: Korte, Issuer at Auditor — kailangan ng korte + isa pa. Kapag may kaso: case-open (korte, may court order no.) → case-approve (issuer o auditor) → mababasa ng korte → case-freeze kung kailangan.
- Key split: key = X ⊕ Y ⊕ Z; each trustee holds 2 pieces → any 2 have all of them. (The general version: Shamir's Secret Sharing.)Hati ng susi: susi = X ⊕ Y ⊕ Z; bawat trustee ay may 2 piraso → kahit sinong 2 ay may lahat. (Pangkalahatang bersyon: Shamir's Secret Sharing.)
- Each piece is locked with X25519 (key exchange) → only the trustee's private key can open it.Ang piraso ay naka-lock gamit ang X25519 (key exchange) → ang may private key lang ng trustee ang makakabukas.
- Approval: the issuer/auditor re-locks its piece FOR THE COURT only → even on chain, no one else can read it.Pag-apruba: ini-lock ulit ng issuer/auditor ang piraso PARA SA KORTE lang → kahit nasa chain, walang ibang makakabasa.
- Audit log: every case (order number, whose Soul ID, who approved) is visible to EVERYONE and can't be erased → no secret peeking.Audit log: bawat kaso (numero ng order, kaninong Soul ID, sino ang pumayag) ay nakikita ng LAHAT at hindi mabubura → walang lihim na pagsilip.
- Freeze: none of the keys of that Soul ID can send until the court unfreezes it.Freeze: lahat ng key ng parehong Soul ID ay hindi makakapagpadala hanggang mag-unfreeze ang korte.
⚠ Limits: (1) The chain can't check that a trustee's piece is CORRECT (that needs a ZK proof). (2) The encrypted record stays on chain forever — if X25519 is broken some day (quantum), it becomes readable ('harvest now, decrypt later'); real systems use post-quantum encryption (ML-KEM) or keep the record off chain. (3) The suspect sees the case in the audit log at once — in real life there is a delay before notice.Limitasyon: (1) Hindi kayang i-check ng chain kung TAMA ang piraso na ibinigay ng trustee (kailangan ng ZK proof para doon). (2) Ang naka-encrypt na record ay nasa chain habambuhay — kapag nasira ang X25519 balang araw (quantum), mababasa ito ('harvest now, decrypt later'); sa totoong sistema: post-quantum encryption (ML-KEM) o itago ang record sa labas ng chain. (3) Nakikita agad ng suspek ang kaso sa audit log — sa totoong buhay, may palugit bago abisuhan.
WHERE IN THE CODESAAN SA CODE
- src/features/disclosure/sealed.ts
- src/features/disclosure/rules.ts
- src/features/disclosure/trustees.ts
- src/features/disclosure/court-panel.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 21
Passkey: a fingerprint instead of a PINPasskey: fingerprint sa halip na PIN
In NelPay → 🔐 Passkey: turn on fingerprint / face / Windows Hello. The device checks the biometric — it NEVER leaves the device and is NOT on chain. With the PRF extension, the passkey yields a secret 32 bytes → that becomes the key (AES-GCM) of a second copy of the wallet → the wallet opens without a PIN.Sa NelPay → 🔐 Passkey: i-on ang fingerprint / mukha / Windows Hello. Ang device ang nagsusuri ng biometric — HINDI ito umaalis sa device at WALA sa chain. Gamit ang PRF extension, nagbibigay ang passkey ng lihim na 32 bytes → iyon ang susi (AES-GCM) ng pangalawang kopya ng wallet → mabubuksan ang wallet nang walang PIN.
- WebAuthn: built into the browser (navigator.credentials.create / .get) — no library.WebAuthn: built-in sa browser (navigator.credentials.create / .get) — walang library.
- Anti-phishing: the passkey is bound to the domain → it won't work on a fake 'NelPay' site.Anti-phishing: nakatali ang passkey sa domain → sa pekeng 'NelPay' site, hindi ito gagana.
- Step-up: payments above ₱1,000 → asks for the passkey again; ₱1,000 and below → go ahead.Step-up: bayad na lampas ₱1,000 → hihingi ulit ng passkey; ₱1,000 pababa → tuloy agad.
- If the device has no PRF, the passkey is step-up only and the PIN still opens the wallet.Walang PRF ang device → step-up lang ang passkey, PIN pa rin ang pambukas.
- The PIN is still the backup: a broken phone → PIN (and guardian recovery on chain).Ang PIN ay backup pa rin: nasira ang phone → PIN (at guardian recovery sa chain).
⚠ The step-up is only in the BROWSER (UX): malware on the computer could bypass it. Stronger: the passkey itself signs the tx and the CHAIN requires it (the P-256 scheme — next step). Passkeys only work on https or localhost.Ang step-up ay nasa BROWSER lang (UX): kung may malware sa computer, pwede itong lampasan. Ang mas matibay: ang passkey mismo ang pipirma ng tx at ang CHAIN ang hihingi nito (P-256 scheme — susunod na hakbang). Gumagana lang ang passkey sa https o localhost.
WHERE IN THE CODESAAN SA CODE
- src/features/passkey/passkey.ts
- src/features/passkey/passkey-vault.ts
- src/features/passkey/passkey-card.tsx
- src/features/wallet-app/unlock-screen.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 22
Many attesters: no single holder of 'who is a person'Maraming attester: walang iisang may hawak ng 'sino ang tao'
Before, ONE issuer created Soul IDs — so it could create fake people. Now it takes 2 proofs (soul-attest) from DIFFERENT kinds of attesters: government (PhilSys, PSA, SSS), private (Bangko Nel) or community (Barangay). They check the ID, face (liveness) and fingerprint — OFF chain.Dati, ISANG issuer lang ang gumagawa ng Soul ID — kaya kaya niyang gumawa ng pekeng tao. Ngayon: kailangan ng 2 patunay (soul-attest) mula sa MAGKAIBANG uri ng attester: gobyerno (PhilSys, PSA, SSS), pribado (Bangko Nel) o komunidad (Barangay). Sila ang tumitingin sa ID, mukha (liveness) at fingerprint — SA LABAS ng chain.
- Government + government (e.g. PhilSys + SSS) → ✗. Another kind is needed → not even the government can create a 'ghost' person alone.Gobyerno + gobyerno (hal. PhilSys + SSS) → ✗. Kailangan ng ibang uri → kahit ang gobyerno ay hindi makakagawa ng 'ghost' na tao nang mag-isa.
- Dedup: the hash of the PhilSys PCN (PhilSys itself deduplicates with biometrics) → 1 person = 1 Soul ID.Dedup: ang hash ng PhilSys PCN (ang PhilSys mismo ang nagde-dedup gamit ang biometrics) → 1 tao = 1 Soul ID.
- Census check: more Soul IDs than the barangay's population → 🚨 in the lookup and the list.Census check: mas maraming Soul ID kaysa populasyon ng barangay → 🚨 sa lookup at sa talaan.
- Each attester has a bond (100 NEL) and a public count of proofs. Caught with a fake person (court, open case) → −50% bond (burned), jailed, and the Soul ID revoked.Bawat attester ay may bond (100 NEL) at pampublikong bilang ng patunay. Nahuling pekeng tao (korte, bukas na kaso) → −50% bond (sunog), jailed, at binawi ang Soul ID.
- The PSA (civil registry) now reports deaths.Ang PSA (civil registry) na ang nag-uulat ng pagpanaw.
⚠ The attesters are demo only. A real link to PhilSys, PSA or SSS needs an agreement (MOA), accreditation and Data Privacy Act compliance. Biometrics are NEVER on chain. And some Filipinos have no ID — another path is needed (e.g. barangay + neighbors with Soul IDs) so they aren't left out.Demo lang ang mga attester. Ang totoong koneksyon sa PhilSys, PSA o SSS ay nangangailangan ng kasunduan (MOA), akreditasyon at Data Privacy Act compliance. Ang biometrics ay HINDI kailanman nasa chain. At may mga Pilipinong walang ID — kailangan ng ibang daan (hal. barangay + kapitbahay na may Soul ID) para hindi sila maiwan.
WHERE IN THE CODESAAN SA CODE
- src/features/attesters/registry.ts
- src/features/attesters/rules.ts
- src/features/attesters/attesters-panel.tsx
- src/features/soul-id/soul-panel.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 23
Fair launch: no one holds the supplyFair launch: walang humahawak sa supply
Genesis = 0 NEL: no faucet, no pre-mine, no team share. NEL comes ONLY from: 🧑 +10 NEL once per new Soul ID (created by the code), and ⛏️ the block reward of the drawn committee. 🔥 Every block burns an amount proportional to the total supply → this slows the supply's growth.Genesis = 0 NEL: walang faucet, walang pre-mine, walang team share. Ang NEL ay galing LANG sa: 🧑 +10 NEL isang beses bawat bagong Soul ID (nililikha ng code), at ⛏️ block reward ng nabunot na komite. 🔥 Bawat block, may sunog na proporsyonal sa kabuuang supply → pinapabagal nito ang paglaki ng supply.
- The draw (sortition): anyone with a Soul ID + ≥ 1 NEL stake can be drawn. 1 person = 1 ticket — however many keys stake, there is only one ticket.Palabunutan (sortition): lahat ng may Soul ID + ≥ 1 NEL stake ay pwedeng mabunot. 1 tao = 1 tiket — kahit ilang key ang i-stake, iisa lang ang tiket.
- Each block (and each round) has a new committee (up to 7 in the lab); more than 2/3 of it is needed. Many offline? → the next round = a new draw.Bawat block (at bawat round) ay may bagong komite (hanggang 7 sa lab); kailangan ng higit 2/3 ng komite. Offline ang marami? → susunod na round = bagong bunot.
- Bootstrap: while fewer than 4 validators have Soul IDs, V1–V4 take part — but they hold 0 NEL and earn NOTHING. They leave once there are 4.Bootstrap: habang wala pang 4 na validator na may Soul ID, kasama ang V1–V4 — pero 0 NEL sila at WALANG kinikita. Aalis sila kapag may 4 na.
- Reward: 2 NEL → halving → 0.5 NEL forever (tail). Only voters with a Soul ID earn.Reward: 2 NEL → nahahati → 0.5 NEL habambuhay (tail). Kikita lang ang bumoto na may Soul ID.
- Burn per block ≈ supply ÷ 1,000 (lab) — from fees, and at most HALF the reward → the guards always earn something. So with NO users, supply still grows by +½ reward per block (📈 Net/block in the header) — like Monero, a smaller and smaller % each year. Supply only falls when there are enough FEES (many users).Sunog bawat block ≈ supply ÷ 1,000 (lab) — galing sa fees, at hanggang KALAHATI lang ng reward → laging may kita ang nagbabantay. Kaya kapag WALANG gumagamit, tumataas pa rin ang supply nang +½ reward bawat block (📈 Net/block sa header) — gaya ng Monero, paliit nang paliit ang % bawat taon. Bababa lang ang supply kapag sapat ang FEES (maraming gumagamit).
- Official institution txs (PhilSys proofs, bank cash-in, court orders) pay no fee — they have no pre-mined NEL.Ang opisyal na tx ng institusyon (patunay ng PhilSys, cash-in ng bangko, court order) ay walang fee — wala silang pre-mine na NEL.
- Always true: supply = 🧑 + ⛏️ − 🔥 (there is a test for this).Laging totoo: supply = 🧑 + ⛏️ − 🔥 (may test para dito).
⚠ This is for learning, not ready for a real market: (1) a committee of 7 is far too small — real chains use hundreds to thousands; (2) the draw comes from prevHash (a VRF is needed); (3) halving and burning are faster in the lab; (4) launching with real money needs audits, lawyers and licenses (BSP, SEC). Be wary of any token that promises a 'fair launch' but doesn't show you the genesis.Pang-aral pa lang ito, hindi pa handa sa totoong merkado: (1) komite ng 7 ay masyadong maliit — sa totoong chain, daan-daan hanggang libu-libo; (2) ang bunot ay galing sa prevHash (kailangan ng VRF); (3) mas mabilis ang halving at sunog sa lab; (4) ang paglulunsad nang may totoong pera ay nangangailangan ng audit, abogado at lisensya (BSP, SEC). Mag-ingat sa kahit anong token na nangangakong 'fair launch' pero hindi mo makita ang genesis.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/supply.ts
- src/features/consensus/committee.ts
- src/features/chain/state.ts
- src/features/chain/public-service.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 24
Death and inheritance: fair, but not rushedPagpanaw at mana: patas, pero hindi nagmamadali
While alive: set a 👪 beneficiary (soul-beneficiary). When the PSA reports a death (soul-close): ⏳ a GRACE PERIOD first (20 blocks in the lab) — every key is frozen, and the owner can say 🙋 'I'm still alive' (soul-alive). After the grace period: 🔥 the 10 NEL welcome goes back to the protocol; the remaining NEL (including stake) and ALL the nPHP → the beneficiary.Habang buhay: itakda ang 👪 beneficiary (soul-beneficiary). Kapag nag-ulat ang PSA ng pagpanaw (soul-close): ⏳ PALUGIT muna (20 block sa lab) — naka-freeze ang lahat ng key, at pwedeng sabihin ng may-ari ang 🙋 'Buhay pa ako' (soul-alive). Pagkatapos ng palugit: 🔥 ang 10 NEL na welcome ay bumabalik sa protocol; ang natirang NEL (pati stake) at LAHAT ng nPHP → beneficiary.
- Why a grace period? What is burned can't come back — so it isn't instant. A false death report → 'I'm still alive'.Bakit may palugit? Hindi na maibabalik ang nasunog — kaya hindi agad-agad. Pekeng ulat ng pagpanaw → 'Buhay pa ako'.
- Only the welcome is burned (it was a gift because they were a PERSON). What they worked for goes to the family.Ang welcome lang ang sinusunog (regalo ito dahil TAO siya). Ang pinaghirapan niya ay napupunta sa pamilya.
- nPHP is NEVER burned — real pesos in a bank back it; burning it would only benefit the issuer.Ang nPHP ay HINDI kailanman sinusunog — may totoong piso sa bangko sa likod nito; kung susunugin, ang issuer ang makikinabang.
- No beneficiary → locked as an 'estate'; the COURT gives it to the heirs (estate-release), like inheritance today.Walang beneficiary → naka-lock bilang 'estate'; ang KORTE ang magbibigay sa tagapagmana (estate-release), gaya ng proseso ng mana ngayon.
- Every key of the same Soul ID is included — no money is left stranded on a signing key.Lahat ng key ng parehong Soul ID ay kasama — hindi maiiwan ang pera sa signing key.
⚠ Real inheritance is more complex (the Civil Code gives children and spouses a 'legitime', and there is estate tax). This rule is for learning only — not a substitute for a lawyer or a court.Sa totoong buhay, mas kumplikado ang mana (Civil Code: may 'legitime' ang mga anak at asawa, at may estate tax). Pang-aral lang ang patakarang ito — hindi kapalit ng abogado o ng korte.
WHERE IN THE CODESAAN SA CODE
- src/features/inheritance/rules.ts
- src/features/inheritance/types.ts
- src/features/soul-id/soul-panel.tsx
- src/features/disclosure/court-panel.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 25
Passkey on chain: the fingerprint itself signsPasskey sa chain: ang fingerprint mismo ang pumipirma
In Phase 21, only the browser asked for the passkey (malware could bypass it). Now there is a new kind of signature, 'passkey-p256'. In NelPay → 🔐 Passkey → ⛓️ Move signing to the passkey: one key-rotate (same address and money) → from then on the phone/PC's secure chip signs EVERY tx, and the CHAIN rejects any tx without it.Sa Phase 21, ang browser lang ang humihingi ng passkey (kayang lampasan ng malware). Ngayon: bagong klase ng pirma, ang 'passkey-p256'. Sa NelPay → 🔐 Passkey → ⛓️ Ilipat ang pirma sa passkey: isang key-rotate (parehong address at pera) → mula ngayon, ang secure chip ng phone/PC ang pumipirma ng BAWAT tx, at ang CHAIN ang tumatanggi sa kahit anong tx na wala nito.
- No secret key in the app or in localStorage — it lives in the device's secure chip. Only the credential ID and public key are saved.Walang secret key sa app o sa localStorage — nasa secure chip ng device. Ang naka-save lang: credential ID at public key.
- How: challenge = sha256(tx). The device signs authenticatorData + sha256(clientDataJSON) — and the challenge is inside clientDataJSON. Change the tx → the challenge doesn't match → ✗.Paano: challenge = sha256(tx). Pumipirma ang device ng authenticatorData + sha256(clientDataJSON) — at nasa clientDataJSON ang challenge. Binago ang tx → hindi tugma ang challenge → ✗.
- The chain checks the 'UV' flag (User Verified): the device's fingerprint/face/PIN was used. No UV → ✗, even with a correct signature.Iche-check ng chain ang 'UV' flag (User Verified): may fingerprint/mukha/PIN ng device. Walang UV → ✗, kahit tama ang pirma.
- After the key-rotate, the OLD key (the PIN wallet) is ✗ 'Old key' — even a stolen phone and PIN are useless.Pagkatapos ng key-rotate, ang LUMANG key (PIN wallet) ay ✗ 'Lumang key' — nanakaw man ang phone at PIN, wala nang silbi.
- Coinbase Smart Wallet and RIP-7212 on Ethereum work this way (P-256 verification on chain). Our bonus: crypto-agility from Phase 2 → no new address.Ganito ang Coinbase Smart Wallet at ang RIP-7212 sa Ethereum (P-256 verify sa chain). Bonus sa atin: crypto-agility mula Phase 2 → walang bagong address.
⚠ If you lose the device with the passkey, guardian recovery is the only way back (Phase 7). Set up guardians before moving signing. And P-256 is not post-quantum — post-quantum passkeys will be needed some day.Kapag nawala ang device na may passkey: guardian recovery lang ang paraan (Phase 7). I-set muna ang guardians bago ilipat ang pirma. At ang P-256 ay hindi post-quantum — sa hinaharap, kailangan ng post-quantum na passkey.
WHERE IN THE CODESAAN SA CODE
- src/features/passkey/webauthn-signature.ts
- src/features/passkey/passkey-signer.ts
- src/features/wallet/keys.ts
- src/features/nelpay/nelpay-app.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 26
VRF: a secret ticket in the drawVRF: lihim na tiket sa palabunutan
Before (Phase 23), the draw came from the previous block's hash — so EVERYONE knew in advance who would vote (easy to bribe or attack). Now each validator SECRETLY draws a ticket with a VRF (RFC 9381) and its own Ed25519 key. It is drawn if ticket < chance (≈ 7 ÷ number of candidates). The proof is shown only WHEN VOTING — and anyone can check it.Dati (Phase 23), ang bunot ay galing sa hash ng nakaraang block — kaya ALAM NG LAHAT nang maaga kung sino ang boboto (madaling suhulan o atakihin). Ngayon: bawat validator ay LIHIM na kumukuha ng tiket gamit ang VRF (RFC 9381) at sarili niyang Ed25519 key. Nabunot kapag tiket < tsansa (≈ 7 ÷ bilang ng kandidato). Ipinapakita lang ang patunay PAGBOTO — at kahit sino ay makakapag-check nito.
- VRF = 'random' that can't be predicted but can be proven: there is only one ticket per (key, seed) — no picking a better one.VRF = 'random' na hindi mahuhulaan pero mapapatunayan: iisa lang ang tiket bawat (key, seed) — hindi makakapili ng mas magandang tiket.
- Our implementation matches the official RFC 9381 test vector (there is a test).Ang implementasyon natin ay tugma sa opisyal na test vector ng RFC 9381 (may test).
- Every vote carries a VRF proof. A vote from someone not drawn, or a borrowed proof → ✗.Bawat boto ay may VRF na patunay. Boto ng hindi nabunot, o patunay na hiniram sa iba → ✗.
- Needed: > 2/3 of the expected committee (5 when it is 7). Not enough drawn members online → the next round = a new draw.Kailangan: > 2/3 ng inaasahang komite (5 kapag 7). Kulang ang nabunot na online → susunod na round = bagong bunot.
- Why a big committee? If cheaters hold 20% of the tickets: a committee of 7 → they capture ~0.47% of blocks; 21 → ~0.00005%; 1,000 → nearly impossible. See 'odds of capture' in the Validators panel.Bakit malaking komite? Kapag hawak ng mandaraya ang 20% ng tiket: komite ng 7 → ~0.47% ng block ang maaagaw niya; 21 → ~0.00005%; 1,000 → halos imposible. Sa Validators panel: 'tsansang maagaw'.
- In Phase 26 the proposer was still public (one per round). From Phase 43 it is SECRET too (VRF) — like Algorand.Noong Phase 26, pampubliko pa ang proposer (isa bawat round). Mula Phase 43, LIHIM na rin ito (VRF) — gaya ng Algorand.
- CONSENSUS KEY: the voting key (Ed25519) is separate from the account key. Upgraded to ML-DSA or a passkey? → the old Ed25519 still votes. A new Ed25519 (e.g. recovery after theft)? → that becomes the voting key, so the thief can't vote.CONSENSUS KEY: ang pamboto (Ed25519) ay hiwalay sa account key. Nag-upgrade sa ML-DSA o passkey? → ang lumang Ed25519 pa rin ang pamboto. Bagong Ed25519 (hal. recovery dahil nanakaw)? → iyon na ang pamboto, para hindi makaboto ang magnanakaw.
⚠ A committee of 7 is for the lab. A real chain with thousands of voters needs signature aggregation (BLS) so blocks don't get heavy. Don't trust a chain that claims to be 'decentralized' but has only a few validators everyone knows.Pang-lab ang komite ng 7. Ang totoong chain na may libu-libong botante ay kailangan ng pagsasama ng pirma (BLS aggregation) para hindi bumigat ang bawat block. Huwag magtiwala sa chain na 'decentralized' daw pero iilan lang ang validator na kilala ng lahat.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/vrf.ts
- src/features/consensus/committee.ts
- src/features/consensus/votes.ts
- src/features/network/node.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 27
Lab, testnet and mainnet: one codebase, different worldsLab, testnet at mainnet: iisang code, iba-ibang mundo
Before, every number was for the lab (a halving every 100 blocks!). Now there are 3 networks, like Bitcoin Core (main / testnet / regtest): LAB = fast (default), TESTNET = real time, MAINNET = the whitepaper draft (refuses to run). Chosen with NEL_NETWORK.Dati, pang-lab ang lahat ng numero (halving bawat 100 block!). Ngayon, may 3 network gaya ng Bitcoin Core (main / testnet / regtest): LAB = mabilis (default), TESTNET = totoong bilis ng oras, MAINNET = draft para sa whitepaper (ayaw tumakbo). Pinipili gamit ang NEL_NETWORK.
- One place for every number: src/features/chain/params.ts — block time, halving, burn, committee size, delays.Iisang lugar ng lahat ng numero: src/features/chain/params.ts — oras ng block, halving, sunog, laki ng komite, mga palugit.
- ≈ 5 seconds per block → 17,280 blocks per day. Mainnet draft: halving every 4 years (like Bitcoin), burn ≈ 1% a year, a committee of 1,000.≈ 5 segundo bawat block → 17,280 block bawat araw. Mainnet draft: halving bawat 4 na taon (gaya ng Bitcoin), sunog ≈ 1% bawat taon, komite ng 1,000.
- The CHAIN ID (e.g. nel-testnet-1) is part of EVERY tx signature, vote and block hash. A tx signed on testnet is ✗ 'Wrong signature' on another network — tested (REPLAY).CHAIN ID (hal. nel-testnet-1) ay kasama sa BAWAT pirma ng tx, sa boto, at sa hash ng block. Ang tx na pinirmahan sa testnet ay ✗ 'Mali ang pirma' sa ibang network — may test (REPLAY).
- A node's saved chain is stamped with the chain ID. Another network or an old file → set aside (.bak), not deleted, and the node starts from genesis.Ang naka-save na chain ng node ay may tatak ng chain ID. Ibang network o lumang file → itinatabi (.bak), hindi binubura, at magsisimula sa genesis.
- Mainnet is 'ready: false' → the node refuses: 'still a draft (whitepaper)'. No accidental launch.Ang mainnet ay 'ready: false' → tumatanggi ang node: 'draft pa (whitepaper)'. Walang aksidenteng paglulunsad.
⚠ The chain ID changed what gets signed — so your network's old saved chain (data/V?-400?.json) will be set aside and start again from genesis. And in Phase 29, the validator and institution keys are still DEMO keys (in the code) — that is fixed in Phase 30.Ang chain ID ay nagbago ng pinipirmahan — kaya ang lumang naka-save na chain ng network mo (data/V?-400?.json) ay itatabi at magsisimula ulit sa genesis. At sa Phase 29, ang mga key ng validators at institusyon ay DEMO pa rin (nasa code) — iyon ang aayusin sa Phase 30.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/params.ts
- src/features/chain/transaction.ts
- src/features/network/storage.ts
- src/features/chain/params.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 28
Own keys and genesis.json: no more secrets in the codeSariling keys at genesis.json: wala nang sikreto sa code
Before, the secret keys of V1–V4, PhilSys, Bangko Nel and the Court were in the code — anyone with the code could sign as PhilSys. Now on testnet: each role has its OWN key file (keys/testnet/V1.json, only on your PC), and only the public key is in networks/testnet/genesis.json, which every node shares.Dati, ang secret key ng V1–V4, PhilSys, Bangko Nel at Korte ay nasa code — kahit sino na may code ay pwedeng pumirma bilang PhilSys. Ngayon sa testnet: bawat role ay may SARILING key file (keys/testnet/V1.json, nasa iyong PC lang), at ang public key lang ang nasa networks/testnet/genesis.json na pare-pareho sa lahat ng node.
- npm run keygen → creates 2 files: <ROLE>.json (SECRET, -rw------- = only you can read it, in .gitignore) and <ROLE>.pub.json (to hand out).npm run keygen → gumagawa ng 2 file: <ROLE>.json (SIKRETO, -rw------- = ikaw lang ang makakabasa, nasa .gitignore) at <ROLE>.pub.json (ibinibigay).
- npm run genesis → combines the .pub.json files into genesis.json. Checked: the right chain ID, the right address for each public key, no two roles sharing a key.npm run genesis → pinagsasama ang mga .pub.json sa genesis.json. Iche-check: tamang chain ID, tamang address ng bawat public key, walang dalawang role na iisa ang key.
- V1's node reads keys/testnet/V1.json and checks it matches genesis.json. Wrong key or missing file → ✗ it won't run.Ang node ng V1 ay binabasa ang keys/testnet/V1.json at iche-check kung tugma sa genesis.json. Maling key o walang file → ✗ hindi tatakbo.
- On testnet, PHILSYS in the code is a PUBLIC KEY ONLY → sign() refuses ('No secret key here'). Only PhilSys itself, with its own file, can sign.Sa testnet, ang PHILSYS sa code ay PUBLIC KEY LANG → ang sign() ay tatanggi ('Walang secret key dito'). Ang PhilSys lang mismo, gamit ang sarili niyang file, ang makakapirma.
- In the lab, the demo keys stay (like Bitcoin's regtest) — so everything works in one browser. They are public: for learning only.Sa lab, nananatili ang demo keys (gaya ng regtest ng Bitcoin) — para gumana ang lahat sa iisang browser. Pampubliko ang mga iyon: pang-aral lang.
⚠ NEVER commit, upload or send the keys/ folder to anyone. Lose <ROLE>.json = lose the ability to sign as that role (keep a backup somewhere safe, like a seed phrase). For now the web app (NelPay 'Verify') can't sign as PhilSys on testnet — institutions need a separate tool (next phase).Ang keys/ folder ay HUWAG i-commit, i-upload, o i-send kahit kanino. Mawala ang <ROLE>.json = mawala ang kakayahang pumirma bilang role na iyon (gumawa ng backup sa ligtas na lugar, gaya ng seed phrase). Sa ngayon, ang web app (NelPay 'Verify') ay hindi pa makakapirma bilang PhilSys sa testnet — kailangan ng hiwalay na tool ng institusyon (susunod na phase).
WHERE IN THE CODESAAN SA CODE
- src/features/chain/genesis-keys.ts
- src/features/chain/genesis-file.ts
- src/features/chain/key-file.ts
- scripts/keygen.ts
- scripts/genesis.ts
- networks/testnet/genesis.json
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 29
A hardened node: spam can't knock it overMatibay na node: hindi mapapabagsak ng spam
A node is open to the whole internet — so anyone can send broken, too many, or too large messages. Like Bitcoin Core: everything has a limit, and a misbehaving peer gets POINTS. At 100 → disconnected and the IP banned (lab: 1 minute · testnet: 24 hours).Bukas sa buong internet ang isang node — kaya kahit sino ay pwedeng magpadala ng sira, sobrang dami, o sobrang laking mensahe. Gaya ng Bitcoin Core: may hangganan ang lahat, at ang peer na nanloloko ay may PUNTOS. Umabot sa 100 → putol at ban ng IP (lab: 1 minuto · testnet: 24 oras).
- CHAIN RULE: a tx is at most 16 KB (before, 'data' had no limit → one multi-MB tx could weigh down everyone).PATAKARAN NG CHAIN: hanggang 16 KB lang ang isang tx (dati: walang limit ang 'data' → isang tx na ilang MB ay pwedeng magpabigat sa lahat).
- Message size: lab 1 MB, testnet 16 MB — over → the WebSocket closes it (code 1009).Laki ng mensahe: lab 1 MB, testnet 16 MB — lampas → kusang pinuputol ng WebSocket (code 1009).
- Rate: a 'token bucket' per connection — 300 at once, then 100 per second. Over → the message is dropped (+5 points each).Bilis: 'token bucket' bawat koneksyon — 300 agad, tapos 100 bawat segundo. Lampas → itinatapon ang mensahe (+5 puntos bawat isa).
- Shape: every message is checked first (right type, right fields, no negative numbers) before processing. Broken → +20.Hugis: iche-check muna ang bawat mensahe (tamang uri, tamang field, hindi negatibong numero) bago iproseso. Sira → +20.
- Fake signature on a tx or vote → +20 · sync with a broken block → +50 · 'pause' outside the lab → +50 (before, anyone could stop your node!).Pekeng pirma sa tx o boto → +20 · sync na may sirang block → +50 · 'pause' sa labas ng lab → +50 (dati: kahit sino ay kayang patigilin ang node mo!).
- Limits too: the mempool (lab 80 tx), sync answers (100 blocks per batch, not the whole chain), how many hashes votes are counted for, and 64 connections.May hangganan din: mempool (lab 80 tx), sagot sa sync (100 block bawat batch, hindi ang buong chain), ilang hash ang binibilangan ng boto, at 64 na koneksyon.
- localhost (127.0.0.1) isn't banned — that's your own lab network; it is only disconnected.Hindi bina-ban ang localhost (127.0.0.1) — iyon ang sarili mong network sa lab; puputulin lang.
⚠ It isn't enough for a real mainnet yet: it still needs protection against an 'eclipse attack' (surrounded by fake peers), one attacker with many IPs (a botnet), and an expert security audit. But this is the foundation.Hindi pa ito sapat para sa totoong mainnet: kailangan pa ng proteksyon laban sa 'eclipse attack' (napapalibutan ng pekeng peers), maraming IP ng iisang umaatake (botnet), at isang security audit ng eksperto. Pero ito ang pundasyon.
WHERE IN THE CODESAAN SA CODE
- src/features/network/limits.ts
- src/features/network/peer-guard.ts
- src/features/network/validate-message.ts
- src/features/network/server.ts
- src/features/network/hardening.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 30
A real testnet: the app, the nodes and the institutionsTotoong testnet: app, node at mga institusyon
The whole testnet works: 4 validators with their own keys, the web app (NelPay, explorer, /id, /network) connected to it, and the institutions (PhilSys, Bangko Nel, Auditor, PSA) signing with their OWN key files through 'npm run institution'.Gumagana na ang buong testnet: 4 na validator na may sariling key, ang web app (NelPay, explorer, /id, /network) na nakakonekta rito, at ang mga institusyon (PhilSys, Bangko Nel, Auditor, PSA) na pumipirma gamit ang SARILI nilang key file sa pamamagitan ng 'npm run institution'.
- Chain ID handshake: the node says which network it is (status and info). Different from the app? → a clear message: 'The node is on nel-testnet-1, but the app is nel-lab-1' — no more confusing 'Wrong signature'.Chain ID handshake: sinasabi ng node kung anong network siya (status at info). Iba sa app? → malinaw na mensahe: 'Ang node ay nasa nel-testnet-1, pero ang app ay nel-lab-1' — hindi na nakakalitong 'Mali ang pirma'.
- Every page shows a network badge (yellow = lab, blue = testnet).May tatak ng network ang bawat pahina (dilaw = lab, asul = testnet).
- npm run institution -- --as PHILSYS verify-human …: reads keys/testnet/PHILSYS.json, checks it matches genesis.json, signs, and sends to the node. Wrong role, key or network → ✗ before sending.npm run institution -- --as PHILSYS verify-human …: binabasa ang keys/testnet/PHILSYS.json, iche-check kung tugma sa genesis.json, pumipirma, at nagpapadala sa node. Maling role, maling key, o maling network → ✗ bago pa magpadala.
- In NelPay (testnet): when an institution's signature is needed, it shows the EXACT command to ask them to run — the app no longer tries to sign.Sa NelPay (testnet): kapag kailangan ng pirma ng institusyon, ipinapakita ang EKSAKTONG command na ipapagawa sa kanila — hindi na sinusubukang pumirma ang app.
- Tested: a new person → PhilSys + Bangko Nel → +10 NEL (Soul ID) → KYC → reserve audit → cash-in ₱250. All on testnet, no demo keys.Sinubukan: bagong tao → PhilSys + Bangko Nel → +10 NEL (Soul ID) → KYC → audit ng reserves → cash-in ₱250. Lahat sa testnet, walang demo key.
- On the /network page: 'Take offline' (pause) only appears in the lab.Sa /network page: ang 'I-offline' (pause) ay sa lab lang lumalabas.
⚠ On testnet, NEL and nPHP have no value. In real life, 'npm run institution' would be replaced by each institution's own system (with an approval process, an audit log and a hardware security module for the key) — not a terminal command.Sa testnet, walang halaga ang NEL at nPHP. Sa totoong buhay, ang 'npm run institution' ay papalitan ng sariling sistema ng bawat institusyon (may proseso ng pag-apruba, audit log, at hardware security module para sa key) — hindi isang terminal command.
WHERE IN THE CODESAAN SA CODE
- src/features/institution/commands.ts
- scripts/institution.ts
- src/features/node-client/node-client.ts
- src/features/chain/network-badge.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 31
Whitepaper v0.1: the design in one documentWhitepaper v0.1: ang disenyo sa isang dokumento
Like Satoshi's 9 pages (2008): the problem → the design → attacks and defenses → the numbers → what's missing. At /whitepaper (and WHITEPAPER.md in the repo), in English so developers and possible validators outside the Philippines can read it.Gaya ng 9 na pahina ni Satoshi (2008): problema → disenyo → mga atake at depensa → mga numero → mga kulang. Nasa /whitepaper (at WHITEPAPER.md sa repo), sa English para mabasa ng mga developer at posibleng validator sa labas ng Pilipinas.
- 12 sections: Introduction, Transactions, Soul ID, Consensus (with a diagram of one round), Monetary policy, nPHP, Protecting users, Privacy, Network, Calculations, Trust assumptions, Status and roadmap.12 seksyon: Introduction, Transactions, Soul ID, Consensus (may diagram ng isang round), Monetary policy, nPHP, Proteksyon ng user, Privacy, Network, Calculations, Trust assumptions, Status at roadmap.
- Every number comes from the code (the mainnet draft in params.ts) — and a TEST (whitepaper.test.ts) fails when a number changes in the code but not in the whitepaper.Lahat ng numero ay galing sa code (mainnet draft sa params.ts) — at may TEST (whitepaper.test.ts) na babagsak kapag binago ang numero sa code pero hindi sa whitepaper.
- Calculations: the odds that an attacker captures a committee (binomial) — straight from captureOdds. A committee of 7 = for learning; 1,000 = nearly impossible.Calculations: tsansang maagaw ng umaatake ang isang komite (binomial) — galing mismo sa captureOdds. Komite ng 7 = pang-aral lang; 1,000 = halos imposible.
- Section 11 matters most: who is trusted (attesters, issuer, auditor, court, PSA, bootstrap validators), what they CANNOT do, and what happens if they cheat.Seksyon 11 ang pinakamahalaga: sino ang pinagkakatiwalaan (attesters, issuer, auditor, korte, PSA, bootstrap validators), ano ang HINDI nila kayang gawin, at ano ang mangyayari kapag nandaya sila.
- An honest list of what's missing: a public demo salt, a public proposer, no BLS, a consensus key that isn't post-quantum, no peer discovery or encryption, no audit, and the BSP, SEC and Data Privacy Act requirements.Tapat na listahan ng kulang: pampublikong demo salt, pampublikong proposer, walang BLS, hindi post-quantum ang consensus key, walang peer discovery at encryption, walang audit, at kailangan ng BSP, SEC at Data Privacy Act.
⚠ A whitepaper that promises 'guaranteed returns' or hides who is trusted is a red flag. This is only draft v0.1 of a learning project — not an offer to invest.Ang whitepaper na nangangako ng 'garantisadong kita' o nagtatago ng pinagkakatiwalaan ay red flag. Draft v0.1 lang ito ng isang learning project — hindi alok na mamuhunan.
WHERE IN THE CODESAAN SA CODE
- WHITEPAPER.md
- src/features/whitepaper/whitepaper-view.tsx
- src/features/whitepaper/whitepaper.test.ts
- public/whitepaper/consensus-round.svg
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 32
Speed: measure first, then fixBilis: sukatin muna, saka ayusin
The first rule of speed: don't guess — MEASURE. 'npm run bench' measures the node (sync, accepting a tx) and the lab (each press of 'Make a block'). The finding: the lab replayed the WHOLE chain ~5 times per new block, and the node hashed the whole chain for every new tx.Ang unang tuntunin sa bilis: huwag manghula — SUKATIN. Ang 'npm run bench' ay sumusukat sa node (sync, pagtanggap ng tx) at sa lab (bawat pindot ng 'Gumawa ng block'). Ang natagpuan: ang lab ay nire-replay ang BUONG chain nang ~5 beses bawat bagong block, at ang node ay hina-hash ang buong chain bawat bagong tx.
- Lab: one pass for the 3 checks (Hashes · Signatures · Votes) with a CACHE per block → only the new block is computed. The 300th block: 98 ms → 0.2 ms. In the browser: ⏩ +100 no longer slows down as the chain grows.Lab: iisang lakad para sa 3 check (Hashes · Pirma · Boto) na may CACHE bawat block → ang bagong block lang ang kinukuwenta. Ika-300 na block: 98 ms → 0.2 ms. Sa browser: ⏩ +100 ay hindi na bumabagal habang humahaba ang chain.
- Node: the 'pending' state (ledger + mempool) and the Set of tx hashes on chain are kept → accepting a tx: 4.15 ms → 0.15 ms (~27×).Node: naka-save ang 'pending' state (ledger + mempool) at ang Set ng tx hash sa chain → pagtanggap ng tx: 4.15 ms → 0.15 ms (~27×).
- Each block is applied ONCE now (before: twice — once to check, once for the state).Bawat block ay ina-apply nang ISANG beses na lang (dati: dalawa — isa para sa check, isa para sa state).
- Supply from the counters (🧑 + ⛏️ − 🔥) instead of counting every account per block — a test checks the answer is the same.Supply mula sa mga counter (🧑 + ⛏️ − 🔥) imbes na bilangin ang lahat ng account bawat block — may test na pareho ang sagot.
- VRF: your own proof isn't verified again (the answer is known) → making a block ~32 ms → ~18 ms. And the SECRET numbers are now constant-time (multiply) — so the key can't be guessed from timing (side-channel).VRF: ang sariling patunay ay hindi na vine-verify ulit (alam na ang sagot) → paggawa ng block ~32 ms → ~18 ms. At ang mga SECRET na numero ay constant-time na (multiply) — para hindi mahulaan ang key sa tagal ng pagkuwenta (side-channel).
- The cache is safe because blocks and txs are never modified (immutable): 'tampering' in the lab always makes a new object → recomputed from there. A test checks the answer matches the old way.Ligtas ang cache dahil hindi binabago ang block o tx (immutable): ang 'daya' sa lab ay laging bagong object → kukuwentahin ulit mula roon. May test na pareho ang sagot sa dating paraan.
⚠ A cache is fast but dangerous when wrong: if any code changes a block or tx directly (e.g. block.txs.push), the cache returns something stale. So we always create new objects, and a test compares the fast path with the slow one.Ang cache ay mabilis pero delikado kapag mali: kung may code na direktang magbabago ng block o tx (hal. block.txs.push), luma ang ibabalik ng cache. Kaya laging bagong object ang ginagawa natin, at may test na ikinukumpara ang mabilis na paraan sa mabagal.
WHERE IN THE CODESAAN SA CODE
- scripts/bench.ts
- src/features/chain/verify.ts
- src/features/network/node.ts
- src/features/consensus/vrf.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 33
Trade screen: like Binance, but an AMMTrade screen: gaya ng Binance, pero AMM
In the Lab, press '📈 Open Trade' → a big screen: a large chart, Buy/Sell NEL, an order book and recent trades. Every Buy/Sell is included in a new block at once (like 'filled' on Binance).Sa Lab, pindutin ang '📈 Buksan ang Trade' → malaking screen: malaking chart, Bumili/Magbenta ng NEL, order book at mga huling trade. Bawat Buy/Sell ay agad na isinasama sa bagong block (gaya ng 'filled' sa Binance).
- Binance has an ORDER BOOK: people queued with prices. We have no queue — one POOL (AMM, x × y = k). The 'order book' is computed: if you buy 0.5%, 1%, 2%… of the NEL in the pool, what is the average price?Sa Binance, may ORDER BOOK: mga taong nakapila na may presyo. Sa atin, walang pila — isang POOL (AMM, x × y = k). Ang 'order book' ay kinukuwenta: kung bibili ka ng 0.5%, 1%, 2%… ng NEL sa pool, magkano ang average na presyo?
- A bigger buy → more per NEL (price impact). The gap between the cheapest sell and the most expensive buy = the 0.3% fee + price impact.Mas malaking bili → mas mahal bawat NEL (price impact). Ang agwat ng pinakamurang benta at pinakamahal na bili = 0.3% fee + price impact.
- Recent trades: from swaps on chain — green = bought NEL, red = sold. The price is the AVERAGE you got (₱ ÷ NEL).Mga huling trade: galing sa mga swap sa chain — berde = bumili ng NEL, pula = nagbenta. Ang presyo ay ang AVERAGE na nakuha mo (₱ ÷ NEL).
- Protection: a 'minimum received' (1% slippage) — if the price moves before the trade is included, the chain rejects it.Proteksyon: may 'minimum na matatanggap' (1% slippage) — kapag gumalaw ang presyo bago maisama ang trade, tatanggihan ito ng chain.
- In a small pool, rounding to the centavo scrambles the order book — so prices use an exact formula (tested).Sa maliit na pool, ang pag-round sa centavo ay nagpapagulo sa order book — kaya eksaktong formula ang ginagamit para sa presyo (may test).
⚠ In a small pool the price impact is huge (e.g. a ₱10 buy in a ₱10 pool → +100% price). Real DEXs are the same: a token with little liquidity is easy to push up and down — a favorite 'pump and dump' tactic.Sa maliit na pool, napakalaki ng price impact (hal. ₱10 na bili sa pool na ₱10 → +100% presyo). Ganito rin sa totoong DEX: ang token na kaunti ang liquidity ay madaling paakyatin at pababain — paboritong taktika ng 'pump and dump'.
WHERE IN THE CODESAAN SA CODE
- src/features/exchange/trade-view.tsx
- src/features/exchange/depth.ts
- src/features/exchange/price-history.ts
- src/features/chain/chain-view.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 34
/trade: the trade screen on the real network/trade: Trade screen sa totoong network
The Lab's trade screen, but on the REAL network: your NelPay wallet (PIN or passkey) signs, sends to the node, and it's included in the next block (~5 seconds). The chart, order book and recent trades come from blocks that you download and CHECK yourself.Ang Trade screen ng Lab, pero sa TOTOONG network: ang NelPay wallet mo (PIN o passkey) ang pumipirma, ipinapadala sa node, at maisasama sa susunod na block (~5 segundo). Ang chart, order book at mga huling trade ay galing sa mga block na dina-download mo at CHINE-CHECK mo mismo.
- The node isn't blindly trusted: every block is checked in your browser (verifyChain — signatures, votes, supply). Broken? → '✗ don't trust it'.Hindi bulag na pinagkakatiwalaan ang node: lahat ng block ay chine-check sa browser mo (verifyChain — pirma, boto, supply). Sira? → '✗ huwag pagkatiwalaan'.
- Downloaded in pieces (100 blocks per node answer), then only new ones every 2 seconds — checks are cached per block, so it stays fast as the chain grows.Dina-download nang paunti-unti (100 block bawat sagot ng node), tapos ang bago lang bawat 2 segundo — naka-cache ang check bawat block, kaya mabilis kahit humaba.
- The same wallet as NelPay (locked with the PIN in the browser). If your key on chain is a passkey (Phase 25), the fingerprint signs.Parehong wallet ng NelPay (naka-lock sa PIN sa browser). Kapag passkey na ang key mo sa chain (Phase 25), fingerprint ang pipirma.
- One TradeView for the Lab and /trade: it gets the pool + balances, not the whole state.Iisang TradeView para sa Lab at sa /trade: pool + balance ang ibinibigay, hindi ang buong state.
- Tested: a new wallet → PhilSys + Bangko Nel (npm run institution) → +10 NEL, KYC, cash-in ₱100 → liquidity 5 NEL + ₱20 → bought ₱10 → sold 1 NEL. It showed up in the chart and recent trades.Sinubukan: bagong wallet → PhilSys + Bangko Nel (npm run institution) → +10 NEL, KYC, cash-in ₱100 → liquidity 5 NEL + ₱20 → bumili ₱10 → nagbenta 1 NEL. Lumabas sa chart at sa mga huling trade.
⚠ On testnet/lab, NEL and nPHP have no value. On a real DEX: check the price impact before you press — in a small pool, one buy can raise the price 30% or more.Sa testnet/lab, walang halaga ang NEL at nPHP. Sa totoong DEX: suriin ang price impact bago pumindot — sa maliit na pool, isang bili ay kayang itaas ang presyo nang 30% o higit pa.
WHERE IN THE CODESAAN SA CODE
- src/features/trade-app/trade-app.tsx
- src/features/trade-app/chain-sync.ts
- src/features/exchange/trade-view.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 35
A secret identity salt: no guessing whose hash it isLihim na identity salt: hindi mahuhulaan kung kanino ang hash
A Soul ID's 'person hash' comes from the ID number. If the salt is public (as before, in the code), anyone can try every possible ID number and learn whose each hash is. Now: HMAC-SHA256 with a SECRET key held only by the attesters.Ang 'person hash' ng Soul ID ay galing sa ID number. Kung pampubliko ang salt (gaya dati, nasa code), kahit sino ay kayang subukan ang lahat ng posibleng ID number at malaman kung kanino ang bawat hash. Ngayon: HMAC-SHA256 na may LIHIM na susi na hawak ng mga attester lang.
- HMAC = a hash with a key (like password systems). Without the key → no correct hash, so no guessing.HMAC = hash na may susi (gaya ng password system). Walang susi → hindi makakagawa ng tamang hash, kaya hindi mahuhulaan.
- One salt for ALL attesters: PhilSys and the bank must produce the same hash for the same person — otherwise a second Soul ID wouldn't be caught.Iisang salt para sa LAHAT ng attester: ang PhilSys at ang bangko ay dapat makagawa ng parehong hash para sa parehong tao — kung hindi, hindi mahuhuli ang pangalawang Soul ID.
- The nodes don't need it: they only compare the hash (a string). So it doesn't spread to every computer.Hindi ito kailangan ng mga node: ang kinukumpara lang nila ay ang hash (string). Kaya hindi ito kumakalat sa lahat ng computer.
- npm run keygen -- --network testnet --all → keys/testnet/identity-salt.hex (-rw------- , gitignored). Read by npm run institution (or --salt-file).npm run keygen -- --network testnet --all → keys/testnet/identity-salt.hex (-rw------- , gitignored). Binabasa ng npm run institution (o --salt-file).
- In the lab, the demo salt is still public (like the demo keys) — so it works in one browser.Sa lab: pampubliko pa rin ang demo salt (gaya ng demo keys) — para gumana sa iisang browser.
⚠ Each attester holding the salt can still try ID numbers. So the salt is only for trusted attesters, and losing it means replacing it (a new salt = the hash of every NEW person changes).Ang bawat attester na may hawak ng salt ay kaya pa ring subukan ang mga ID number. Kaya ang salt ay para lang sa mga pinagkakatiwalaang attester, at ang pagkawala nito ay kailangang palitan (bagong salt = magbabago ang hash ng lahat ng BAGONG tao).
WHERE IN THE CODESAAN SA CODE
- src/features/soul-id/identity.ts
- src/features/chain/key-file.ts
- scripts/institution.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 36
Encrypted connections and peer discoveryNaka-encrypt na koneksyon at peer discovery
Before: nodes talked in plain JSON (anyone in between could read and change it), and the peer list was manual. Now: every connection between two nodes is encrypted with proven identities (like CometBFT/Cosmos's SecretConnection), and nodes find each other on their own — only one SEED is needed.Dati: plain JSON ang usapan ng mga node (kahit sino sa gitna ay kayang basahin at baguhin), at mano-mano ang listahan ng peers. Ngayon: bawat koneksyon ng dalawang node ay naka-encrypt at may napatunayang pagkakakilanlan (gaya ng SecretConnection ng CometBFT/Cosmos), at kusang natutuklasan ng mga node ang isa't isa — isang SEED lang ang kailangan.
- Handshake: exchange temporary X25519 keys → the same secret (ECDH) → HKDF → one ChaCha20-Poly1305 key per direction.Handshake: magpapalitan ng pansamantalang X25519 key → parehong lihim (ECDH) → HKDF → isang ChaCha20-Poly1305 key bawat direksyon.
- Identity: each node signs the handshake with its Ed25519 node key → no one in the middle can impersonate (man-in-the-middle). The node ID = the node key's address.Pagkakakilanlan: pinipirmahan ng bawat node ang handshake gamit ang Ed25519 node key → hindi makakapagpanggap ang nasa gitna (man-in-the-middle). Ang node ID = address ng node key.
- Every message has a counter → a changed or replayed message is rejected and earns misbehavior points.Bawat mensahe ay may counter → binago o inulit (replay) na mensahe ay tinatanggihan at may puntos ng panloloko.
- Peer discovery: a node says where it can be reached (--announce) and passes addresses on (get-peers). An address book with a limit (1,000), forgetting addresses that always fail, and one connection per pair of nodes.Peer discovery: sinasabi ng node kung saan siya maaabot (--announce), at ipinapasa ang mga address (get-peers). Address book na may hangganan (1,000), kinakalimutan ang laging bigo, at iisang koneksyon bawat pares ng node.
- Browsers/tools (NelPay, explorer, /network) = CLIENTS: transactions and queries only. Votes, proposals and blocks are accepted only from proven nodes.Mga browser/tool (NelPay, explorer, /network) = CLIENT: tx at mga tanong lang. Ang boto, proposal at block ay sa napatunayang node lang tinatanggap.
- Tested: V2–V4 knowing only V1 → found everyone (3 peers each, encrypted) and made a block; a client that sent a vote → disconnected.Sinubukan: V2–V4 na si V1 lang ang alam → natuklasan ang lahat (3 peer bawat isa, naka-encrypt) at gumawa ng block; client na nagpadala ng boto → pinutol.
⚠ This is no defense yet against an 'eclipse attack' (surrounded by an attacker's nodes) or an attacker with many IPs. And the BROWSER connection is still plain — put a public node behind a TLS proxy (wss://).Hindi pa ito depensa laban sa 'eclipse attack' (napapalibutan ng mga node ng umaatake) o sa umaatakeng maraming IP. At ang koneksyon ng BROWSER ay plain pa rin — sa public na node, ilagay sa likod ng TLS proxy (wss://).
WHERE IN THE CODESAAN SA CODE
- src/features/network/secret-connection.ts
- src/features/network/address-book.ts
- src/features/network/server.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 37
A public testnet with friendsPublic testnet kasama ang mga kaibigan
Like Bitcoin in January 2009 (Satoshi and Hal Finney): a small experiment on the internet, the money worth nothing. TESTNET.md is a step-by-step guide: your server (4 bootstrap validators), the web app, and friends as observers or validators.Gaya ng Bitcoin noong Enero 2009 (si Satoshi at si Hal Finney): isang maliit na eksperimento sa internet, walang halaga ang pera. Ang TESTNET.md ay hakbang-hakbang na gabay: server mo (4 na bootstrap validator), web app, at mga kaibigan bilang observer o validator.
- Server: a VPS + systemd (deploy/nel-network.service) → always running, restarts by itself. --announce-host = the public IP each node announces.Server: VPS + systemd (deploy/nel-network.service) → tumatakbo palagi, kusang nagre-restart. --announce-host = ang public IP na sasabihin ng bawat node.
- Browsers on HTTPS need wss:// → Caddy (deploy/Caddyfile) adds free HTTPS. The app accepts wss://… and has a default node from NEXT_PUBLIC_NEL_NODE.Browser sa HTTPS: kailangan ng wss:// → Caddy (deploy/Caddyfile) ang naglalagay ng libreng HTTPS. Ang app ay tumatanggap na ng wss://… at may default na node mula sa NEXT_PUBLIC_NEL_NODE.
- Behind a proxy, everything looks like 127.0.0.1 → --trust-proxy: the real IP comes from X-Forwarded-For (only from localhost, so it can't be faked) → bans still work.Sa likod ng proxy, lahat ay mukhang 127.0.0.1 → --trust-proxy: ang totoong IP ay mula sa X-Forwarded-For (pero galing lang sa localhost, para hindi mapeke) → gumagana pa rin ang ban.
- A friend as validator: keygen --validator → Soul ID (2 attesters) → npm run wallet … stake 1 → npm run node … --key. Tested: they found the 4 nodes from one seed, made a block, and earned (9 → 18.93 NEL).Kaibigan bilang validator: keygen --validator → Soul ID (2 attester) → npm run wallet … stake 1 → npm run node … --key. Sinubukan: natuklasan niya ang 4 na node mula sa isang seed, gumawa ng block, at kumita (9 → 18.93 NEL).
- localhost addresses are no longer shared with other computers (for them, that's their own PC).Hindi na ibinabahagi ang localhost na address sa ibang computer (sa kanila, iyon ang sarili nilang PC).
⚠ FAKE names and IDs only on testnet — even encrypted, a real ID number is personal data. And the keys/ folder (secret keys and the identity salt) never goes on GitHub or to anyone.PEKENG pangalan at ID lang sa testnet — kahit naka-encrypt, personal na data ang totoong ID number. At ang keys/ folder (secret keys at identity salt) ay hindi kailanman ilalagay sa GitHub o ipapadala kahit kanino.
WHERE IN THE CODESAAN SA CODE
- TESTNET.md
- deploy/nel-network.service
- deploy/Caddyfile
- scripts/wallet.ts
- src/features/wallet-cli/commands.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 38
Defending against eclipse attacks and botnetsDepensa sa eclipse attack at botnet
Eclipse attack: your node is surrounded by the nodes of ONE attacker → they tell you what the 'real' chain is. It can't be stopped completely, but it can be made expensive: like Bitcoin Core, connections and addresses are limited per IP 'neighborhood' (netgroup: IPv4 /16).Eclipse attack: napapalibutan ang node mo ng mga node ng IISANG umaatake → siya ang nagsasabi sa iyo kung ano ang 'totoong' chain. Hindi ito mapipigilan nang buo, pero kayang gawing mahal: gaya ng Bitcoin Core, nililimitahan ang koneksyon at address bawat 'kapitbahayan' ng IP (netgroup: IPv4 /16).
- Inbound: up to 8 per IP and 16 per /16. Tested: the 9th from one IP and the 17th from one /16 → rejected.Papasok: hanggang 8 bawat IP at 16 bawat /16. Sinubukan: ang ika-9 mula sa iisang IP at ang ika-17 mula sa iisang /16 → tinanggihan.
- All 64 slots full? Evict the NEWEST from the LARGEST group. Protected: the 8 longest-connected, the 4 that most recently delivered a new block, and localhost/LAN. So a botnet can't replace good peers just by numbers.Puno ang 64 na slot? Palalabasin ang PINAKABAGO mula sa grupong PINAKAMARAMI. Protektado: ang 8 pinakamatagal, ang 4 na huling nagbigay ng bagong block, at ang localhost/LAN. Kaya hindi mapapalitan ng botnet ang mabubuting peer sa dami lang.
- Outbound: one peer per group (different neighborhoods) — not all your outbound connections end up in one cloud.Palabas: isang peer lang bawat grupo (iba-ibang kapitbahayan) — hindi lahat ng outbound mo ay mapupunta sa iisang cloud.
- Address book: up to 16 addresses per group, and 64 per sender → one attacker can't fill it with fake addresses.Address book: hanggang 16 na address bawat grupo, at 64 bawat nagsasabi → hindi mapupuno ng pekeng address mula sa iisang umaatake.
- Anchors: the 2 longest outbound peers are remembered → called first after a restart (so you aren't surrounded right after restarting).Anchors: ang 2 pinakamatagal na outbound ay tinatandaan → sila ang unang tatawagan pagbukas ulit (para hindi ka agad mapalibutan pagka-restart).
- localhost and private networks (192.168.x, 10.x…) are exempt → the lab and friends in the same house still work.Hindi saklaw ang localhost at pribadong network (192.168.x, 10.x…) → gumagana pa rin ang lab at ang mga kaibigan sa iisang bahay.
⚠ This only makes the attack MORE EXPENSIVE, not impossible: an attacker with IPs in many /16s (e.g. many cloud providers) can still surround you. That's why many independent nodes and checking every block yourself also matter.Mas MAHAL lang ang atake, hindi imposible: ang umaatakeng may IP sa maraming /16 (hal. maraming cloud provider) ay kaya pa ring makapalibot. Kaya mahalaga rin ang maraming independent na node at ang sariling pag-check ng bawat block.
WHERE IN THE CODESAAN SA CODE
- src/features/network/netgroup.ts
- src/features/network/eviction.ts
- src/features/network/address-book.ts
- src/features/network/server.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 39
An economics model: test the numbers before launchingEconomics model: subukan ang mga numero bago maglunsad
/economics simulates 40 years (day by day) with the chain's EXACT rules: the welcome grant, reward + halving + tail, burning (~1% of supply a year, up to fees + ½ reward) and the block limit. Enter how many people, transactions and validators → supply, inflation, capacity and income.Ang /economics ay nagsi-simulate ng 40 taon (bawat araw) gamit ang EKSAKTONG mga patakaran ng chain: welcome grant, reward + halving + tail, sunog (~1% ng supply bawat taon, hanggang fees + ½ reward) at ang hangganan ng block. Ilagay kung ilang tao, ilang tx at ilang validator → supply, inflation, kapasidad at kita.
- ⚠️ FINDING #1: the reward per block is the same even when the network is SMALL. 100,000 people and 100 validators → 98% of the NEL in the first 4 years went to validators (~158,000 NEL each). Even 10 million people → 56%. That contradicts the goal that 'no one holds the supply'.⚠️ NATUKLASAN #1: pareho ang reward bawat block kahit MALIIT ang network. 100,000 tao at 100 validator → 98% ng NEL sa unang 4 na taon ay napunta sa validators (~158,000 NEL bawat isa). Kahit 10 milyong tao → 56%. Salungat ito sa layunin na 'walang may hawak ng supply'.
- ⚠️ FINDING #2: 1,000 tx per block (~200 per second) isn't enough if 50 million people pay twice a day (almost 6× demand). The base fee rises until people stop.⚠️ NATUKLASAN #2: 1,000 tx bawat block (~200 bawat segundo) ay kulang kung 50 milyong tao ay magbabayad nang 2 beses bawat araw (halos 6× ang gusto). Tataas ang base fee hanggang may tumigil.
- ✓ With large fees, the supply SHRINKS (deflation) — burning exceeds new NEL. With small fees it rises slowly (the tail, < 1% a year after ~20 years).✓ Kapag malaki ang fees, LUMILIIT ang supply (deflation) — ang sunog ay mas malaki sa bagong NEL. Kapag maliit ang fees, dahan-dahang tumataas (tail, < 1% bawat taon pagkatapos ng ~20 taon).
- The model is tested: the reward formula matches the chain, supply = people + reward − burned each year, and burning never exceeds ~1% a year.Ang modelo ay may test: pareho ang formula ng reward sa chain, supply = tao + reward − sunog bawat taon, at ang sunog ay hindi lalampas sa ~1% bawat taon.
- The findings went into the whitepaper (Section 11) — the right thing for a whitepaper is to state the problem, not hide it.Ang mga natuklasan ay isinulat sa whitepaper (Seksyon 11) — ang tamang gawin sa whitepaper ay sabihin ang problema, hindi itago.
⚠ The model is simplified: people grow evenly, fees are constant, and there is no NEL price. It doesn't say what NEL is worth — only WHERE the new NEL goes and whether the transactions fit.Ang modelo ay pinasimple: pantay ang pagdami ng tao, pare-pareho ang fee, at walang presyo ng NEL. Hindi nito sinasabi kung magkano ang NEL — ang sinasabi lang nito ay KUNG SAAN napupunta ang bagong NEL at kung kakasya ang mga tx.
WHERE IN THE CODESAAN SA CODE
- src/features/economics/simulate.ts
- src/features/economics/economics-view.tsx
- src/features/economics/line-chart.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 40
A fair reward: it grows with the number of peoplePatas na reward: lumalaki kasabay ng dami ng tao
The fix for Phase 41's finding: the block reward is now proportional to the number of Soul IDs — reward = schedule (2 → 1 → 0.5 NEL) × min(1, Soul IDs ÷ N). In the mainnet draft, N = 10 million (~10% of Filipinos). Few people → little new NEL → the first few validators can't take almost everything.Ang ayos sa natuklasan ng Phase 41: ang reward ng block ay proporsyonal na sa dami ng Soul ID — reward = iskedyul (2 → 1 → 0.5 NEL) × min(1, Soul ID ÷ N). Sa mainnet draft, N = 10 milyon (~10% ng mga Pilipino). Kaunting tao → kaunting bagong NEL → hindi makukuha ng iilang unang validator ang halos lahat.
- N was chosen with /economics: tried 1 (before), 10M, 25M and 50M. At 10M: ≤ 20% of NEL went to validators in the first 4 years in every scenario (before: 98% in a small network). At 25M and up, a small network's reward is almost 0 (rounding to 0.01 NEL).Pinili ang N gamit ang /economics: sinubukan ang 1 (dati), 10M, 25M at 50M. Sa 10M: ≤ 20% ng NEL ang napunta sa validators sa unang 4 na taon sa lahat ng sitwasyon (dati: 98% sa maliit na network). Sa 25M pataas, halos 0 ang reward ng maliit na network (dahil sa pag-round sa 0.01 NEL).
- The number of people comes from the 'people' pocket counter ÷ 10 NEL (it drops when someone dies) → O(1), not counted one by one each block.Ang bilang ng tao ay galing sa counter ng 'tao' na bulsa ÷ 10 NEL (bumababa kapag pumanaw) → O(1), hindi binibilang isa-isa bawat block.
- Lab: 4 people = the full reward (see the header: 'Reward (1/4 people) 0.50 NEL'). Testnet: 20.Lab: 4 na tao = buong reward (makikita sa header: 'Reward (1/4 tao) 0.50 NEL'). Testnet: 20.
- Validators still earn: reward + fees. In a large network, almost the same as before.Ang mga validator ay kumikita pa rin: reward + fees. Sa malaking network, halos pareho sa dati.
- This is a CHAIN RULE: every node must run the same version (a different reward → a different state → the block is rejected).PATAKARAN NG CHAIN ito: lahat ng node ay dapat parehong bersyon (iba ang reward → iba ang state → tatanggihan ang block).
⚠ Changing a chain rule after launch is called a 'hard fork' — everyone must upgrade together. That's why testing the economics BEFORE mainnet matters, as we did.Ang pagbabago ng patakaran ng chain pagkatapos maglunsad ay tinatawag na 'hard fork' — kailangang sabay-sabay mag-upgrade ang lahat. Kaya mahalagang subukan ang ekonomiya BAGO ang mainnet, gaya ng ginawa natin.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/supply.ts
- src/features/chain/params.ts
- src/features/chain/state.ts
- src/features/economics/simulate.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 41
A secret proposer: no one knows who will make the blockLihim na proposer: walang nakakaalam kung sino ang gagawa ng block
Before, everyone knew who the next proposer was (from a hash) → they could be attacked (DoS) within seconds, stopping the round. Now, like Algorand: the proposer is drawn SECRETLY with a VRF too. They reveal the proof only WITH the block — too late to attack them.Dati, alam ng lahat kung sino ang susunod na proposer (galing sa hash) → pwede siyang atakihin (DoS) sa loob ng ilang segundo, at hihinto ang round. Ngayon, gaya ng Algorand: ang proposer ay LIHIM ding binubunot gamit ang VRF. Ipapakita lang niya ang patunay KASAMA ng block — huli na para atakihin siya.
- Each candidate draws a second VRF ticket (seed + '|propose'). If it is below 5 ÷ (number of candidates) → they may propose. About 5 per round, so there is almost always one (no proposer ≈ 0.7%).Bawat kandidato ay kumukuha ng ikalawang VRF na tiket (seed + '|propose'). Kung mas mababa sa 5 ÷ (bilang ng kandidato) → pwede siyang mag-propose. Mga 5 bawat round, para halos laging may isa (walang proposer ≈ 0.7%).
- With several: voters wait 1 second from the start of the round, then vote for the proposal with the LOWEST ticket — every honest node picks the same one.Kapag marami: maghihintay ang botante ng 1 segundo mula sa simula ng round, tapos iboboto ang proposal na may PINAKAMABABANG tiket — pare-pareho ang pipiliin ng lahat ng tapat na node.
- Votes split (e.g. a slow network)? → no FINAL in that round → the next round, a new draw. That's why votes now include the ROUND in what's signed (chain ID · height · round · hash).Nahati ang boto (hal. bagal ng network)? → walang FINAL sa round na iyon → susunod na round, bagong bunot. Kaya ang boto ay may ROUND na sa pinipirmahan (chain ID · height · round · hash).
- Slashing changed too: a DOUBLE vote is two blocks at the SAME height and round. Voting in a new round is not an offense.Kaya rin nagbago ang slashing: ang DOBLENG boto ay dalawang block sa PAREHONG height at round. Ang pagboto sa bagong round ay hindi kasalanan.
- In the lab there are only 4 candidates → all may propose; the ★ in the Validators panel marks the lowest ticket (visible only because the lab holds every key).Sa lab, 4 lang ang kandidato → lahat ay pwedeng mag-propose; ang ★ sa Validators panel ay ang may pinakamababang tiket (nakikita lang dahil hawak ng lab ang lahat ng key).
- BLS (signature aggregation): deliberately NOT done — it saves only about half (VRF proofs can't be aggregated), and it isn't post-quantum. It's noted in the whitepaper.BLS (pagsasama ng pirma): sinadyang HINDI ginawa — halos kalahati lang ang matitipid (hindi kayang pagsamahin ang VRF proofs), at hindi ito post-quantum. Nakasulat sa whitepaper.
⚠ The cost: +1 second per block (waiting for the secret proposers), and now and then a round is lost when votes split. This is a CHAIN RULE — every node must run the same version.Ang kapalit: +1 segundo bawat block (hintay para sa mga lihim na proposer), at paminsan-minsan ay nawawala ang isang round kapag nahati ang boto. PATAKARAN NG CHAIN ito — lahat ng node ay dapat parehong bersyon.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/committee.ts
- src/features/consensus/consensus.ts
- src/features/network/node.ts
- src/features/consensus/slashing.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 42
Fake Soul IDs: what if one gets through?Pekeng Soul ID: paano kung may makalusot?
No system is 100% — a fake person will get past the attesters. The questions: how much damage, and will it be caught? Four defenses: (1) the 10 NEL welcome is LOCKED at first (like Bitcoin's 100-block coinbase maturity), (2) a court can declare it fake (soul-fake), (3) every attester that vouched gets a strike, (4) proofs per day are limited.Walang sistemang 100% — may pekeng taong makakalusot sa attesters. Ang tanong: gaano kalaki ang pinsala, at mahuhuli ba? Apat na depensa: (1) ang 10 NEL na welcome ay NAKA-LOCK muna (gaya ng 100-block coinbase maturity ng Bitcoin), (2) ang korte ay pwedeng magdeklarang peke (soul-fake), (3) bawat attester na nagpatunay ay may strike, (4) may hangganan ang patunay bawat araw.
- 🔒 A new Soul ID → the welcome is locked (lab 10 blocks · testnet 1 hour · mainnet 30 days). Only fees and staking are allowed; it can't be sent. That leaves time to catch a fake before the money escapes.🔒 Bagong Soul ID → naka-lock ang welcome (lab 10 block · testnet 1 oras · mainnet 30 araw). Fee at stake lang ang pwede; hindi maipapadala. May panahong mahuli ang peke bago makatakas ang pera.
- ⚖️ soul-fake (court + an open case): the Soul ID is revoked → NONE of its keys can send, 🔥 the remaining welcome is burned, and it no longer counts as a person (the Phase 42 reward).⚖️ soul-fake (korte + bukas na kaso): binawi ang Soul ID → hindi na makakapagpadala ang LAHAT ng key niya, 🔥 sunog ang natitirang welcome, at hindi na siya kasama sa bilang ng tao (Phase 42 reward).
- What was already SENT to others is NOT clawed back. If money could be taken back from the recipient, no one could be sure what they received is theirs — the shopkeeper did nothing wrong. Final is final, like Bitcoin.Ang NAIPADALA na sa iba ay HINDI binabawi. Kung pwedeng bawiin ang pera sa tatanggap, walang makakatiyak na kanya na ang natanggap niya — ang tindera ay walang kasalanan. Final ang final, gaya ng Bitcoin.
- Strikes: every attester that vouched for the fake gets +1. 3 strikes → suspended even without proven collusion. If it is proven DELIBERATE (attester-slash) → jailed at once and −50% bond.Strike: bawat attester na nagpatunay sa peke ay +1. 3 strike → suspendido kahit walang napatunayang sabwatan. Kapag napatunayang SINADYA (attester-slash) → jailed agad at −50% bond.
- ⏱️ A daily limit (mainnet 20,000 per attester): even if PhilSys's key is stolen, it can't create millions of fake people overnight — and it shows in the public count.⏱️ Hangganan bawat araw (mainnet 20,000 bawat attester): kahit manakaw ang susi ng PhilSys, hindi ito makakagawa ng milyon-milyong pekeng tao sa isang gabi — at halata sa pampublikong bilang.
- 🌱 A wallet warning: if the recipient has sent < 3 transactions, or its welcome is still locked → 'New account — be careful with large amounts'. A warning, not a block.🌱 Babala sa wallet: kapag < 3 tx pa lang ang naipadala ng tatanggap, o naka-lock pa ang welcome niya → 'Bagong account — mag-ingat kung malaki ang halaga'. Babala lang, hindi harang.
⚠ The lock is only on the IDENTITY key (where the welcome arrives), and it can't be passed to your own signing key while locked either. This is a CHAIN RULE — every node must run the same version.Ang lock ay nasa IDENTITY key lang (doon pumapasok ang welcome), at hindi rin maipapasa sa sariling signing key habang naka-lock. PATAKARAN NG CHAIN ito — lahat ng node ay dapat parehong bersyon.
WHERE IN THE CODESAAN SA CODE
- src/features/soul-id/rules.ts
- src/features/attesters/rules.ts
- src/features/chain/state.ts
- src/features/scam-shield/check.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 43
Threat model: every attack, defense and WHAT'S STILL MISSINGThreat model: lahat ng atake, depensa at KULANG PA
Before inviting other people or hiring an auditor, write every known attack in one list: who attacks, how, what stops it, and WHAT CAN STILL HAPPEN. The list is data (threats.ts) — a test checks that every code and test path is real, and THREAT-MODEL.md is generated from it (npm run threats).Bago mag-imbita ng ibang tao o kumuha ng auditor, isulat muna ang lahat ng kilalang atake sa iisang listahan: sino ang umaatake, paano, ano ang pumipigil, at ANO PA ANG PWEDENG MANGYARI. Ang listahan ay data (threats.ts) — may test na sumusuri na totoo ang bawat code at test path, at ang THREAT-MODEL.md ay ginagawa mula rito (npm run threats).
- 33 threats in 7 areas: Identity, Consensus, Ledger, Network, Wallet, Institutions, Economics. Each has a STRIDE category (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege).33 banta sa 7 lugar: Identity, Consensus, Ledger, Network, Wallet, Institusyon, Ekonomiya. Bawat isa ay may kategoryang STRIDE (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege).
- Status: Mitigated (a defense, no known gap) · Partial (a defense, some residual risk) · Open (still missing). An honest list has 'Open' items — one without them probably hasn't looked hard enough.Status: Mitigated (may depensa, walang kilalang butas) · Partial (may depensa, may natitirang panganib) · Open (kulang pa). Ang tapat na listahan ay may 'Open' — ang walang 'Open' ay malamang hindi pa naghanap nang mabuti.
- 4 Open now: long-range attacks (checkpoints needed), unchecked block time, post-quantum consensus keys, and no Content-Security-Policy in the web app.4 na Open ngayon: long-range attack (kailangan ng checkpoints), oras ng block na hindi sinusuri, post-quantum na consensus keys, at walang Content-Security-Policy sa web app.
- One finding was fixed at once: a new Soul ID no longer joins the validator draw while its welcome is locked (T10) — so a fake person can't take a committee seat right away.Naayos agad ang isang nakita: ang bagong Soul ID ay hindi na kasali sa palabunutan ng validators hangga't naka-lock pa ang welcome (T10) — kaya ang pekeng tao ay hindi agad makakaupo sa komite.
- Audit checklist (14): what an auditor should check, e.g. is the state the same on two machines, are amounts integers only, does the signature check come before any state change.Audit checklist (14): ang mga dapat suriin ng auditor, hal. pareho ba ang state sa dalawang makina, integer lang ba ang halaga, nauuna ba ang pirma bago gumalaw ang state.
⚠ A threat model is NOT an audit. It is the map for the auditor — someone who didn't write the code still has to look for what we missed.Ang threat model ay HINDI audit. Ito ang mapa para sa auditor — kailangan pa rin ng taong hindi gumawa ng code para hanapin ang hindi natin nakita.
WHERE IN THE CODESAAN SA CODE
- src/features/threats/threats.ts
- src/features/threats/markdown.ts
- src/features/consensus/committee.ts
- THREAT-MODEL.md
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 44
A second opinion: burning shouldn't eat the guards' incomeSecond opinion: ang sunog ay hindi dapat kumain ng kita ng nagbabantay
We tried /economics with 8.3 billion people (the whole world) and asked another AI to review it. Two of its points were WRONG (the supply did add up; the Reward column is a TOTAL, not per year) but a real problem surfaced: income per validator fell from 60,724 → 158 NEL a year. The cause: burning is ~1% of SUPPLY, so with a large supply ALL fees were burned.Sinubukan ang /economics na may 8.3 bilyong tao (buong mundo) at ipinasuri sa ibang AI. Dalawang puna nito ang MALI (tugma pala ang supply; ang Reward column ay KABUUAN, hindi bawat taon) pero may tunay na problemang lumabas: bumagsak ang kita bawat validator mula 60,724 → 158 NEL bawat taon. Dahilan: ang sunog ay ~1% ng SUPPLY, kaya kapag malaki ang supply, nasusunog ang LAHAT ng fees.
- New rule: burning is at most HALF the pot (fees + reward). Validators always keep ≥ ½ of the fees and ≥ ½ of the reward — like EIP-1559 always leaving the tip to the validator.Bagong patakaran: ang sunog ay hanggang KALAHATI ng pot (fees + reward). Laging ≥ ½ ng fees at ≥ ½ ng reward ang napupunta sa validators — gaya ng EIP-1559 na laging may tip ang validator.
- Model: over capacity, the fee now rises (like the base fee). Assumption: 2× the fee → ½ the people want to send. All of the Philippines (109M, PSA 2020) × 1 tx/day → ~6× capacity → ~6× the fee.Modelo: kapag lampas sa kapasidad, tumataas na ang fee (gaya ng base fee). Palagay: 2× ang fee → ½ ang gustong magpadala. Buong Pilipinas (109M, PSA 2020) × 1 tx/araw → ~6× ang kapasidad → ~6× ang fee.
- A clearer table: 'Welcome (total)', 'Reward (total)', 'Reward this year' and 'Fee/tx' — so the next reader (person or AI) isn't confused.Mas malinaw na talahanayan: 'Welcome (kabuuan)', 'Reward (kabuuan)', 'Reward ngayong taon' at 'Fee/tx' — para hindi malito ang susunod na magbabasa (tao man o AI).
- A warning when over the Philippine population: that's a stress test, not the design.Babala kapag lampas sa populasyon ng Pilipinas: stress test iyon, hindi ang disenyo.
- Lesson: a second opinion is good, but CHECK every point against the code and numbers — don't accept or dismiss it wholesale.Aral: magandang humingi ng second opinion, pero SURIIN ang bawat puna laban sa code at numero — huwag tanggapin o itapon nang buo.
⚠ The new burn cap is a CHAIN RULE — every node must run the same version. The fee assumption (elasticity −1) is only a guess; no one knows how many stop when fees rise.PATAKARAN NG CHAIN ang bagong hangganan ng sunog — lahat ng node ay dapat parehong bersyon. Ang palagay sa fee (elasticity −1) ay hula lang; hindi alam ng kahit sino kung ilan ang titigil kapag tumaas ang fee.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/supply.ts
- src/features/chain/state.ts
- src/features/economics/simulate.ts
- src/features/economics/economics-view.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 45
Closing 3 of the 4 'Open' threatsIsinara ang 3 sa 4 na 'Open' sa threat model
Three gaps from the threat model (Phase 45): (T28) no Content-Security-Policy in the web app, (T12) block time not checked, (T11) long-range attacks on a new node. Only one stays Open: post-quantum consensus keys (no standard PQ VRF yet).Tatlong butas mula sa threat model (Phase 45): (T28) walang Content-Security-Policy sa web app, (T12) hindi sinusuri ang oras ng block, (T11) long-range attack sa bagong node. Isa na lang ang Open: post-quantum na consensus keys (wala pang standard na PQ VRF).
- T28 CSP: no scripts from other sites, the wallet can't be iframed, and limits on where data can be sent. Plus nosniff, no-referrer, and a Permissions-Policy (no location; camera only for QR Pay).T28 CSP: hindi makakapag-load ng script mula sa ibang site, hindi ma-iframe ang wallet, at limitado kung saan pwedeng magpadala ng data. Kasama ang nosniff, no-referrer, at Permissions-Policy (walang lokasyon; camera para sa QR Pay lang).
- Why T28 is still 'Partial': the app uses partial prerendering, which per the Next.js docs doesn't work with a nonce → inline scripts still need 'unsafe-inline'. And ws/wss to any host, since the user picks the node.Bakit 'Partial' pa rin ang T28: ang app ay gumagamit ng partial prerendering, at ayon sa Next.js docs ay hindi ito tugma sa nonce → 'unsafe-inline' pa rin ang inline script. At ws/wss sa kahit anong host, dahil ang user ang pumipili ng node.
- T12 time: each block must be later than the one before (a CHAIN RULE). A proposal more than 15 s ahead of the node's clock → not stored and not voted for (like Bitcoin's 2-hour limit).T12 oras: bawat block ay dapat mas huli sa nauna (PATAKARAN NG CHAIN). Ang proposal na lampas 15 s sa orasan ng node → hindi itatabi at hindi iboboto (gaya ng 2-oras na limit ng Bitcoin).
- T11 checkpoints: known hashes of FINAL blocks written into the software (params.ts). A different block at that height → 'a different history', rejected. Get one with npm run checkpoint -- --file data/V1-4001.json.T11 checkpoints: kilalang hash ng FINAL na block na nakasulat sa software (params.ts). Ibang block sa height na iyon → 'ibang kasaysayan', tinanggihan. Kunin gamit ang npm run checkpoint -- --file data/V1-4001.json.
- Why T11 is still 'Partial': blocks AFTER the latest checkpoint aren't protected yet, so checkpoints must be updated in every release. Empty until there's a public testnet.Bakit 'Partial' pa rin ang T11: ang mga block PAGKATAPOS ng huling checkpoint ay hindi pa protektado, kaya dapat i-update ang checkpoints sa bawat release. Wala pang laman hangga't walang public testnet.
⚠ Checkpoints have to be trusted: whoever releases the software picks the hashes. So others should review them (as with Bitcoin Core) before release.Ang checkpoints ay kailangang pagkatiwalaan: ang naglalabas ng software ang pumipili ng hash. Kaya dapat itong suriin ng ibang tao (gaya ng sa Bitcoin Core) bago ilabas.
WHERE IN THE CODESAAN SA CODE
- src/features/security/headers.ts
- next.config.ts
- src/features/chain/chain.ts
- scripts/checkpoint.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 46
Any ID + biometrics: still 1 person = 1 Soul IDKahit anong ID + biometrics: pero 1 tao pa rin = 1 Soul ID
To let more people in, any valid ID is accepted now (passport, LTO, UMID, PRC, postal, voter's ID, barangay certificate). But if the ID number were the basis, someone with a passport AND a driver's license would get 2 Soul IDs. The answer: BIOMETRIC DEDUPLICATION — a person has only one face and one set of fingerprints, whatever ID they carry. PhilSys already does this (1:N: compared against EVERYONE registered), so we don't build our own fingerprint database.Para mas maraming makasali, tinatanggap na ang kahit anong valid na ID (passport, LTO, UMID, PRC, postal, voter's ID, barangay certificate). Pero kung ID number lang ang basehan, ang may passport AT driver's license ay magkakaroon ng 2 Soul ID. Ang sagot: BIOMETRIC DEDUPLICATION — iisa lang ang mukha at fingerprint ng tao, anuman ang ID na dala niya. Ginagawa na ito ng PhilSys (1:N: ikinukumpara sa LAHAT ng nakarehistro), kaya hindi na tayo gagawa ng sariling database ng fingerprint.
- First proof: PhilSys (with PhilSys) — the person hash is always the HMAC of the PhilSys PCN. No PhilSys yet? Register first (it's free).Unang patunay: PhilSys (gamit ang PhilSys) — ang person hash ay laging HMAC ng PhilSys PCN. Wala pang PhilSys? Magparehistro muna (libre).
- Second proof: a different KIND of attester (a bank, barangay…) with ANY valid ID. The Soul ID card shows which ID and biometric were checked.Pangalawang patunay: ibang URI ng attester (bangko, barangay…) gamit ang KAHIT ANONG valid na ID. Nakikita sa Soul ID card kung anong ID at biometric ang tiningnan.
- A liveness check is required (a live person, not a photo, video or deepfake) — face OR fingerprint, since some people have no clear fingerprints.Kailangan ng liveness check (buhay na tao, hindi litrato, video o deepfake) — mukha O fingerprint, dahil may mga taong walang malinaw na fingerprint.
- Biometrics on chain are FORBIDDEN: a proof with an extra field (e.g. 'fingerprint') is rejected. A fingerprint can't be changed once leaked — and its hash is useless, since every scan differs slightly.BAWAL ang biometrics sa chain: kapag may dagdag na field ang patunay (hal. 'fingerprint'), tinatanggihan. Hindi mapapalitan ang fingerprint kapag na-leak — at walang silbi ang hash nito, dahil bahagyang iba ang bawat scan.
- Biometrics stay with PhilSys and the attesters only, under the Data Privacy Act. New threats in the threat model: T34 (biometric leaks) and T35 (cheating the face/fingerprint check).Ang biometrics ay nasa PhilSys at attesters lang, sa ilalim ng Data Privacy Act. Bagong banta sa threat model: T34 (leak ng biometrics) at T35 (pandaraya sa face/fingerprint check).
- For other countries: a national ID with deduplication (like India's Aadhaar) is needed before joining.Para sa ibang bansa: kailangan ng sariling national ID na may deduplication (gaya ng Aadhaar ng India) bago makasali.
⚠ The chain can't check that a liveness check really happened — it's the attester's word. That's why strikes and accountability matter (Phase 44).Hindi kayang suriin ng chain kung talagang ginawa ang liveness check — salita ito ng attester. Kaya mahalaga ang strikes at pananagutan (Phase 44).
WHERE IN THE CODESAAN SA CODE
- src/features/soul-id/id-types.ts
- src/features/soul-id/identity.ts
- src/features/attesters/rules.ts
- src/features/institution/commands.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 47
Capacity: a faster ledger, bigger blocks, and payment channelsKapasidad: mas mabilis na libro, mas malaking block, at payment channels
All of the Philippines needs ~6× what a block can hold. Before making blocks bigger, we MEASURED (npm run capacity) — and found a bigger problem: every tx copied the WHOLE account list. At 3,000 tx: only 238 tx/s. Fixed with a persistent map, then bigger blocks, then Layer 2 (payment channels).Ang buong Pilipinas ay ~6× ang kailangan kaysa sa kaya ng block. Bago palakihin ang block, SINUKAT muna (npm run capacity) — at may nahanap na mas malaking problema: bawat tx ay kumokopya ng BUONG listahan ng account. Sa 3,000 tx: 238 tx/s lang. Inayos gamit ang persistent map, tapos pinalaki ang block, tapos idinagdag ang Layer 2 (payment channels).
- Persistent map (a 16-way trie, like Ethereum and Immutable.js): changing one account copies only ~5 small nodes. Result: 238 → ~3,900 tx/s per core, even with 1 MILLION accounts.Persistent map (trie na 16 sanga, gaya ng Ethereum at Immutable.js): ang pagbago ng isang account ay kumokopya lang ng ~5 maliit na node. Resulta: 238 → ~3,900 tx/s bawat core, kahit may 1 MILYONG account.
- Bigger blocks (mainnet and testnet): 4,000 tx (was 1,000) and up to 4 MB — since a post-quantum tx (ML-DSA) is ~7.7 KB and Ed25519 ~0.4 KB. About 800 tx per second.Mas malaking block (mainnet at testnet): 4,000 tx (dati 1,000) at hanggang 4 MB — dahil ang post-quantum na tx (ML-DSA) ay ~7.7 KB, ang Ed25519 ~0.4 KB. Mga 800 tx bawat segundo.
- Payment channel (Layer 2): lock ₱50 once for a shop or jeepney → each payment is a SIGNED voucher saying 'total ₱X so far' (no block, no fee, instant) → one claim by the shop: payment + change. 30 payments = only 2 tx.Payment channel (Layer 2): i-lock ang ₱50 minsan para sa tindera o jeep → bawat bayad ay PIRMADONG voucher na 'kabuuang ₱X na' (walang block, walang fee, agad) → isang claim ng tindera: bayad + sukli. 30 bayad = 2 tx lang.
- Safe: the deposit is locked on chain; the shop checks the signature before accepting; the payer can take it back only after a delay. The shop must claim before then.Ligtas: naka-lock ang deposit sa chain; sinusuri ng tindera ang pirma bago tanggapin; ang payer ay makakabawi lang pagkalampas ng palugit. Ang tindera ay dapat mag-claim bago iyon.
- Found along the way: escrow and paluwagan weren't counted in the daily limit (Safety) → a thief could bypass it. Fixed: all money leaving to someone else now counts.Nakita habang ginagawa: ang escrow at paluwagan ay hindi binibilang sa daily limit (Safety) → kayang lusutan ng magnanakaw. Naayos: lahat ng perang lumalabas papunta sa iba ay bilang na.
- Economics: all of the Philippines, 1 payment/day → ~1.6× capacity. Half in channels → ~0.84 → IT FITS.Economics: buong Pilipinas, 1 bayad/araw → ~1.6× ang kapasidad. Kalahati sa channels → ~0.84 → KASYA.
⚠ A channel goes one way, to one recipient. Routing payments through many channels (like Bitcoin's Lightning Network) is harder and not done yet. The new block size and channels are CHAIN RULES.Isang direksyon lang at iisang tatanggap ang channel. Ang pagdaan ng bayad sa maraming channel (gaya ng Lightning Network ng Bitcoin) ay mas mahirap at hindi pa ginagawa. PATAKARAN NG CHAIN ang bagong laki ng block at ang channels.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/pmap.ts
- src/features/channels/rules.ts
- src/features/channels/voucher.ts
- scripts/capacity.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 48
Suki in NelPay: pay with just a QR, no fee, instantlySuki sa NelPay: bayad na QR lang, walang fee, agad
The payment channel (Phase 49) is now in NelPay as '🤝 Suki' (a regular customer). The payer locks a deposit for a shop or jeepney (1 tx). Each payment: a voucher QR the shop scans — the shop's app checks the signature AT ONCE against the channel on chain, no waiting for a block. At the end: one Claim (1 tx) → payment to the shop, change to the payer.Ang payment channel (Phase 49) ay nasa NelPay na bilang '🤝 Suki'. Ang nagbabayad ay nagla-lock ng deposit para sa isang tindahan o jeep (1 tx). Bawat bayad: QR ng voucher na ini-scan ng tindera — sinusuri AGAD ng app ng tindera ang pirma laban sa channel na nasa chain, walang hintay sa block. Sa dulo: isang Claim (1 tx) → bayad sa tindera, sukli sa nagbabayad.
- Voucher QR: nel:voucher?channel=…&amount=TOTAL&sig=… — under 200 characters (Ed25519), fits in a QR. The amount is a TOTAL, so only the newest one matters.Voucher QR: nel:voucher?channel=…&amount=KABUUAN&sig=… — wala pang 200 character (Ed25519), kasya sa QR. Ang halaga ay KABUUAN, kaya ang pinakabago lang ang mahalaga.
- Shop: rejects an old or repeated QR (not larger than the last one received) and a tampered QR (wrong signature).Tindera: tinatanggihan ang luma o dobleng QR (hindi mas malaki sa huling natanggap) at ang dinayang QR (mali ang pirma).
- The node has a new query: get-channels — only MY CONFIRMED channels (already in a block), so the shop never accepts payment on a channel that isn't on chain yet.Ang node ay may bagong tanong: get-channels — mga KUMPIRMADONG channel ko lang (nasa block na), para hindi tumanggap ng bayad ang tindera sa channel na wala pa sa chain.
- Vouchers live only on the phone (localStorage). Lose the phone = lose the payments since the last claim — so claim often, and always before the deadline.Nasa phone lang ang mga voucher (localStorage). Mawala ang phone = mawala ang bayad mula sa huling claim — kaya mag-claim nang madalas, at laging bago ang palugit.
- NelPay's Verify was also fixed for Phase 48: the PhilSys PCN is the basis of the Soul ID, and other IDs (passport, LTO…) are for the bank's second proof.Inayos din ang Verify ng NelPay para sa Phase 48: PhilSys PCN ang basehan ng Soul ID, at ang ibang ID (passport, LTO…) ay para sa pangalawang patunay ng bangko.
⚠ A passkey can't sign vouchers yet (it signs differently). And as with any voucher: if the payer's phone is stolen while unlocked, it can spend up to the deposit — so keep suki deposits small.Ang passkey ay hindi pa pwedeng pumirma ng voucher (iba ang paraan ng pagpirma nito). At gaya ng lahat ng voucher: kapag nanakaw ang phone ng nagbabayad na naka-unlock, kaya nitong gumastos hanggang sa deposit — kaya maliit na deposit lang para sa suki.
WHERE IN THE CODESAAN SA CODE
- src/features/channels/suki-card.tsx
- src/features/channels/voucher-link.ts
- src/features/channels/voucher-store.ts
- src/features/nelpay/nelpay-app.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 49
A public testnet from your PC — no VPSPublic testnet mula sa PC mo — walang VPS
One command (npm run testnet:home): 4 testnet nodes + the NelPay web app + Cloudflare quick tunnels → links to give friends. The tunnel connects outward, so the router stays closed and the home IP isn't visible. Friends can use NelPay in the browser, or run their own node (npm run testnet:join -- <link>).Isang command (npm run testnet:home): 4 na testnet node + NelPay web app + Cloudflare quick tunnel → mga link na ibibigay sa kaibigan. Palabas ang koneksyon ng tunnel, kaya hindi binubuksan ang router at hindi makikita ang IP ng bahay. Ang kaibigan ay pwedeng gumamit ng NelPay sa browser, o magpatakbo ng sariling node (npm run testnet:join -- <link>).
- Two tunnels: the seed node (wss://…:443) and the web app (https://…). The app reads ?node= from the link, so it doesn't need rebuilding when the link changes.Dalawang tunnel: ang seed node (wss://…:443) at ang web app (https://…). Ang app ay binabasa ang ?node= sa link, kaya hindi na kailangang i-build ulit kapag nagbago ang link.
- Behind the tunnel, every connection looks like it comes from 127.0.0.1 — and localhost is never banned! So the node reads the real IP from CF-Connecting-IP (--trust-proxy).Sa likod ng tunnel, lahat ng koneksyon ay mukhang galing sa 127.0.0.1 — at ang localhost ay hindi naba-ban! Kaya binabasa ng node ang totoong IP sa CF-Connecting-IP (--trust-proxy).
- Caught in testing: DNS was asked about the new link BEFORE Cloudflare had spread it → 'not found', remembered for minutes. Now the script waits for DNS (DNS-over-HTTPS) before showing the link.Nahuli sa pagsubok: tinanong ng DNS ang bagong link BAGO pa ito naikalat ng Cloudflare → 'not found', at naalala iyon nang ilang minuto. Ngayon, hinihintay muna ng script ang DNS (DNS-over-HTTPS) bago ipakita ang link.
- Also caught: testnet:join didn't stop its node on SIGTERM (not Ctrl+C) → it was left running. Fixed.Nahuli rin: ang testnet:join ay hindi nag-aalis ng node kapag SIGTERM (hindi Ctrl+C) → naiwang tumatakbo. Inayos.
- Separate from your lab: ports 4101–4104 and 3100, and its own build (.next-testnet).Hiwalay sa lab mo: ports 4101–4104 at 3100, at sariling build (.next-testnet).
- Real decentralization: once friends run their own nodes, the chain keeps going even if you turn off your PC — as long as 2/3 of the validators are online.Ang tunay na decentralization: kapag ang mga kaibigan ay may sariling node, tuloy ang chain kahit patayin mo ang PC mo — basta may 2/3 ng mga validator.
⚠ While you hold all the validators, the testnet stops when your PC is off. And any hole in the node or app is reachable from the internet — so testnet only, fake money and fake IDs only.Habang ikaw lang ang may mga validator, hihinto ang testnet kapag pinatay mo ang PC. At ang anumang butas sa node o app ay maaabot mula sa internet — kaya testnet lang, pekeng pera at pekeng ID lang.
WHERE IN THE CODESAAN SA CODE
- scripts/home-testnet.ts
- scripts/testnet-join.ts
- src/features/node-client/use-node-host.ts
- TESTNET.md
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 50
Status: the network's health at a glanceStatus: ang kalusugan ng network sa isang tingin
With friends joining the testnet, you need to see problems at once. /status asks the node (get-health) every 2 seconds: chain height, seconds since the last block, connected nodes, validators (and how many are still waiting), the mempool, and bans.Habang may mga kaibigang sumasali sa testnet, kailangan mong makita agad kung may problema. Ang /status ay nagtatanong sa node (get-health) bawat 2 segundo: taas ng chain, ilang segundo mula sa huling block, ilang node ang kausap, ilang validator (at ilan ang naghihintay pa), mempool, at mga naka-ban.
- The verdict at the top: ✓ Healthy · ⚠️ no peers or slow · ✗ stopped (no new block for a long time — not enough validators online, > 2/3 needed).Hatol sa itaas: ✓ Malusog · ⚠️ walang kausap o mabagal · ✗ huminto (walang bagong block nang matagal — kulang ang online na validator, kailangan > 2/3).
- Chart: seconds per block. The line is the expected time (~5 s). Yellow = needed more than one round (split vote or an offline proposer).Chart: segundo bawat block. Ang guhit ay ang inaasahan (~5 s). Dilaw = kinailangan ng higit sa isang round (nahating boto o offline ang proposer).
- Privacy: only node IDs are shown, NEVER a friend's IP — even though the node knows it (for bans).Privacy: node ID lang ang ipinapakita, HINDI ang IP ng kahit sinong kaibigan — kahit alam ito ng node (para sa ban).
- Tested: 4 nodes → ✓ Healthy. Stopped 2 → after ~1 minute, ✗ 'the chain has stopped' (2/4 isn't > 2/3).Sinubukan: 4 na node → ✓ Malusog. Pinatay ang 2 → pagkalipas ng ~1 minuto, ✗ 'huminto ang chain' (2/4 ay hindi > 2/3).
⚠ The status comes from ONE node (the one you're talking to). If that node has a problem, another node may show something else — so it helps to check the status from a friend's node too.Ang status ay galing sa ISANG node (ang kinakausap mo). Kung ang node na iyon ang may problema, iba ang makikita mo sa node ng iba — kaya magandang tingnan din ang status mula sa node ng kaibigan.
WHERE IN THE CODESAAN SA CODE
- src/features/status/health.ts
- src/features/status/status-view.tsx
- src/features/network/server.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 51
No PhilSys? You can still pay — fees in nPHPWalang PhilSys? Pwede pa ring magbayad — fee sa nPHP
Someone without PhilSys has no Soul ID → no welcome NEL → nothing to pay fees with → can't send even with pesos. Now they sign a 'maxFeePhp' (the most ₱ they accept), and the CHAIN itself buys the NEL for the fee from the exchange pool with their pesos. That NEL then goes through the usual fee path (burn + committee) — nothing changes in the economics.Ang taong walang PhilSys ay walang Soul ID → walang welcome NEL → walang pambayad ng fee → hindi makakapagpadala kahit may piso. Ngayon: pumipirma siya ng 'maxFeePhp' (pinakamalaking ₱ na papayag siya), at ang CHAIN mismo ang bumibili ng NEL na pang-fee sa exchange pool gamit ang piso niya. Ang NEL na iyon ay dumadaan sa karaniwang fee (sunog + komite) — walang nagbago sa ekonomiya.
- Like Celo's 'fee currency': paying gas with a stablecoin.Gaya ng 'fee currency' ng Celo: pambayad ng gas gamit ang stablecoin.
- Protection: maxFeePhp is part of the SIGNATURE. If someone moves the pool price to inflate the fee → the tx is rejected; they are never charged more.Proteksyon: kasama sa PIRMA ang maxFeePhp. Kung may gumalaw ng presyo ng pool para lumaki ang fee → tinanggihan ang tx, hindi siya sisingilin nang higit.
- Old txs (without maxFeePhp) keep the same signature and hash — it's only included in what's signed when used.Ang lumang tx (walang maxFeePhp) ay pareho pa rin ang pirma at hash — kasama lang sa pinipirmahan kapag ginamit.
- NelPay uses it automatically when NEL is short but there are pesos (max = today's price + 20%). In the lab: ₱100 → send ₱20 → ₱79.85 (₱0.15 fee), 0 NEL.NelPay: kusang ginagamit kapag kulang ang NEL pero may piso (max = presyo ngayon + 20%). Sa lab: ₱100 → padala ₱20 → ₱79.85 (₱0.15 na fee), 0 NEL.
- It needs an exchange pool with liquidity. No pool → no price → not possible (the right answer: 'Not enough NEL in the exchange pool').Kailangan ng exchange pool na may laman. Walang pool → walang presyo → hindi pwede (tamang sagot: 'Walang sapat na NEL sa exchange pool').
- Found along the way: a locked welcome must not 'slip through' as a fee when paying in pesos — fixed.Nahanap habang ginagawa: ang naka-lock na welcome ay hindi dapat 'makalusot' bilang fee kapag sa piso ang bayad — inayos.
⚠ People without a Soul ID can pay now, but they still get NO free NEL, no ticket in the draw, and no scam reports — so '1 person = 1' stays safe against fake people.Ang walang Soul ID ay makakapagbayad na, pero WALA pa ring libreng NEL, tiket sa palabunutan, o scam report — kaya ligtas pa rin ang '1 tao = 1' laban sa pekeng tao.
WHERE IN THE CODESAAN SA CODE
- src/features/exchange/fee-in-php.ts
- src/features/chain/state.ts
- src/features/chain/transaction.ts
- src/features/nelpay/nelpay-app.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 52
Vouching: a Soul ID without a bank or PhilSysVouching: Soul ID nang walang bangko o PhilSys
No real bank or PhilSys needed anymore. 2 people who already have Soul IDs can vouch: 'I know them, they are a real person'. 2 different people → Soul ID + 10 NEL (locked at first, like everyone else). Like Proof of Humanity and BrightID — the community itself is the attester.Hindi na kailangan ng tunay na bangko o PhilSys. Ang 2 taong may Soul ID na ay pwedeng mag-vouch: 'kilala ko siya, totoong tao siya'. 2 magkaibang tao → Soul ID + 10 NEL (naka-lock muna, gaya ng iba). Gaya ng Proof of Humanity at BrightID — ang komunidad mismo ang attester.
- Vouchers sign with their OWN wallet (in NelPay: 🙋 Vouch) — no operator, no command, no institution key.Ang nag-vouch ay pumipirma gamit ang SARILI niyang wallet (sa NelPay: 🙋 Vouch) — walang operator, walang command, walang susi ng institusyon.
- Brakes: you must have held a Soul ID for a while before vouching (lab 10 blocks, testnet ~5 minutes, mainnet 30 days), up to 3 vouches per period, and both vouches must have the SAME name and barangay.Mga preno: may Soul ID nang matagal-tagal bago makapag-vouch (lab 10 block, testnet ~5 minuto, mainnet 30 araw), hanggang 3 vouch bawat panahon, at dapat PAREHO ang pangalan at barangay ng 2 vouch.
- Accountability: if someone vouched for is proven FAKE (a court's soul-fake) → a strike for EVERY voucher. 2 strikes → never able to vouch again.Pananagutan: kapag napatunayang PEKE ang na-vouch (soul-fake ng korte) → strike sa LAHAT ng nag-vouch. 2 strike → hindi na makakapag-vouch kailanman.
- A vouch has no ID number and no biometrics — so there is no dedup. 'One person' rests on the vouchers' honesty (new threat T40: vouching rings).Walang ID number at walang biometrics sa vouch — kaya walang dedup. Ang 'iisang tao' ay nakasalalay sa katapatan ng mga nag-vouch (bagong banta T40: vouching rings).
- How the testnet starts: the first 2 'founders' come from the demo attesters; after that, the community grows by vouching.Paano nagsisimula ang testnet: ang unang 2 'founder' ay galing sa demo attesters; pagkatapos, lumalaki ang komunidad sa pamamagitan ng vouching.
- AI can HELP the voucher (e.g. a liveness check), but a PERSON stays accountable — AI alone can never be the attester.Ang AI ay pwedeng TUMULONG sa nag-vouch (hal. liveness check), pero ang TAO pa rin ang mananagot — hindi pwedeng AI lang ang attester.
⚠ This is weaker than PhilSys against an organized group vouching for each other. It's fine for a testnet and a small community; a national currency would still need dedup.Mas mahina ito kaysa sa PhilSys laban sa organisadong grupo na nagvo-vouch para sa isa't isa. Ayos ito para sa testnet at maliit na komunidad; para sa pambansang pera, kailangan pa rin ng dedup.
WHERE IN THE CODESAAN SA CODE
- src/features/vouch/rules.ts
- src/features/vouch/vouch-card.tsx
- src/features/soul-id/identity.ts
- src/features/attesters/rules.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 53
AI liveness: a face-to-face vouch with a camera (no pictures kept)AI liveness: harapang vouch gamit ang camera (walang larawang naiipon)
Before vouching, the voucher can open THEIR camera (a phone or a PC webcam) while facing the person. The AI (Google's MediaPipe Face Landmarker) runs IN THE BROWSER: it asks them to blink and turn to one side and then the other, in a random order. Passed → 'with AI liveness (face to face)' on the Soul ID card. No picture or video leaves the device.Bago mag-vouch, pwedeng buksan ng nag-vouch ang camera NIYA (phone o webcam ng PC) habang kaharap ang taong ive-vouch. Ang AI (MediaPipe Face Landmarker ng Google) ay tumatakbo SA BROWSER: hinihingi nitong kumurap at lumingon sa isang gilid at sa kabila, sa random na ayos. Pumasa → 'may AI liveness (harapan)' sa Soul ID card. Walang larawan o video na lumalabas sa device.
- Why the VOUCHER's camera, not the person's? If the person ran the check on their own phone, they could fake the app and say 'I passed'.Bakit sa camera ng NAG-VOUCH, hindi ng ive-vouch? Kapag ang tao mismo ang nagpapatakbo ng check sa sariling phone, kaya niyang dayain ang app at sabihing 'pumasa ako'.
- A photo doesn't blink; a recorded video doesn't know the random order of challenges. Several frames in a row are needed (not one blurry frame). Two faces → fail.Ang litrato ay hindi kumukurap; ang naka-record na video ay hindi alam ang random na ayos ng mga hamon. Kailangan ng sunod-sunod na frame (hindi isang malabong frame lang). Dalawang mukha → bigo.
- Fingerprint? A browser can't: the phone only says 'yes/no' (passkey), never handing over the fingerprint itself — on purpose, for privacy.Fingerprint? Hindi kaya ng browser: ang phone ay nagsasabi lang ng 'oo/hindi' (passkey), hindi kailanman ibinibigay ang fingerprint mismo — at sinadya iyon para sa privacy.
- On chain: only 'liveness: yes/no'. Any picture or face data is still forbidden (the extra field is rejected).Sa chain: 'liveness: oo/hindi' lang. Bawal pa rin ang anumang larawan o datos ng mukha (tinatanggihan ang dagdag na field).
- Technical: the WASM and AI model are hosted on our own site (public/), since the CSP blocks other sites — and 'wasm-unsafe-eval' had to be allowed (WASM only, not JavaScript's eval).Teknikal: ang WASM at AI model ay naka-host sa sariling site (public/), dahil hinaharangan ng CSP ang ibang site — at kinailangang payagan ang 'wasm-unsafe-eval' (WASM lang, hindi ang eval ng JavaScript).
- Works with a PC webcam: http://localhost counts as 'secure' for the camera.Gumagana sa webcam ng PC: ang http://localhost ay 'secure' para sa camera.
⚠ This isn't dedup: the AI doesn't know whether this face is already registered (that would need a database of everyone's face — the most dangerous data). And a good deepfake on another screen might still pass. The PERSON who vouched stays accountable.Hindi ito dedup: hindi alam ng AI kung nakarehistro na ang mukhang ito (kailangan noon ng database ng mukha ng lahat — ang pinakadelikadong datos). At ang magaling na deepfake sa ibang screen ay pwede pang lumusot. Ang TAO na nag-vouch pa rin ang mananagot.
WHERE IN THE CODESAAN SA CODE
- src/features/liveness/liveness.ts
- src/features/liveness/liveness-check.tsx
- src/features/vouch/vouch-card.tsx
- scripts/copy-mediapipe-wasm.mjs
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 54
Keys and backups: public key, private key, and a backup codeSusi at backup: public key, private key, at backup code
Like other crypto wallets: 🔑 Keys / Backup in NelPay shows the address and public key (safe to show), creates a 💾 backup code (encrypted, long password), and shows the 🔑 private key (PIN first, blurred first). On a new link, browser or phone: ♻️ I have a backup or private key → the same wallet and Soul ID.Gaya ng ibang crypto wallet: ang 🔑 Susi / Backup sa NelPay ay nagpapakita ng address at public key (ligtas ipakita), gumagawa ng 💾 backup code (naka-encrypt, mahabang password), at nagpapakita ng 🔑 private key (PIN muna, malabo muna). Sa bagong link, browser o phone: ♻️ May backup o private key ako → parehong wallet at Soul ID.
- Address = the account's name (from the public key) — share it so people can pay you. Public key = checks signatures — safe too.Address = pangalan ng account (galing sa public key) — ibigay para mapadalhan ka. Public key = pang-check ng pirma — ligtas din.
- Private key = the money itself. Whoever holds it owns it — no PIN, no password. No support, admin or AI will ever ask for it.Private key = ang mismong pera. Kung sino ang may hawak, siya ang may-ari — walang PIN, walang password. Walang support, admin o AI na hihingi nito.
- Backup code = an encrypted copy (PBKDF2 600,000 rounds → AES-GCM) with a 10+ character password — not the 6-digit PIN, since there are only 1 million PINs and they can be guessed offline if the code is copied.Backup code = naka-encrypt na kopya (PBKDF2 600,000 ulit → AES-GCM) gamit ang password na 10+ character — hindi ang 6-digit PIN, dahil 1 milyon lang ang PIN at kayang hulaan offline kapag nakopya ang code.
- The backup includes the address — this matters for a wallet that upgraded its key (post-quantum) or was recovered by guardians: a different key, the same address.Kasama sa backup ang address — mahalaga sa wallet na nag-upgrade ng key (post-quantum) o na-recover ng guardians: iba na ang key, pareho pa rin ang address.
- Why it's needed: a browser wallet is tied to the 'website' (origin). A new tunnel link = a different website = 'Start' again. Now just restore.Bakit ito kailangan: ang wallet sa browser ay nakatali sa 'website' (origin). Bagong link ng tunnel = ibang website = 'Magsimula' ulit. Ngayon: i-restore lang.
- Bitcoin and MetaMask use a seed phrase (BIP-39: 12–24 words), easier to write on paper — it could be added later.Ang Bitcoin at MetaMask ay gumagamit ng seed phrase (BIP-39: 12–24 na salita) na mas madaling isulat sa papel — pwedeng idagdag sa hinaharap.
⚠ Keep the backup code and the password in DIFFERENT places. If you forget the password, no one can open the backup. Never paste a private key into a chat, email, or an AI.Itago ang backup code at ang password sa MAGKAIBANG lugar. Kapag nakalimutan ang password, walang makakabukas ng backup. Huwag kailanman i-paste ang private key sa chat, email, o AI.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet-backup/backup.ts
- src/features/wallet-backup/keys-card.tsx
- src/features/wallet-app/unlock-screen.tsx
- src/features/wallet-app/secure-storage.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 55
An operator inbox, a faucet, and NelPay on the home screenInbox ng operator, faucet, at NelPay sa home screen
To make joining easy for friends: (1) 📨 NelPay's Submit (Verify) and Cash-in go to the node's INBOX; the operator approves with npm run approve (y/N) — no more copying commands. (2) 💧 Faucet: npm run approve -- --faucet 100 → an automatic ₱100 of fake pesos for each cash-in request. (3) 📱 PWA: Add to Home Screen → NelPay with its own icon, full screen.Para madaling sumali ang mga kaibigan: (1) 📨 ang Isumite (Verify) at Cash-in sa NelPay ay napupunta sa INBOX ng node; ang operator ay nag-aapruba gamit ang npm run approve (y/N) — wala nang kinokopyang command. (2) 💧 Faucet: npm run approve -- --faucet 100 → kusang ₱100 na pekeng piso para sa bawat cash-in request. (3) 📱 PWA: Add to Home Screen → NelPay na may sariling icon, buong screen.
- The inbox lives in the node's MEMORY, not on chain — no name or PhilSys number (even fake) reaches the chain this way. It has a limit (100) and no duplicates.Ang inbox ay nasa MEMORYA ng node, hindi sa chain — walang pangalan o PhilSys number (kahit pekeng) na napupunta sa chain dahil dito. May hangganan (100) at walang doble.
- Anyone can send a request, but only LOCALHOST (the operator on their own PC) can read and approve. Behind the tunnel the IP comes from CF-Connecting-IP — so a friend is not 'localhost'.Kahit sino ay pwedeng magpadala ng request, pero ang LOCALHOST lang (ang operator sa sariling PC) ang makakabasa at makakapag-apruba. Sa likod ng tunnel, ang IP ay galing sa CF-Connecting-IP — kaya ang kaibigan ay hindi 'localhost'.
- Verify is ALWAYS decided by a person (y/N) — never by the faucet. The faucet is only for fake pesos on testnet.Ang Verify ay LAGING tao ang nagpapasya (y/N) — hindi kasama sa faucet. Ang faucet ay para lang sa pekeng piso sa testnet.
- In production the shape is the same: each institution has its own 'inbox' (e.g. a bank's KYC queue), and its own servers approve after their own checks.Sa production, ganito rin ang hugis: bawat institusyon ay may sariling 'inbox' (hal. KYC queue ng bangko), at ang sariling server nila ang nag-aapruba pagkatapos ng sariling pagsusuri.
- PWA: a manifest (src/app/manifest.ts) + icons (made by scripts/make-icons.mjs with only node:zlib). No offline mode — a node is still needed.PWA: manifest (src/app/manifest.ts) + mga icon (ginawa ng scripts/make-icons.mjs gamit ang node:zlib lang). Walang offline mode — kailangan pa rin ng node.
- The old institution script was split: src/features/institution/operator.ts (signs as an institution with its own key file) — used by institution and approve.Ang dating institution script ay hinati: src/features/institution/operator.ts (pumirma bilang institusyon gamit ang sariling key file) — ginagamit na ng institution at approve.
⚠ With a quick tunnel the link changes on every restart — so a NelPay installed on a phone stops working after a restart (it's a different website). Use the ♻️ backup on the new link, or get a link that doesn't change (Tailscale Funnel).Sa quick tunnel, nagbabago ang link bawat restart — kaya ang naka-install na NelPay sa phone ay hindi na gagana pagkatapos ng restart (ibang website na). Gamitin ang ♻️ backup sa bagong link, o kumuha ng hindi nagbabagong link (Tailscale Funnel).
WHERE IN THE CODESAAN SA CODE
- src/features/inbox/types.ts
- scripts/approve.ts
- src/features/institution/operator.ts
- src/app/manifest.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 56
A review: 4 bugs caught before friends joinedPagsusuri: 4 na bug na nahuli bago ang mga kaibigan
After 11 quickly added phases, the riskiest parts (money, consensus, network) were reviewed, and an 'all-in-one' test was written: one chain going through users' whole lives, checking the laws of money after EVERY block.Pagkatapos ng 11 phase na mabilis na idinagdag, sinuri ang mga pinakamapanganib na bahagi (pera, consensus, network), at isinulat ang isang 'lahat-sa-isa' na pagsubok: isang chain na dumadaan sa buong buhay ng mga user, at pagkatapos ng BAWAT block ay sinusuri ang mga batas ng pera.
- Bug 1 (Phase 47): when the proposer's clock lagged, its block was earlier than the previous one → rejected → a wasted round. Fix: blockTime = the later of the clock or the previous block + 1 ms.Bug 1 (Phase 47): kapag nahuhuli ang orasan ng proposer, ang block niya ay mas maaga sa nauna → tinatanggihan → nasasayang ang round. Ayos: blockTime = mas huli sa orasan o sa naunang block + 1 ms.
- Bug 2 (Phase 57): the inbox was protected only by 'localhost'. Behind a proxy without --trust-proxy, EVERYONE looks like localhost → anyone could read it. Fix: a secret operator token (a 0600 file), compared in constant time.Bug 2 (Phase 57): ang inbox ay protektado lang ng 'localhost'. Sa likod ng proxy na walang --trust-proxy, LAHAT ay mukhang localhost → mababasa ng kahit sino. Ayos: lihim na operator token (file na 0600), inihahambing nang constant-time.
- Bug 3 (Phase 57): one person could fill the inbox (100) → others' requests dropped. Fix: up to 5 per person. And the faucet left duplicate requests → now removed.Bug 3 (Phase 57): kayang punuin ng isang tao ang inbox (100) → mabubura ang request ng iba. Ayos: hanggang 5 bawat tao. At ang faucet ay nag-iiwan ng dobleng request → inaalis na.
- Bug 4 (get-history): read the WHOLE chain for every wallet's every question. Fix: an address index — each block is read once (like an Electrum server).Bug 4 (get-history): binabasa ang BUONG chain bawat tanong ng bawat wallet. Ayos: address index — isang beses lang binabasa ang bawat block (gaya ng Electrum server).
- All-in-one: founders → vouch → KYC → cash-in → pool → a payment with the fee in ₱ → suki → a fake person → a strike. Every block: NEL (🧑 + ⛏️ − 🔥 = all NEL anywhere) and ₱ (≤ reserves) — nothing created or lost.Lahat-sa-isa: founders → vouch → KYC → cash-in → pool → padala na fee sa ₱ → suki → pekeng tao → strike. Bawat block: NEL (🧑 + ⛏️ − 🔥 = lahat ng NEL kahit saan) at ₱ (≤ reserves) — walang nalilikha o nawawala.
⚠ A review by the author is no substitute for an external audit: others more easily see what we didn't think of. You can also run /code-review in Claude Code for a separate review.Ang pagsusuri ng gumawa mismo ay hindi kapalit ng external audit: mas madaling makita ng ibang tao ang hindi natin naisip. Pwede ring patakbuhin ang /code-review sa Claude Code para sa hiwalay na pagsusuri.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/lifecycle.test.ts
- src/features/chain/chain.ts
- src/features/network/history-index.ts
- src/features/inbox/types.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 57
Become a validator: stake, node, and rewardMaging validator: stake, node, at reward
The reward is for those who VOTED for the block. You need: a Soul ID + stake ≥ 1 NEL + a finished welcome lock + a NODE running with YOUR key (a browser wallet can't vote — it must always be online). Now: NelPay → ⛏️ Validator (stake/unstake, status) and npm run validator (key file + node in one command).Ang reward ay para sa mga BUMOTO sa block. Kailangan: Soul ID + stake ≥ 1 NEL + tapos na ang welcome lock + NODE na tumatakbo gamit ang SUSI mo (ang wallet sa browser ay hindi makakaboto — dapat online palagi). Ngayon: NelPay → ⛏️ Validator (stake/unstake, status) at npm run validator (key file + node sa isang command).
- NelPay ⛏️ Validator: Stake/Unstake in one tap; status: 'you are a candidate', 'becomes a candidate at block #…', how often you voted in the last 100 blocks.NelPay ⛏️ Validator: Stake/Unstake sa isang pindot; status: 'kandidato ka na', 'magiging kandidato sa block #…', ilang beses bumoto sa huling 100 block.
- npm run validator -- --name Juan: asks for the private key or backup code HIDDEN (not shown on screen, not saved in the terminal history), saves it to keys/<network>/validator-juan.json (0600), then runs the node with --key.npm run validator -- --name Juan: itinatanong ang private key o backup code nang NAKATAGO (hindi lumalabas sa screen, hindi napupunta sa history ng terminal), sine-save sa keys/<network>/validator-juan.json (0600), tapos pinapatakbo ang node na may --key.
- Tested in the lab: a test validator → candidate → voted in 10 blocks, even MADE a block, and earned (~+4.8 NEL).Sinubukan sa lab: test validator → kandidato → bumoto sa 10 block, GUMAWA pa ng isang block, at kumita (~+4.8 NEL).
- Reward per block = 2 NEL × (Soul IDs ÷ 20 on testnet) + fees − burn (up to half), shared among the VOTERS with Soul IDs. V1–V4 (bootstrap) earn 0.Reward bawat block = 2 NEL × (Soul IDs ÷ 20 sa testnet) + fees − sunog (hanggang kalahati), hinahati sa mga BUMOTONG may Soul ID. Ang V1–V4 (bootstrap) ay 0 ang kita.
- Once 4 validators have Soul IDs → V1–V4 leave → you all run the chain (real decentralization).Kapag 4 na ang validator na may Soul ID → aalis ang V1–V4 → kayo na ang nagpapatakbo ng chain (tunay na decentralization).
- One ticket per PERSON — whether the stake is 1 NEL or 1,000 NEL, the chance of being drawn is the same (unlike other Proof-of-Stake).Isang tiket bawat TAO — kahit 1 NEL o 1,000 NEL ang stake, pareho ang tsansang mabunot (hindi gaya ng ibang Proof-of-Stake).
⚠ Never give the private key to anyone — type it only into your own terminal. If the node (or the PC) is off, you don't vote and you don't earn. A double vote (e.g. the same key on two nodes) → slashing: −50% of the stake and jail.Ang private key ay HINDI kailanman ibinibigay kahit kanino — sa sarili mong terminal lang ito ilalagay. Kapag pinatay ang node (o ang PC), hindi ka boboto at hindi ka kikita. Ang dobleng boto (hal. iisang key sa dalawang node) → slashing: −50% ng stake at jail.
WHERE IN THE CODESAAN SA CODE
- src/features/validator/status.ts
- src/features/validator/validator-card.tsx
- scripts/validator.ts
- src/features/chain/key-file.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 58
🔒 Locked supply rules🔒 Naka-lock na patakaran ng supply
'No one holds the supply' — not even whoever wrote the code. The money numbers (10 NEL per person, 2 → 0.5 NEL reward, halving, ~1% burn, the burn cap) have a FINGERPRINT (SHA-256). The testnet and mainnet fingerprints are written in the code. Change even one number and the node refuses to run.'Walang humahawak sa supply' — pati ang gumawa ng code. Ang mga numero ng pera (10 NEL bawat tao, 2 → 0.5 NEL reward, halving, ~1% na sunog, hangganan ng sunog) ay may FINGERPRINT (SHA-256). Ang fingerprint ng testnet at mainnet ay nakasulat sa code. Kapag may nagbago ng kahit isang numero, ayaw tumakbo ng node.
- 4 guards: (1) the node refuses to start, (2) it won't sync from a node with a different fingerprint (now part of the status message), (3) it refuses a saved chain made under other rules, (4) a test fails.4 na bantay: (1) ayaw tumakbo ng node, (2) hindi ito magsi-sync mula sa node na iba ang fingerprint (kasama na sa status message), (3) ayaw buksan ang naka-save na chain na ginawa sa ibang patakaran, (4) babagsak ang test.
- The supply isn't FIXED (unlike Bitcoin's 21M): a tail reward of 0.5 NEL and a ~1% yearly burn → growth slows and nearly levels off (a soft cap). What's locked is the RULES, not the amount.Hindi FIXED ang supply (hindi gaya ng 21M ng Bitcoin): may tail reward na 0.5 NEL at sunog na ~1% bawat taon → bumabagal ang paglaki at halos pumapantay (soft cap). Ang naka-lock ay ang PATAKARAN, hindi ang bilang.
- Why not fixed: new people arrive every day who should get 10 NEL, and honest validators always get paid even when fees are small (like Monero's tail emission).Bakit hindi fixed: may bagong tao araw-araw na dapat makatanggap ng 10 NEL, at laging may sahod ang tapat na validator kahit maliit ang fees (gaya ng tail emission ng Monero).
- The only way to change it: a new version with a new fingerprint that node operators choose to run (a hard fork). It shows in the code diff — no silent changes.Ang tanging paraan ng pagbabago: bagong bersyon na may bagong fingerprint, na kusang pipiliin ng mga nagpapatakbo ng node (hard fork). Kita ito sa diff ng code — walang tahimik na pagbabago.
- Lab: not locked, so you can experiment freely.Lab: hindi naka-lock, para malayang mag-eksperimento.
- See the fingerprint: /economics (🔒 card), /status (tile), or open http://localhost:4101 (the node's text).Tingnan ang fingerprint: /economics (🔒 card), /status (tile), o buksan ang http://localhost:4101 (text ng node).
⚠ The fingerprint covers the NUMBERS and the name of the burn formula, not every line of code. The formulas themselves are guarded by the economics tests and by reviewers (T42 in /threats).Ang fingerprint ay sumasaklaw sa mga NUMERO at sa pangalan ng formula ng sunog, hindi sa bawat linya ng code. Ang mga formula mismo ay binabantayan ng mga test ng economics at ng mga nagre-review (T42 sa /threats).
WHERE IN THE CODESAAN SA CODE
- src/features/supply-rules/rules.ts
- src/features/supply-rules/rules.test.ts
- src/features/network/node.ts
- src/features/network/storage.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 59
A separate consensus key for validatorsHiwalay na consensus key ng validator
Before (Phase 59), your WALLET key itself sat on the always-on PC to vote — steal the PC and your money goes too. Now the node has its OWN key that only votes. The wallet (NEL, ₱, stake) stays in NelPay, and it registers the node's public key with one 'validator-key' tx.Dati (Phase 59), ang WALLET key mo mismo ang nasa PC na laging bukas para bumoto — kapag nanakaw ang PC, kasama ang pera mo. Ngayon: ang node ay may SARILING key na bumoboto lang. Ang wallet (NEL, ₱, stake) ay nananatili sa NelPay, at ito ang nag-re-register ng public key ng node gamit ang isang 'validator-key' tx.
- npm run validator -- --name Ana → asks only for the ADDRESS (not secret) → creates a new key (keys/<network>/validator-ana.json, 0600, with validatorFor) → shows the PUBLIC key.npm run validator -- --name Ana → itinatanong lang ang ADDRESS (hindi lihim) → gumagawa ng bagong key (keys/<network>/validator-ana.json, 0600, may validatorFor) → ipinapakita ang PUBLIC key.
- NelPay → ⛏️ Validator → 🔑 Register (paste the public key) → from the next block, the node's votes and VRF count for you. No node restart needed.NelPay → ⛏️ Validator → 🔑 I-register (i-paste ang public key) → simula sa susunod na block, ang boto at VRF ng node ang binibilang para sa iyo. Hindi na kailangang i-restart ang node.
- PC stolen? The thief can't move any NEL or stake. Make a new key (--new-key) and register it — the old key can no longer vote.Nanakaw ang PC? Walang NEL o stake na magagalaw ng magnanakaw. Gumawa ng bagong key (--new-key) at i-register — ang lumang key ay hindi na makakaboto.
- A retired key still counts as EVIDENCE of double votes it signed while active → changing keys doesn't escape slashing. But it can't be used to frame you in new blocks, and evidence older than the unbonding period is refused (like Cosmos's evidence max age).Ang dating key ay may bisa pa rin bilang EBIDENSYA ng dobleng boto na pinirmahan nito habang aktibo pa → hindi matatakasan ang slashing sa pagpalit ng key. Pero hindi ito magagamit para siraan ka sa mga bagong block, at ang ebidensyang mas luma sa unbonding ay tinatanggihan (gaya ng evidence max age ng Cosmos).
- No two validators may share a key (present or past). Once a separate key is set, extra stake or changing the wallet key (e.g. a passkey) leaves it alone.Walang dalawang validator na pwedeng magkapareho ng key (ngayon o dati). Kapag may hiwalay na key na, hindi ito ginagalaw ng dagdag na stake o ng pagpalit ng wallet key (hal. passkey).
- Old files (Phase 59, the wallet key) still work — but npm run validator suggests --new-key, which DELETES the wallet key from the PC (make sure you have a backup in NelPay).Lumang file (Phase 59, wallet key) ay gumagana pa rin — pero ang npm run validator ay magmumungkahi ng --new-key, na BUBURAHIN ang wallet key sa PC (siguraduhing may backup ka sa NelPay).
⚠ Still don't share the consensus key: until it is replaced, a thief can double-vote → −50% of the stake and jail. One key, one node — two nodes with the same key is a double vote too.Ang consensus key ay hindi pa rin dapat ibahagi: hanggang mapalitan ito, kaya ng magnanakaw na gumawa ng dobleng boto → −50% ng stake at jail. Isang key, isang node lang — dalawang node na iisa ang key ay dobleng boto rin.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/staking.ts
- src/features/consensus/slashing.ts
- src/features/chain/key-file.ts
- scripts/validator.ts
- src/features/consensus/validator-key.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 60
Still alive? Death, disappearance and inheritance — without the PSABuhay pa ba? Pumanaw, nawawala, at pamana — walang PSA
When everyone has a Soul ID, some will die with no one reporting it, and some will go missing with no one knowing if they're alive. Now TIME (no activity) and the COMMUNITY (2 people) report it — no PSA or court is needed to keep Soul IDs from becoming 'ghosts'. There is always a grace period and 'I'm still alive'.Kapag lahat ng tao ay may Soul ID, may mamamatay nang walang nag-uulat, at may mawawala nang hindi alam kung buhay pa. Ngayon: ang PANAHON (walang galaw) at ang KOMUNIDAD (2 tao) ang nag-uulat — hindi na kailangan ng PSA o korte para hindi maging 'multo' ang Soul ID. Laging may palugit at 'Buhay pa ako'.
- 💤 Dormant: no activity for 2 years (testnet: 7 days) → no longer counted for the reward. The money is NOT touched. Any payment or 'I'm still alive' → awake.💤 Dormant: walang galaw nang 2 taon (testnet: 7 araw) → hindi na bilang sa reward. HINDI ginagalaw ang pera. Kahit isang padala o 'Buhay pa ako' → gising.
- ❓ Missing: no activity for 10 years (testnet: 30 days) → grace period → inheritance. Like Civil Code Art. 390: 10 years before the estate is divided. The chain doesn't know anyone's age (privacy), so the safest number is used.❓ Nawawala: walang galaw nang 10 taon (testnet: 30 araw) → palugit → mana. Gaya ng Civil Code Art. 390: 10 taon bago mahati ang mana. Walang edad sa chain (privacy) kaya ang pinakaligtas na numero ang ginamit.
- 📣 A report by 2 people: 'deceased' → grace period at once; 'lost in danger' (a boat, a plane, a disaster) → after 4 years with no activity (Art. 391). A false 'deceased' report → a strike; 2 strikes → no more reporting.📣 Ulat ng 2 tao: 'pumanaw' → palugit agad; 'nawala sa panganib' (bangka, eroplano, sakuna) → kapag walang galaw nang 4 na taon (Art. 391). Ang maling ulat na 'pumanaw' → strike; 2 strike → bawal nang mag-ulat.
- 'Activity' = a tx by any key of the Soul ID, or a vote by its validator node. Receiving money is NOT activity (so others can't keep a dead person 'alive').Ang 'galaw' = tx ng kahit anong key ng Soul ID, o boto ng validator node. Ang pagtanggap ng pera ay HINDI galaw (kaya hindi mapapanatiling 'buhay' ng iba ang patay).
- 👨👩👧 Beneficiary: anyone (a parent, sibling, friend, a charity). Without one: an estate waiting for a court; unclaimed for 10 years → 🔥 the NEL is burned. The ₱ is never burned: it has real reserves at the issuer (in law: the Unclaimed Balances Act).👨👩👧 Beneficiary: kahit sino (magulang, kapatid, kaibigan, charity). Kapag wala: estate na hinihintay ang korte; kapag walang umangkin nang 10 taon → 🔥 sunog ang NEL. Ang ₱ ay hindi sinusunog: may tunay na reserba ito sa issuer (sa batas: Unclaimed Balances Act).
- Fast even with millions: nobody is counted every block — each Soul ID has one scheduled 'check at block X'.Mabilis kahit milyon-milyon: walang binibilang na lahat ng tao bawat block — bawat Soul ID ay may isang nakatakdang 'suriin sa block X'.
- Hard fork: the supply rules changed → a new fingerprint (Phase 60). The saved testnet still opens (UPGRADES_FROM) and is fully re-verified.Hard fork: nagbago ang patakaran ng supply → bagong fingerprint (Phase 60). Ang naka-save na testnet ay binubuksan pa rin (UPGRADES_FROM) at sinusuri ulit nang buo.
⚠ The chain can't take back what was given to the beneficiary. If the 'missing' person returns, the family or a court must sort it out (Civil Code Art. 392). That's why the periods are long — better slow than handing over a living person's money.Hindi kayang bawiin ng chain ang naibigay na sa beneficiary. Kapag bumalik ang taong 'nawala', ang pamilya o korte na ang mag-aayos (Civil Code Art. 392). Kaya mahaba ang mga palugit — mas mabuting matagal kaysa maibigay ang pera ng buhay pa.
WHERE IN THE CODESAAN SA CODE
- src/features/life/rules.ts
- src/features/life/schedule.ts
- src/features/life/life-card.tsx
- src/features/inheritance/rules.ts
- src/features/life/life.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 61
🛡️ Guardians: when you lose EVERYTHING🛡️ Guardians: kapag nawala ang LAHAT
Forgot the PIN, lost the private key AND the backup? If you have guardians (3 trusted people with Soul IDs), 2 of them approve a NEW key for the SAME address — your money, Soul ID and stake are intact. No bank, government or developer needed.Nakalimutan ang PIN, nawala ang private key AT ang backup? Kung may guardians ka (3 taong pinagkakatiwalaan na may Soul ID), ang 2 sa kanila ang mag-aapruba ng BAGONG key para sa PAREHONG address — buo ang pera, Soul ID at stake. Walang bangko, gobyerno, o developer na kailangan.
- While you still have access: NelPay → 🛡️ Guardians → 3 addresses (or QRs) → Set. NelPay checks each has a Soul ID (a real person, not another wallet of yours).Habang may access ka: NelPay → 🛡️ Guardians → 3 address (o QR) → Itakda. Sinusuri ng NelPay na may Soul ID ang bawat isa (totoong tao, hindi sariling ibang wallet).
- Lost everything: on a new device → 🆘 I lost everything → the old wallet's address + a new PIN → creates a NEW key → 🛡️ Guardians → a recovery link and QR → send them to your guardians.Nawala ang lahat: sa bagong device → 🆘 Nawala ang lahat → address ng lumang wallet + bagong PIN → gumagawa ng BAGONG key → 🛡️ Guardians → recovery link at QR → ipadala sa guardians.
- Guardian: 🛡️ Guardians → 🤝 Help a friend → paste or scan the link → Approve. CALL your friend first — the sender might be a scammer.Guardian: 🛡️ Guardians → 🤝 Tulungan ang kaibigan → i-paste o i-scan ang link → Aprubahan. TAWAGAN muna ang kaibigan — baka manloloko ang nagpadala.
- A majority (2 of 3) → a delay (testnet/mainnet: 1 day). During it, the REAL owner sees a warning and can cancel — in case 2 guardians colluded.Karamihan (2 sa 3) → may palugit (testnet/mainnet: 1 araw). Habang palugit, nakikita ng TUNAY na may-ari ang babala at pwedeng i-cancel — kung nagsabwatan pala ang 2 guardian.
- ALL guardians (3 of 3) → at once. For a thief draining the money right now (who could also cancel a majority recovery with the stolen key).LAHAT ng guardian (3 sa 3) → agad. Para sa magnanakaw na umuubos ng pera ngayon din (kaya rin niyang i-cancel ang recovery ng karamihan, gamit ang ninakaw na key).
- While a recovery waits, key-rotate is blocked (so a thief can't get ahead of the guardians).Habang may naghihintay na recovery, bawal ang key-rotate (para hindi maunahan ng magnanakaw ang guardians).
- No guardians and everything lost → it can't be opened. But it isn't lost forever either: after a long time with no activity, it goes to the beneficiary (Phase 62).Walang guardians at nawala ang lahat → hindi na mabubuksan. Pero hindi rin ito mawawala habambuhay: pagkalipas ng mahabang panahon na walang galaw, mapupunta sa beneficiary (Phase 62).
⚠ A guardian can NOT see or move your money — they can only vote, and a majority is needed. Still, pick people who don't know each other well (e.g. a sibling, a work friend, a godparent) so collusion is hard.Ang guardian ay HINDI nakakakita o nakakagalaw ng pera mo — boto lang ang kaya niya, at kailangan ng karamihan. Pero pumili ng mga taong hindi magkakakilala nang husto (hal. kapatid, kaibigan sa trabaho, ninong) para mahirap silang magsabwatan.
WHERE IN THE CODESAAN SA CODE
- src/features/safety/rules.ts
- src/features/safety/guardians-card.tsx
- src/features/safety/recovery-link.ts
- src/features/wallet-app/unlock-screen.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 62
Public testnet: a link that doesn't changePublic testnet: hindi nagbabagong link
The first step before any mainnet: a testnet running for SEVERAL MONTHS, with many people and many PCs, and a link that doesn't change. Now: npm run testnet:home -- --domain example.com → your own Cloudflare tunnel named 'nel-testnet' with 2 hostnames (app and node).Ang unang hakbang bago ang anumang mainnet: isang testnet na tumatakbo nang ILANG BUWAN, may maraming tao at maraming PC, at may hindi nagbabagong link. Ngayon: npm run testnet:home -- --domain example.com → sariling Cloudflare tunnel na 'nel-testnet' na may 2 hostname (app at node).
- Quick tunnel (Phase 51): free with no account, but a new link on every run → the NelPay installed on phones is lost, and the link must be sent again.Quick tunnel (Phase 51): libre at walang account, pero bagong link bawat takbo → nawawala ang naka-install na NelPay sa phone, at kailangang ipadala ulit ang link.
- Named tunnel: needs a domain on Cloudflare and a one-time `cloudflared tunnel login`. One tunnel for the node (wss://node-testnet.…) and the app (https://nelpay-testnet.…) — ingress splits by hostname.Named tunnel: kailangan ng domain sa Cloudflare at isang beses na `cloudflared tunnel login`. Iisang tunnel para sa node (wss://node-testnet.…) at app (https://nelpay-testnet.…) — ang ingress ang naghahati ayon sa hostname.
- Only one subdomain level (nelpay-testnet.example.com, not nelpay.testnet.example.com) → covered by Cloudflare's free SSL certificate.Isang antas lang ang subdomain (nelpay-testnet.example.com, hindi nelpay.testnet.example.com) → sakop ng libreng SSL certificate ng Cloudflare.
- The router stays closed: the connection goes outward. Your existing DNS records aren't overwritten either.Hindi binubuksan ang router: palabas ang koneksyon. Hindi rin pinapatungan ang dati mong DNS record.
- After launch: a checkpoint (Phase 47) of a final block in params.ts → a new node can't be fooled by a fake history.Pagkatapos ilunsad: checkpoint (Phase 47) ng isang final na block sa params.ts → ang bagong node ay hindi malilinlang ng pekeng kasaysayan.
- Next on the roadmap: friends with their OWN nodes and validators (so you no longer hold V1–V4 alone), a bug bounty and external review, and a legal opinion — before even thinking about mainnet.Ang susunod sa roadmap: mga kaibigan na may SARILING node at validator (para hindi na ikaw lang ang may hawak ng V1–V4), bug bounty at external review, at legal na opinyon — bago pa man isipin ang mainnet.
⚠ It's still a testnet: NEL and nPHP have no real value, fake names and IDs only. Your PC must be on for it to run — once many friends run their own nodes, the chain won't stop when you turn your PC off.Testnet pa rin ito: walang tunay na halaga ang NEL at nPHP, pekeng pangalan at ID lang. Ang PC mo ay dapat bukas para tumakbo ito — kapag maraming kaibigan na ang may sariling node, hindi na titigil ang chain kapag pinatay mo ang PC.
WHERE IN THE CODESAAN SA CODE
- scripts/home-testnet.ts
- TESTNET.md
- src/features/chain/params.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 63
The web app on Vercel, the nodes on your PCWeb app sa Vercel, node sa PC
The web app is static pages + JavaScript (all signing and computing happens in the browser), so it can go on Vercel for free, with HTTPS and a link that doesn't change. The NODE can't: it must always be awake (WebSocket, chain on disk, a vote every ~5 s) — so it stays on your PC, with the tunnel.Ang web app ay static na pahina + JavaScript (lahat ng pirma at pagkalkula ay nasa browser), kaya pwede itong ilagay sa Vercel nang libre, may HTTPS at hindi nagbabagong link. Ang NODE ay hindi: kailangan nitong laging gising (WebSocket, chain sa disk, boto bawat ~5 s) — kaya nasa PC mo pa rin ito, kasama ang tunnel.
- Why the wallet isn't lost: what the browser saves (localStorage, the locked wallet) is tied to the ORIGIN (https://name.vercel.app). With a quick tunnel, a new origin every run → empty. On Vercel, always the same.Bakit hindi mawawala ang wallet: ang naka-save sa browser (localStorage, ang naka-lock na wallet) ay nakatali sa ORIGIN (https://pangalan.vercel.app). Sa quick tunnel, bagong origin bawat takbo → walang laman. Sa Vercel, iisa.
- The app remembers the last node (?node= in the link) → when the node's link changes, just send the NelPay link again.Naaalala ng app ang huling node (?node= sa link) → kapag nagbago ang link ng node, ipadala lang ulit ang NelPay link.
- Vercel: Import the GitHub repo → NEXT_PUBLIC_NEL_NETWORK=testnet → Deploy. Every git push → automatic deploy.Vercel: Import ang GitHub repo → NEXT_PUBLIC_NEL_NETWORK=testnet → Deploy. Bawat git push → kusang deploy.
- Safe: keys/ and data/ are ignored by git, so they never reach GitHub or Vercel. The whole git history was checked before pushing.Ligtas: ang keys/ at data/ ay naka-ignore sa git, kaya hindi kailanman napupunta sa GitHub o Vercel. Sinuri ang buong kasaysayan ng git bago i-push.
- Every page that reads a file (whitepaper, threats) is static — read at build time, not per request (works on serverless).Lahat ng pahinang nagbabasa ng file (whitepaper, threats) ay static na — binabasa sa build, hindi sa bawat request (gumagana sa serverless).
- npm run testnet:home -- --app-url https://name.vercel.app → only the nodes run on your PC, and the Vercel link is shown.npm run testnet:home -- --app-url https://pangalan.vercel.app → node lang ang tatakbo sa PC, at ang Vercel link ang ipapakita.
⚠ Vercel's Hobby plan = non-commercial (fine for a learning testnet). And the app on Vercel is public: anyone can open it — so there must be no secrets in the code (there aren't: keys/ isn't included).Hobby plan ng Vercel = hindi pang-negosyo (ayos para sa learning testnet). At ang app sa Vercel ay pampubliko: kahit sino ay makakabukas nito — walang lihim dapat sa code (wala nga: ang keys/ ay hindi kasama).
WHERE IN THE CODESAAN SA CODE
- scripts/home-testnet.ts
- src/features/node-client/node-client.ts
- next.config.ts
- TESTNET.md
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 64
English / Taglish across the whole app (Phases 66–70)English / Taglish sa buong app (Phases 66–70)
Every page has a 🌐 EN | TL switch (English by default, your choice is remembered). NelPay, the public pages, the lab, the 65 lessons and the chain's errors are now in both languages. The chain itself didn't change: it still answers in Taglish — the APP translates.May 🌐 EN | TL na switch sa bawat pahina (English ang default, naaalala ang pinili). Ang NelPay, ang mga pampublikong pahina, ang lab, ang 65 aralin, at ang mga error ng chain ay nasa dalawang wika na. Ang chain mismo ay hindi binago: Taglish pa rin ang sagot nito — ang APP ang nagsasalin.
- No 'flash' of the wrong language: a tiny script in <head> reads the chosen language BEFORE the page appears (per the Next.js guide on 'preventing flash'), with <html suppressHydrationWarning>.Walang 'kislap' ng maling wika: isang maliit na script sa <head> ang nagbabasa ng napiling wika BAGO lumabas ang pahina (gaya ng gabay ng Next.js sa 'preventing flash'), at <html suppressHydrationWarning>.
- Two ways: useT() → t('English', 'Taglish') in client components; <T en tl /> anywhere — both are in the HTML and CSS picks one (so it works in server components like /learn too).Dalawang paraan: useT() → t('English', 'Taglish') sa mga client component; <T en tl /> kahit saan — parehong nasa HTML, CSS ang pumipili (kaya gumagana kahit sa server component gaya ng /learn).
- Lessons: a separate lessons-en.ts keyed by id. A test fails if a lesson has no English or a different number of points.Ang mga aralin: hiwalay na lessons-en.ts na naka-key sa id. May test: walang aralin na walang English, at pareho ang bilang ng points.
- Chain errors (e.g. 'Kulang ang NEL (meron 0.50)') are translated by translateError with a table of [Taglish, English] pairs using {} for the changing parts. A test READS the source code: a new error without English makes it fail.Ang mga error ng chain (hal. 'Kulang ang NEL (meron 0.50)') ay isinasalin ng translateError gamit ang talaan ng [Taglish, English] na may {} para sa nagbabagong bahagi. May test na BINABASA ang source code: kapag may bagong error na walang English, babagsak ito.
- Not translated (on purpose): the operator's terminal logs and commands, and data written on chain (e.g. a scam report's reason) — those are only displayed in English.Hindi isinalin (sinadya): ang log at mga command ng operator sa terminal, at ang data na nakasulat sa chain (hal. dahilan ng scam report) — ipinapakita lang sa English.
WHERE IN THE CODESAAN SA CODE
- src/features/i18n/lang.ts
- src/features/i18n/t.tsx
- src/features/i18n/errors.ts
- src/features/learn/lessons-en.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 65
Code review (Phase 71): 10 holes fixed before friends joinCode review (Phase 71): 10 butas na naayos bago ang mga kaibigan
A separate reviewer (/code-review) went through all of src/features. It found 10 holes — 5 serious. Each now has a test that replays the exact attack, which must be ✗ now.Sinuri ang buong src/features ng hiwalay na reviewer (/code-review). 10 butas ang nakita — 5 ang seryoso. Bawat isa ay may test na eksaktong ginagaya ang atake, at dapat ✗ na ito ngayon.
- #1 Anyone on the internet could crash a node: an operator token made of 'é' (2 bytes per letter) made timingSafeEqual throw. Fix: compare BYTE lengths, and an error in one message no longer brings down the whole node.#1 Kahit sino sa internet ay kayang pabagsakin ang node: ang operator token na gawa sa 'é' (2 bytes bawat letra) ay nagpapatapon ng error sa timingSafeEqual. Ayos: ihambing ang haba ng BYTES, at ang anumang error sa isang mensahe ay hindi na nagpapabagsak sa buong node.
- #2 The chain could stop: the mempool was checked on a different basis than the block (no 'start of block' like activating a new key). Fix: one startBlock() for both, and the mempool is rechecked before proposing.#2 Pwedeng huminto ang chain: ang mempool ay sinusuri sa ibang batayan kaysa sa block (walang 'simula ng block' gaya ng pag-activate ng bagong key). Ayos: iisang startBlock() para sa dalawa, at muling sinusuri ang mempool bago mag-propose.
- #3 Slashing could be escaped by unstaking at once. Fix: the validator's record stays (including jailed), and NEL still unbonding is burned −50% too — like Cosmos.#3 Natatakasan ang slashing sa pag-unstake agad. Ayos: nananatili ang talaan ng validator (pati ang jailed), at ang NEL na pabalik pa (unbonding) ay nasusunog din nang −50% — gaya ng Cosmos.
- #4 Approvals from removed guardians still counted. #8 Duplicate guardians → no recovery possible. Fix: only current guardians count, and duplicates are refused.#4 Nabibilang ang apruba ng inalis nang guardian. #8 Dobleng guardian → hindi na mare-recover. Ayos: kasalukuyang guardians lang ang bilang, at bawal ang doble.
- #5 One signature for 2 different txs (because of '|' in what's signed). Fix: '|feePhp:' is not allowed in data — all old txs still work.#5 Iisang pirma para sa 2 magkaibang tx (dahil sa '|' sa pinipirmahan). Ayos: bawal ang '|feePhp:' sa data — gumagana pa rin ang lahat ng lumang tx.
- #6 A revoked fake person still counted for the reward · #7 money arriving after death could be spent by whoever holds the key · #9 a ₱0 reserve couldn't be reported · #10 one broken court tx crashed every node. All fixed.#6 Ang binawing pekeng tao ay bilang pa rin sa reward · #7 ang perang dumating sa pumanaw ay nagagastos ng may susi · #9 hindi maiulat ang ₱0 na reserba · #10 isang sirang court tx ay bumabagsak sa lahat ng node. Lahat ay naayos.
- Also checked: the real testnet chain (4,521 blocks) is still valid under the new rules; and a real node no longer crashes on a token with 'é'.Sinuri rin: ang tunay na testnet chain (4,521 block) ay valid pa rin sa bagong patakaran; at ang tunay na node ay hindi na bumabagsak sa token na may 'é'.
⚠ A reviewer is no substitute for an external audit — and a self-review always misses things. Repeat the review before every big step (e.g. inviting friends, mainnet).Ang reviewer ay hindi kapalit ng external audit — at ang sariling review ay laging may hindi nakikita. Ulitin ang review bago ang bawat malaking hakbang (hal. pag-imbita ng mga kaibigan, mainnet).
WHERE IN THE CODESAAN SA CODE
- src/features/chain/review-fixes.test.ts
- src/features/inbox/operator-token.ts
- src/features/chain/state.ts
- src/features/consensus/slashing.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 66
Spiteful reports (Phase 72): a deposit, close people only, no freezeUlat na may galit (Phase 72): deposito, malalapit lang, walang freeze
Question: what if someone who hates you recruits an accomplice and you're both reported as 'deceased'? Before: your wallet froze at once, and any 2 people could do it. Now: 4 barriers — so a false report is a nuisance, not theft.Tanong: paano kung may galit sa iyo, nag-recruit ng kasabwat, at sabay kayong iniulat na 'pumanaw'? Dati: naka-freeze agad ang wallet mo, at kahit sinong 2 tao ay pwede. Ngayon: 4 na harang — kaya ang maling ulat ay abala lang, hindi pagnanakaw.
- 🧑🤝🧑 ONLY your guardians or the people who vouched for you can report you. Strangers (even 100 accomplices with Soul IDs) are ✗. If you have no guardians or vouchers: only time (missing) decides.🧑🤝🧑 Ang guardians mo o ang mga nag-vouch sa iyo LANG ang pwedeng mag-ulat. Ang hindi kakilala (kahit 100 kasabwat na may Soul ID) ay ✗. Kapag wala kang guardians o nag-vouch: ang panahon lang (nawawala) ang huhusga.
- 💸 Every report needs a deposit (testnet 1 NEL, mainnet 5 NEL). You turn out to be alive → the reporters' deposits go TO YOU (compensation) + a strike for them. A correct report, or 'lost in danger' and back → it returns to them.💸 May deposito (testnet 1 NEL, mainnet 5 NEL) ang bawat ulat. Buhay ka pala → SA IYO ang deposito ng mga nag-ulat (bayad-pinsala) + strike sa kanila. Tama ang ulat, o 'nawala sa panganib' na nakabalik → babalik sa kanila.
- 🔓 The grace period for community, danger and missing reports is NOT frozen. Any payment or tap counts as 'I'm still alive'. Only the PSA (with a death certificate) freezes.🔓 Ang palugit ng komunidad, panganib at nawawala ay HINDI naka-freeze. Ang anumang padala o pindot ay 'buhay pa ako' na. Ang PSA lang (may death certificate) ang nagfi-freeze.
- ⏳ A longer grace period: mainnet 90 days (testnet 7 days) — enough to come back from a hospital or from abroad. The PSA stays at 30 days.⏳ Mas mahabang palugit: mainnet 90 araw (testnet 7 araw) — sapat para makabalik mula sa ospital o abroad. Ang PSA ay 30 araw pa rin.
- 🔔 Guardians and vouchers see an alert in NelPay when someone they protect is reported — so they can tell you even if you don't open the app.🔔 May babala sa NelPay ng guardians at nag-vouch kapag iniulat ang binabantayan nila — para masabihan ka nila kahit hindi mo binubuksan ang app.
- The deposit is held by the chain while the report is open — still part of the supply (nelSupply). The rules fingerprint changed too (hard fork): all nodes must update together.Ang deposito ay hawak ng chain habang bukas ang ulat — bahagi pa rin ng supply (nelSupply). Binago rin ang fingerprint ng patakaran (hard fork): sabay dapat i-update ang lahat ng node.
⚠ This doesn't stop a spiteful guardian. Choose guardians you trust — and if you fall out, replace them (safety-set).Hindi nito napipigilan ang galit na guardian mismo. Pumili ng guardians na pinagkakatiwalaan mo — at kung may away, palitan sila (safety-set).
WHERE IN THE CODESAAN SA CODE
- src/features/life/rules.ts
- src/features/life/schedule.ts
- src/features/inheritance/rules.ts
- src/features/life/life.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 67
One list of votes (Phase 73): why 'each node's own copy' doesn't workIisang listahan ng boto (Phase 73): bakit hindi pwedeng 'kanya-kanyang kopya'
Before building phone validators, a silent bug turned up: the reward was split among the votes each node RECEIVED — but every node receives a different set (your vote reached V1 but was late at V3). So once a validator with a Soul ID votes, balances start to differ between nodes, and nobody would notice.Bago gawing phone validator, nakita ang tahimik na bug: ang reward ay hinahati sa mga botong NATANGGAP ng bawat node — pero magkakaiba ang natatanggap ng bawat isa (dumating ang boto mo sa V1 pero huli sa V3). Kaya kapag may validator na may Soul ID na bumoto, magkakaiba na ang balance sa bawat node, at walang makakapansin.
- Why votes aren't in the hash: a vote is a SIGNATURE of the hash — you can't sign your own signature. So votes are always just 'attached' to a block, and differ per node.Bakit hindi kasama ang boto sa hash: ang boto ay PIRMA sa hash — hindi mo mapipirmahan ang sariling pirma. Kaya ang boto ay laging 'nakadikit' lang sa block, at iba-iba sa bawat node.
- The fix (like CometBFT's LastCommit): the NEXT block carries 'lastVotes' — the votes for the previous block, chosen by the proposer, and INCLUDED in the hash. That is the official list → the same on every node.Ayos (gaya ng LastCommit ng CometBFT): ang SUSUNOD na block ay may 'lastVotes' — ang mga boto para sa naunang block, pinili ng proposer, at KASAMA sa hash. Iyon ang opisyal na listahan → iisa sa lahat ng node.
- So the reward for block N is paid in block N+1. The fees of N are held by the chain (lastCommit) meanwhile — still part of the supply, nothing lost.Kaya ang reward ng block N ay ibinibigay sa block N+1. Ang fees ng N ay hawak muna ng chain (lastCommit) — bahagi pa rin ng supply, walang nawawala.
- Every vote in lastVotes is checked: a real signature, drawn for the committee (VRF), no duplicates. Change lastVotes → the hash breaks.Bawat boto sa lastVotes ay sinusuri: tunay na pirma, nabunot sa komite (VRF), walang doble. Binago ang lastVotes → sira ang hash.
- Old blocks (without lastVotes) are still checked the old way → the whole old chain still opens. Hard fork: a new rules fingerprint.Ang mga lumang block (walang lastVotes) ay sinusuri pa rin sa dating paraan → nabubuksan ang buong lumang chain. Hard fork: bagong fingerprint ng patakaran.
- This is also the foundation for what's next: Online/Offline (Phase 74) and validators on phones (Phase 75) — they need one shared list of 'who voted' to know who has been gone for long.Ito rin ang pundasyon ng susunod: Online/Offline (Phase 74) at validator sa phone (Phase 75) — kailangan ng iisang listahan ng 'sino ang bumoto' para malaman kung sino ang matagal nang wala.
⚠ The proposer chooses which votes to include — so it can leave out other people's votes (censorship). CometBFT gives the proposer a bonus for including more votes; we'll add that once there are many validators.Ang proposer ang pumipili kung aling boto ang isasama — kaya niyang hindi isama ang boto ng iba (censorship). Sa CometBFT, may dagdag na gantimpala ang proposer na mas maraming boto ang isinama; idadagdag natin iyon kapag marami nang validator.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/last-commit.test.ts
- src/features/consensus/votes.ts
- src/features/chain/state.ts
- src/features/chain/block.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 68
⛏️ Online / Offline (Phase 74): why the testnet stopped at #6360⛏️ Online / Offline (Phase 74): bakit huminto ang testnet sa #6360
This really happened: at block #6360 a staked Soul ID's welcome lock ended → it became a candidate. Now 6 candidates needed 5 votes (> 2/3) — but only 4 had a running node. So the chain stopped (on purpose: stopping is safer than being wrong). The fix: only validators that said ⛏️ ON are candidates.Totoong nangyari: sa block #6360, natapos ang welcome lock ng isang Soul ID na naka-stake → naging kandidato. 6 na ang kandidato, kailangan ng 5 boto (> 2/3) — pero 4 lang ang may tumatakbong node. Kaya huminto ang chain (sinadya: mas ligtas huminto kaysa magkamali). Ayos: kandidato lang ang nagsabing ⛏️ ON.
- ⛏️ ON / ⏸ OFF = 1 tx from the wallet (NelPay → ⛏️ Validator). OFF → not drawn → can't stop the chain. Like Algorand's 'participation'.⛏️ ON / ⏸ OFF = 1 tx mula sa wallet (NelPay → ⛏️ Validator). Naka-OFF → hindi binubunot → hindi mapapahinto ang chain. Gaya ng 'participation' ng Algorand.
- Automatic OFF: ON but missing from lastVotes for ≥ 20 expected draws (testnet: ≥ ~10 min) → OFF. No penalty — you just don't earn. Based on lastVotes (Phase 73), so every node makes the same decision.Kusang OFF: naka-ON pero hindi lumalabas sa lastVotes nang ≥ 20 inaasahang bunot (testnet: ≥ ~10 min) → OFF. Walang multa — hindi ka lang kikita. Batay sa lastVotes (Phase 73) kaya iisa ang desisyon sa lahat ng node.
- A smaller chance of being drawn (e.g. 1,000 out of 1 million) → a longer wait before OFF, so plain bad luck isn't punished.Mas maliit ang tsansang mabunot (hal. 1,000 sa 1 milyon) → mas mahabang hintay bago OFF, para hindi maparusahan ang malas lang.
- Caught in testing: someone who is ON WITHOUT a node (careless or on purpose) can stop a small chain — and the automatic OFF needs blocks. The fix: a FALLBACK ROUND — after 3 rounds with no block, only those who REALLY voted recently (per lastVotes) are drawn. The chain keeps going (slower) until the absent ones turn OFF by themselves.Nahuli sa pagsubok: ang naka-ON na WALANG node (pabaya o sinadya) ay kayang pahintuin ang maliit na chain — at ang kusang OFF ay nangangailangan ng mga block. Ayos: FALLBACK ROUND — kapag 3 round nang walang block, ang TALAGANG bumoto kamakailan lang (ayon sa lastVotes) ang binubunot. Tuloy ang chain (mas mabagal), hanggang kusang OFF ang mga wala.
- A hard fork with a start height: on testnet, from block #6360 (where it stopped). Old blocks are still checked the old way.Hard fork na may simula: sa testnet, simula sa block #6360 (kung saan huminto). Ang mga lumang block ay sinusuri pa rin sa dating paraan.
- This is the foundation for phone validators (Phase 75): a phone that is closed no longer slows the chain down.Ito ang pundasyon ng validator sa phone (Phase 75): ang phone na naka-sara ay hindi na magpapabagal ng chain.
⚠ If more than 1/3 of the ON validators vanish at once (e.g. a brownout in one area), the chain still stops until some come back — the automatic OFF needs blocks. That's why many validators in different places matter.Kapag sabay-sabay na nawala ang higit 1/3 ng naka-ON (hal. brownout sa iisang lugar), hihinto pa rin ang chain hanggang may bumalik — ang kusang OFF ay nangangailangan ng mga block. Kaya mahalaga ang maraming validator sa magkakaibang lugar.
WHERE IN THE CODESAAN SA CODE
- src/features/consensus/online.ts
- src/features/consensus/committee.ts
- src/features/consensus/online.test.ts
- src/features/validator/validator-card.tsx
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 69
Fast sync and the divergence it caught (Phase 75a)Mabilis na sync at ang nahuling paghihiwalay (Phase 75a)
A validator on a phone needs to read the chain fast. Measured: ~90% of the 2+ minutes is checking VRFs and signatures. The fix (like Bitcoin Core's assumevalid): old blocks up to a checkpoint in the code skip signature checks — as long as the block hash AND the fingerprint of the WHOLE state match. While doing this, a real divergence between the 4 nodes was caught.Para sa validator sa phone, kailangang mabilis ang pagbasa ng chain. Sinukat: ~90% ng 2+ minuto ay ang pagsusuri ng VRF at pirma. Ayos (gaya ng assumevalid ng Bitcoin Core): ang mga lumang block hanggang sa isang checkpoint sa code ay hindi na sinusuri ang pirma — basta tugma ang hash ng block AT ang fingerprint ng BUONG state. Habang ginagawa ito, nahuli ang totoong paghihiwalay ng 4 na node.
- State fingerprint (stateHash): one hash of every balance, stake, Soul ID, life record… It must be the same on every node with the same chain.State fingerprint (stateHash): iisang hash ng lahat ng balance, stake, Soul ID, buhay… Pareho dapat sa lahat ng node na may parehong chain.
- Caught: at testnet block #6000 the 4 nodes had the same block hash — but DIFFERENT states. Old blocks paid rewards by each node's own copy of the votes (the Phase 73 bug): 212.70 vs 201.00 NEL created on different nodes.Nahuli: sa block #6000 ng testnet, iisa ang hash ng block sa 4 na node — pero MAGKAKAIBA ang state. Ang reward ng mga lumang block ay ayon sa sariling kopya ng boto (ang bug ng Phase 73): 212.70 vs 201.00 NEL ang nalikha sa magkaibang node.
- The fix (hard fork): blocks without lastVotes pay no validator reward → the 4 nodes now have one state, and the whole chain (6,443 blocks) is still valid.Ayos (hard fork): ang mga block na walang lastVotes ay walang validator reward → iisa na ang state sa 4 na node, at valid pa rin ang buong chain (6,443 block).
- Assume-valid: block hash at the checkpoint matches → fast replay (no signatures/VRF) → fingerprint matches? Yes → continue. No → full check. A fake signature in an old block changes the hash → always caught.Assume-valid: block hash sa checkpoint tugma → mabilis na replay (walang pirma/VRF) → fingerprint tugma? Oo → tuloy. Hindi → buong pagsusuri. Ang pekeng pirma sa lumang block ay nagpapalit ng hash → laging nahuhuli.
- Result on testnet: opening a node went from ~150 s → ~28 s. This is the basis for the browser validator (Phase 75b).Resulta sa testnet: pagbukas ng node mula ~150 s → ~28 s. Ito ang batayan ng validator sa browser (Phase 75b).
⚠ The checkpoint is trusted because it's in the code — so a person must review it before a release (like Bitcoin Core). Never accept a checkpoint that only came from another node.Ang checkpoint ay pinagkakatiwalaan dahil nasa code — kaya dapat itong suriin ng tao bago i-release (gaya ng Bitcoin Core). Huwag tanggapin ang checkpoint na galing lang sa ibang node.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/state-hash.ts
- src/features/wallet/assume-valid.ts
- src/features/chain/snapshot.ts
- src/features/chain/assume-valid.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 70
📱 A validator on your phone (Phase 75b): NelPay itself is the node📱 Validator sa phone (Phase 75b): ang NelPay mismo ang node
No server, no terminal: NelPay → ⛏️ Validator → 'Start voting from this device'. The whole node (node.ts) runs in a browser Web Worker, connects to the operator's node with the same encrypted handshake nodes use, and votes while the app is open. In the lab: the phone earned 0.50 NEL.Walang server, walang terminal: NelPay → ⛏️ Validator → '⛏️ Simulan ang pagboto mula rito'. Ang buong node (node.ts) ay tumatakbo sa Web Worker ng browser, kumokonekta sa node ng operator gamit ang parehong naka-encrypt na handshake ng mga node, at bumoboto habang bukas ang app. Sa lab: kumita ang phone ng 0.50 NEL.
- Web Worker: the heavy work (reading and checking the chain) runs apart from the screen → the app doesn't freeze.Web Worker: hiwalay sa screen ang mabigat na trabaho (pagbasa at pagsuri ng chain) → hindi nagfi-freeze ang app.
- IndexedDB: blocks are saved in the browser → next time only new ones are downloaded. Fast checking thanks to assume-valid (Phase 75a).IndexedDB: naka-save ang mga block sa browser → sa susunod, ang bago lang ang dina-download. Mabilis na pagsuri dahil sa assume-valid (Phase 75a).
- Device key: derived from the wallet + a random salt that stays on the device → different on every phone → it can never double-vote in two places. Registered and turned ON automatically (2 txs).Key ng device: galing sa wallet + random na asin na nasa device lang → iba sa bawat phone → hindi makakaboto nang doble sa dalawang lugar. Kusang nire-register at ini-ON (2 tx).
- Web Locks: only one tab votes. Wake Lock: the screen stays awake while running. Close the app → the chain turns you OFF by itself (Phase 74), no penalty.Web Locks: isang tab lang ang bumoboto. Wake Lock: gising ang screen habang tumatakbo. Isinara ang app → kusang OFF ng chain (Phase 74), walang multa.
- Caught in testing: the phone's vote always arrived AFTER the block was already final (3 votes) → dropped → no earnings. The fix (like CometBFT's timeout_commit): late votes for the last block are still accepted → the next proposer includes them in lastVotes.Nahuli sa pagsubok: ang boto ng phone ay laging dumarating PAGKATAPOS maging final ang block (3 boto na) → itinatapon → walang kita. Ayos (gaya ng timeout_commit ng CometBFT): tinatanggap pa ang nahuling boto para sa huling block → isinasama ng susunod na proposer sa lastVotes.
⚠ Not every vote from the phone gets included yet (1 of 7 in the first test) — a phone is slower than nodes on a PC. It works, but will be improved. And the phone only votes while NelPay is OPEN.Hindi pa lahat ng boto ng phone ay nasasama (1 sa 7 sa unang pagsubok) — mas mabagal ang phone kaysa sa mga node sa PC. Gumagana na, pero pagbubutihin pa. At ang phone ay bumoboto lang habang BUKAS ang NelPay.
WHERE IN THE CODESAAN SA CODE
- src/features/browser-validator/worker.ts
- src/features/browser-validator/peer-link.ts
- src/features/browser-validator/device-validator.tsx
- src/features/network/late-vote.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 71
📵 Lost or stolen phone (Phase 76): replace the key, same address📵 Nawala o nanakaw ang phone (Phase 76): palitan ang key, parehong address
A backup brings the wallet back on a new phone — but the OLD phone still holds the same key, locked only by a 6-digit PIN (just 1 million possibilities — guessable offline if the storage is copied). So: 🔑 Keys / Backup → 📵 → PIN → 🔄 Replace the key.Ang backup ay nagbabalik ng wallet sa bagong phone — pero ang LUMANG phone ay may hawak pa rin ng parehong key, naka-lock lang sa 6-digit PIN (1 milyong posibilidad lang — kayang hulaan offline kapag nakopya ang storage). Kaya: 🔑 Susi / Backup → 📵 → PIN → 🔄 Palitan ang key.
- A new key for the SAME address (key-rotate) → same money, Soul ID and stake. The old phone's key: 'Old key' — rejected by the chain.Bagong key para sa PAREHONG address (key-rotate) → parehong pera, Soul ID at stake. Ang key sa lumang phone: 'Lumang key' — tinatanggihan ng chain.
- The new key is saved first (encrypted with the PIN) BEFORE the tx is sent → even if the app closes, it isn't lost. It's switched in automatically once the chain recognizes it.Naka-save muna ang bagong key (naka-encrypt sa PIN) BAGO ipadala ang tx → kahit maisara ang app, hindi nawawala. Kusang ipinapalit kapag kinilala na ng chain.
- No guardians → immediate. With guardians → a waiting period (protection when it's the thief replacing it). To make it immediate: send the link to ALL guardians.Walang guardians → agad. May guardians → may palugit (proteksyon kapag ang magnanakaw ang nagpapalit). Para agad: ipadala ang link sa LAHAT ng guardians.
- A weakness we tested: during the wait, the thief can also replace the key with the old one. The app warns ('someone else replaced it') — guardians are the final answer: once enough approve, the thief's replacement is wiped.Kahinaan na sinubukan: habang palugit, kaya ring magpalit ng magnanakaw gamit ang lumang key. Ang app ay nagbababala ('may ibang nagpalit') — ang guardians ang huling sagot: kapag sapat ang pumayag, nabubura ang pagpalit ng magnanakaw.
- Afterwards: make a NEW backup (the old one is for the old key). A validator? ⛏️ Start on the new phone → a new device key.Pagkatapos: gumawa ng BAGONG backup (ang luma ay para sa lumang key). Validator? ⛏️ Simulan sa bagong phone → bagong key ng device.
⚠ The best protection comes BEFORE anything is lost: a backup (on paper or in a password manager) + 2–3 guardians + a beneficiary. Without all of these, a lost key is lost money — like lost cash.Ang pinakamahusay na proteksyon ay BAGO pa mawala: backup (sa papel o password manager) + 2–3 guardians + beneficiary. Kung wala ang lahat ng ito, ang nawalang key ay nawalang pera — gaya ng nawalang cash.
WHERE IN THE CODESAAN SA CODE
- src/features/wallet-backup/lost-phone-card.tsx
- src/features/wallet-app/next-key.ts
- src/features/wallet-app/next-key.test.ts
- src/features/safety/rules.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 72
Correct counting and fast reopening (Phase 77)Tamang bilang at mabilis na pagbukas (Phase 77)
In Phase 75b, only '1 of 7' of the phone's votes seemed to get included. Measured again: the count was WRONG — the phone also counted rounds where it was NOT drawn. The right count: 23 real votes in 2 minutes, 23 on chain (100%). Measure before fixing.Sa Phase 75b, '1 sa 7' lang daw ang boto ng phone na nasasama. Sinukat ulit: MALI ang bilang — binibilang ng phone pati ang round na HINDI siya nabunot. Ang tamang bilang: 23 tunay na boto sa 2 minuto, 23 ang nasa chain (100%). Sukatin muna bago ayusin.
- Only real votes are counted now (signed and sent), not 'checked whether I was drawn'.Ang tunay na boto lang ang binibilang na ngayon (ang pinirmahan at ipinadala), hindi ang 'tiningnan kung nabunot'.
- The CHECKED state is also saved in IndexedDB (every 50 blocks). Next time you open it: no replay — only new blocks are checked.Naka-save na rin ang NASURING state sa IndexedDB (bawat 50 block). Sa susunod na bukas: walang replay — ang mga bagong block lang ang sinusuri.
- The saved state doesn't match the block (e.g. the chain changed)? → a full read again, as before (always correct).Hindi tugma ang naka-save na state sa block (hal. nagbago ang chain)? → buong pagbasa ulit, gaya ng dati (laging tama).
- npm run checkpoint → now also prints assumeValid (block hash + state fingerprint from a FULL check) for the next release → fewer blocks need a full check.npm run checkpoint → nagbibigay na rin ng assumeValid (block hash + state fingerprint mula sa BUONG pagsusuri) para sa susunod na release → mas kaunting block ang kailangang suriin nang buo.
⚠ The saved state is trusted because this device wrote it (like the wallet). If the phone already has malware, there are bigger problems — use a passkey and guardians.Ang naka-save na state ay pinagkakatiwalaan dahil ang sariling device ang sumulat nito (gaya ng wallet). Kapag may malware na ang phone, may mas malaking problema na — gumamit ng passkey at guardians.
WHERE IN THE CODESAAN SA CODE
- src/features/browser-validator/worker.ts
- src/features/browser-validator/block-cache.ts
- scripts/checkpoint.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 73
How many validators? (Phase 78)Ilan ang validator? (Phase 78)
/status now shows the whole picture: how many are in the draw, how many are staked but ⏸ OFF, and a list of validators with a Soul ID — Soul ID # only, no addresses.Ang /status ay nagpapakita na ng buong larawan: ilan ang nasa bunot, ilan ang naka-stake pero ⏸ OFF, at isang listahan ng mga validator na may Soul ID — Soul ID # lang, walang address.
- Candidates = in the draw now (including bootstrap V1–V4 while fewer than 4 have a Soul ID).Kandidato = nasa bunot ngayon (kasama ang bootstrap V1–V4 habang wala pang 4 na may Soul ID).
- ⏸ Staked but OFF = has a stake and a Soul ID, but hasn't pressed ⛏️ ON yet (or turned OFF by itself for not voting).⏸ Naka-stake pero OFF = may stake at Soul ID, pero hindi pa pinipindot ang ⛏️ ON (o kusang naging OFF dahil walang boto).
- 'Voted' comes from the official list in each block (lastVotes, Phase 73) — the same on every node, not each node's own copy.Ang 'bumoto' ay mula sa opisyal na listahan sa bawat block (lastVotes, Phase 73) — pareho sa lahat ng node, hindi sa sariling kopya.
- First look at the testnet: 4 candidates (bootstrap only) · 3 staked but OFF (Soul #1, #4, #5).Unang tingin sa testnet: 4 na kandidato (bootstrap lang) · 3 naka-stake pero OFF (Soul #1, #4, #5).
WHERE IN THE CODESAAN SA CODE
- src/features/status/health.ts
- src/features/status/status-view.tsx
- src/features/status/health.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 74
State sync (Phase 79): the phone no longer starts from #0State sync (Phase 79): hindi na mula #0 ang phone
In 50 years there will be ~315 million blocks (5 s each) — a phone can't handle that. But a phone doesn't need the whole history: just the STATE (balances, Soul IDs, stakes) and the new blocks. So the phone asks for the block and state at a checkpoint, and checks them against the code.Sa 50 taon, ~315 milyong block (5 s bawat isa) — hindi iyon kaya ng phone. Pero hindi kailangan ng phone ang buong kasaysayan: ang STATE lang (balance, Soul ID, stake) at ang mga bagong block. Kaya ang phone ay humihingi ng block at state sa checkpoint, at sinusuri laban sa code.
- The node keeps the state at the assumeValid checkpoint (#8000 on testnet) while opening the chain → hands it out when asked (get-checkpoint).Ang node ay nagtatabi ng state sa assumeValid na checkpoint (#8000 sa testnet) habang binubuksan ang chain → ibinibigay kapag hiniling (get-checkpoint).
- The phone only accepts it when the block hash AND the fingerprint of the whole state match the CODE. The node faked a balance? Different fingerprint → rejected → full download.Tinatanggap lang ng phone kapag tugma sa CODE ang block hash AT ang fingerprint ng buong state. Dinaya ng node ang balance? Iba ang fingerprint → tinatanggihan → buong download.
- Then only blocks AFTER the checkpoint are downloaded and fully checked. On the real testnet: only 656 blocks (instead of 8,657), and the SAME state as the whole chain.Pagkatapos: ang mga block lang PAGKATAPOS ng checkpoint ang dina-download at sinusuri nang buo. Sa totoong testnet: 656 block lang (imbes na 8,657), at PAREHONG state sa buong chain.
- The phone's chain is empty before the checkpoint — so the parts that walk the chain (history, syncing others, health) were fixed to skip the gaps.Walang laman ang chain bago ang checkpoint sa phone — kaya inayos ang mga bahaging umiikot sa chain (kasaysayan, sync sa iba, health) para lampasan ang mga butas.
- This isn't pruning for PC nodes yet (theirs is still complete) — that's next. And with very many people, the next step is stateless validation (like Ethereum).Hindi pa ito pruning para sa mga node sa PC (buo pa rin ang kanila) — susunod iyon. At sa malaking bilang ng tao, ang susunod na hakbang ay stateless validation (gaya ng Ethereum).
⚠ The checkpoint in the code must be reviewed by a person before every release (npm run checkpoint, on several nodes). The node only provides data — the CODE decides whether it's right.Ang checkpoint sa code ay dapat suriin ng tao bago ang bawat release (npm run checkpoint, sa ilang node). Ang node lang ang nagbibigay ng data — ang CODE ang nagpapasya kung tama.
WHERE IN THE CODESAAN SA CODE
- src/features/browser-validator/state-sync.ts
- src/features/network/state-sync.test.ts
- src/features/network/node.ts
- src/features/browser-validator/worker.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 75
State root and pruning (Phase 80): a phone can still cope after 50 yearsState root at pruning (Phase 80): kaya pa rin ng phone pagkalipas ng 50 taon
Two conditions keep a phone's work from growing over time: (1) there is always a fresh checkpoint, and (2) the phone doesn't keep every block. Now: a state fingerprint is in the header every 1,000 blocks, and the phone keeps only the last 1,000 blocks.Dalawang kondisyon para hindi lumaki ang trabaho ng phone habang tumatagal: (1) laging may bagong checkpoint, at (2) hindi itinatago ng phone ang lahat ng block. Ngayon: may fingerprint ng state sa header bawat 1,000 block, at ang huling 1,000 block lang ang hawak ng phone.
- State root: every 1,000 blocks (testnet, from #20000) the header carries the fingerprint of the state BEFORE the block. EVERY node checks it — a node with a different state can't accept the block → it shows immediately (no longer silent like Ana's reward).State root: bawat 1,000 block (testnet, simula #20000), ang header ay may fingerprint ng state BAGO ang block. Sinusuri ito ng LAHAT ng node — ang node na iba ang state ay hindi matatanggap ang block → kitang-kita agad (hindi na tahimik gaya ng reward ni Ana).
- Why 'before' and not 'after': the state after a block contains that block's own hash (lastCommit) → circular. So block R's root = the state after R−1.Bakit 'bago' at hindi 'pagkatapos': ang state pagkatapos ng block ay may hash na ng block mismo (lastCommit) → iikot. Kaya ang root ng block R = state pagkatapos ng R−1.
- npm run checkpoint: just reads the newest state root from a header (instant) → easy to move the phone's checkpoint every release.npm run checkpoint: binabasa na lang ang pinakabagong state root sa header (agad) → madaling itaas ang checkpoint ng phone sa bawat release.
- Pruning on the phone: only the last 1,000 blocks are kept (memory and IndexedDB); older ones' effects are already in the state. So however many days or years it runs, it doesn't grow.Pruning sa phone: ang huling 1,000 block lang ang hawak (memorya at IndexedDB); nasa state na ang epekto ng mas luma. Kaya kahit ilang araw o taon tumakbo, hindi lumalaki.
- An honest limit: a phone starting from nothing still needs a checkpoint in the CODE as the root of trust (like Ethereum's 'weak subjectivity'). And with millions of people, stateless validation is still needed.Tapat na hangganan: ang phone na walang hawak ay kailangan pa rin ng checkpoint sa CODE bilang ugat ng tiwala (gaya ng 'weak subjectivity' ng Ethereum). At sa milyon-milyong tao: stateless validation pa ang kailangan.
⚠ A hard fork with a start height: on testnet, block #20000. EVERY node must run the new code before then — otherwise old nodes stop at #20000.Hard fork na may simula: sa testnet, block #20000. Dapat naka-bagong code ang LAHAT ng node bago umabot doon — kung hindi, hihinto ang mga lumang node sa #20000.
WHERE IN THE CODESAAN SA CODE
- src/features/chain/state-root.ts
- src/features/chain/state-root.test.ts
- src/features/browser-validator/state-sync.ts
- scripts/checkpoint.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 76
Your share of the pool (Phase 81): see and withdraw liquidityAng hati mo sa pool (Phase 81): makita at mabawi ang liquidity
'Added liquidity −10 NEL + ₱100' is a deposit into the exchange pool — not lost, you own a SHARE. Before: no way to see or withdraw it in NelPay. Now: 💧 Your share of the pool → % of the pool, what you'd get now, and Withdraw 25% / 50% / All.Ang 'Added liquidity −10 NEL + ₱100' ay deposito sa exchange pool — hindi nawala, may HATI ka (shares). Dati: walang paraan para makita o mabawi ito sa NelPay. Ngayon: 💧 Ang hati mo sa pool → % ng pool, magkano kapag binawi ngayon, at Bawiin 25% / 50% / Lahat.
- Shares: your part of the pool. When withdrawn: (shares ÷ all shares) × what's in the pool — NEL and ₱.Shares: ang bahagi mo sa pool. Kapag binawi: (shares ÷ lahat ng shares) × ang laman ng pool — NEL at ₱.
- Already includes the 0.3% fee from everyone's swaps (left in the pool) — that's what liquidity providers earn.Kasama na ang 0.3% fee ng bawat palit ng iba (naiiwan sa pool) — iyon ang kita ng nagbigay ng liquidity.
- Impermanent loss: when the price moves, the mix of NEL and ₱ you get back is different. Sometimes simply holding would have been worth more.Impermanent loss: kapag gumalaw ang presyo, iba na ang timpla ng NEL at ₱ na babalik. Minsan mas malaki sana kung hinawakan mo lang.
- What's shown is exactly what you'd get (the chain's same formula — tested).Ang ipinapakita ay eksaktong pareho sa makukuha (parehong formula ng chain — may test).
⚠ The exact 'earned from fees' can't be shown: the chain records the MAXIMUM ₱ you allowed, not the exact amount used. So the current value is shown.Hindi maipakita nang eksakto ang 'kinita sa fees': ang naitatala ng chain ay ang PINAKAMATAAS na ₱ na pinayagan mo, hindi ang eksaktong nagamit. Kaya ang kasalukuyang halaga ang ipinapakita.
WHERE IN THE CODESAAN SA CODE
- src/features/nelpay/exchange-card.tsx
- src/features/exchange/amm.ts
- src/features/exchange/rules.ts
- src/features/exchange/exchange.test.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)
PHASE 77
Not relying on one server (Phase 82)Hindi umaasa sa iisang server (Phase 82)
A phone validator can't be called by other phones — so it needs a node as a meeting point. Before: just one node (the one in the link); if it went down, voting stopped. Now: it learns public nodes (get-peers) and switches to the next one when the connection drops.Ang phone validator ay hindi kayang tawagan ng ibang phone — kaya kailangan nito ng node na tagpuan. Dati: iisang node lang (ang nasa link); kapag na-down → huminto ang pagboto. Ngayon: natututo ito ng mga pampublikong node (get-peers) at lumilipat sa susunod kapag naputol.
- After connecting: 'get-peers' → it remembers the public nodes (e.g. a friend's node with its own link), up to 10, saved on the phone.Pagkakonekta: 'get-peers' → tinatandaan ang mga pampublikong node (hal. node ng kaibigan na may sariling link), hanggang 10, naka-save sa phone.
- Connection dropped? → the NEXT one on the list (not the same dead server). Tested: node 5101 was killed → it switched to 5104, and blocks kept coming.Naputol ang kausap? → ang SUSUNOD sa listahan (hindi ang iisang patay na server). Sinubukan: pinatay ang node 5101 → lumipat sa 5104, tuloy ang block.
- Safe: a node only relays. The phone still checks every block, and the checkpoint is checked against the code — so a bad node can't fool it.Ligtas: tagapasa lang ang node. Sinusuri pa rin ng phone ang bawat block, at ang checkpoint ay laban sa code — kaya hindi ito madadaya ng masamang node.
- On testnet/mainnet only public nodes are remembered (not localhost or private IPs). Localhost is allowed only in the lab.Sa testnet/mainnet, pampubliko lang ang tinatandaan (hindi localhost o pribadong IP). Sa lab lang pwede ang localhost.
- Also caught: after a drop, the wallet kept asking over a closed socket (console errors) — now requests are refused right away and the polling stops.Nahuli rin: kapag naputol, patuloy na nagtatanong ang wallet sa saradong socket (console error) — ngayon ay agad nang tinatanggihan at humihinto ang pagtatanong.
⚠ You only feel this once there are OTHER public nodes (friends with their own node and link). With just one server there's still only one place to go. Future: WebRTC so phones can talk directly.Mararamdaman lang ito kapag may IBANG pampublikong node (mga kaibigan na may sariling node at link). Kung iisa pa lang ang server, iisa pa rin ang mapupuntahan. Hinaharap: WebRTC para direktang mag-usap ang mga phone.
WHERE IN THE CODESAAN SA CODE
- src/features/browser-validator/known-nodes.ts
- src/features/browser-validator/worker.ts
- src/features/node-client/node-client.ts
READ (OFFICIAL DOCS)BASAHIN (OFFICIAL DOCS)