Kryon Network Docs
The fully decentralized, Zero-Knowledge invoice factoring and liquidity protocol on Soroban.
The Problem
Small to Medium Businesses (SMBs) consistently face crippling cash flow bottlenecks due to standard Net-30, Net-60, or Net-90 invoice payment terms.
Traditional factoring is heavily centralized, opaque, painfully slow, and predatory—charging exorbitant fees and requiring massive amounts of manual paperwork, invasive audits, and exposing proprietary client lists to third parties.
The Kryon Solution
Kryon brings invoice factoring entirely on-chain while preserving complete corporate privacy.
By leveraging cutting-edge Noir Zero-Knowledge (ZK) Proofs and EZKL Machine Learning Models (ZKML), businesses can tokenize open invoices trustlessly. Liquidity Providers supply capital to a decentralized Soroban Treasury, earning reliable yield as borrowers factor invoices instantly.
Comprehensive Architecture
1. Decoupled Proving
The client fetches OAuth data from the ERP. The Noir Backend generates an execution trace proving integrity, while the EZKL microservice runs a PyTorch model for risk assessment.
2. Trustless Execution
Soroban Smart Contracts receive ONLY the SNARK proofs, not the raw data. Soroban verifies the cryptography and releases the XLM from the Liquidity Pool instantly.
Zero-Knowledge Implementation (Animated)
1. Persistent ZK Identity
Proves a borrower holds a valid digital identity (KYC/AML) without leaking specific PII to the public ledger. Verified status is persisted globally across devices via a KV store.
2. Confidential Factoring (Noir)
Generates a Groth16 SNARK proving that an invoice from Stripe/ERPNext is digitally signed and valid, fully concealing the corporate client and trade margins.
3. ZKML Risk Model (EZKL)
A PyTorch Neural Network executes inside a Halo2 circuit. It evaluates default risk and generates a cryptographic proof that the exact, untampered AI model was used.
4. Proof of Solvency
Assures Liquidity Providers that the Soroban treasury is perfectly healthy. Proves Total Assets exceed Liabilities without exposing specific underlying loans.
With ZK vs. Without ZK
| Feature | Without Zero-Knowledge | With ZK (Kryon) | How ZK Improves It |
|---|---|---|---|
| Invoice Integrity | Upload raw invoices directly to smart contract. Exposes secrets. | Generates a Groth16/Halo2 SNARK off-chain. Submits only the proof. | Total Privacy: Competitors cannot see your corporate clients or pricing on the public blockchain. |
| Credit Risk Assessment | Manual human review or black-box centralized AI model. | PyTorch model executes inside a Halo2 circuit (ZKML). | Unbiased: Borrowers cryptographically verify they were evaluated fairly without human bias. |
| Identity & KYC | Upload passports/IDs to central databases (honeypots). | Localized ZK Identity Proof confirms compliance signatures. | Security: Eliminates data breach risks. Proves Age > 18 without touching actual data. |
| Factoring Speed | Weeks of legal paperwork and human underwriters. | Takes < 15 seconds to generate SNARK and submit to Soroban. | Hyper-efficiency: Math removes the need for human trust, enabling instant atomic settlement. |
Installation & Setup
To run the entire suite locally (Frontend, ZK Backend, and Smart Contracts), ensure you follow these instructions precisely.
Prerequisites
- Node.js v20.0.0+
- Rust 1.70.0+ (with
wasm32-unknown-unknown) - Soroban CLI v22.0.0+
- Python 3.10+
Phase 1: Deploy Soroban Contracts
cd kryon_contracts soroban contract build cargo test soroban contract deploy \ --wasm target/wasm32-unknown-unknown/release/kryon_escrow.wasm \ --source admin_wallet \ --network testnet
Phase 2: Next.js Frontend
cd frontend npm install cp .env.example .env.local # Required in .env.local: # NEXT_PUBLIC_SOROBAN_CONTRACT_ID="<YOUR_CONTRACT_ID>" # KV_REST_API_URL="<YOUR_KVDB_URL>" npm run dev
How Kryon Works
A seamless, trustless protocol turning unpaid invoices into instant liquidity.
1. Connect ERP
Borrower connects accounting software (QuickBooks/Stripe/ERPNext) to the protocol securely via OAuth. No manual document uploads.
2. ZK Proof Generation
A Zero-Knowledge cryptographic proof is generated, mathematically proving the invoice is valid without leaking your private client data to the public.
3. Smart Contract Execution
KryonEscrow validates the ZK Proof on the Stellar Network via Soroban. The smart contract acts as the decentralized judge.
4. Dynamic Price Oracle
The protocol queries a live CoinGecko API oracle to instantly convert the fiat invoice value (e.g., PHP, USD) into the exact, to-the-second equivalent amount of XLM.
5. Instant XLM Advance
KryonLiquidity releases exactly 90% of the live XLM converted value instantly into the borrower's Freighter Wallet from its massive >100k XLM testnet treasury. No waiting 60 days.
6. Invoice Paid & Yield
The Corporation pays the invoice on day 60. The remaining 10% is released to the borrower, minus a protocol fee distributed to LPs as yield.