Skip to content

9. Technical Implementation

9.1 Smart Contract Architecture

9.1.1 Core Contracts

  • ZKPay.sol: Main contract, implements privacy payment functionality
  • EnclaveToken.sol: Token contract, implements mining and burning
  • NFTManager.sol: NFT management contract, implements node management
  • NodeNFT.sol: NFT contract, implements node identification
  • TokenVesting.sol: Lock-up contract, implements token lock-up
  • Treasury.sol: Fund management contract, implements fund management

9.1.2 Auxiliary Contracts

  • ZKPayVault.sol: Vault contract
  • TreasuryConfigCore.sol: Configuration core contract
  • IntentManager.sol: Intent management contract
  • Workers: Various Worker contracts (cross-chain, swap, etc.)

9.2 Zero-Knowledge Proofs

9.2.1 SP1 Verifier

  • Verification Key: Use verification key to verify proofs
  • Public Values: Verify correctness of public values
  • Proof Verification: Verify zero-knowledge proofs

9.2.2 Proof Generation

  • Node Proof Generator: Each node runs a zero-knowledge proof generator
    • Responsible for generating zero-knowledge proofs required by the Enclave Privacy system
    • Supports generation of Commitment Proof and Withdraw Proof
    • Ensures timeliness and accuracy of proof generation
    • One node can provide proof generation services for multiple NFTs
  • NFT Binding Mechanism: One node can bind up to 10 NFTs
    • NFT serves as the unique identifier for node identity
    • Multiple NFTs can share the same node's proof generation service
    • Binding relationship is managed through on-chain contracts
    • Each NFT independently calculates rewards and status
    • Improves resource utilization efficiency and reduces operational costs
  • Proof Types:
    • Commitment Proof: Generate allocation commitment proof
    • Withdraw Proof: Generate withdrawal proof
    • Batch Proof: Generate batch operation proof

9.3 Cross-Chain Support

9.3.1 Cross-Chain Bridging

  • DeBridge: Supports DeBridge cross-chain
  • Other Bridges: Supports other cross-chain bridges
  • Native Cross-Chain: Supports native cross-chain functionality

9.3.2 Multi-Chain Deployment

  • BSC: Mainly deployed on BSC
  • Other Chains: Supports deployment to other chains
  • Cross-Chain Interoperability: Implements cross-chain interoperability

[← Previous: Governance Mechanism](./08-governance-mechanism) | [Next: Roadmap and Outlook →](./10-roadmap-outlook)

Released under the MIT License.