Skip to content

Commit 55f2521

Browse files
0xBorarphair
andauthored
[Contribute] - CBOR debugging + Sidebar Structure + Governance (#1636)
* introduce cbor debugging + move funding to get started * update conway era * txId links + header hierarchy * remove word * update cardano-cli structure + governance pages * Update links and references in governance and CLI documentation + sidebar * cardano-cli prerequisite * update landing description * Update docs/smart-contracts/advanced/debug-cbor.md Co-authored-by: Robert Phair <[email protected]> * Update docs/smart-contracts/advanced/debug-cbor.md Co-authored-by: Robert Phair <[email protected]> * Update docs/smart-contracts/advanced/debug-cbor.md Co-authored-by: Robert Phair <[email protected]> * add pycardano * add video format resources * Add Aiken overview images and update documentation * introduce navbar dropdowns and seperate category sidebar visibility * move security docs to Get Started section and add redirects * Update sidebars.js (Security & Key Management autogeneration) Co-authored-by: Robert Phair <[email protected]> * fix merge conflict with cardano-testnet.md on staging * fix links for security & key management * resolve previous conflicts cardano-testnet * add newline --------- Co-authored-by: Robert Phair <[email protected]>
1 parent 9926d1f commit 55f2521

38 files changed

+1349
-399
lines changed
File renamed without changes.

docs/get-started/cli-operations/basic-operations/get-started.md renamed to docs/get-started/cardano-cli/basic-operations/get-started.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
id: get-started
33
title: Get started with Cardano CLI
44
sidebar_position: 1
5-
sidebar_label: CLI - Get started
5+
sidebar_label: Get started
66
keywords: [cardano-cli, cli, keys, addresses, cardano-node]
77
---
88

@@ -16,6 +16,10 @@ Cardano CLI uses the *node-to-client* protocol to communicate with the node. Thi
1616
export CARDANO_NODE_SOCKET_PATH=~/node.socket
1717
```
1818

19+
:::note
20+
This guide assumes you have installed cardano-node into your system. If not you can refer to Installing [cardano-node](../../../operate-a-stake-pool/node-operations/installing-cardano-node) guide for instructions on how to do that.
21+
:::
22+
1923
### CARDANO_NODE_NETWORK_ID
2024

2125
Each network has a unique identifier (--mainnet or --testnet-magic NATURAL). This is used by the node-to-client protocol to ensure communication with a node on the desired network. It is useful to set up an environment variable for the network ID. Alternatively, you can provide the flag `--testnet-magic <network-id>` with each command that interacts with the node.
File renamed without changes.
File renamed without changes.

docs/get-started/cli-operations/basic-operations/stakeaddress-registration.md renamed to docs/get-started/cardano-cli/basic-operations/stakeaddress-registration.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords: [cardano-cli, cli, keys, stake addresses, register, cardano-node, tran
88
---
99

1010
:::tip
11-
To integrate the latest (Conway) era, which differs significantly from previous eras, `cardano-cli` has introduced `<era>` as a top-level command, replacing the former `<era>` flags. For example, instead of using era-specific flags like `--babbage-era` with commands such as `cardano-cli transaction build --babbage-era`, users must now utilize the syntax `cardano-cli <era> transaction build <options>`.
11+
To integrate the latest (Conway) era, which differs significantly from previous eras, `cardano-cli` has introduced `<era>` as a top-level command, replacing the former `<era>` flags. For example, instead of using era-specific flags like `--babbage-era` with commands such as `cardano-cli transaction build --babbage-era`, users must now utilize the syntax `cardano-cli <era> transaction build <options>`.
1212
:::
1313

1414
## Registering a stake address
@@ -82,15 +82,17 @@ cardano-cli latest transaction build \
8282
--certificate-file registration.cert \
8383
--out-file tx.raw
8484
```
85-
:::note
85+
86+
:::note
8687
With the `build` command, you don't need to worry about the transaction fees and deposit, it handles it automatically:
8788
:::
8889

89-
Inspecting the `tx.raw` file reveals that this transaction includes the certificate, and is ready to be signed and submitted.
90+
Inspecting the `tx.raw` file reveals that this transaction includes the certificate, and is ready to be signed and submitted.
9091

9192
```shell
9293
cardano-cli debug transaction view --tx-file tx.raw
9394
```
95+
9496
```json
9597
{
9698
"auxiliary scripts": null,
@@ -140,7 +142,7 @@ cardano-cli debug transaction view --tx-file tx.raw
140142

141143
### Using the `build-raw` command
142144

143-
Using the `build-raw` command involves a slightly more intricate process. Similarly to the steps outlined in [simple transactions](docs/get-started/cli-operations/basic-operations/simple-transactions.md), you should calculate the fee yourself, and handle the deposit accordingly.
145+
Using the `build-raw` command involves a slightly more intricate process. Similarly to the steps outlined in [simple transactions](docs/get-started/cardano-cli/basic-operations/simple-transactions.md), you should calculate the fee yourself, and handle the deposit accordingly.
144146

145147
Query the balance of the `payment.addr`:
146148

@@ -169,20 +171,23 @@ cardano-cli latest query utxo --address $(< paymentstake.addr) --output-json
169171
}
170172
}
171173
```
174+
172175
Using `jq` to parse that JSON
176+
173177
```shell
174178
cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
175179
9999834851
176180
```
181+
177182
:::
178183

179-
Query the protocol parameters:
184+
Query the protocol parameters:
180185

181186
```shell
182187
cardano-cli latest query protocol parameters --out-file pparams.json
183188
```
184189

185-
Draft the transaction to calculate its transaction fee:
190+
Draft the transaction to calculate its transaction fee:
186191

187192
```shell
188193
cardano-cli latest transaction build-raw \
@@ -206,16 +211,16 @@ cardano-cli latest transaction calculate-min-fee \
206211
>171089 Lovelace
207212
```
208213

209-
Calculate the change of the transaction. Note that the deposit is not explicitly included, instead, you should deduct the deposit amount (2000000 lovelace) from the change __Change = currentBalance - fee - deposit__:
214+
Calculate the change of the transaction. Note that the deposit is not explicitly included, instead, you should deduct the deposit amount (2000000 lovelace) from the change **Change = currentBalance - fee - deposit**:
210215

211-
Query the protocol parameters to get the deposit amount:
216+
Query the protocol parameters to get the deposit amount:
212217

213218
```shell
214219
cardano-cli latest query protocol-parameters | jq .stakeAddressDeposit
215220
2000000
216221
```
217-
Query the current balance of `payment.addr`:
218222

223+
Query the current balance of `payment.addr`:
219224

220225
```shell
221226
cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
@@ -226,7 +231,7 @@ cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r
226231
change=$((9999834851 - 171089 - 2000000))
227232
```
228233

229-
Build the transaction:
234+
Build the transaction:
230235

231236
```shell
232237
cardano-cli latest transaction build-raw \
@@ -236,6 +241,7 @@ cardano-cli latest transaction build-raw \
236241
--certificate-file registration.cert \
237242
--out-file tx.raw
238243
```
244+
239245
## Sign and submit the transaction
240246

241247
```shell
@@ -245,9 +251,8 @@ cardano-cli latest transaction sign \
245251
--signing-key-file stake.skey \
246252
--out-file tx.signed
247253
```
254+
248255
```shell
249256
cardano-cli latest transaction submit \
250257
--tx-file tx.signed
251258
```
252-
253-
File renamed without changes.
File renamed without changes.

docs/get-started/cli-operations/governance/constitutional-committee.md renamed to docs/get-started/cardano-cli/governance/constitutional-committee.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords: [Governance, constitutional committee, committee, credentials, CIP1694
1111

1212
Individuals or entities nominated as committee members must generate a *cold* credential, which can be either a public key (Ed25519) or a script. This cold credential serves as the primary identifier and is used to authorize a *hot* credential, which is used for voting.
1313

14-
The term 'cold' emphasizes that this credential is stored in a secure, offline environment, such as safeguarded USB drives, isolated computing machines, or other devices deliberately formatted and disconnected from the internet for enhanced security. Conversely, the term 'hot' indicates that this credential is slightly more exposed, as it is more frequently used for signing votes. New hot credentials can be authorized at any point, where a new authorization certificate overrides the previous one.
14+
The term 'cold' emphasizes that this credential is stored in a secure, offline environment, such as safeguarded USB drives, isolated computing machines, or other devices deliberately formatted and disconnected from the internet for enhanced security. Conversely, the term 'hot' indicates that this credential is slightly more exposed, as it is more frequently used for signing votes. New hot credentials can be authorized at any point, where a new authorization certificate overrides the previous one.
1515

1616
import Tabs from '@theme/Tabs';
1717
import TabItem from '@theme/TabItem';
@@ -27,13 +27,14 @@ import TabItem from '@theme/TabItem';
2727

2828
The most basic setup for a Constitutional Committee member is using Ed25519 keys. An Ed25519 key pair includes a private key and its corresponding public key. The private key is utilized to create digital signatures, while the public key is employed to verify those signatures. On this setup. the constitutional committee member would generate two sets of keys: *cold* and *hot* and issue an authorization certificate to link them.
2929

30-
### Generate cold key pair:
30+
### Generate cold key pair
3131

3232
```shell
3333
cardano-cli conway governance committee key-gen-cold \
3434
--cold-verification-key-file cc-cold.vkey \
3535
--cold-signing-key-file cc-cold.skey
3636
```
37+
3738
As usual, the ed25519 keys are wrapped on a text envelope:
3839

3940
```json
@@ -51,7 +52,8 @@ As usual, the ed25519 keys are wrapped on a text envelope:
5152
"cborHex": "5820ffafa2978add44508e2d9d704faf54bccd41fad5f5c312b268c48d32a99c1099"
5253
}
5354
```
54-
### Generate the cold verification key hash:
55+
56+
### Generate the cold verification key hash
5557

5658
```shell
5759
cardano-cli conway governance committee key-hash \
@@ -63,15 +65,15 @@ cat cc-key.hash
6365
89181f26b47c3d3b6b127df163b15b74b45bba7c3b7a1d185c05c2de
6466
```
6567

66-
The key hash (or script hash) is what identifies the CC member on-chain and would be typically used in the **update committee** governance
68+
The key hash (or script hash) is what identifies the CC member on-chain and would be typically used in the **update committee** governance
6769
action that attempts to add or remove CC members.
6870

69-
Members of the Interim Constitutional Committee are required to share their Cold key hash or Cold script hash to be added to the Conway genesis file.
71+
Members of the Interim Constitutional Committee are required to share their Cold key hash or Cold script hash to be added to the Conway genesis file.
7072

71-
### Generate Hot key pair:
73+
### Generate Hot key pair
7274

73-
After the Chang hardfork, members of the Interim Constitutional Committee are required to generate a _hot key pair_ (or hot script) and
74-
submit an _Authorization Certificate_. This also applies to new Committee members appointed after the interim phase.
75+
After the Chang hardfork, members of the Interim Constitutional Committee are required to generate a *hot key pair* (or hot script) and
76+
submit an *Authorization Certificate*. This also applies to new Committee members appointed after the interim phase.
7577

7678
To generate a hot key-pair run the following command:
7779

@@ -99,12 +101,11 @@ Hot keys are also ed25519 keys wrapped on a text envelope:
99101
}
100102
```
101103

102-
### Generate the Authorization Certificate:
104+
### Generate the Authorization Certificate
103105

104-
The _Authorization Certificate_ allows the hot credential to act on behalf of the cold credential by signing transactions where votes are cast. If the
106+
The *Authorization Certificate* allows the hot credential to act on behalf of the cold credential by signing transactions where votes are cast. If the
105107
*hot* credential is compromised at any point, the committee member must generate a new one and issue a new Authorization Certificate. A new Authorization Certificate registered on-chain overrides the previous one, effectively invalidating any votes signed by the old hot credential. This applies only to actions that have not yet been ratified. Actions that have been already ratified or enacted by the old hot credential are not affected.
106108

107-
108109
```shell
109110
cardano-cli conway governance committee create-hot-key-authorization-certificate \
110111
--cold-verification-key-file cc-cold.vkey \
@@ -122,7 +123,7 @@ cat cc-authorization.cert
122123
}
123124
```
124125

125-
### Submit the authorization certificate in a transaction:
126+
### Submit the authorization certificate in a transaction
126127

127128
```shell
128129
cardano-cli conway transaction build \
@@ -151,15 +152,15 @@ cardano-cli conway transaction submit \
151152

