|
|
@@ -1,20 +1,20 @@
|
|
|
# DAO
|
|
|
|
|
|
-On the testnet, we are also able to create an anonymous DAO. Using
|
|
|
-the `drk` CLI tool, we have a `dao` subcommand that can perform the
|
|
|
-necessary operations.
|
|
|
+On the testnet, we can also create anonymous DAOs. Using the `drk`
|
|
|
+CLI tool, we have a `dao` subcommand that can perform the necessary
|
|
|
+operations.
|
|
|
|
|
|
DarkFi DAOs have several configurable parameters, including:
|
|
|
|
|
|
- **Proposer_limit**: the minimum amount of governance tokens needed to
|
|
|
open a proposal.
|
|
|
- **Quorum**: The minimal threshold of participating total tokens
|
|
|
-needed for a proposal to pass (expressed as an absolute value).
|
|
|
+needed for a proposal to pass.
|
|
|
- **Early execution quorum**: The minimal threshold of participating
|
|
|
-total tokens needed for a proposal to be considered as strongly
|
|
|
-supported, enabling early execution. Must be greater or equal to normal
|
|
|
+total tokens needed for a proposal to be considered strongly supported,
|
|
|
+enabling early execution. Must be greater than or equal to normal
|
|
|
quorum.
|
|
|
-- **Approval_ratio**: The ratio of winning/total votes needed for a
|
|
|
+- **Approval_ratio**: The ratio of yes/total votes needed for a
|
|
|
proposal to pass.
|
|
|
- **Governance token**: The DAO's governance token ID.
|
|
|
|
|
|
@@ -47,9 +47,9 @@ FLAGS:
|
|
|
ARGS:
|
|
|
<proposer-limit> The minimum amount of governance tokens needed to open a proposal for this DAO
|
|
|
<quorum> Minimal threshold of participating total tokens needed for a proposal to pass
|
|
|
- <early-exec-quorum> Minimal threshold of participating total tokens needed for a proposal to be considered as
|
|
|
- strongly supported, enabling early execution. Must be greater or equal to normal quorum
|
|
|
- <approval-ratio> The ratio of winning votes/total votes needed for a proposal to pass (2 decimals)
|
|
|
+ <early-exec-quorum> Minimal threshold of participating total tokens needed for a proposal to be considered
|
|
|
+ strongly supported, enabling early execution. Must be greater than or equal to normal quorum
|
|
|
+ <approval-ratio> The ratio of yes votes/total votes needed for a proposal to pass (2 decimals)
|
|
|
<gov-token-id> DAO's governance token ID
|
|
|
```
|
|
|
|
|
|
@@ -86,13 +86,23 @@ Early Exec Secret key: 9r9URX...TZCHPL
|
|
|
Bulla blind: 6TVkmM...Jjd5zC
|
|
|
```
|
|
|
|
|
|
-Since its a normal `toml` file, you may open it with you favourite
|
|
|
-editor, modify the keys configuration and/or maintain different config
|
|
|
-versions for different DAO members. By default all keys are different,
|
|
|
-so its up to the DAO founders to chose what configuration they are
|
|
|
-going to use. After configuring the file(s) properly, it can be shared
|
|
|
-among DAO members, so they hold the generated DAO information and keys.
|
|
|
-The view command will show us the parameters. If everything looks fine,
|
|
|
+The DAO configuration includes several keypairs controlling different
|
|
|
+permissions:
|
|
|
+
|
|
|
+- **Proposer key**: Required to create new proposals
|
|
|
+- **Exec key**: Required to execute proposals after voting ends
|
|
|
+- **Early Exec key**: Required to execute strongly supported proposals immediately
|
|
|
+- **Notes key**: Required to decrypt encrypted DAO-related notes
|
|
|
+- **Proposals/Votes keys**: Required to view proposals and votes on-chain
|
|
|
+
|
|
|
+By default, all keys are unique, giving DAO founders flexibility in
|
|
|
+access control. DAO founders may share certain keys (e.g., proposer
|
|
|
+key with all members, exec key only with trusted executors) or maintain
|
|
|
+separation of duties.
|
|
|
+
|
|
|
+Since its a normal `toml` file, you can edit it with any text editor to
|
|
|
+modify keys or maintain different versions for different members. The
|
|
|
+view command will show us the parameters. If everything looks fine,
|
|
|
we can now import it into our wallet:
|
|
|
|
|
|
```shell
|
|
|
@@ -140,10 +150,9 @@ Wallet Address: DX7N6v...5Lz8Pp
|
|
|
|
|
|
## Minting
|
|
|
|
|
|
-If parameters are shown, this means the DAO was successfully imported
|
|
|
-into our wallet. We use the DAO name to reference it. Now we can create
|
|
|
-a transaction that will mint the DAO on-chain, if we hold all its keys,
|
|
|
-and broadcast it:
|
|
|
+The parameters shown confirm the DAO was successfully imported. We use the
|
|
|
+DAO name to reference it. Now we can create and broadcast a transaction to
|
|
|
+mint the DAO on-chain (requires holding all its keys):
|
|
|
|
|
|
```shell
|
|
|
drk> dao mint AnonDAO | broadcast
|
|
|
@@ -154,7 +163,7 @@ Broadcasting transaction...
|
|
|
Transaction ID: 2e7931f200c1485ea7752076e199708b011a504d71e69d60ed606817c5ff4bd5
|
|
|
```
|
|
|
|
|
|
-Now the transaction is broadcasted to the network. After confirmation
|
|
|
+Now the transaction has been broadcast to the network. After confirmation
|
|
|
you should see a leaf position, a mint height and a transaction hash
|
|
|
when running:
|
|
|
|
|
|
@@ -194,7 +203,7 @@ Wallet Address: DX7N6v...5Lz8Pp
|
|
|
|
|
|
Let's send some tokens to the DAO's treasury so we're able to make
|
|
|
a proposal to send those somewhere. First, find the DAO wallet address,
|
|
|
-the DAO bulla and the dao contract spend hook.
|
|
|
+the DAO bulla and the DAO contract spend hook.
|
|
|
|
|
|
Then create a transfer transaction as follows:
|
|
|
|
|
|
@@ -259,11 +268,11 @@ drk> dao balance AnonDAO
|
|
|
|
|
|
## Creating a proposal
|
|
|
|
|
|
-Now that the DAO has something in its treasury, we can generate a
|
|
|
-transfer proposal to send it somewhere, that will be up to vote
|
|
|
-for 1 [block period][blockwindow](~4h), if we hold the DAO proposer
|
|
|
-key. Let's propose to send 5 of the 10 tokens to our address (we can
|
|
|
-find that with `wallet address`):
|
|
|
+Now that the DAO has funds, we can create a transfer proposal to send
|
|
|
+tokens somewhere. The proposal will be open to vote for 1 [block
|
|
|
+period][blockwindow](~4h), if we hold the DAO proposer key. Let's
|
|
|
+propose sending 5 of the 10 tokens to our address (we can find that with
|
|
|
+`wallet address`):
|
|
|
|
|
|
[blockwindow]: ../spec/contract/dao/model.md#blockwindow
|
|
|
|
|
|
@@ -273,8 +282,8 @@ drk> dao propose-transfer AnonDAO 1 5 DAWN {YOUR_ADDRESS}
|
|
|
Generated proposal: {PROPOSAL_BULLA}
|
|
|
```
|
|
|
|
|
|
-After command was executed, it will output the generated proposal
|
|
|
-bulla, which we will use to view the proposal full information:
|
|
|
+The command outputs the proposal bulla, which we can use to view the
|
|
|
+proposal's full details:
|
|
|
|
|
|
```shell
|
|
|
drk> dao proposal {PROPOSAL_BULLA}
|
|
|
@@ -310,7 +319,7 @@ Voting status: Ongoing
|
|
|
Current proposal outcome: Unknown
|
|
|
```
|
|
|
|
|
|
-We can export this proposal, to share with rest DAO members.
|
|
|
+We can export this proposal to share with the rest of the DAO.
|
|
|
The exported file will be encrypted using the DAO proposals view key,
|
|
|
so only its members can decrypt and import it.
|
|
|
|
|
|
@@ -332,11 +341,10 @@ Broadcasting transaction...
|
|
|
Transaction ID: 2149d7e3a60be12c96b6c6fc7ba009717d8b229b815dd4006bbe120c31681f38
|
|
|
```
|
|
|
|
|
|
-Members that didn't receive the encrypted file will receive the
|
|
|
-proposal when they scan the corresponding block, but its plaintext
|
|
|
-data will be missing, so they should ask the DAO for it.
|
|
|
-Once confirmed, you should see a leaf position, a mint height and a
|
|
|
-transaction hash when running:
|
|
|
+Members who didn't receive the encrypted file will see the proposal
|
|
|
+when scanning the block, but the plaintext data will be missing, so
|
|
|
+they should ask the DAO for it. Once confirmed, you should see a leaf
|
|
|
+position, a mint height and a transaction hash when running:
|
|
|
|
|
|
```shell
|
|
|
drk> dao proposal {PROPOSAL_BULLA}
|
|
|
@@ -375,7 +383,7 @@ Current proposal outcome: Unknown
|
|
|
## Voting on a proposal
|
|
|
|
|
|
Now the DAO members are ready to cast their votes.
|
|
|
-First lets check the `dao vote` subcommand usage.
|
|
|
+First, let's check the `dao vote` subcommand usage.
|
|
|
|
|
|
```shell
|
|
|
$ ./drk help dao vote
|
|
|
@@ -453,11 +461,10 @@ Current proposal outcome: Approved
|
|
|
|
|
|
## Executing the proposal
|
|
|
|
|
|
-Once the block period has passed(~4h) and enough votes have been cast
|
|
|
-that meet the required minimum (quorum), and assuming the yes:no votes
|
|
|
-ratio is bigger than the approval ratio, then we are ready to confirm
|
|
|
-the vote. Only DAO members with the executor key can perform this
|
|
|
-action.
|
|
|
+Once the voting period ends (~4 hours), if enough votes were cast to
|
|
|
+meet the quorum requirement and the yes:no ratio exceeds the approval
|
|
|
+ratio, the proposal is ready to execute. Only DAO members with the
|
|
|
+executor key can perform this action.
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -469,9 +476,9 @@ Broadcasting transaction...
|
|
|
Transaction ID: 808b75685d91c766574dd5a3d46206b8e145b29f3647736161d2e2b2db051444
|
|
|
```
|
|
|
|
|
|
-Since in our tutorial the `ANON` governance tokens we used surpass the
|
|
|
-early execution quorum, we can execute the proposal right away, if we
|
|
|
-hold both the DAO executor and early executor keys:
|
|
|
+Since our vote exceeds the early execution quorum, we can execute the
|
|
|
+proposal immediately (requires both the executor and early executor
|
|
|
+keys):
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec --early {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -483,9 +490,9 @@ Broadcasting transaction...
|
|
|
Transaction ID: 808b75685d91c766574dd5a3d46206b8e145b29f3647736161d2e2b2db051444
|
|
|
```
|
|
|
|
|
|
-After the proposal has been executed on chain, we will see that the DAO
|
|
|
-balance has been reduced by 5 `DAWN`, if we hold the DAO notes key,
|
|
|
-while our own balance has been increased by the same amount:
|
|
|
+After the proposal has been executed on-chain, we will see the DAO's
|
|
|
+balance reduced by 5 `DAWN`, and our own balance increased by the same
|
|
|
+amount (if we hold the DAO notes key):
|
|
|
|
|
|
```shell
|
|
|
drk> dao balance AnonDAO
|
|
|
@@ -507,8 +514,8 @@ drk> wallet balance
|
|
|
|
|
|
## Generic proposal
|
|
|
|
|
|
-DAOs can vote on off-chain operations by creating what is known as
|
|
|
-generic proposals, meaning that no on-chain action is tied to it:
|
|
|
+DAOs can vote on off-chain actions by creating generic proposals,
|
|
|
+which have no on-chain execution tied to them:
|
|
|
|
|
|
```shell
|
|
|
drk> dao propose-generic AnonDAO 1
|
|
|
@@ -536,7 +543,7 @@ Broadcasting transaction...
|
|
|
Transaction ID: 47240cd8ae28eb4d1768029b488d93fe6df6c2c6847cc987ce79f75dfcd56cdc
|
|
|
```
|
|
|
|
|
|
-And execute it, after the vote period(1 block period) has passed:
|
|
|
+Execute it after the voting period (1 block period) ends:
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -547,7 +554,7 @@ Broadcasting transaction...
|
|
|
Transaction ID: a9d77e2d6a64372cb1cf33ed062e0439e617b88ca6374917c83cd284d788d1ce
|
|
|
```
|
|
|
|
|
|
-Or right away, since the early execution quorum has been reached:
|
|
|
+Or immediately, since the early execution quorum was reached:
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec --early {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -558,15 +565,15 @@ Broadcasting transaction...
|
|
|
Transaction ID: a9d77e2d6a64372cb1cf33ed062e0439e617b88ca6374917c83cd284d788d1ce
|
|
|
```
|
|
|
|
|
|
-Executing the proposal will just confirm it on-chain, without any
|
|
|
-other actions taken.
|
|
|
+Executing the proposal confirms it on-chain without taking any
|
|
|
+additional actions.
|
|
|
|
|
|
## DAO->DAO
|
|
|
|
|
|
Let's now try some more exotic operations!
|
|
|
|
|
|
Since we hold the mint authority of the `ANON` token,
|
|
|
-instead of transfering some to the DAO, we will mint them
|
|
|
+instead of transferring tokens to the DAO, we mint them
|
|
|
directly into it:
|
|
|
|
|
|
```shell
|
|
|
@@ -592,7 +599,7 @@ drk> dao balance AnonDAO
|
|
|
{TOKEN2} | DAWN | 5
|
|
|
```
|
|
|
|
|
|
-Now we will create a second dao:
|
|
|
+Now we'll create a second DAO:
|
|
|
|
|
|
```shell
|
|
|
drk> dao create 20 10 10 0.67 DAWN | dao import DawnDAO
|
|
|
@@ -600,7 +607,7 @@ drk> dao create 20 10 10 0.67 DAWN | dao import DawnDAO
|
|
|
Importing "DawnDAO" DAO into the wallet
|
|
|
```
|
|
|
|
|
|
-And mint it on-chain:
|
|
|
+Mint it on-chain:
|
|
|
|
|
|
```shell
|
|
|
drk> dao mint DawnDAO | broadcast
|
|
|
@@ -672,7 +679,7 @@ Broadcasting transaction...
|
|
|
Transaction ID: 9dd81f166115563e88262ef9ed83b15112dd72247bf48ce7b161779405830a63
|
|
|
```
|
|
|
|
|
|
-And execute it, after the vote period(1 block period) has passed:
|
|
|
+Execute it after the voting period (1 block period) ends:
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -684,7 +691,7 @@ Broadcasting transaction...
|
|
|
Transaction ID: b78824d5d6c6e6fdb6a002848353dc60279e1c8800e2741062f8944c44796582
|
|
|
```
|
|
|
|
|
|
-Or right away, since the early execution quorum has been reached:
|
|
|
+Or immediately, since the early execution quorum was reached:
|
|
|
|
|
|
```shell
|
|
|
drk> dao exec --early {PROPOSAL_BULLA} | broadcast
|
|
|
@@ -719,9 +726,8 @@ drk> dao balance DawnDAO
|
|
|
|
|
|
## Mining for a DAO
|
|
|
|
|
|
-A DAO can deploy its own mining nodes and/or other miners can choose to
|
|
|
-directly give their rewards towards one. To retrieve a DAO mining
|
|
|
-configuration, execute:
|
|
|
+A DAO can deploy mining nodes, or miners can direct rewards to a DAO.
|
|
|
+To retrieve a DAO's mining configuration, execute:
|
|
|
|
|
|
```shell
|
|
|
drk> dao mining-config {YOUR_DAO}
|