Provenance Contract

The Provenance contract ensures data traceability by allowing authorized writers to create and modify provenance data. This contract is particularly useful for verifying the history and modifications of digital assets.

Key Features

  • Writer Management: Only designated writers can create or modify provenance data.

  • Data Traceability: Each provenance record links back to its original hash for complete transparency.

  • Modification Mapping: Tracks updates made to existing provenance records.

Contract Details

Constructor

Initializes the contract by assigning the deployer as the owner and the first writer.

Provenance Structure

struct ProvenanceData {
    string provenance;
    address writer;
}
  • provenance: The description or metadata of the asset.

  • writer: The address of the entity that created or modified the record.

Key Functions

  1. getWriters: Returns the list of all authorized writers.

  2. addWriterAddress: Allows the owner to add new writers.

  3. removeWriterAddress: Enables the owner to remove writers.

  4. createProvenance: Allows a writer to create a new provenance record.

  5. updateProvenance: Updates an existing provenance record and links it to the original hash.

  6. getProvenanceData: Fetches the provenance data for a given hash.

  7. getOriginalHash: Retrieves the original hash for a given modified hash.

Contract Deployed on the Hash Network Testnet at: View Provenance Contract

Last updated