152153
Constitutional Committee members comprising multiple individuals can opt for a multisignature setup using simple scripts.
153154

154-
There are multiple possible setups, in this example we show how [Simple scripts](docs/get-started/cli-operations/simple-scripts/simple-scripts.md) can be used for both the *cold* and the *hot* credentials.
155+
There are multiple possible setups, in this example we show how [Simple scripts](../simple-scripts/simple-scripts.md) can be used for both the *cold* and the *hot* credentials.
155156

156-
Assume Alice, Bob and Carol form an organization "ABC" and the community wishes to appoint "ABC" as a Constitutional Committee member.
157+
Assume Alice, Bob and Carol form an organization "ABC" and the community wishes to appoint "ABC" as a Constitutional Committee member.
157158

158-
### Generate keys for the cold credential:
159+
### Generate keys for the cold credential
159160

160161
Alice, Bob, and Carol need to generate a key-pair for the multisignature cold credential.
161162

162-
Alice:
163+
Alice:
163164

164165
```shell
165166
cardano-cli conway governance committee key-gen-cold \
@@ -174,6 +175,7 @@ cardano-cli conway governance committee key-gen-cold \
174175
--cold-verification-key-file bob-cold.vkey \
175176
--cold-signing-key-file bob-cold.skey
176177
```
178+
177179
Carol:
178180

