Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial draft of docs #24

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

initial draft of docs #24

wants to merge 21 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 12, 2021

No description provided.


### Curve

The curve used is BLS12-381. $\mathbb{G}_1$ denotes the prime order subgroup of order $r$ and $\mathbb{F}_r$ is the scalar field of BLS12-381 with prime order $r$. The pairing operation is $e(P,Q) : \mathbb{G}_1 \times \mathbb{G}_2$ \rightarrow \mathbb{G}_T$. The generator of $\mathbb{G}_1$ and $\mathbb{G}_2$ are denoted $G_1$ and $G_2$ respectively.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiousity, why not BLS12-377, that way theres future support for one layer of recursion should a need arise?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some mild convenience in terms of the trusted setup already existing; though given the small size of the polynomials we use, there is no reason we can't actually just include an ongoing trusted setup in the DKG itself.

Are there any other pro/cons to switching the implementation right now? It doesn't seem like a big deal to switch either now or later (depending on if anyone has strong opinions)

Copy link

@ValarDragon ValarDragon Apr 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not at all a big deal to switch later

Copy link

@simonmasson simonmasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a query-replace of $ to \\( and \\), and few forgotten lines in the encryption / decryption schemes.

@@ -0,0 +1,11 @@
# Preliminaries

Ferveo is intended to integrate into an existing framework such as Tendermint, and so the validator set is the natural participant set for Ferveo. Therefore, Ferveo assumes that all \\(n\\) validators have an associated Ed25519 public key identity and have staked some amount of token for the current epoch. Ferveo derives from the staking amounts an associated relative weight $\\(w_i\\). The total weight \\(\sum_i w_i = W\\) is a fixed parameter of the system, determined by a performance tradeoff (higher total weight allows more identities, higher resolution of weights, but larger computation and communication complexity). For performance reasons, $W$ is ideally a power of two.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ferveo is intended to integrate into an existing framework such as Tendermint, and so the validator set is the natural participant set for Ferveo. Therefore, Ferveo assumes that all \\(n\\) validators have an associated Ed25519 public key identity and have staked some amount of token for the current epoch. Ferveo derives from the staking amounts an associated relative weight $\\(w_i\\). The total weight \\(\sum_i w_i = W\\) is a fixed parameter of the system, determined by a performance tradeoff (higher total weight allows more identities, higher resolution of weights, but larger computation and communication complexity). For performance reasons, $W$ is ideally a power of two.
Ferveo is intended to integrate into an existing framework such as Tendermint, and so the validator set is the natural participant set for Ferveo. Therefore, Ferveo assumes that all \\(n\\) validators have an associated Ed25519 public key identity and have staked some amount of token for the current epoch. Ferveo derives from the staking amounts an associated relative weight \\(w_i\\). The total weight \\(\sum_i w_i = W\\) is a fixed parameter of the system, determined by a performance tradeoff (higher total weight allows more identities, higher resolution of weights, but larger computation and communication complexity). For performance reasons, \\(W\\) is ideally a power of two.

Under the asynchronous model, node clocks are not synchronized and messages can be delayed for arbitrary periods of time.

In practice a weak synchrony assumption is needed to assure liveness.
Under weak synchrony, the time difference $delay(T)$ between the time a message was sent ($T$) and the time it is received doesn't grow indefinitely over time.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Under weak synchrony, the time difference $delay(T)$ between the time a message was sent ($T$) and the time it is received doesn't grow indefinitely over time.
Under weak synchrony, the time difference \\(delay(T)\\) between the time a message was sent (\\(T\\)) and the time it is received doesn't grow indefinitely over time.

Tendermint works under the partially synchronous model.
In this model, there exist a point in time (GST - Global Stabilization Time) after which messages are delivered within a specific time bound.
The GST and time bound are not known in advance.
Tendermint tolerates a $t$-limited Byzantine adversary, with resilience

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tendermint tolerates a $t$-limited Byzantine adversary, with resilience
Tendermint tolerates a \\(t\\)-limited Byzantine adversary, with resilience


