Skip to content

JSON committer should commit array values individually #807

@TheFrozenFire

Description

@TheFrozenFire

From this discord thread: https://discord.com/channels/974410303255232542/1364680340198658238

// 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions