Skip to content

feat: Add proof delegation system for Boundless Signal campaign #961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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

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