#### Ferveo
Ferveo's model and resilience will be the most restrictive of the above:
$n \ge 3t+1$ under the partially synchronous mode.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$n \ge 3t+1$ under the partially synchronous mode.
\\(n \ge 3t+1\\) under the partially synchronous mode.

Ferveo's model and resilience will be the most restrictive of the above:
$n \ge 3t+1$ under the partially synchronous mode.

In addition, the assumption that $2W/3$ weight of validators are not malicious means that they honestly follow the protocol. This excludes honest-but-curious behavior, such as engaging in out-of-band collusion outside of the protocol, which will be addressed later.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In addition, the assumption that $2W/3$ weight of validators are not malicious means that they honestly follow the protocol. This excludes honest-but-curious behavior, such as engaging in out-of-band collusion outside of the protocol, which will be addressed later.
In addition, the assumption that \\(2W/3\\) weight of validators are not malicious means that they honestly follow the protocol. This excludes honest-but-curious behavior, such as engaging in out-of-band collusion outside of the protocol, which will be addressed later.


The ideal scenario is that the fewest possible number of VSS instances are used, and everyone computationally prioritizes the same instances (so there are fewer VSS instances that consume computation time and are left unused)

Since we need at least dealer total weight $p+1$ of VSS instances to finish, the dealer identities can be sorted by their weight such that the $\ell$ highest weighted dealers sum to total weight at least $p+1$ and $\ell$ is minimized.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since we need at least dealer total weight $p+1$ of VSS instances to finish, the dealer identities can be sorted by their weight such that the $\ell$ highest weighted dealers sum to total weight at least $p+1$ and $\ell$ is minimized.
Since we need at least dealer total weight \\(p+1\\) of VSS instances to finish, the dealer identities can be sorted by their weight such that the \\(\ell\\) highest weighted dealers sum to total weight at least \\(p+1\\) and \\(\ell\\) is minimized.


Since we need at least dealer total weight $p+1$ of VSS instances to finish, the dealer identities can be sorted by their weight such that the $\ell$ highest weighted dealers sum to total weight at least $p+1$ and $\ell$ is minimized.

In the optimistic phase, if there are no faults that prevent these $\ell$ VSS instances from being finalized, and no disputes against those dealers, then these VSS instances are used in the DKG. This can be confirmed by $W-t-f$ weight signing a message indicating the optimistic phase succeeded along with the resulting public key. Since BLS signature aggregation can be used, this consumes $O(\log m)$ on-chain storage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the optimistic phase, if there are no faults that prevent these $\ell$ VSS instances from being finalized, and no disputes against those dealers, then these VSS instances are used in the DKG. This can be confirmed by $W-t-f$ weight signing a message indicating the optimistic phase succeeded along with the resulting public key. Since BLS signature aggregation can be used, this consumes $O(\log m)$ on-chain storage.
In the optimistic phase, if there are no faults that prevent these \\(\ell\\) VSS instances from being finalized, and no disputes against those dealers, then these VSS instances are used in the DKG. This can be confirmed by \\(W-t-f\\) weight signing a message indicating the optimistic phase succeeded along with the resulting public key. Since BLS signature aggregation can be used, this consumes \\(O(\log m)\\) on-chain storage.


### Pessimistic phase

