Skip to content

Commit

Permalink
Added commitment trees
Browse files Browse the repository at this point in the history
  • Loading branch information
ihordiachenko committed Jul 4, 2024
1 parent 0ddc605 commit 3d878e3
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Accounts overview doc;
- Commitment trees docs;

### Changed
- Updated the docs structure to reflect the shift to social protocol;
Expand Down
21 changes: 19 additions & 2 deletions docs/commitment-trees/commitments.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
---
slug: /commitment-trees/commitments
title: Commitments
description: Commitments
description: The cryptographic backbone of private interactions
---
import OutLink from "@site/src/components/OutLink";
import IdealImage from '@site/src/components/IdealImage';

# Commitments
# Commitments


Cryptographic commitment is a crucial low-level primitive that binds specific data while concealing its content. This function is vital in standardizing all statements at the protocol level. Such standardization is essential for maintaining social tree structural uniformity. The structure of social trees facilitates the creation of efficient inclusion proofs, which is particularly beneficial for proof aggregation, for example, when a user must demonstrate their inclusion within a set of trees. This method ensures both the integrity and privacy of user data within the network.

The construction of a commitment is as follows:

```
Comm = hash(statement || salt)
```

The `statement` can represent any data, including some algorithms and programs. The `salt` is an additional value generated by the commitment initiator that allows the statement to be blinded. Usually, the `salt` is random, but in some cases, it can be deterministic (i.e., for achieving uniqueness). We recommend using the user's secret key for salt derivation to simplify the proving and recovery procedures.

When constructing a commitment, the user creates an irreversible anchor for the statement while keeping its content private. The following actions should be performed to disclose information about the underlying statement selectively:

1. Prove that the commitment is part of a particular tree. Some trees can be built off-chain with time stamping only their root values.
1. Prove the knowledge of the statement and the salt (two values that were used for commitment construction)
1. Prove that the statement satisfies particular criteria. The complexity of the criteria can range from a statement revealing to provable queries without disclosure.
19 changes: 17 additions & 2 deletions docs/commitment-trees/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
---
slug: /commitment-trees
title: Commitment trees
description: Commitment trees
description: Еhe efficient and secure data structure for commitments to the private social graph.
---
import OutLink from "@site/src/components/OutLink";
import IdealImage from '@site/src/components/IdealImage';

# Commitment trees
# Commitment trees

Although Rarimo users fully own their private social graph, some on-chain state data is required to facilitate the use of ZK proofs in social apps. The protocol employs [Commitments](/commitment-trees/commitments) to create public anchors for the artifacts of private social graphs and commitment trees to securely and efficiently store the commitments on-chain.

Rarimo Protocol defines the following tree types:
- [Statement Trees(ST)](/commitment-trees/statement-trees) containing basic statements
- [Credential Trees(CT)](/credential-trees) used for hierarchical one-to-many relations
- [Time Trees(TT)](/commitment-trees/time-trees) active for a specific time range

<IdealImage img={require('/img/social-forest.png')} alt="Social forest" />

An aggregation of commitment trees corresponding to some private social graph forms a social forest. The social forest can be used to build novel privacy-first social apps. Here are several examples of such applications:
- Users seeking to create a permissionless chat may utilize the [Arbitrary Statement Tree(ARST)](/commitment-trees/statement-trees#arbitrary-statement-trees). Each message is encapsulated within a corresponding commitment. For anonymity, participants might opt for random salts and signatures, discarding them after usage. Deterministic salt and consistent keypairs for signing can be used to prove the message sequence later.
- The [Asjustable Statement Tree(ADST)](/commitment-trees/statement-trees#adjastable-statement-trees) can be employed to establish a chat accessible only to users meeting specific criteria. Users must provide proof of eligibility when posting messages, with the eligibility criteria set transparently by the chat's creator and enforced via smart contract.
- Entities desiring to act as identity providers, such as authoritative organizations issuing verifiable credentials, should use the [Credential Trees](/credential-trees). Unlike the `ARST` and `ADST` trees, this tree type is exclusively manageable by its owner.
- The [Time Trees(TT)](/commitment-trees/time-trees) are most suitable for events confined to a specific timeframe, such as petition signings or periodic check-ins for liveness proofs.
17 changes: 15 additions & 2 deletions docs/commitment-trees/statement-trees.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
---
slug: /commitment-trees/statement-trees
title: Statement trees
description: Statement trees
description: A type of commitment tree that accommodates basic statements without hierarchical relations and time bounds.
# TODO: add illustrations
---
import OutLink from "@site/src/components/OutLink";
import IdealImage from '@site/src/components/IdealImage';

# Statement trees
# Statement trees

Statement Trees (ST) accommodate basic statements without hierarchical relations and time bounds. They are further subdivided into arbitrary and adjustable.

## Arbitrary Statement Trees (ARST)

This subtype imposes no validation rules on the data added. It acts as an open outlet where any commitment can be submitted and later revealed alongside its validation rules, like a permissionless wall where anyone can write what they want.

## Adjustable Statement Trees (ADST)

This subtype allows setting rules for adding commitments to the tree. To add commitment to the ADST tree, the user must prove that the statement satisfies the rules (partial knowledge).


6 changes: 4 additions & 2 deletions docs/commitment-trees/time-trees.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
slug: /commitment-trees/time-trees
title: Time trees
description: Time trees
description: Type of commitment tree that is active within a specific time frame.
---
import OutLink from "@site/src/components/OutLink";
import IdealImage from '@site/src/components/IdealImage';

# Time trees
# Time trees

Time Trees are active within some time frame and restrict the addition of new commitments after a predetermined point. They can be implemented on top of both [statement trees](/commitment-trees/statement-trees) and [credential trees](/credential-trees).
Binary file added static/img/social-forest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d878e3

Please sign in to comment.