Skip to content

Conversation

@wkss1
Copy link

@wkss1 wkss1 commented Jul 29, 2025

Problem

Users running Boundless provers with dedicated wallets cannot claim campaign points because their prover wallet differs from their main wallet connected to social profiles.

Solution

Add a proof delegation system that allows provers to securely delegate their proof-solving accreditation to another address using EIP-712 signatures.

Features

  • ProofDelegation.sol: Smart contract for permanent, one-time delegation
  • CLI Integration: New boundless account delegate-proofs command
  • User Script: scripts/delegate-proofs.js for easy delegation (optional)
  • Campaign Integration: Documentation for campaign system integration

Security

  • Uses EIP-712 signatures (no private key exposure)
  • One-time delegation (cannot delegate twice)
  • Permanent delegations (no revocation complexity)
  • Nonce protection against replay attacks

Usage

# Using CLI
boundless account delegate-proofs --target-address 0x...

# Using script
node scripts/delegate-proofs.js delegate 0x...

Files Changed

  • contracts/src/ProofDelegation.sol - Core delegation contract
  • crates/boundless-cli/src/bin/boundless.rs - CLI integration
  • crates/boundless-market/src/deployments.rs - Optional deployment config
  • scripts/delegate-proofs.js - User-friendly delegation script
  • scripts/deploy.js - Deployment script
  • CONTRIBUTION_PROOF_DELEGATION.md - Comprehensive documentation

Testing

  • Contract tested with Foundry
  • CLI integration tested
  • Script tested with existing .env files

Campaign Integration

The campaign system can query ProofDelegation.getProverTarget(prover) to get the delegated address for any prover, then credit points to the delegated address instead of the prover address.

Important: Campaign Duplication Prevention Required

Problem Identified

The delegation system could create a duplication exploit where users who have already claimed campaign points could delegate their prover wallet and potentially claim rewards again on their delegated address.

Example Scenario:

  • User has prover wallet 0xProver with 30 proofs
  • User already claimed Silver (1 proof) and Gold (25 proofs) with 0xProver
  • User delegates 0xProver → 0xMain

Risk: 0xMain could potentially claim Silver/Gold again using the same proofs

Recommended Solution for Campaign Backend:

Point Recalculation:

  • When a delegation is detected, remove points from the prover address for "Submit proof" tasks
  • Recalculate the prover's level based on remaining points
  • Warn users that delegating will affect their current prover address level

gBerry

- Add ProofDelegation.sol contract for secure proof delegation
- Add delegate-proofs.js script for user-friendly delegation
- Add deploy.js script for contract deployment
- Add delegation CLI commands to boundless CLI
- Add proof_delegation_address to deployment configuration
- Add comprehensive contribution documentation

This allows provers to securely delegate their proof solving
to another address for campaign participation using EIP-712 signatures.
Delegations are permanent and one-time only for simplicity.

Closes: #XXX
@wkss1 wkss1 force-pushed the feature/proof-delegation branch from f96ec90 to fac1d34 Compare July 29, 2025 07:40
@wkss1
Copy link
Author

wkss1 commented Jul 30, 2025

next steps:

Complete CLI implementation with proper contract bindings
Fix EIP-712 signature creation with correct domain separator
Add propr nonce handling from the contract
comprehensive error handling
tests to verify the implementation works

@willpote willpote requested a review from ec2 as a code owner November 5, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant