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
Context
Currently
DataProvenance.registerData()anchors a singlebytes32 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
recordTransformationto 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(orbytes32[] storageRefsfor multiple storage backends) to theDataRecordstruct and extendregisterData/registerDataForto accept it.Things to consider
bytes32or an array for multiple storage locations?updateStorageReffunction to add/change storage refs after registration?