Blockchain, but practical
Only transactional evidence is anchored on-chain. We batch events into Merkle roots on Polygon for low cost, optionally anchor to Ethereum for finality, and keep documents plus PII off-chain but cryptographically bound.
One Polygon tx stores the Merkle root for hundreds of ledger updates; anchor to Ethereum only weekly or on demand.
Full docs and personal data stay in the database/object store; hashes and proofs provide verifiability without exposure.
Every ledger item keeps its Merkle proof, with a “Verify on chain” check against the stored root and tx link.
Attest to integrity, not content. Keep sensitive data under HomeTruth control while making tamper evidence public.
Reduce gas by committing one root for many updates while keeping per-item proofs for verification.
Normalize each ledger item (stable order of fields) and hash it; assemble into a Merkle tree.
Call the registry contract with root, batchId, period, chainId, and optional URI.
Store each item’s Merkle proof, the on-chain tx hash, and block number alongside the ledger row.
Batch Polygon roots into a higher-level tree and anchor that root to Ethereum weekly for stronger immutability.
Ledger entry created (e.g., “Boiler service”, £180, timestamp, property/user IDs, doc hash).
Normalize record → hash; add to batch queue; upload doc to storage and store doc hash.
Batcher builds Merkle tree, submits root to Polygon; receives tx hash and block number.
DB stores ledger row, proof, root, tx hash, block; doc stays off-chain.
UI shows “Verify on chain”: recompute root from proof, compare to on-chain value, link to block explorer.
Minimal surface area: store roots, emit events, keep roles tight.
pragma solidity ^0.8.20;
contract LedgerRootRegistry {
event BatchStored(bytes32 indexed batchId, bytes32 indexed root, uint64 chainId, string period, string uri);
mapping(bytes32 => bytes32) public roots;
address public admin;
modifier onlyAdmin() { require(msg.sender == admin, "auth"); _; }
constructor(address _admin) { admin = _admin; }
function submitBatch(bytes32 batchId, bytes32 root, uint64 chainId, string calldata period, string calldata uri) external onlyAdmin {
roots[batchId] = root;
emit BatchStored(batchId, root, chainId, period, uri);
}
}
Local anvil (Foundry) or Hardhat node; instant resets; no cost.
Polygon Amoy; optional Sepolia if trialing L1 anchoring.
Polygon PoS for daily batches; weekly Ethereum anchor if required by partners.
Polygon: fractions of a cent per root. Ethereum anchoring: a few dollars depending on gas; do it weekly/when needed.
Hash normalized data; never upload PII or docs on-chain. Encrypt storage; keep salts/keys off-chain.
Show tx hash, batch ID, root, and a “Verify proof” button on the ledger row (e.g., John Doe’s property view).