|
@@ -12,7 +12,9 @@ Let $\t{MerklePos}, \t{MerklePath}, \t{MerkleRoot}$ be defined as in the section
|
|
|
|
|
|
|
|
Let $\t{Params}_\t{DAO}, \t{Bulla}_\t{DAO}, \t{Params}_\t{Proposal}, \t{Bulla}_\t{Proposal}$ be defined as in [DAO Model](model.md).
|
|
Let $\t{Params}_\t{DAO}, \t{Bulla}_\t{DAO}, \t{Params}_\t{Proposal}, \t{Bulla}_\t{Proposal}$ be defined as in [DAO Model](model.md).
|
|
|
|
|
|
|
|
-Let $\t{EncNote}$ be defined as in [In-band Secret Distribution](../../crypto-schemes.md#in-band-secret-distribution).
|
|
|
|
|
|
|
+Let $\t{AeadEncNote}$ be defined as in [In-band Secret Distribution](../../crypto-schemes.md#in-band-secret-distribution).
|
|
|
|
|
+
|
|
|
|
|
+Let $\t{ElGamal.Encryptโ}, \t{ElGamalEncNote}โ$ be defined as in the section [Verifiable In-Band Secret Distribution](../../crypto-schemes.md#verifiable-in-band-secret-distribution).
|
|
|
|
|
|
|
|
## Mint
|
|
## Mint
|
|
|
|
|
|
|
@@ -97,7 +99,7 @@ $$ \begin{aligned}
|
|
|
R_\t{DAO} &โ ๐ฝโ \\
|
|
R_\t{DAO} &โ ๐ฝโ \\
|
|
|
T &โ ๐ฝโ \\
|
|
T &โ ๐ฝโ \\
|
|
|
๐ซ &โ \t{im}(\t{Bulla}_\t{Proposal}) \\
|
|
๐ซ &โ \t{im}(\t{Bulla}_\t{Proposal}) \\
|
|
|
- \t{note} &โ \t{EncNote} \\
|
|
|
|
|
|
|
+ \t{note} &โ \t{AeadEncNote} \\
|
|
|
๐ข &โ \t{ProposeInput}^*
|
|
๐ข &โ \t{ProposeInput}^*
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
|
|
|
|
@@ -228,7 +230,7 @@ $$ \begin{aligned}
|
|
|
ฯ &โ ๐ฝโ \\
|
|
ฯ &โ ๐ฝโ \\
|
|
|
๐ซ &โ \t{im}(\t{Bulla}_\t{Proposal}) \\
|
|
๐ซ &โ \t{im}(\t{Bulla}_\t{Proposal}) \\
|
|
|
V_\t{yes} &โ โโ \\
|
|
V_\t{yes} &โ โโ \\
|
|
|
- \t{note} &โ \t{EncNote} \\
|
|
|
|
|
|
|
+ \t{enc\_vote} &โ \t{ElGamalEncNote}โ \\
|
|
|
๐ข &โ \t{VoteInput}^*
|
|
๐ข &โ \t{VoteInput}^*
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
|
|
|
|
@@ -240,6 +242,14 @@ $$ \begin{aligned}
|
|
|
\t{VoteInput}.\t{PK}_ฯ &โ โโ
|
|
\t{VoteInput}.\t{PK}_ฯ &โ โโ
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
|
|
|
|
|
|
|
+**Note**: $\t{VoteInput}.V$ is a pedersen commitment, where the blinds are
|
|
|
|
|
+selected such that their sum is a valid field element in $๐ฝโ$ so the blind
|
|
|
|
|
+for $โ V$ can be verifiably encrypted. Likewise we do the same for the blind
|
|
|
|
|
+used to calculate $V_\t{yes}$.
|
|
|
|
|
+
|
|
|
|
|
+This allows DAO members to securely receive all secrets for votes on a proposal.
|
|
|
|
|
+This is then used in the Exec phase when we work on the sum of DAO votes.
|
|
|
|
|
+
|
|
|
```rust
|
|
```rust
|
|
|
{{#include ../../../../../src/contract/dao/src/model.rs:dao-vote-params}}
|
|
{{#include ../../../../../src/contract/dao/src/model.rs:dao-vote-params}}
|
|
|
```
|
|
```
|
|
@@ -260,11 +270,12 @@ $$ \begin{aligned}
|
|
|
d &โ \t{Params}_\t{DAO} \\
|
|
d &โ \t{Params}_\t{DAO} \\
|
|
|
b_d &โ ๐ฝโ \\
|
|
b_d &โ ๐ฝโ \\
|
|
|
o &โ ๐ฝโ \\
|
|
o &โ ๐ฝโ \\
|
|
|
- b_y &โ ๐ฝแตฅ \\
|
|
|
|
|
|
|
+ b_y &โ ๐ฝโ \\
|
|
|
v &โ ๐ฝโ \\
|
|
v &โ ๐ฝโ \\
|
|
|
- bแตฅ &โ ๐ฝแตฅ \\
|
|
|
|
|
|
|
+ bแตฅ &โ ๐ฝโ \\
|
|
|
b_ฯ &โ ๐ฝโ \\
|
|
b_ฯ &โ ๐ฝโ \\
|
|
|
- t_\t{now} &โ ๐ฝโ
|
|
|
|
|
|
|
+ t_\t{now} &โ ๐ฝโ \\
|
|
|
|
|
+ \t{esk} &โ ๐ฝโ \\
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
Attach a proof $ฯ_\mathcal{V}$ such that the following relations hold:
|
|
Attach a proof $ฯ_\mathcal{V}$ such that the following relations hold:
|
|
|
|
|
|
|
@@ -275,9 +286,9 @@ commit $T = \t{PedersenCommit}(d.ฯ, b_ฯ)$ where $T = โ_{i โ ๐ข} Tแตข$.
|
|
|
|
|
|
|
|
**Proposal bulla integrity**   $๐ซ = \t{Bulla}_\t{Proposal}(p, b_p)$
|
|
**Proposal bulla integrity**   $๐ซ = \t{Bulla}_\t{Proposal}(p, b_p)$
|
|
|
|
|
|
|
|
-**Yes vote commit**   $V_\t{yes} = \t{PedersenCommit}(ov, b_y)$
|
|
|
|
|
|
|
+**Yes vote commit**   $V_\t{yes} = \t{PedersenCommit}(ov, \t{Lift}แตฅ(b_y))$
|
|
|
|
|
|
|
|
-**Total vote value commit**   $V_\t{all} = \t{PedersenCommit}(v, bแตฅ)$ where
|
|
|
|
|
|
|
+**Total vote value commit**   $V_\t{all} = \t{PedersenCommit}(v, \t{Lift}แตฅ(bแตฅ))$ where
|
|
|
$V_\t{all} = โ_{i โ ๐ข} i.V$ should also hold.
|
|
$V_\t{all} = โ_{i โ ๐ข} i.V$ should also hold.
|
|
|
|
|
|
|
|
**Vote option boolean**   enforce $o โ \{ 0, 1 \}$.
|
|
**Vote option boolean**   enforce $o โ \{ 0, 1 \}$.
|
|
@@ -285,6 +296,10 @@ $V_\t{all} = โ_{i โ ๐ข} i.V$ should also hold.
|
|
|
**Proposal not expired**   let $t_\t{end} = โโโ2๐ฝโ(p.tโ) + โโโ2๐ฝโ(p.D)$,
|
|
**Proposal not expired**   let $t_\t{end} = โโโ2๐ฝโ(p.tโ) + โโโ2๐ฝโ(p.D)$,
|
|
|
and then check $t_\t{now} < t_\t{end}$.
|
|
and then check $t_\t{now} < t_\t{end}$.
|
|
|
|
|
|
|
|
|
|
+**Verifiable encryption of vote commit secrets**  
|
|
|
|
|
+let $๐ง = (o, b_y, v, bแตฅ)$, and verify
|
|
|
|
|
+$\t{enc\_vote} = \t{ElGamal}.\t{Encrypt}(๐ง, \t{esk}, d.\t{PK})$.
|
|
|
|
|
+
|
|
|
For each input $i โ ๐ข$, perform the following checks:
|
|
For each input $i โ ๐ข$, perform the following checks:
|
|
|
|
|
|
|
|
  **Valid input merkle root**   check that $i.R_\t{coin}$ is the
|
|
  **Valid input merkle root**   check that $i.R_\t{coin}$ is the
|
|
@@ -427,29 +442,11 @@ DAO treasury but be unspendable.
|
|
|
|
|
|
|
|
Define the DAO AuthMoneyTransfer function params
|
|
Define the DAO AuthMoneyTransfer function params
|
|
|
$$ \begin{aligned}
|
|
$$ \begin{aligned}
|
|
|
- ๐_\t{enc} &โ \t{AuthCoinAttrs}^* \\
|
|
|
|
|
- \t{EPK}_\t{DAO} &โ โโ \\
|
|
|
|
|
- v_\t{DAO}^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- ฯ_\t{DAO}^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- ฮถ_\t{DAO}^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
|
|
+ ๐_\t{enc} &โ \t{ElGamalEncNote}โ
^* \\
|
|
|
|
|
+ ๐_\t{enc} &โ \t{ElGamalEncNote}โ
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
|
|
|
|
|
-Define the DAO $\t{AuthCoinAttrs}$ as
|
|
|
|
|
-$$ \begin{aligned}
|
|
|
|
|
- \t{AuthCoinAttrs}.\t{EPK} &โ โโ \\
|
|
|
|
|
- \t{AuthCoinAttrs}.v^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- \t{AuthCoinAttrs}.ฯ^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- \t{AuthCoinAttrs}.ฮถ^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- \t{AuthCoinAttrs}.\t{SH}^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
- \t{AuthCoinAttrs}.\t{UD}^\t{enc} &โ ๐ฝโ \\
|
|
|
|
|
-\end{aligned} $$
|
|
|
|
|
-which corresponds to encrypted coin attributes.
|
|
|
|
|
-In both cases $\t{EPK}$ refers to the ephemeral key used to construct a
|
|
|
|
|
-diffie-hellman shared secret. We then derive further blinding factors from this
|
|
|
|
|
-shared secret which we use to encrypt the [coin attributes](../money/model.md#coin)
|
|
|
|
|
-$v, ฯ, ฮถ, \t{SH}, \t{UD}$.
|
|
|
|
|
-
|
|
|
|
|
-This provides verifiable note encryption for all output coins in the sibling `Money::transfer()` call.
|
|
|
|
|
|
|
+This provides verifiable note encryption for all output coins in the sibling `Money::transfer()` call as well as the DAO change coin.
|
|
|
|
|
|
|
|
```rust
|
|
```rust
|
|
|
{{#include ../../../../../src/contract/dao/src/model.rs:dao-auth_xfer-params}}
|
|
{{#include ../../../../../src/contract/dao/src/model.rs:dao-auth_xfer-params}}
|
|
@@ -480,7 +477,7 @@ $$ \begin{aligned}
|
|
|
v_\t{DAO} &โ ๐ฝโ \\
|
|
v_\t{DAO} &โ ๐ฝโ \\
|
|
|
ฯ_\t{DAO} &โ ๐ฝโ \\
|
|
ฯ_\t{DAO} &โ ๐ฝโ \\
|
|
|
ฮถ_\t{DAO} &โ ๐ฝโ \\
|
|
ฮถ_\t{DAO} &โ ๐ฝโ \\
|
|
|
- e &โ ๐ฝโ \\
|
|
|
|
|
|
|
+ \t{esk} &โ ๐ฝโ \\
|
|
|
\end{aligned} $$
|
|
\end{aligned} $$
|
|
|
|
|
|
|
|
Attach a proof $ฯ_\t{auth}$ such that the
|
|
Attach a proof $ฯ_\t{auth}$ such that the
|
|
@@ -499,19 +496,9 @@ where $๐ซ $ matches the value in `DAO::exec()`, and $p.๐ = ๐ $.
|
|
|
$$ C_\t{DAO} = \t{Coin}(d.\t{PK}, v_\t{DAO}, ฯ_\t{DAO}, ฮถ_\t{DAO},
|
|
$$ C_\t{DAO} = \t{Coin}(d.\t{PK}, v_\t{DAO}, ฯ_\t{DAO}, ฮถ_\t{DAO},
|
|
|
\t{CID}_\t{DAO}, ๐ ) $$
|
|
\t{CID}_\t{DAO}, ๐ ) $$
|
|
|
|
|
|
|
|
-**Diffie-Hellman shared secret**   $\t{EPK}_\t{DAO} = \t{DerivePubKey}(e)$.
|
|
|
|
|
-Now we create the shared secret with the DAO pubkey.
|
|
|
|
|
-$$ P = \t{Lift}แตฅ(e) d.\t{PK} $$
|
|
|
|
|
-$$ ฮฑ = \t{PoseidonHash}(\mathcal{X}(P), \mathcal{Y}(P)) $$
|
|
|
|
|
-This is then used in the following three checks.
|
|
|
|
|
-
|
|
|
|
|
-**Verifiable encryption for value**   $v_\t{DAO}^\t{enc} = v_\t{DAO} + ฮฑ$
|
|
|
|
|
-
|
|
|
|
|
-**Verifiable encryption for token ID**   let $ฮฑโ = \t{PoseidonHash}(ฮฑ, 1_{๐ฝโ})$
|
|
|
|
|
-then $ฯ_\t{DAO}^\t{enc} = ฯ_\t{DAO} + ฮฑโ$.
|
|
|
|
|
-
|
|
|
|
|
-**Verifiable encryption for serial**   let $ฮฑโ = \t{PoseidonHash}(ฮฑ, 2_{๐ฝโ})$
|
|
|
|
|
-then $ฮถ_\t{DAO}^\t{enc} = ฮถ_\t{DAO} + ฮฑโ$.
|
|
|
|
|
|
|
+**Verifiable DAO change coin note encryption**  
|
|
|
|
|
+let $๐ง = (v_\t{DAO}, ฯ_\t{DAO}, ฮถ_\t{DAO})$, and verify
|
|
|
|
|
+$๐_\t{enc} = \t{ElGamal}.\t{Encrypt}(๐ง, \t{esk}, d.\t{PK})$.
|
|
|
|
|
|
|
|
Then we do the same for each output coin of `Money::transfer()`.
|
|
Then we do the same for each output coin of `Money::transfer()`.
|
|
|
For $k โ [n]$, let $a = (๐_\t{enc})โ$ and $C$ be the $k$th output coin from
|
|
For $k โ [n]$, let $a = (๐_\t{enc})โ$ and $C$ be the $k$th output coin from
|
|
@@ -525,19 +512,9 @@ Attach a proof $ฯโ$ such that the following relations hold:
|
|
|
|
|
|
|
|
  **Coin integrity**   $C = \t{Coin}(c)$
|
|
  **Coin integrity**   $C = \t{Coin}(c)$
|
|
|
|
|
|
|
|
-  **Diffie-Hellman shared secret**   $a.\t{EPK} = \t{DerivePubKey}(e)$.
|
|
|
|
|
-Now we create the shared secret with the DAO pubkey.
|
|
|
|
|
-$$ P = \t{Lift}แตฅ(e) c.\t{PK} $$
|
|
|
|
|
-$$ ฮฑ = \t{PoseidonHash}(\mathcal{X}(P), \mathcal{Y}(P)) $$
|
|
|
|
|
-This is then used in the following three checks.
|
|
|
|
|
-
|
|
|
|
|
-  **Verifiable encryption for value**   $a.v^\t{enc} = c.v + ฮฑ$
|
|
|
|
|
-
|
|
|
|
|
-  **Verifiable encryption for token ID**   let $ฮฑโ = \t{PoseidonHash}(ฮฑ, 1_{๐ฝโ})$
|
|
|
|
|
-then $a.ฯ^\t{enc} = c.ฯ + ฮฑโ$.
|
|
|
|
|
-
|
|
|
|
|
-  **Verifiable encryption for serial**   let $ฮฑโ = \t{PoseidonHash}(ฮฑ, 2_{๐ฝโ})$
|
|
|
|
|
-then $a.ฮถ^\t{enc} = c.ฮถ + ฮฑโ$.
|
|
|
|
|
|
|
+  **Verifiable output coin note encryption**  
|
|
|
|
|
+let $๐ง = (c.v, c.ฯ, c.ฮถ, c.\t{SH}, c.\t{UD})$, and verify
|
|
|
|
|
+$a = \t{ElGamal}.\t{Encrypt}(๐ง, \t{esk}, d.\t{PK})$.
|
|
|
|
|
|
|
|
### Signatures
|
|
### Signatures
|
|
|
|
|
|