179181
```shell
@@ -182,7 +184,7 @@ cardano-cli conway governance committee key-gen-cold \
182184
--cold-signing-key-file carol-cold.skey
183185
```
184186

185-
### Get verification key hashes:
187+
### Get verification key hashes
186188

187189
To generate a multisignature script, Alice, Bob, and Carol need to obtain their verification key hashes:
188190

@@ -197,9 +199,10 @@ cardano-cli conway governance committee key-hash --verification-key-file carol-c
197199
da1a4d13a1c951f30a7efb4dac2b4c1f603f4eabbfa0ecc7f361bfc1
198200

199201
```
200-
### Create the multisignature cold script:
201202

202-
Create the multisignature `cold.script` file using the simple scrypt syntax. In this example we use the `atLeast` type, so that 2 out of the 3 keys are required for the script to evaluate to true. To learn more about simple scripts read [this article](docs/get-started/cli-operations/simple-scripts/simple-scripts.md)
203+
### Create the multisignature cold script
204+
205+
Create the multisignature `cold.script` file using the simple scrypt syntax. In this example we use the `atLeast` type, so that 2 out of the 3 keys are required for the script to evaluate to true. To learn more about simple scripts read [this article](../simple-scripts/simple-scripts.md)
203206

204207
```shell
205208
cat cold.script
@@ -225,7 +228,7 @@ cat cold.script
225228
}
226229
```
227230

228-
### Calculate the script hash:
231+
### Calculate the script hash
229232

230233
The governance action that proposes "ABC" organization as a Committee Member needs to reference their cold script hash. They can obtain it with:
231234

@@ -234,9 +237,9 @@ cardano-cli hash script --script-file cold.script
234237
ad31d247bb2549db98020c5a6331732ebe559ad85b5768abbda3eb0d
235238
```
236239

237-
### Generate keys for the hot credential:
240+
### Generate keys for the hot credential
238241

239-
If ratified, "ABC" will need to generate a *Hot* credential and an Authorization certificate. Alice, Bob and Carol can follow the exact same workflow from above: Generate Ed25519 key pair for each member, and create a multisignature simple script.
242+
If ratified, "ABC" will need to generate a *Hot* credential and an Authorization certificate. Alice, Bob and Carol can follow the exact same workflow from above: Generate Ed25519 key pair for each member, and create a multisignature simple script.
240243

241244
Alice:
242245

@@ -245,6 +248,7 @@ cardano-cli conway governance committee key-gen-hot \
245248
--verification-key-file alice-hot.vkey \
246249
--signing-key-file alice-hot.skey
247250
```
251+
248252
Bob:
249253

250254
```shell
@@ -260,7 +264,8 @@ cardano-cli conway governance committee key-gen-hot \
260264
--verification-key-file carol-hot.vkey \
261265
--signing-key-file carol-hot.skey
262266
```
263-
### Get the hot key hashes:
267+
268+
### Get the hot key hashes
264269

265270
```shell
266271
cardano-cli conway governance committee key-hash --verification-key-file alice-hot.vkey
@@ -273,7 +278,7 @@ cardano-cli conway governance committee key-hash --verification-key-file carol-h
273278
643f4e3d521675e199e38a6904038057252507fd69b97b9f181912b1
274279
```
275280

276-
### Create the multisignature hot script:
281+
### Create the multisignature hot script
277282

278283
```shell
279284
cat hot.script
@@ -299,7 +304,7 @@ cat hot.script
299304
}
300305
```
301306

302-
### Calculate the hot script hash:
307+
### Calculate the hot script hash
303308

304309
```shell
305310
cardano-cli hash script --script-file hot.script
@@ -308,7 +313,7 @@ f5d42214cb2625cfc34e5c0cfb1daceee44a4a3c2e6807ab67cd6adb
308313

309314
### Issue the authorization certificate
310315

311-
The _Authorization Certificate_ allows the hot credential to act on behalf of the cold credential by signing transactions where votes are cast. If the
316+
The *Authorization Certificate* allows the hot credential to act on behalf of the cold credential by signing transactions where votes are cast. If the
312317
*hot* credential is compromised at any point, the committee member must generate a new one and issue a new Authorization Certificate. A new Authorization Certificate registered on-chain overrides the previous one, effectively invalidating any votes signed by the old hot credential. This applies only to actions that have not yet been ratified. Actions that have been already ratified or enacted by the old hot credential are not affected.
313318

314319
```shell
@@ -321,6 +326,7 @@ cardano-cli conway governance committee create-hot-key-authorization-certificate
321326
### Submit the authorization certificate in a transaction
322327

323328
Build the transaction:
329+
324330
```shell
325331
cardano-cli conway transaction build \
326332
--tx-in "$(cardano-cli query utxo --address "$(< payment.addr)" --output-json | jq -r 'keys[0]')" \
@@ -381,22 +387,20 @@ cardano-cli conway transaction assemble \
381387
--out-file tx.signed
382388
```
383389

384-
Submit the transaction
390+
Submit the transaction
385391

386392
```shell
387393
cardano-cli conway transaction submit \
388394
--tx-file tx.signed
389395
```
390396

391-
392397
</TabItem>
393398
<TabItem value="plutus-script">
394399

395400
:::info
396-
Please go to [Credential Manager](https://credential-manager.readthedocs.io/en/latest/index.html)
401+
Please go to [Credential Manager](https://credential-manager.readthedocs.io/en/latest/index.html)
397402

398403
It is a suite of Plutus scripts and tools for managing credentials with an X.509 certificate chain, ensuring secure access and operations within the Cardano blockchain for key management and security best practices.
399404
:::
400405
</TabItem>
401406
</Tabs>
402-

docs/get-started/cli-operations/governance/delegating-vote.md renamed to docs/get-started/cardano-cli/governance/delegating-vote.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ In addition to the registered DReps, the system features a couple of default vot
1818
### Prerequisites
1919

2020
* Payment keys and address with funds
21-
* [Registered stake address](docs/get-started/cli-operations/basic-operations/stakeaddress-registration.md)
21+
* [Registered stake address](docs/get-started/cardano-cli/basic-operations/stakeaddress-registration.md)
2222
* DRep ID (key hash or script hash) of a registered DRep.
2323

2424
## Generating the vote delegation certificate
2525

26-
### Generate the vote delegation certificate.
26+
### Generate the vote delegation certificate
2727

2828
* Delegating to the `--always-abstain` default voting option:
2929

@@ -34,7 +34,7 @@ cardano-cli conway stake-address vote-delegation-certificate \
3434
--out-file vote-deleg.cert
3535
```
3636

37-
* Delegating to the `--always-no-confidence` default voting option:
37+
* Delegating to the `--always-no-confidence` default voting option:
3838

3939
```shell
4040
cardano-cli conway stake-address vote-delegation-certificate \
@@ -51,6 +51,7 @@ cardano-cli conway stake-address vote-delegation-certificate \
5151
--drep-key-hash $(< drep.id) \
5252
--out-file vote-deleg.cert
5353
```
54+
5455
* Delegating to a **script-based** (i.e. multisignature) registered DRep:
5556

5657
```shell
@@ -88,4 +89,4 @@ cardano-cli conway transaction sign \
8889
```shell
8990
cardano-cli conway transaction submit \
9091
--tx-file tx.signed
91-
```
92+
```

0 commit comments

Comments
 (0)