Skip to content

Consider adding storageRef field to DataProvenance DataRecord #10

@crtahlin

Description

@crtahlin

Context

Currently DataProvenance.registerData() anchors a single bytes32 dataHash (e.g. SHA256 of content). There is no way to associate a secondary reference such as a Swarm storage hash with the same record.

Use case: When uploading content to Swarm, you get a Swarm reference hash back. You want to register both the content's SHA256 and the Swarm reference where it's stored, linked together on-chain.

Current workaround

Use recordTransformation to link the two hashes, but this is semantically incorrect — a storage location is not a transformation.

No other contract in the set (ConsentAuditLog, ConsentProxy, DataAccessControl, DataDeletion, KantaraConsentReceipt, PurposeRegistry) handles this either.

Proposal

Add a bytes32 storageRef (or bytes32[] storageRefs for multiple storage backends) to the DataRecord struct and extend registerData / registerDataFor to accept it.

Things to consider

  • Should it be a single bytes32 or an array for multiple storage locations?
  • Should there be an updateStorageRef function to add/change storage refs after registration?
  • Impact on gas costs
  • Whether this belongs in DataProvenance or a separate StorageRegistry contract

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions