-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into doc-comments
- Loading branch information
Showing
15 changed files
with
235 additions
and
357 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "nomic" | ||
version = "8.0.0" | ||
authors = ["The Turbofish Team <[email protected]>"] | ||
authors = ["Nomic DAO Foundation <[email protected]>"] | ||
edition = "2021" | ||
default-run = "nomic" | ||
|
||
|
@@ -47,7 +47,6 @@ ics23 = "0.12.0" | |
cosmos-sdk-proto = { version = "0.23.0", optional = true } | ||
prometheus_exporter = "0.8.5" | ||
lazy_static = "1.4.0" | ||
getrandom = { version = "0.2.15", features = ["js"] } | ||
|
||
[dev-dependencies] | ||
bitcoind = { version = "0.27.0", features = ["22_0"] } | ||
|
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 |
---|---|---|
@@ -1,198 +1,55 @@ | ||
<h1 align="center"> | ||
<img src="./logo.svg" width="40%"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="./nomic-logo-dark-100.png"> | ||
<source media="(prefers-color-scheme: light)" srcset="./nomic-logo-100.png"> | ||
<img alt="Nomic" src="./nomic-logo-100.png"> | ||
</picture> | ||
</h1> | ||
<p align="center"> | ||
<i>Decentralized Custody Engine for Bitcoin</i> | ||
</p> | ||
|
||
Nomic Bitcoin Bridge | ||
![CI](https://github.com/nomic-io/nomic/actions/workflows/ci.yml/badge.svg) | ||
|
||
## Testnet Interchain Upgrade | ||
Nomic is a blockchain which offers a decentralized custody solution for Bitcoin. Built on Turbofish’s [Orga](https://github.com/turbofish-org/orga), a custom high-performance blockchain application framework. Nomic mints nBTC, a token backed 1:1 with BTC, using [IBC](https://www.ibcprotocol.dev/) for secure and efficient bridging. | ||
|
||
This testnet version is the release candidate for the upcoming Stakenet upgrade. | ||
|
||
## Upgrading existing nodes | ||
## Running a Node | ||
|
||
If you're upgrading your existing testnet node: | ||
Running a node increases the health of the network by decentralizing ledger validation and data, even for non-validator nodes. Community members are encouraged to run a node, especially when regularly interacting with the network via transactions and queries. | ||
|
||
1. Rebuild from this branch with: | ||
[Nomic Network Docs](https://docs.nomic.io/) | ||
|
||
``` | ||
git pull | ||
## Integrating with Nomic | ||
|
||
cargo install --locked --path . | ||
``` | ||
Integrating with nBTC enables accepting Bitcoin deposits with Interchain Deposits to any IBC-enabled blockchain. | ||
|
||
2. Shut down your running node. | ||
[nBTC Docs](https://github.com/nomic-io/nomic-bitcoin-js/blob/main/README.md) | ||
|
||
3. Restart your node with `nomic start`. | ||
## Contributing | ||
|
||
Your node will automatically perform the upgrade on Friday, October 7 at 17:00 UTC. | ||
Nomic is an open-source project spearheaded by contributors. Anyone is able to contribute to Nomic via GitHub. | ||
|
||
## Node setup guide | ||
[Contribute to Nomic](https://github.com/nomic-io/nomic/contribute) | ||
|
||
This guide will walk you through setting up a node for the Nomic testnet. | ||
## Security | ||
|
||
If you need any help getting your node running, join the [Discord](https://discord.gg/jH7U2NRJKn) and ask for the Validator role. | ||
Nomic is currently undergoing security audits. | ||
|
||
### Requirements | ||
Vulnerabilities should not be reported through public channels, including GitHub Issues. You can report a vunerability via GitHub's Private Vunerability Reporting or via the Nomic DAO Foundation at `[email protected]`. | ||
|
||
- >= 4GB RAM | ||
- >= 100GB of storage | ||
- Linux or macOS _(Windows support coming soon)_ | ||
[Report a Vulnerability](https://github.com/nomic-io/nomic/security/advisories/new) | ||
|
||
### 1. Build Nomic | ||
|
||
Start by building Nomic - for now this requires Rust nightly. | ||
Install rustup if you haven't already: | ||
``` | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
Install nightly as well (nomic currently requires rust nightly): | ||
``` | ||
rustup default nightly | ||
``` | ||
## License | ||
|
||
Install required dependencies (ubuntu): | ||
``` | ||
sudo apt install build-essential libssl-dev pkg-config clang | ||
``` | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. You may obtain a copy of the License at | ||
|
||
For systems running fedora: | ||
``` | ||
sudo dnf install clang openssl-devel && sudo dnf group install "C Development Tools and Libraries" | ||
``` | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Clone the github folder and switch to the correct folder: | ||
``` | ||
git clone https://github.com/nomic-io/nomic.git && cd nomic | ||
git checkout testnet | ||
``` | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
|
||
Build and install, adding a `nomic` command to your PATH: | ||
``` | ||
cargo install --locked --path . | ||
``` | ||
|
||
### 2. Run your node | ||
Start your Nomic node: | ||
``` | ||
nomic start | ||
``` | ||
|
||
This will run the Nomic state machine and a Tendermint process. For new nodes the statesync process will run automatically to get the node up to speed with the current chain. | ||
|
||
### 3. Acquiring coins and staking for voting power | ||
|
||
First, find your address by running `nomic balance` (for now this must be run on | ||
the same machine as your active full node). | ||
|
||
Ask the Nomic team for some coins in the Discord and include your address. | ||
|
||
Once you have received coins, you can declare your node as a validator and | ||
delegate to yourself with: | ||
|
||
``` | ||
nomic declare \ | ||
<validator_consensus_key> \ | ||
<amount> \ | ||
<commission_rate> \ | ||
<max_commission_rate> \ | ||
<max_commission_rate_change_per_day> \ | ||
<min_self_delegation> \ | ||
<moniker> \ | ||
<website> \ | ||
<identity> \ | ||
<details> | ||
``` | ||
|
||
**IMPORTANT NOTE:** Carefully double-check all the fields since you will not be | ||
able to modify the `commission_max` or `commission_max_change` after declaring. If you make a mistake, you will have to | ||
declare a new validator instead. | ||
|
||
- The `validator_consensus_key` field is the base64 pubkey `value` field found | ||
under `"validator_info"` in the output of http://localhost:26657/status. | ||
- The `identity` field is the 64-bit hex key suffix found on your Keybase | ||
profile, used to get your profile picture in wallets and block explorers. | ||
|
||
For example: | ||
|
||
``` | ||
nomic declare \ | ||
ohFOw5u9LGq1ZRMTYZD1Y/WrFtg7xfyBaEB4lSgfeC8= \ | ||
100000 \ | ||
0.042 \ | ||
0.1 \ | ||
0.01 \ | ||
100000 \ | ||
"Foo's Validator" \ | ||
"https://foovalidator.com" \ | ||
37AA68F6AA20B7A8 \ | ||
"Please delegate to me!" | ||
``` | ||
|
||
### 4. Run your Bitcoin signer | ||
|
||
The funds in the Bitcoin bridge are held in a large multisig controlled by the Nomic validators. If you are a validator with a significant amount of voting power, it is very important that you run a signer. | ||
|
||
#### i. Set your signatory key | ||
|
||
This will submit your public key to the network so you can be added to the multisig. If you do not have a key stored at `~/.nomic-testnet-4c/signer/xpriv`, this will automatically generate a Bitcoin extended private key for you. **KEEP THIS KEY SAFE** - similar to your validator private key, it is important to be mindful of this key so that it is never lost or stolen. | ||
|
||
**Note:** Setting your signatory key is only required if you are starting a fresh node. Migrating nodes can move on to the next step. | ||
|
||
``` | ||
nomic set-signatory-key | ||
``` | ||
|
||
If you have your extended private key stored in a different location than the default, you may pass a path. | ||
|
||
``` | ||
nomic set-signatory-key <path-to-your-key> | ||
``` | ||
|
||
#### ii. Run your Bitcoin signer | ||
|
||
You can run the signer with: | ||
|
||
``` | ||
nomic signer | ||
``` | ||
|
||
If you have stored your xpriv in a different location, you can pass the path to the signer. | ||
|
||
``` | ||
nomic signer xpriv_paths=[<path_to_your_xpriv>] | ||
``` | ||
|
||
Leave this process running, it will automatically sign Bitcoin transactions that the network wants to create. | ||
|
||
In the future, we hope for the community to come up with alternative types of signers which provide for extra security, by e.g. airgapping keys, using HSMs, or prompting the user for an encryption key. | ||
|
||
### 5. (Optional) Run a relayer | ||
|
||
Relayer nodes carry data between the Bitcoin blockchain and the Nomic blockchain. You can help support the health of the network by running a Bitcoin node alongside your Nomic node and running the relayer process. | ||
|
||
#### i. Sync a Bitcoin node | ||
|
||
Download Bitcoin Core: https://bitcoin.org/en/download | ||
|
||
Run it with: | ||
``` | ||
bitcoind -server -testnet -rpcuser=satoshi -rpcpassword=nakamoto | ||
``` | ||
(The RPC server only listens on localhost, so the user and password are not critically important.) | ||
|
||
**NOTE:** To save on disk space, you may want to configure your Bitcoin node to prune block storage. For instance, add `-prune=5000` to only keep a maximum of 5000 MB of blocks. You may also want to use the `-daemon` option to keep the node running in the background. | ||
|
||
#### ii. Run the relayer process | ||
|
||
``` | ||
nomic relayer --rpc-port=18332 --rpc-user=satoshi --rpc-pass=nakamoto | ||
``` | ||
|
||
Leave this running - the relayer will constantly scan the Bitcoin and Nomic chains and broadcast relevant data. | ||
|
||
The relayer will also create a server which listens on port 8999 for clients to announce their deposit addresses. To help make the network more reliable, if you run a relayer please open this port and let us know your node's address in Discord or a Github issue so we can have clients make use of your node. If you're going to make this service public, putting the server behind an HTTP reverse proxy is recommended for extra safety. | ||
|
||
--- | ||
|
||
Thanks for participating in the Nomic Testnet! We'll be updating the network | ||
often so stay tuned in [Discord](https://discord.gg/jH7U2NRJKn) for updates. | ||
Copyright © 2024 Nomic DAO Foundation. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.