Skip to content

Commit

Permalink
feat(x/data): add simple privacy preserving merkle tree algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Nov 29, 2023
1 parent 5d4fd33 commit c09b8d8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions proto/regen/data/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ enum GraphMerkleTree {

// unspecified and valid
GRAPH_MERKLE_TREE_NONE_UNSPECIFIED = 0;

// specifies that the content hash for the graph is based on the following merkle tree algorithm:
// 1. the graph is canonicalized using the specified canonicalization algorithm
// 2. each triple in the canonicalized graph is hashed as follows:
// a. the number of triples in the graph is used as the subject and predicate salt prefix
// b. the subject is hashed using the specified digest algorithm and the salt prefix
// c. the predicate is hashed using the specified digest algorithm and the salt prefix
// d. the object is hashed using the specified digest algorithm and a salt prefix consisting of the subject hash and predicate hash
// e. the resulting hashes are concatenated
// 3. each concatenated triple hash is concatenated with the following concatenated triple hash and these
// concatenated hashes are hashed using the specified digest algorithm and inserted into an array. If
// there is an odd number of concatenated triple hashes, the last concatenated triple hash is hashed
// with itself and placed in the array.
// 4. this process is repeated on the resulting array until there is only one hash remaining which is
// the graph hash
//
// This algorithm is allows for selectively disclosing any individual triples or parts of triples in the graph
// without disclosing the entire graph.
GRAPH_MERKLE_TREE_SIMPLE_PRIVACY_PRESERVING = 1;
}

// ContentHashes contains list of content ContentHash.
Expand Down

0 comments on commit c09b8d8

Please sign in to comment.