Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uncomputable/simpiwallet
First wallet that uses Simplicity descriptors
https://github.com/uncomputable/simpiwallet
bitcoin cli cryptography rust wallet
Last synced: about 1 month ago
JSON representation
First wallet that uses Simplicity descriptors
- Host: GitHub
- URL: https://github.com/uncomputable/simpiwallet
- Owner: uncomputable
- License: cc0-1.0
- Created: 2023-08-14T20:19:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-18T17:18:14.000Z (over 1 year ago)
- Last Synced: 2023-09-18T23:01:44.578Z (over 1 year ago)
- Topics: bitcoin, cli, cryptography, rust, wallet
- Language: Rust
- Homepage:
- Size: 91.8 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simplicity Wallet
First wallet that uses Simplicity descriptors.
The latest research on Bitcoin smart contracts at your fingertips.
## Build the wallet
```
$ cargo build
```## Install Elements
We need [Elements Core with added Simplicity support](https://github.com/ElementsProject/elements/tree/simplicity).
There are multiple ways to install it:
### Download the binary
Download the [prebuilt binary by psgreco](https://github.com/psgreco/elements/releases/tag/simplicityregtest1-0.0) which adheres to the same security standards as the Bitcoin Core binaries.
### Compile the binary
Compile Elements manually using the [official instructions](https://github.com/ElementsProject/elements/blob/simplicity/doc/build-unix.md).
### Use the nix shell
Use the [provided nix shell](https://github.com/uncomputable/simpiwallet/blob/master/shell.nix). This will give you `elementsd` and `elements-cli`.
```
$ nix-shell
```### Install via nixpkgs
A slightly outdated version of Elements + Simplicity can be installed via nixpkgs.
```
$ nix-shell -p elementsd-simplicity
```## Run the wallet
```
$ simpiwallet
$ simpiwallet help
```## Initialize the wallet
Generate the initial xpub and save it to disk.
```
$ simpiwallet new
```Other operations will read and write from the same file.
**Secret keys are stored in plain on disk!** Don't forget, this is a research prototype. Use it on regtest or testnet, but never on mainnet!
## Run Elements
The wallet needs to communicate with Elements.
Feel free to use the [provided Elements configuration](https://github.com/uncomputable/simpiwallet/blob/master/elements.conf).
```
$ mkdir ~/.elements
$ cp elements.conf ~/.elements
```Run elementsd.
```
$ elementsd
```## Fund the wallet
Initially the wallet will not have any funds. You have to generate an address and send coins from another wallet.
Check how many coins are inside your Simplicity wallet. If there are enough, then you can skip the rest of this section.
```
$ simpiwallet getbalance
:
```Create an Elements wallet if you don't already have one.
```
$ elements-cli createwallet
```Or load your existing Elements wallet.
```
$ elements-cli loadwallet
```For technical reasons it is often necessary to rescan the blockchain.
```
$ elements-cli rescanblockchain
```Check if your Elements wallet has funds. With the provided configuration, it should have 21 million bitcoin.
```
$ elements-cli getbalance
```Generate an address for your Simplicity wallet.
```
$ simpiwallet getnewaddress
:
```Send coins to your Simplicity wallet.
```
$ elements-cli sendtoaddress
```Mine an Elements block to finalize the transaction.
```
$ elements-cli -generate 1
```Now your Simplicity wallet should have a higher balance.
```
$ simpiwallet getfunds
:
```## Send to an address
Send coins to a given Elements address.
```
$ simpiwallet sendtoaddress
:
```The wallet will sign and broadcast the transaction immediately to Elements via RPC.
The returned transaction ID can be used to get the full transaction hex.
```
$ elements-cli getrawtransaction
:
```Use [hal-simplicity](https://github.com/uncomputable/hal-simplicity) to inspect the transaction further.
```
$ hal-simplicity tx decode
```Don't forget to mine an Elements block to finalize the transaction.
```
$ elements-cli -generate 1
```