@guardianproject/proofmode
v0.5.0
Published
Capture, share, and preserve verifiable photos and videos
Readme
ProofMode-Rust
Rust implementation of Guardian Project's ProofMode system for capturing, sharing, and preserving verifiable photos and videos.
Features
- Generate Proofs: Create cryptographic proof bundles for media files
- Verify Media: Check authenticity using C2PA, PGP signatures, OpenTimestamps, and EXIF data
- Multi-Platform: Available as Rust CLI, WebAssembly, Python/Ruby/Node.js CLIs, and mobile libraries
- Cross-Platform: Works on Linux, macOS, Windows, Android, iOS, and in web browsers
Platform Structure
Each platform provides both a library (for integration) and an application (CLI or mobile app). See Platform Structure Documentation for detailed architecture.
| Platform | Library | Application | Location |
|----------|---------|-------------|----------|
| Rust | Crate (src/lib.rs) | CLI binary | src/main.rs |
| Python | UniFFI bindings (pip package) | CLI tool | cli/python/ |
| Ruby | UniFFI bindings (gem) | CLI tool | cli/ruby/ |
| Node.js | WASM module (npm package) | CLI tool | cli/node/ |
| Web | WASM module | Next.js App | examples/web/ |
| Android | AAR with Kotlin bindings | Example App | examples/android/ |
| iOS | XCFramework with Swift bindings | Example App | examples/ios/ |
Platform Support & Status
✅ Production Ready
Rust Command Line Tool
- Status: ✅ Fully functional
- Location: Native Rust binary
- Usage:
cargo build --release && ./target/release/proofmode - Features: Full proof generation, verification, C2PA, PGP, OpenTimestamps
Rust Library
- Status: ✅ Fully functional
- Location:
src/lib.rs - Usage:
cargo add proofmode - Features: Core ProofMode functionality as Rust crate
Python CLI & Bindings
- Status: ✅ Working with UniFFI bindings
- Location:
cli/python/(CLI),examples/python/(integration examples) - Usage:
cd cli/python && ./setup_python_cli.sh && ./proofmode-cli - Features: Full CLI functionality via UniFFI bindings
- Build: Native library required (
cargo build --release)
Ruby CLI & Bindings
- Status: ✅ Working with UniFFI bindings
- Location:
cli/ruby/(CLI),examples/ruby/(integration examples) - Usage:
cd cli/ruby && ./setup.sh && ./proofmode-cli - Features: Full CLI functionality via UniFFI bindings
- Build: Native library required, FFI gem dependency
Docker Image
- Status: ✅ Functional
- Location:
Dockerfileanddocker-compose.yml - Usage:
docker-compose upordocker build -t proofmode . - Features: Containerized CLI with volume mounts for file processing
🔄 In Development
WebAssembly (WASM) Package
- Status: 🔄 Build succeeds, runtime issues
- Location: Built to
pkg/directory - Usage:
cargo make wasm-pack - Features: Browser integration, NPM package
- Current Issue: Module loading in Node.js environment
Web Application
- Status: ✅ Built and ready with latest dependencies
- Location:
examples/web/ - Usage:
cd examples/web && pnpm install && pnpm dev - Features:
- Next.js 15 with Material-UI 7
- React 19 with latest performance improvements
- Proof generation and verification
- Camera capture support
- Geolocation integration
- Web Worker for non-blocking WASM operations
- Uses pnpm for fast, efficient package management
- Build: Successfully compiles with all latest dependencies
Node.js CLI
- Status: 🔄 Structure complete, WASM integration pending
- Location:
cli/node/(CLI),examples/node/(integration examples) - Usage:
cd cli/node && npm install && node cli.js - Features: JavaScript CLI using WASM bindings
- Current Issue: Requires working WASM module
Android Library & Example App
- Status: 🔄 Build system functional, integration testing needed
- Location:
examples/android/ - Usage:
cargo make build-android && cargo make create-aar - Build Output: AAR package with Kotlin bindings
- Progress:
- ✅ Cross-compilation for all Android architectures
- ✅ UniFFI Kotlin bindings generation
- ✅ AAR package structure
- ✅ Example app with Compose UI
- ⏳ Integration testing on devices
- ⏳ Publishing to Maven repository
iOS Library & Example App
- Status: 🔄 macOS required for full build
- Location:
examples/ios/ - Usage:
cargo make build-ios && cargo make create-xcframework - Build Output: XCFramework with Swift bindings
- Progress:
- ✅ Swift bindings generation
- ✅ Example app with SwiftUI
- ✅ XCFramework structure
- ⏳ Universal binary creation (requires macOS)
- ⏳ CocoaPods/SPM distribution
Quick Start
Quick Commands
# Setup development environment
make setup
# Build Rust CLI
make build
# Run tests
make test
# Clean all build artifacts
make clean
# Show all available commands
make helpUsing cargo-make directly
# Install cargo-make (if not using the Makefile wrapper)
cargo install cargo-make
# All make commands above can be prefixed with 'cargo'
cargo make setup
cargo make build
# etc...Rust CLI
cargo build --release
./target/release/proofmode generate -f photo.jpg -s ./proofs -e [email protected]
./target/release/proofmode check -f photo.jpgPython CLI
cd examples/python
./setup_python_cli.sh
./proofmode-cli generate -f photo.jpg --pgp-key [email protected]Ruby CLI
cd examples/ruby
./setup.sh
./proofmode-cli generate -f photo.jpg --pgp-key [email protected]Node.js CLI
cd examples/node
npm install
node cli.js generate -f photo.jpg --email [email protected]Docker
docker-compose up
# or
docker build -t proofmode .
docker run -v $(pwd):/data proofmode generate -f /data/photo.jpgMobile Development
# Android
cargo make build-android
cargo make create-aar
# Open examples/android in Android Studio
# iOS (macOS only)
cargo make build-ios
cargo make create-xcframework
# Open examples/ios/ProofModeExample.xcodeproj in XcodeArchitecture
Core Components
- Proof Generation: SHA-256 hashing, metadata collection, PGP signing
- Verification: C2PA manifest checking, PGP signature validation, OpenTimestamps
- Storage: Pluggable storage backends (file system, cloud)
- Mobile Interface: UniFFI-based bindings for iOS/Android
Platform-Specific Features
- Mobile: Callback-based APIs for location, device info, network data
- CLI: Full-featured command-line interface with progress reporting
- UniFFI Bindings: Cross-language bindings for Python, Ruby, Kotlin, Swift
- WebAssembly: Browser integration via wasm-bindgen
- Docker: Isolated execution environment
Development Status
| Platform | Core Features | Bindings | Example/CLI | Status | |----------|---------------|----------|-------------|---------| | Rust CLI | ✅ Complete | N/A | ✅ Complete | ✅ Production | | Rust Library | ✅ Complete | N/A | N/A | ✅ Production | | Python | ✅ Complete | ✅ UniFFI | ✅ Complete | ✅ Production | | Ruby | ✅ Complete | ✅ UniFFI | ✅ Complete | ✅ Production | | Node.js | 🔄 Pending | 🔄 WASM | ✅ Structure | 🔄 Development | | WebAssembly | 🔄 Builds | 🔄 Runtime | ⏳ Planned | 🔄 Development | | Docker | ✅ Complete | N/A | ✅ Complete | ✅ Production | | Android | ✅ Complete | ✅ UniFFI | ✅ Example | 🔄 Testing | | iOS | ✅ Complete | ✅ UniFFI | ✅ Example | 🔄 macOS needed |
Project Structure
proofmode-rust/
├── src/ # Rust library source
├── examples/ # Platform examples and CLIs
│ ├── android/ # Android example app
│ ├── ios/ # iOS example app
│ ├── node/ # Node.js CLI
│ ├── python/ # Python CLI & bindings
│ └── ruby/ # Ruby CLI & bindings
├── bindings/ # Generated UniFFI bindings
├── scripts/ # Build and setup scripts
├── docs/ # Documentation
├── tests/ # Integration tests
└── Makefile.toml # cargo-make configurationBuilding From Source
Prerequisites
- Rust 1.70+
- cargo-make (
cargo install cargo-make) - Python 3.8+ (for Python bindings)
- Ruby 2.7+ (for Ruby bindings)
- Node.js 16+ (for Node.js CLI)
- Android SDK + NDK (for Android)
- Xcode (for iOS, macOS only)
- Docker (optional)
Build Everything
# One-time setup
make setup
# Build targets (individual commands recommended)
make build # Build Rust CLI (fast)
make wasm-pack # Build WebAssembly
make mobile # Build all mobile targets (slow)
# Or build everything at once (very slow)
make build-all # Builds Rust, WASM, and all mobile targets
# Run tests
make test # Run Rust tests
make test-cli # Test all CLIs
# Build specific platforms
make build-android # Android library
make build-ios # iOS library (macOS only)
make generate-bindings # Generate UniFFI bindings
# Other useful commands
make clean # Clean all build artifacts
make fmt # Format code
make help # Show all available commandsDocumentation
- Development Guides - Platform-specific setup
- API Documentation - Rust API docs
- Example Apps - Working examples for each platform
Contributing
See platform-specific guides:
examples/android/README.md- Android developmentexamples/ios/README.md- iOS developmentexamples/python/README.md- Python developmentexamples/ruby/README.md- Ruby developmentexamples/node/README.md- Node.js development
License
Apache-2.0
