Overview
We built a Solidity smart contract for Daplie, a decentralized file storage network similar to IPFS. Owners run always-on NAS devices that register on-chain, periodically send a heartbeat to prove availability, and earn staking tokens for sustained uptime.
Responsibilities
- Heartbeat Tracking — Added on-chain recording of periodic device pings to confirm online status without leaking sensitive metadata.
- Staking Rewards — Implemented reward accrual based on verified uptime windows; owners claim tokens proportionally to participation.
- Access Control — Ensured only registered devices and their associated owners can report heartbeats and receive rewards.
- Gas Efficiency — Structured updates so heartbeats are rate-limited and batched to keep costs predictable as the network scales.
Technical Details
- Language/Chain: Solidity on Ethereum
- Patterns: Minimal state writes per interval, event-driven monitoring for off-chain observers
- Libraries/Tools: OpenZeppelin (roles/ownership), Truffle, Web3.js
- Data Model:
- Device registry mapping device IDs to owners
- Rolling timestamps for last heartbeat and participation windows
- Per-owner reward balances, claimable on demand