-
Notifications
You must be signed in to change notification settings - Fork 112
Description
From this discord thread: https://discord.com/channels/974410303255232542/1364680340198658238
tlsn/crates/formats/src/json/commit.rs
Lines 160 to 161 in de7a47d
// TODO: Commit each value separately, but we need a strategy for handling | |
// separators. |
JsonCommit::commit_array
currently commits the whole array only, preventing selective disclosures.
The sensible logic here is to take the rangeset of the array, and the union of the rangesets of the elements, and compute their difference. Then, commit to each range in the difference individually. This should result in commits for the open and close of the array, as well as each separator, with whitespace.
Each element of the array should then be committed to recursively through commit_value.
This should permit a set of reveals to be computed that selectively discloses the values. Further work would be in computing the set of ranges that would reveal a valid JSON array, including separators, for some given subset of array elements.