Closed olizilla closed 1 year ago
I'm looking at the walk api now to see how that needs to change to deal with bi-directional equals claims now.
Walk api is not critical to this work. We will be querying by content cid only. There is a more general problem of "the walk api needs to guard against loops" that should be tackled before we go live with that api. Issue raised https://github.com/web3-storage/content-claims/issues/24
We want to return equals claims when quired with either the content cid or the equals cid, so store 2 records in dynamo for equals claims.
assert/equals
claims provide 2 CIDs. Thecontent
CID and theequals
CID that we claim thecontent
CID is equivelant to. (e.g. different hash fn for same bytes)The dynamo records are
{ content: "base58btc-multihash", claim: CID }
. The actual bytes of the claim are stored in s3, only once per claim.For equals claims we store an additional record that sets the
content
to the multihash of the providedequals
CID.Alternatively we could have stored an
equals
property on dynamo records for equals claims, and added a global secondary index for that field, and updated the query to check both the content field and the equals field (and the secondary index) for every query, but this would incur additonal read costs for every query. It is assumed that storing a extra tuple of [string,cid] per equals claim will be cheap, and avoids a larger refactor of the claims db.License: MIT