High-level Flow Overview of ZKCross
We use a casual game developed with ZKC sdk and ZKC rpc as an example to walk it through.
-
Playing the Game: Alice plays a game that has integrated ZKCross technology.
-
The Game interacts with other modules: The game is being executed while Alice plays it, there are some other services via ZKC RPC server, and then both execution and zkWasm can access the same set of data.
-
Saving Her Game On-Chain: Whenever Alice makes a significant move or finishes a level, she clicks 'Save My Progress' for two primary reasons:
- To receive on-chain rewards.
- To ensure the game's centralized server can't tamper with her results.
-
Simulate the execution and generate proof: Behind the scenes, the game notes down Alice’s gameplay. It then sends her play record to ZKCross and generates a zkProof by the zkWasm prover network.
-
Post proofs to the blockchain: The game uses cryptographic methods (zkProof) to provide evidence that Alice's moves or scores are legitimate without revealing her gameplay strategies. This zkProof is then sent to an on-chain smart contract for further verification.
-
Trigger on-chain behaviors: After the proofs are posted to blockchains, they will be verified and following on-chain behaviors will be triggered, like updating the NTF, token transactions, etc. Those on-chain behaviors will be configurable to developers.