-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add
Using gnokey
tutorial (#2226)
<!-- please provide a detailed description of the changes made in this pull request. --> ## Description This PR adds the `Using gnokey` tutorial to the documentation. It has three sections: - State-changing calls (transactions), which covers all Gno message types - ABCI queries, which covers all currently available query types - Making an airgapped transaction, which shows how to use the sign & broadcast functionalities in gnokey [Current state of the PR](#2226 (comment)) Closes: #2126 <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [x] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Co-authored-by: deelawn <[email protected]> Co-authored-by: Manfred Touron <[email protected]>
- Loading branch information
1 parent
c1a3341
commit fc51fc5
Showing
13 changed files
with
945 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
id: creating-a-keypair | ||
--- | ||
|
||
# Creating a Keypair | ||
|
||
## Overview | ||
|
||
In this tutorial, you will learn how to create your Gno keypair using | ||
[`gnokey`](../../gno-tooling/cli/gnokey/gnokey.md). | ||
|
||
Keypairs are the foundation of how users interact with blockchains; and Gno is | ||
no exception. By using a 12-word or 24-word [mnemonic phrase](https://www.zimperium.com/glossary/mnemonic-seed/) | ||
as a source of randomness, users can derive a private and a public key. | ||
These two keys can then be used further; a public key derives an address which is | ||
a unique identifier of a user on the blockchain, while a private key is used for | ||
signing messages and transactions for the aforementioned address, proving a user | ||
has ownership over it. | ||
|
||
Let's see how we can use `gnokey` to generate a Gno keypair locally. | ||
|
||
## Generating a keypair | ||
|
||
The `gnokey add` command allows you to generate a new keypair locally. Simply | ||
run the command, while adding a name for your keypair: | ||
|
||
```bash | ||
gnokey add MyKey | ||
``` | ||
|
||
![gnokey-add-random](../../assets/getting-started/local-setup/creating-a-key-pair/gnokey-add-random.gif) | ||
|
||
After running the command, `gnokey` will ask you to enter a password that will be | ||
used to encrypt your keypair to the disk. Then, it will show you the following | ||
information: | ||
- Your public key, as well as the Gno address derived from it, starting with `g1...`, | ||
- Your randomly generated 12-word mnemonic phrase which was used to derive the keypair. | ||
|
||
:::warning Safeguard your mnemonic phrase! | ||
|
||
A **mnemonic phrase** is like your master password; you can use it over and over | ||
to derive the same keypairs. This is why it is crucial to store it in a safe, | ||
offline place - writing the phrase on a piece of paper and hiding it is highly | ||
recommended. **If it gets lost, it is unrecoverable.** | ||
|
||
::: | ||
|
||
`gnokey` will generate a keybase in which it will store information about your | ||
keypairs. The keybase directory path is stored under the `-home` flag in `gnokey`. | ||
|
||
### Gno addresses | ||
|
||
Your **Gno address** is like your unique identifier on the network; an address | ||
is visible in the caller stack of an application, it is included in each | ||
transaction you create with your keypair, and anyone who knows your address can | ||
send you [coins](../../concepts/stdlibs/coin.md), etc. | ||
|
||
## Conclusion | ||
|
||
That's it 🎉 | ||
|
||
You've successfully created your first Gno keypair. Check out | ||
[Browsing gno.land](./browsing-gnoland.md) and | ||
[Interacting with gno.land](./interacting-with-gnoland.md) to see how you can | ||
use it. | ||
|
||
If you wish to learn more about `gnokey` specifically, check out the | ||
[gnokey section](../../gno-tooling/cli/gnokey/gnokey.md). | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.