Assume the optimistic phase does not succeed before a timeout period expires. Then the DKG enters the pessimistic phase where an arbitrary set of VSS instances of total weight at least $t$ can be used for DKG. The nodes should initiate additional VSS instances in order of decreasing weight of dealers to again minimize the total number of VSS instances that need to be dealt, and also to minimize the number of VSS instances a node spends computation to verify but remain unused. Every time a timeout period expires, more nodes should begin dealing VSS instances.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assume the optimistic phase does not succeed before a timeout period expires. Then the DKG enters the pessimistic phase where an arbitrary set of VSS instances of total weight at least $t$ can be used for DKG. The nodes should initiate additional VSS instances in order of decreasing weight of dealers to again minimize the total number of VSS instances that need to be dealt, and also to minimize the number of VSS instances a node spends computation to verify but remain unused. Every time a timeout period expires, more nodes should begin dealing VSS instances.
Assume the optimistic phase does not succeed before a timeout period expires. Then the DKG enters the pessimistic phase where an arbitrary set of VSS instances of total weight at least \\(t\\) can be used for DKG. The nodes should initiate additional VSS instances in order of decreasing weight of dealers to again minimize the total number of VSS instances that need to be dealt, and also to minimize the number of VSS instances a node spends computation to verify but remain unused. Every time a timeout period expires, more nodes should begin dealing VSS instances.


Assume the optimistic phase does not succeed before a timeout period expires. Then the DKG enters the pessimistic phase where an arbitrary set of VSS instances of total weight at least $t$ can be used for DKG. The nodes should initiate additional VSS instances in order of decreasing weight of dealers to again minimize the total number of VSS instances that need to be dealt, and also to minimize the number of VSS instances a node spends computation to verify but remain unused. Every time a timeout period expires, more nodes should begin dealing VSS instances.

In the pessimistic phase, as soon as $W-t-f$ weight of VSS instances finalize (as determined by ready signatures with no disputes and dealer finalization), then the first sufficient subset of finalized VSS instances is used for the DKG, as determined by the order that the finalization messages are posted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the pessimistic phase, as soon as $W-t-f$ weight of VSS instances finalize (as determined by ready signatures with no disputes and dealer finalization), then the first sufficient subset of finalized VSS instances is used for the DKG, as determined by the order that the finalization messages are posted.
In the pessimistic phase, as soon as \\(W-t-f\\) weight of VSS instances finalize (as determined by ready signatures with no disputes and dealer finalization), then the first sufficient subset of finalized VSS instances is used for the DKG, as determined by the order that the finalization messages are posted.


### Debiasing the final key

The approach of Neji et al can be used to debias the final key. The public key $[s] H_1$ is the sum of all finalization values $[S(0)] H_1$ for all successful VSS instances, and the shared secret key is sharewise sum of all VSS shares.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The approach of Neji et al can be used to debias the final key. The public key $[s] H_1$ is the sum of all finalization values $[S(0)] H_1$ for all successful VSS instances, and the shared secret key is sharewise sum of all VSS shares.
The approach of Neji et al can be used to debias the final key. The public key \\([s] H_1\\) is the sum of all finalization values \\([S(0)] H_1\\) for all successful VSS instances, and the shared secret key is sharewise sum of all VSS shares.

Copy link
Contributor

@ggkitsas ggkitsas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit that adds a description of the TPKE for the KZG-DKG.

I'll push another commit describing the threshold signature schemes.

Left some minor fixes and completions as suggestions in place.


## Fast subgroup checks

