Context
On-chain transaction data is permanent but not easily retrievable. RPC endpoints have rate limits and history constraints, making data recovery difficult.
Current Limitation/Problem
AgenticPay relies on RPC nodes for historical data access. Data could be lost if RPC providers prune history or if the backend database is corrupted. There is no decentralized backup.
Expected Outcome
An automated archival system that periodically backs up on-chain transaction data, event logs, and contract state to IPFS, with content-addressed retrieval and restore capability.
Acceptance Criteria
- Archive transaction data from all supported chains to IPFS
- Data format: normalized JSON with proof-of-inclusion (tx hash, block number)
- Daily archival batches with IPFS CID recorded on-chain or in database
- Data integrity verification: compute hash before and after archival
- Restore workflow: download from IPFS and re-index into database
- Dashboard showing last archive timestamp, size, and CID
- Retention policy: full archives for 7 years
- Compression before archival (<100MB per daily archive)
Technical Scope
backend/src/services/archival/ - archival service
- IPFS client (Pinata, web3.storage, or local IPFS node)
backend/src/services/archival/data-collector.ts - data gathering
backend/src/services/archival/ipfs-uploader.ts - IPFS upload
- BullMQ cron for daily archival
- Prisma:
DataArchive, ArchivalBatch models
- Edge cases: IPFS node unavailability, large datasets, partial chain data, restore conflicts
Context
On-chain transaction data is permanent but not easily retrievable. RPC endpoints have rate limits and history constraints, making data recovery difficult.
Current Limitation/Problem
AgenticPay relies on RPC nodes for historical data access. Data could be lost if RPC providers prune history or if the backend database is corrupted. There is no decentralized backup.
Expected Outcome
An automated archival system that periodically backs up on-chain transaction data, event logs, and contract state to IPFS, with content-addressed retrieval and restore capability.
Acceptance Criteria
Technical Scope
backend/src/services/archival/- archival servicebackend/src/services/archival/data-collector.ts- data gatheringbackend/src/services/archival/ipfs-uploader.ts- IPFS uploadDataArchive,ArchivalBatchmodels