Demo & On-Chain Data
This section explains how the live demo works, what data is stored on the Casper blockchain, and how to verify transactions yourself on the block explorer.
How the Demo Works
The demo showcases a complete B2B invoice escrow workflow running on Casper 2.0 testnet. When you interact with the demo, you're executing real blockchain transactions.
Architecture Overview
Demo Account Configuration
The demo uses a pre-funded testnet account to pay for gas and escrow funding. This allows judges and testers to experience the full workflow without needing their own testnet CSPR.
What Gets Stored On-Chain
Every escrow creates a smart contract instance on Casper with the following data stored in the contract's Named Keys:
| Key | Type | Description |
|---|---|---|
state | U8 | Current escrow state (0=Draft, 1=Accepted, 2=Funded, 3=Released, 4=Cancelled) |
issuer | AccountHash | Address of the party receiving payment |
payer | AccountHash | Address of the party making payment |
amount | U512 | Required escrow amount in motes (1 CSPR = 10^9 motes) |
description | String | Invoice description stored on-chain |
balance | U512 | Current balance held in escrow |
escrow_purse | URef | Purse holding the escrowed funds |
State Transitions
Each state transition is recorded as a blockchain transaction (deploy):
Deploy Contract (call) ├── Args: amount (U64), description (String) ├── Creates: escrow_package, escrow_contract ├── Initial state: Draft (0) └── Gas: ~10 CSPR accept() ├── Caller: must be payer ├── Validates: state == Draft ├── Updates: state → Accepted (1) └── Gas: ~2.5 CSPR fund() ├── Args: amount (U512), source (URef) ├── Caller: must be payer ├── Validates: state == Accepted, amount >= required ├── Transfers: CSPR from source purse to escrow_purse ├── Updates: state → Funded (2), balance = amount └── Gas: ~2.5 CSPR release() ├── Caller: must be payer ├── Validates: state == Funded ├── Transfers: balance from escrow_purse to issuer ├── Updates: state → Released (3), balance = 0 └── Gas: ~2.5 CSPR
Verifying On-Chain
Every transaction can be verified on the Casper block explorer:
- Copy the deploy hash shown after any action in the demo
- Go to testnet.cspr.live
- Search for the deploy hash
- View execution results, gas used, and state changes
Try It Yourself
Ready to see the infrastructure in action? The live demo lets you:
Deploy a new escrow contract with description and amount
Payer reviews and accepts the escrow terms
Deposit CSPR into the escrow contract
Transfer funds to issuer and complete the escrow
Technical Details
For developers who want to understand the implementation:
- Smart Contract: Native Rust contract using
casper-contract 5.xandcasper-types 6.x - Entry Points:
accept,fund,release,cancel,get_state,get_balance - SDK:
casper-js-sdk 5.0.7for transaction building and submission - Key Derivation: BIP39/BIP44 with Casper coin type (506)
Check the Smart Contract and Integration sections for full technical documentation.