All subgroup checks of membership in the subgroup \\(\mathbb{G}_1\\) and \\(\mathbb{G}_2\\) are performed as described in https://eprint.iacr.org/2019/814.pdf for performance reasons.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All subgroup checks of membership in the subgroup \\(\mathbb{G}_1\\) and \\(\mathbb{G}_2\\) are performed as described in https://eprint.iacr.org/2019/814.pdf for performance reasons.
All subgroup checks of membership in the subgroup \\(\mathbb{G}_1\\) and \\(\mathbb{G}_2\\) are performed as described in [here](https://eprint.iacr.org/2019/814.pdf) for performance reasons.

All subgroup checks of membership in the subgroup \\(\mathbb{G}_1\\) and \\(\mathbb{G}_2\\) are performed as described in https://eprint.iacr.org/2019/814.pdf for performance reasons.
## Hashing

Let \\(\operatorname{H}_{\mathbb{G}}: \{0,1\}^* \rightarrow \mathbb{G}\\) be the hash to curve function into the group \\(\mathbb{G}\\) as specified in RFC https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Let \\(\operatorname{H}_{\mathbb{G}}: \{0,1\}^* \rightarrow \mathbb{G}\\) be the hash to curve function into the group \\(\mathbb{G}\\) as specified in RFC https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/
Let \\(\operatorname{H}_{\mathbb{G}}: \{0,1\}^* \rightarrow \mathbb{G}\\) be the hash to curve function into the group \\(\mathbb{G}\\) as specified in [this RFC](https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/)

\\[C = \operatorname{encrypt}(k, M)\\]
\\[M = \operatorname{decrypt}(k, C)\\]

Symmetric key encryption and decryption are provided by the ChaCha20Poly1305 (RFC8439) cipher, implemented as the chacha20poly1305 crate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Symmetric key encryption and decryption are provided by the ChaCha20Poly1305 (RFC8439) cipher, implemented as the chacha20poly1305 crate.
Symmetric key encryption and decryption are provided by the ChaCha20Poly1305 ([RFC8439](https://datatracker.ietf.org/doc/html/rfc8439) cipher, implemented as the chacha20poly1305 crate.

book/src/tpke.md Outdated
4. Let \\(W = [r] H_{\mathbb{G}_2} (U || V)\\)
5. Let \\(k = HKDF\\)

The public key portion of the ciphertext is \\(U,W)\\) and the derived shared secret is \\(s\\).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The public key portion of the ciphertext is \\(U,W)\\) and the derived shared secret is \\(s\\).
The public key portion of the ciphertext is \\((U,W)\\) and the derived shared secret is \\(s\\). The ciphertext is \\(V\\).

book/src/tpke.md Outdated
Comment on lines 11 to 15
1. Let \\(r\\) be a random scalar
2. Let \\(s = e([r] Y, H)\\)
3. Let \\(U = [r] G\\)
4. Let \\(W = [r] H_{\mathbb{G}_2} (U || V)\\)
5. Let \\(k = HKDF\\)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Let \\(r\\) be a random scalar
2. Let \\(s = e([r] Y, H)\\)
3. Let \\(U = [r] G\\)
4. Let \\(W = [r] H_{\mathbb{G}_2} (U || V)\\)
5. Let \\(k = HKDF\\)
1. Let \\(m\\) be the plaintext
2. Let \\(r\\) be a random scalar
3. Let \\(s = e([r] Y, H)\\)
4. Let \\(U = [r] G\\)
5. Let \\(k = \\(\operatorname{H}_{\ell}(s)\\)
6. Let \\(V = encrypt(k, m)\\)
7. Let \\(W = [r] H_{\mathbb{G}_2} (U || V)\\)

Comment on lines +25 to +26
1. Check ciphertext validity.
2. Let \\(s = e(U, Z)\\)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Check ciphertext validity.
2. Let \\(s = e(U, Z)\\)
1. Check ciphertext validity.
2. Let \\(s = e(U, Z)\\)
3. Let \\(k = \\(\operatorname{H}_{\ell}(s)\\)
4. Plaintext is \\(m = decrypt(k, V)\\)

@@ -0,0 +1,3 @@
# Side Channel Analysis

As Ferveo is an online protocol that depends on complex cryptographic primitives, this section will include an analysis of potential side channels where private dta and keys may be leaked.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As Ferveo is an online protocol that depends on complex cryptographic primitives, this section will include an analysis of potential side channels where private dta and keys may be leaked.
As Ferveo is an online protocol that depends on complex cryptographic primitives, this section will include an analysis of potential side channels where private data and keys may be leaked.

@ggkitsas
Copy link
Contributor

ggkitsas commented Jul 1, 2021

TSS desciption added ⬆️

Copy link

@simonmasson simonmasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants