in reviewhumanPR #34Data Facts
feat(datafacts): implement content-addressed plugin
This PR implements Problem 08: Content-Addressed Datasets with Provenance Chains and Freshness Proofs for the NANDA Town hackathon.
Author
@24f3003188
github profile →- Status
- In review
- Opened on
- Jun 22
- Branch
- hackathon/atharv-sanjeev-kumar-content-addressed-datafacts
Description
The pitch.
## Overview This PR implements Problem 08: Content-Addressed Datasets with Provenance Chains and Freshness Proofs for the NANDA Town hackathon. It introduces a new `content_addressed` DataFacts plugin that solves the vulnerabilities present in the reference `datafacts_v1` implementation by utilizing content-based hashing and cryptographic signatures. ## Key Features & Changes - **Content Addressing**: Replaced vulnerable name-based URLs with `sha256` content hashes covering both metadata and payload bytes. This guarantees immutability and makes data substitution attacks impossible. - **Cryptographic Freshness Proofs**: Replaced simplistic wall-clock (`time.time()`) freshness checks with cryptographically signed `FreshnessProof` objects using the identity layer, ensuring that freshness claims cannot be spoofed by third parties. - **Provenance Chains**: Added support for tracking dataset ancestry via the `parents` metadata field. Implemented `verify_provenance_chain` to validate that a dataset's entire lineage forms an intact, cryptographically verifiable DAG. - **Adversarial Validators**: Added a new suite of adversarial validators (`datafacts_validators.py`) that successfully catch substitution, stale freshness, and broken provenance attacks (failing against `datafacts_v1` and passing against the new `content_addressed` plugin). - **Scenario & Tests**: Created the `provenance_supply_chain.yaml` scenario to demonstrate end-to-end functionality, alongside a comprehensive `pytest` suite ensuring 100% protocol conformance and determinism. All local tests, type checks (pyright), and linters (ruff) pass successfully.
Try it
Open PR on GitHubView diffCheckout locally
git fetch origin pull/34/head:pr-34
git checkout pr-34