Developer Guide
Build secure, decentralized verification systems with Shield’s smart contracts and architecture.Smart Contract
Deployed Contract
Base Mainnet:0x04e0f1Ca613E1c0397f847537D70BaA52536441f
- Explorer: View on BaseScan
- Source Code: Shield.sol on GitHub
- ABI: Shield.json
Contract Interface
Architecture Overview
Shield combines client-side encryption with blockchain-based access control:Integration Examples
JavaScript/ethers.js
React Hook Example
Technical Deep Dives
How Self-Destruct Works
Shield policies “self-destruct” through smart contract state changes:- On Success:
policy.valid = falseimmediately after successful access - On Max Attempts:
policy.valid = falsewhen attempts ≥ maxAttempts - On Expiry:
block.timestamp >= policy.expiryreturns invalid
isPolicyValid() returns false.
Zero-Knowledge Backend
Shield’s “zero-knowledge” claim means: What the Backend Knows:- IPFS hash of encrypted content
- Policy ID
- Blockchain transaction history
- Encryption keys (generated client-side)
- Decrypted content
- Original file contents
- Browser generates AES-256 key using Web Crypto API
- Content encrypted locally before upload
- Only encrypted blob sent to IPFS
- Decryption key shared out-of-band (in share link)
- Recipient’s browser decrypts locally
IPFS Integration
Shield uses Pinata for IPFS pinning:Extending Shield
Custom Policy Logic
You can extend Shield’s policy system:Integration Patterns
Pattern 1: NFT-Gated AccessSecurity Considerations
Best Practices
- Policy ID Generation: Use cryptographically secure random bytes
- Expiry Times: Set reasonable expiry (default: 1 hour)
- Max Attempts: Limit to prevent brute force (default: 3)
- Recipient Validation: Ensure recipient address is correct
- Event Monitoring: Listen for
VerificationAttemptevents
Known Limitations
- No Data Deletion: Encrypted content persists on IPFS
- Policy Visibility: All policies are public on-chain
- Gas Costs: Each attempt costs gas on Base
- Client-Side Trust: Encryption security depends on browser implementation
Audit Status
Current Status: Not yet audited Planned Audits: Q3 2026 The Shield smart contract is simple (52 lines) but has not undergone formal security audit. Use at your own risk in production. Security Measures in Place:- Minimal attack surface
- No fund handling
- Simple state machine
- Deployed on Base (Ethereum L2)
- Contract verified on BaseScan
Testing
Test the contract on Base Sepolia testnet: Testnet Contract: Check GitHub for testnet deploymentsAdditional Resources
- Full Source Code: GitHub Repository
- Contract ABI: Shield.json
- Base Network Docs: docs.base.org
- IPFS Documentation: docs.ipfs.tech
Support
For technical questions or integration help:- GitHub Issues: Report bugs or request features
- Email: eliope933@gmail.com
- Twitter/X: ShieldApp
- Discord: Open a ticket
Ready to build? Check out the Quickstart for a step-by-step guide or explore the FAQs for common questions.