Crypto that works for real businesses.
Near-zero fees. Real-time inventory. No complexity.
CoCo is a Substrate-based blockchain protocol purpose-built for real businesses. It creates a programmable economic layer where merchants can issue tokens, track inventory, manage digital rights, and accept payments β all without understanding blockchain. The system hides behind familiar tools: a barcode scanner, a dashboard, a POS terminal.
Any organization can issue custom programmable tokens β loyalty points, employee compensation, asset-backed credits, or micro-finance instruments β that can be exchanged across a unified ecosystem with near-zero fees (0% internal, 0.25% external vs. 2-5% card networks). The protocol extends this with a Product Rights Management (PRM) system: physical products are tokenized as NFTs carrying DRM flags that enable pay-as-you-go, lease-to-own, subscriptions, and microtransaction-based feature unlocks.
Barcode scanning, real-time inventory analysis, and POS integration provide the physical-world bridge. The goal is not to build a crypto platform β it's to build a better payment and inventory system that happens to run on a blockchain.
| Capability | CoCo | Traditional |
|---|---|---|
| Payment Fees (retail) | 0.25% | Visa/MC 2-5% |
| B2B / Supplier Payment | 0% internal | 2-3% card or $25 wire |
| Settlement Time | 6 seconds | 1-3 business days |
| Chargebacks | None | Costly & frequent |
| Programmable Tokens | Custom sub-tokens + smart contracts | Siloed loyalty programs |
| DRM Enforcement | On-chain lock/unlock/repossess | No enforcement mechanism |
| Micro-finance | PAYG, lease-to-own, subscriptions, rentals | Credit cards (2-3% fees) |
| Supply Chain + Inventory | Real-time, on-chain, auto-reorder from suppliers | Siloed, no cross-org data |
| Inter-Ecosystem Trade | 0% between any CoCo tokens | Visa/Mastercard 2-3% |
| Merchant Complexity | Scan barcode β done | Terminal contract, PCI audit, chargeback risk |
| Processor | Fee on $20 | Settlement |
|---|---|---|
| β CoCo | $0.05 | 6 seconds |
| Visa / Mastercard | $0.50 β $0.90 | 1-2 days |
| MercadoPago QR | $0.30 β $0.40 | Next day |
| MercadoPago Card | $0.80 β $1.00 | Next day |
| PayPal | $1.19 | Instant (holds apply) |
| Stripe | $0.88 | 1-2 days |
| Method | Fee on $1,000 | Settlement |
|---|---|---|
| β CoCo (internal) | $0.00 | 6 seconds |
| β CoCo (border crossing) | $2.50 | 6 seconds |
| Wire Transfer | $25 β $50 flat | 1-3 days |
| Corporate Credit Card | $20 β $30 (2-3%) | 1-2 days |
| Paper Check | $5 β $10 + float | 5-10 days |
| ACH / SEPA | ~$0.50 | 2-3 days |
0.25% border fee is still 10-24x cheaper than any card processor. Internal ecosystem movement is 0%. The only thing cheaper is cash β and cash doesn't give you inventory analytics, DRM enforcement, automated supplier ordering, or yield-bearing savings.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CoCo Blockchain (Substrate) β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Runtime (FRAME) β 3 Layers β β
β β β β
β β LAYER 1: ECONOMIC β¦ BRIDGE β β
β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββ β β
β β βpallet- β βpallet- β βpallet- β βpallet- β β β
β β βassets β βkyc β βrewards β βbridge π β β β
β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββ β β
β β β β
β β LAYER 2: PRODUCT RIGHTS MANAGEMENT β β
β β ββββββββββββββββββββ ββββββββββββββ ββββββββββββββββββββ β β
β β βpallet-product-nftβ βpallet-drm β βpallet- β β β
β β ββ
(digital twins) β β(enforce) β βmicrofinance β β β
β β ββββββββββββββββββββ ββββββββββββββ ββββββββββββββββββββ β β
β β β β
β β LAYER 3: PHYSICAL BRIDGE β¦ REALTIME INVENTORY β β
β β ββββββββββββ ββββββββββββ ββββββββββββ β β
β β βbarcode β βinventory β βPOS β β β
β β βscanner β βanalysis β βterminal β β β
β β ββββββββββββ ββββββββββββ ββββββββββββ β β
β β β β
β β System: ββββββββββββ ββββββββββββ ββββββββββββ ββββββββ β β
β β βbalances β βtimestamp β βsudo β βgrandpaβ β β
β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β Consensus: Aura (6s blocks) + Grandpa (fast finality) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
β β β
β ββββββββββββΌβββββββββββ β
β β Node.js Server β β
β β (REST API + WS) β β
β ββββββββββββ¬βββββββββββ β
β β β
β βββββββββββββββββββ βββββββββββββββββββββββββ β
β β Web Apps β β Mobile Apps β β
β β /login β β Android Scanner β β
β β /admin β β (Kotlin + ML Kit) β β
β β /dashboard β βββββββββββββββββββββββββ β
β β /marketplace β β
β β /onboarding β β
β βββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββ coco-substrate/ β Primary β Substrate blockchain β βββ node/ Node binary (CLI, RPC, chain spec) β βββ runtime/ All pallets configured β βββ pallets/ 11 custom pallets + pallet-contracts β βββ product-nft/ β Core β product NFT + DRM (v0.5) β β βββ kyc/ KYC provider network β β βββ rewards/ Yield distribution + staking β β βββ ... (7 more) β βββ contracts/ Example ink! smart contracts (PAYG, Lease, Escrow) β βββ scripts/ Build & run utilities β βββ docs/ Technical documentation βββ barcode/ Scanner app + POS server β βββ app/ Android app (Kotlin) β βββ Server/ Node.js backend (Express, SQLite)
The core pallet managing the full lifecycle of physical products as digital twins (NFTs). 17 extrinsics (0-16) + 8 DRM extrinsics (17-24), 14 storage maps, 26 events, 43 error codes.
| # | Extrinsic | Call Index | Access | Description |
|---|---|---|---|---|
| 0 | register_company | 0 | KYC user | Register a brand/company |
| 1 | deactivate_company | 1 | Owner | Deactivate own company |
| 2 | activate_company | 2 | Owner | Reactivate company |
| 3 | mint_product | 3 | Company | Mint 1 product with GTIN+serial |
| 4 | batch_mint_products | 4 | Company | Mint up to 1000 units |
| 5 | transfer | 5 | Owner | Transfer custody + location |
| 6 | sell_to_consumer | 6 | Owner | Retail sale + warranty |
| 7 | authenticate_product | 7 | Mfr | Mark authentic on-chain |
| 8 | recall_product | 8 | Mfr | Recall product, block sale |
| 9 | resolve_recall | 9 | Mfr | Close recall, EndOfLife |
| 10 | register_product | 10 | Owner | Add to consumer portfolio |
| 11 | submit_warranty_claim | 11 | Owner | File a warranty claim |
| 12 | resolve_warranty_claim | 12 | Mfr | Approve/deny claim |
| 13 | list_for_sale | 13 | Owner | List on marketplace |
| 14 | buy_listing | 14 | Any | Purchase listed product |
| 15 | cancel_listing | 15 | Seller | Remove listing |
| 16 | set_fee_config | 16 | Root | Set fee rates & treasury collector |
| Name | Key | Value | Query |
|---|---|---|---|
| Companies | AccountId | CompanyInfo | Option |
| CompanyCount | β | u32 | Value |
| NextProductId | β | u128 | Value |
| Products | u128 | ProductNFT | Option |
| ProductLookup | (GTIN, Serial) | u128 | β |
| Authentications | u128 | AuthenticationRecord | Option |
| RecalledProducts | u128 | RecallInfo | Option |
| ConsumerPortfolio | AccountId | BoundedVec<u128> | Value |
| WarrantyClaimCount | β | u32 | Value |
| WarrantyClaims | (u128, u32) | WarrantyClaim | Option |
| MarketListings | u128 | MarketListing | Option |
| FeeConfig | β | FeeConfiguration | Value |
| ProductDRM π | u128 | DRMStatus | Option |
ProductNFT {
product_id: u128,
gtin: BoundedString, // GTIN-14 (GS1 standard)
serial_number: BoundedString, // Unit-level serial
batch_id: BoundedString,
name: BoundedString,
category: ProductCategory,
manufacturer: AccountId,
manufactured_at: BlockNumber,
current_owner: AccountId,
status: ProductStatus, // InProduction β ... β Sold/EndOfLife
custody_chain: BoundedVec<CustodyRecord>,
sale_price: Option<Balance>,
warranty: Option<WarrantyInfo>,
drm: Option<DRMStatus>, // π v0.5: DRM config, state, features
}
DRMStatus { // π v0.5
drm_config: DRMConfig { drm_enabled, enforcement_type, ... },
drm_state: DRMState, // Unlocked | Licensed | FeatureLocked | FullyLocked | Repossessed | Burned
features: BoundedVec<FeatureLock>,
enforcement_history: BoundedVec<EnforcementRecord>,
}
ProductStatus enum:
InProduction | InTransit | AtDistributor | InStore |
Sold | ListedForResale | Recalled | ReportedStolen | EndOfLife
RecallInfo {
recalled_by: AccountId,
recalled_at: BlockNumber,
reason: BoundedString,
action: RecallAction, // Return | Dispose | Replace | Refund
is_resolved: bool,
resolved_at: Option<BlockNumber>,
}
MarketListing {
seller: AccountId,
price: Balance,
listed_at: BlockNumber,
royalty_percent: Option<u8>, // Brand royalty on resale
}
Product Rights Management system. Enables lock/unlock, feature-level gating, repossession, and emergency override on product NFTs. DRM config is set by the manufacturer at product level with consumer consent.
| # | Extrinsic | Access | Description |
|---|---|---|---|
| 17 | set_drm_config | Manufacturer | Enable DRM on a product, set enforcement type |
| 18 | lock_product | Financing Entity | Lock product (missed payment, default) |
| 19 | unlock_product | Financing Entity | Restore product access on payment |
| 20 | unlock_feature | Any | Microtransaction: unlock single feature for N blocks |
| 21 | lock_feature | Financing Entity | Lock a specific feature |
| 22 | repossess_product | Manufacturer | Transfer ownership back on final default |
| 23 | burn_drm | Owner | Permanently remove DRM (full ownership achieved) |
| 24 | emergency_drm_override | Emergency Auth | Temporary unlock for safety/medical emergencies |
Unlocked β Licensed β FeatureLocked β FullyLocked β Repossessed β Burned
β | | | |
ββββββββββββ΄βββββββββββββ΄ββββββββββββββββ΄ββββββββββββββ
(payment restores access)
| Name | Key | Value | Query |
|---|---|---|---|
| ProductDRM | u128 (product_id) | DRMStatus {config, state, features, history} | Option |
| Model | Example | DRM Flow |
|---|---|---|
| Pay-as-you-go | Heated seats: $0.50/24h | FeatureLocked β unlock_feature(payment) β Timed unlock β Locked on expiry |
| Lease-to-own | Smartphone: $30/mo Γ 24 | Licensed β Each payment β ownership% β Full payment β Burned |
| Subscription | Premium audio: $10/mo | Licensed β Missed payment β FeatureLocked β Payment β Unlocked |
| Micro-loan | $200 loan on $500 phone | FullyLocked β Repayment β Unlocked β Default β Repossessed |
ProductNFT {
...
drm: Option<DRMStatus>, // NEW: DRM config, state, features
}
Manages KYC provider network and user address approvals. Used as a gate for company registration and staking.
| Extrinsic | Access | Description |
|---|---|---|
| add_kyc_provider | Root | Register a KYC provider |
| remove_kyc_provider | Root | Remove a KYC provider |
| activate_provider | Root | Reactivate suspended provider |
| deactivate_provider | Root | Suspend a provider |
| approve_address | Provider | KYC-approve a user |
| revoke_approval | Provider | Revoke KYC approval |
is_kyc_approved(address) β Check if address is KYC'd and activeget_kyc_approval(address) β Get approval details (expiry, provider)is_kyc_provider(account) β Check if account is a KYC providerget_all_approved_addresses() β List all active KYC addressesApartment lease agreements with DRM-enforced access control. An apartment is a ProductNFT with DRM β on-time payment unlocks the door, late payment locks it. Security deposits held in escrow, released on completion or dispute.
| # | Extrinsic | Access | Description |
|---|---|---|---|
| 0 | create_agreement | Landlord | Set terms: rent, deposit, grace period, late fee |
| 1 | accept_agreement | Tenant | Pay deposit + first month β status Active |
| 2 | pay_rent | Tenant | Monthly payment. Restores DRM unlock if late. |
| 3 | trigger_late | Anyone | After grace period. Locks DRM on property. |
| 4 | serve_notice | Landlord | Start eviction process. |
| 5 | vacate | Tenant/Landlord | End tenancy. Status β Terminated. |
| 6 | release_deposit | Tenant/Landlord | Release security deposit. |
Pending β Active β Late β EvictionProcess β Terminated β Completed
β β (pay rent) β
βββββββββββ release_deposit
Cross-chain bridge for Solana, USDC, and USDT interoperability. Wrapped tokens on CoCo backed 1:1 by locked tokens on source chains. Relayer-based verification with replay protection.
| # | Extrinsic | Access | Description |
|---|---|---|---|
| 0 | register_asset | Root | Register bridged token (USDC/USDT/SOL) |
| 1 | deactivate_asset | Root | Stop new deposits |
| 2 | deposit | Relayer | Complete deposit (mint wrapped tokens) |
| 3 | withdraw | Any | Initiate withdrawal (burn wrapped tokens) |
| 4 | complete_withdrawal | Relayer | Confirm unlock on source chain |
| 5 | add_relayer | Root | Authorize relayer |
| 6 | remove_relayer | Root | Remove relayer |
| 7 | set_paused | Root | Emergency stop |
Solana β CoCo: User locks tokens on Solana
β Relayer detects event
β Calls bridge.deposit() on CoCo
β Wrapped tokens minted to recipient
CoCo β Solana: User calls bridge.withdraw() on CoCo
β Wrapped tokens burned
β Relayer detects WithdrawalInitiated event
β Calls unlock_tokens() on Solana program
β User receives native tokens on Solana
| Asset | Solana Address | CoCo ID | Decimals |
|---|---|---|---|
| USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | 0 | 6 |
| USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | 1 | 6 |
| SOL (w) | So11111111111111111111111111111111111111112 | 2 | 9 |
docs/SOLANA_BRIDGE_SPEC.mdscripts/bridge-relayer.jsTreasury-managed yield distribution to KYC-approved stakers. Implements the CoCo-K staking model where real-world asset yield (USDC from T-bills) is distributed proportionally.
| Extrinsic | Access | Description |
|---|---|---|
| set_treasury_manager | Root | Appoint treasury manager |
| remove_treasury_manager | Root | Remove treasury manager |
| activate_manager | Root | Reactivate manager |
| deactivate_manager | Root | Suspend manager |
| distribute_rewards | Manager | Distribute yield to KYC stakers |
| claim_rewards | Staker | Claim pending rewards |
| stake | KYC user | Stake CoCo-K tokens |
| unstake | Staker | Unstake tokens |
| set_distribution_schedule | Root | Configure interval/minimum |
Off-Chain Treasury (T-bills)
β Interest earned
Convert to USDC
β Bridge to CoCo chain
Treasury Manager calls distribute_rewards()
β Proportional to stake
KYC-Approved Stakers β Pending Rewards
β claim_rewards()
Withdrawn to staker's wallet
Wasm-based smart contracts via pallet-contracts. Deploy ink! contracts that call into the CoCo runtime via a custom chain extension. Contract deployment uses COCO for gas metering and storage deposits.
Contracts can query on-chain state through the CoCoExtension without paying cross-contract call fees:
| ID | Function | Input | Output | Description |
|---|---|---|---|---|
| 1 | is_kyc_approved | AccountId | bool | Check if an address is KYC-approved |
| 2 | get_product_owner | u128 (product_id) | Option<AccountId> | Get current owner of a product NFT |
| 3 | is_product_authentic | u128 (product_id) | bool | Check manufacturer authentication status |
| 4 | get_product_status | u128 (product_id) | Option<u8> | Get product lifecycle status enum |
| 5 | is_drm_enabled | u128 (product_id) | bool | Check if DRM is active on a product |
| Contract | Source | Description |
|---|---|---|
| PAYG | contracts/payg/ | Pay-as-you-go: purchase time blocks, vendor withdraws, KYC-gated access |
| Lease | contracts/lease/ | Lease-to-own: fixed installments, ownership transfer on full payment |
| Escrow | contracts/escrow/ | Time-locked escrow with mediator resolution, 10 COCO stake |
# Install ink! toolchain cargo install cargo-contract # Build a contract cd coco-substrate/contracts/payg cargo contract build # Upload via Polkadot.js β Developer β Contracts # Instantiate with constructor args # Call via extrinsic or UI
| Parameter | Value |
|---|---|
| Deposit per storage item | 1 COCO |
| Deposit per byte | 0.01 COCO |
| Max code length | 128 KB |
| Call stack depth | 5 frames |
| Max delegate actions | 2 |
is_kyc_approved before granting product access. No KYC check is needed for deployment β any user can deploy, but the contract logic enforces KYC where required.
The Node.js server at barcode/Server/ provides REST API endpoints for both the POS system and blockchain operations.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Username + password β JWT token |
| POST | /api/auth/register | Create new user (admin required) |
| GET | /api/auth/me | Get current user from token |
| POST | /api/auth/change-password | Change password |
| POST | /api/auth/logout | Logout (stateless, logs event) |
| GET | /api/items | List inventory items |
| POST | /api/items | Add inventory item |
| GET | /api/transactions | List POS transactions |
| Endpoint | Blockchain Call | Key Parameters |
|---|---|---|
| /kyc | kyc.approveAddress | address |
| /register | productNft.registerCompany | name, seed |
| /asset | assets.create + setMetadata | assetId, name, symbol, seed |
| /mint | productNft.mintProduct | gtin, serialNumber, batchId, name, category, seed |
| /mint-batch | productNft.batchMintProducts | gtin, batchId, name, category, quantity, seed |
| /transfer | productNft.transfer | productId, toAddress, newStatus, lat, lng, desc, action, seed |
| /sale | productNft.sellToConsumer | productId, consumerAddress, price, warrantyDuration, lat, lng, desc, seed |
| /authenticate | productNft.authenticateProduct | productId, seed |
| /recall | productNft.recallProduct | productId, reason, action, seed |
| /resolve-recall | productNft.resolveRecall | productId, seed |
| /register-product | productNft.registerProduct | productId, seed |
| /warranty-claim | productNft.submitWarrantyClaim | productId, description, seed |
| /resolve-claim | productNft.resolveWarrantyClaim | productId, claimIndex, resolution, seed |
| /list-for-sale | productNft.listForSale | productId, price, royaltyPercent, seed |
| /buy-listing | productNft.buyListing | productId, lat, lng, desc, seed |
| /cancel-listing | productNft.cancelListing | productId, seed |
| /set-drm π | productNft.setDrmConfig | productId, enforcementType, paymentTokenId, seed |
| /lock π | productNft.lockProduct | productId, reason, seed |
| /unlock π | productNft.unlockProduct | productId, seed |
| /unlock-feature π | productNft.unlockFeature | productId, featureId, durationBlocks, seed |
| /lock-feature π | productNft.lockFeature | productId, featureId, seed |
| /repossess π | productNft.repossessProduct | productId, seed |
| /burn-drm π | productNft.burnDrm | productId, seed |
| /emergency-override π | productNft.emergencyDrmOverride | productId, seed |
| Endpoint | Blockchain Call | Access |
|---|---|---|
| /api/bridge/register-asset | bridge.registerAsset | Root |
| /api/bridge/deactivate-asset | bridge.deactivateAsset | Root |
| /api/bridge/deposit | bridge.deposit | Relayer |
| /api/bridge/withdraw | bridge.withdraw | Any |
| /api/bridge/complete-withdrawal | bridge.completeWithdrawal | Relayer |
| /api/bridge/add-relayer | bridge.addRelayer | Root |
| /api/bridge/remove-relayer | bridge.removeRelayer | Root |
| /api/bridge/set-paused | bridge.setPaused | Root |
Note: "seed" is the private key seed phrase for signing transactions. In production, this would use a wallet connection (Polkadot.js extension, mobile wallet) rather than raw seed input.
// The Polkadot.js API client handles: getApi() β Connect to ws://127.0.0.1:9944 sendTransaction() β Sign + submit + wait for inclusion + decode errors getAlice() β Get dev sudo key for KYC approval
Login/Register page with JWT-based authentication for POS and admin access.
Features:
Username/password sign in Β· Admin-only registration Β· Token-based session management Β· Auto-redirect on expiry
Full-featured admin panel for companies to manage their CoCo operations.
Features:
Product inventory with search/filter Β· Single & batch minting Β· Supply chain transfers Β· Retail sales Β· Recall management Β· Warranty claim resolution Β· Product authentication Β· Company settings
Browse and buy verified products listed for resale on the CoCo network.
Features:
Browse listings Β· Search & filter by category Β· View product details (authenticity, warranty) Β· Buy with wallet Β· List your own products Β· Cancel listings Β· Optional brand royalty on resale
6-step onboarding flow for new companies: KYC β Register β Asset β Mint β Transfer β Sale
Guide for integrating the Android barcode scanner app with the CoCo blockchain (wallet management, on-chain queries, transaction signing).
Command-line tool for common operations: build, run node, test, check, start server, reset chain data, generate spec, build Docker.
./coco-substrate/scripts/admin.sh build ./coco-substrate/scripts/admin.sh run ./coco-substrate/scripts/admin.sh test nft
Every product on CoCo has a scannable QR code linking its physical form to its on-chain digital twin. The standard is defined in docs/QR_CODE_STANDARD.md.
coco://product/{chain_id}/{product_id}?gtin={gtin}&serial={serial}&sig={signature}
coco://product/0/0x00000000000000000000000000000001?gtin=00012345678905&serial=LV-2024-001234
| Type | Use | Signature |
|---|---|---|
| Static QR | Printed on packaging, permanent | No (lookup only) |
| Dynamic QR | App-generated at POS/transfer | ECDSA signature from owner |
GS1 Digital Link: https://id.gs1.org/01/00012345678905/21/LV-2024-001234 CoCo Equivalent: coco://product/0/0x01?gtin=00012345678905&serial=LV-2024-001234
UPC-A, UPC-E, EAN-13, EAN-8, Code 128, Code 39, Code 93, QR, Data Matrix, PDF417, Aztec, ITF, Codabar
User scans QR code β App extracts product_id from URI β Queries chain: Products(product_id) β Displays: authenticity, status, custody chain, warranty β If for sale: show purchase option β If owned by user: show manage options (list, claim warranty)
beta_instructions.md. This section covers building, configuring, and running the CoCo node.
| Component | Development | Testnet Validator |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 4 GB | 8 GB |
| Storage | 20 GB | 100 GB SSD |
| OS | Linux / macOS / WSL2 | Ubuntu 22.04+ |
# Rust toolchain curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup target add wasm32-unknown-unknown # System dependencies (Ubuntu) apt install build-essential pkg-config libssl-dev clang # Node.js 18+ (for server/relayer) curl -fsSL https://deb.nodesource.com/setup_18.x | bash - apt install nodejs # Verify rustc --version # β₯ 1.77 node --version # β₯ 18
cd coco-substrate # Release build (recommended β 30-60 min) ./scripts/build.sh # Or manually: cargo build --release -p coco-substrate # Binary at: ./target/release/coco-node ./target/release/coco-node --version
# Quick start ./scripts/run-dev.sh # Or manual: ./target/release/coco-node --dev --tmp # Connect: ws://127.0.0.1:9944 # Connect: https://polkadot.js.org/apps β Development β Local Node
# 1. Generate chain spec ./target/release/coco-node build-spec --chain local --raw > testnet-spec.json # 2. Generate validator keys ./target/release/coco-node key generate --scheme sr25519 --output-type json > aura-key.json ./target/release/coco-node key generate --scheme ed25519 --output-type json > grandpa-key.json # 3. Insert keys ./target/release/coco-node key insert \ --base-path /opt/coco/data/validator \ --chain testnet-spec.json \ --scheme sr25519 --key-type aura --suri "<seed>" ./target/release/coco-node key insert \ --base-path /opt/coco/data/validator \ --chain testnet-spec.json \ --scheme ed25519 --key-type gran --suri "<seed>" # 4. Start validator ./target/release/coco-node \ --chain testnet-spec.json \ --base-path /opt/coco/data/validator \ --name "My Validator" --validator \ --rpc-methods Safe --rpc-external --ws-external \ --prometheus-external # Ports: 30333 (P2P), 9933 (RPC), 9944 (WS), 9615 (metrics) # See beta_instructions.md for multi-validator testnet setup
# Start Node.js server (POS + blockchain proxy) cd barcode/Server npm install cp .env.example .env # Edit SUBSTRATE_URL npm start # http://localhost:3000 # Web apps: # /admin β POS dashboard # /dashboard β Company inventory # /marketplace β P2P product listings # /onboarding β Company setup wizard # /login β Authentication
# Linux CLI wallet cd barcode/linux-wallet npm install ./wallet.js new # Create wallet ./wallet.js balance # Check balances ./wallet.js send <addr> <amt> # Send COCO # Android wallet # Build: cd barcode && ./gradlew assembleDebug # APK: app/build/outputs/apk/debug/app-debug.apk
# Environment
export COCO_WS_URL=ws://127.0.0.1:9944
export COCO_RELAYER_SEED=//RelayerRelayer
# Start relayer
node scripts/bridge-relayer.js
# Register bridged assets (as root)
curl -X POST http://localhost:3000/api/bridge/register-asset \
-H "Content-Type: application/json" \
-d '{
"sourceChain":"Solana",
"sourceTokenAddress":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"name":"USD Coin","symbol":"USDC","decimals":6,
"seed":"//Alice"
}'
CoCo validators earn from every transaction. No PoW hardware. No 32 ETH stake. Just run a node and earn.
| Transaction | Fee | To Validators | To Treasury |
|---|---|---|---|
| POS settlement (retail) | 0.25% | 80% | 20% |
| Sub-token swap (CoCo-K hub) | 0.25% | 70% | 30% |
| Sub-token swap (peer-to-peer) | 0% | β | β |
| Product minting | 0.1% | 50% | 50% |
| COCO native transfers | Gas only | 100% | 0% |
| Governance (coin create, KYC) | Gas only | 100% | 0% |
| Daily Network Volume | Per-Validator/Day (10 nodes) | Annual |
|---|---|---|
| $100,000 | $200 | $73,000 |
| $1,000,000 | $2,000 | $730,000 |
| $10,000,000 (Visa-scale) | $20,000 | $7,300,000 |
Any merchant can run a validator while saving on database overhead. Hardware cost: ~$10/month VPS. Actively profitable. Merchants earn fees FROM their own transactions β the network pays THEM to participate.
Manufacturer, distributor, retailer, and consumer never share a database. Each has their own systems. Reconciliations take days. CoCo eliminates reconciliation β one shared truth.
A QR code can be copied from a fake Gucci bag. An on-chain authenticity record signed by the manufacturer cannot be forged. Scan to verify cryptographically.
Supplier delivers β QR scan at receiving dock β inventory auto-updates β payment auto-settles at 0% internal fee. No invoice. No wire. No 3-day wait.
French tax authorities require 10-year inventory audits. A blockchain is append-only by design. A database can be modified. A ledger cannot.
Merchants run their own node and earn fees. No SaaS subscription. No platform lock-in. You participate in the network, you get paid by the network.
A customer scanning a QR code on their phone sees the full product history β origin, manufacturer, recalls, authenticity. Impossible with private databases.
The hybrid answer: CoCo isn't "instead of a database" β it's the shared layer of information. CoCo stores the shared truth: who owns what, is it authentic, what's the chain of custody. The POS syncs local β chain. Heavy data stays local.
CoCo offers two POS versions for different needs:
Standalone, zero dependencies. Works on any browser β including old Android phones. Cash, card, and bank transfer payments. Offline-first with localStorage.
Perfect for: Brazilian kiosks, French butchers, any merchant with just a phone.
Chain-connected via API bridge. Accept CoCo-K payments. Wallet balance display. Mining validator integration. Settle on-chain at 0.25% fee. Earn fees by running the miner.
Perfect for: Merchants who want to earn from their own transactions.
cd coco-substrate # Quick build (recommended) ./scripts/build.sh # Or manually: cargo build --release -p coco-substrate-runtime cargo build --release -p coco-substrate # Binary: ./target/release/coco-node
./scripts/run-dev.sh # or: ./target/release/coco-node --dev # RPC: ws://127.0.0.1:9944 | http://127.0.0.1:9933 # Connect: https://polkadot.js.org/apps β Development β Local Node
# Product NFT pallet (36 tests) cargo test -p pallet-product-nft # All pallets cargo test -p pallet-kyc cargo test -p pallet-rewards
cd barcode/Server npm install cp .env.example .env # Edit SUBSTRATE_URL if needed npm start # http://localhost:3000 # Open: http://localhost:3000/onboarding.html
cd barcode ./gradlew assembleDebug # APK: app/build/outputs/apk/debug/app-debug.apk
cargo test -p pallet-product-nft -p pallet-micro-finance -p pallet-bridge β 75 passed, 0 failed.
The company onboarding process is a 6-step flow documented in ONBOARDING.md and implemented in the website at /onboarding.html.
| Step | Blockchain Action | Who |
|---|---|---|
| 1. KYC Approval | kyc.approveAddress | Provider (Alice in demo) |
| 2. Register Company | productNft.registerCompany | KYC-approved user |
| 3. Create Asset | assets.create + setMetadata | Company |
| 4. Mint Products | productNft.mintProduct / batchMintProducts | Company |
| 5. Supply Chain Transfer | productNft.transfer | Current owner |
| 6. Retail Sale | productNft.sellToConsumer | Retailer |
| Action | Blockchain Call | When |
|---|---|---|
| Register product | productNft.registerProduct | After purchase |
| Authenticate product | productNft.authenticateProduct | Manufacturer only |
| Submit warranty claim | productNft.submitWarrantyClaim | Within warranty period |
| List for resale | productNft.listForSale | Owner wants to sell |
| Buy from marketplace | productNft.buyListing | Any user |
| Cancel listing | productNft.cancelListing | Original seller |
| Parameter | Value | Notes |
|---|---|---|
| Block Time | 6 seconds | Aura slot duration |
| Finality | ~12-18 seconds | Grandpa 2/3+ confirmation |
| Native Token | COCO | 12 decimal places |
| Total Supply | 1,000,000,000 | Pre-mined at genesis |
| Existential Deposit | 500 plancks | Minimum balance |
| Max Validators | 32 | Aura authorities |
| Max KYC Providers | 100 | Configurable |
| Max Stakers | 100,000 | CoCo-K stakers |
set_fee_config (sudo). Default rates shown below.
| Transaction | Fee | Recipient | Status |
|---|---|---|---|
| Supply chain transfer | 0% | Free | Live |
| Product minting | 0.1% (configurable) | Treasury | Live |
| Retail sale | 0.25% (configurable) | Treasury | Live |
| P2P resale | 0.25% (configurable) | Treasury | Live |
| COCO transfer | Network fee | Validators | Live |
| Sub-token swap (same brand) | 0% | Free | Planned |
| Sub-token to COCO | 0.25% | Treasury | Planned |
// Fee configuration (stored on-chain):
struct FeeConfiguration {
fee_collector: AccountId, // Treasury address
sale_fee_rate: Permill, // 0.25% default
resale_fee_rate: Permill, // 0.25% default
mint_fee_rate: Permill, // 0.1% default
}
// Example: Retail sale of 1000 COCO product
// Sale price: 1000 COCO
// Fee (0.25%): 2.5 COCO β transferred to TreasuryAccount
// Seller receives: 997.5 COCO (net)
Fees are automatically deducted during sell_to_consumer and buy_listing extrinsics via the charge_fee helper. The treasury account is set to Alice in dev mode and should be changed to a multi-sig treasury for production.
| Name | Role | COCO |
|---|---|---|
| Alice | Sudo / Validator | 1,000,000 |
| Bob | Validator / KYC Provider | 1,000,000 |
| Charlie | User / Staker | 1,000,000 |
| Dave | User | 1,000,000 |
| Eve | User | 1,000,000 |
Done New Pending Planned
/dashboard/marketplacescripts/admin.sh with 9 commandsdocs/SCANNER_INTEGRATION.md