Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
iskyd committed Dec 7, 2024
1 parent 06e37f6 commit 0db349e
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,77 @@

Wall•E is a Bitcoin Wallet written in Zig.

> **WARNING**: This is just an attempt to learn Bitcoin and Zig. Do not use this project with real BTC.
> **WARNING**: Do not use this project with real BTC. It is not secure (yet)! The cryptographic part is built from scratch and it is not audited.
#### Run
Run src/main.zig
``` bash
zig build run
```
Run src/p.zig (used for debugging)
### Project
This project will produce 3 executables:
- walle: Bitcoin wallet CLI.
- indexer: This is the bitcoin blockchain indexer. It will only saves locally (in an sqlite db) the relevant transactions/outputs/inputs.
- wbx: Command line utility for Bitcoin (the name is inspired by [libbitcoin-explorer](https://github.com/libbitcoin/libbitcoin-explorer))

#### Build the project
``` bash
zig build run-p
zig build
```
You can also specify --release=<release mode>. Check the [Zig Docs](https://ziglang.org/learn/build-system/) for more informations.

#### Testing
``` bash
zig build test
zig build test --summary all -- src/bip39/bip39.zig src/bip38/bip38.zig
```

### Dev Environment
See devbox.json
#### Dev Environment
You can directly use devbox to create a complete dev environment. Check devbox.json and [devbox](https://www.jetify.com/devbox) docs for more informations.
``` bash
devbox shell
```

### Bitcoin Node
Use Dockerfile to run bitcoin node using bitcoin-core. node/bitcoin.conf can be used as bitcoin config to run regtest with rpcuser walle and pwd password.
#### Bitcoin Node
walle needs a bitcoin-core node. You can run one using the Dockerfile. The configuration is defined in node/bitcoin.conf and it is used to create a regtest network.


``` bash
docker build -t btcnode .
docker volume create btcnode
docker run --rm --name btcnode -v btcnode:/bitcoin-25.0/data -p 18444:18443 btcnode
```

For mac users use this code to build docker image.
``` bash
docker build -t btcnode -f Dockerfile.arm .
```

The first time you run the node you need to create a new wallet (it is no longer created automatically, if the walle was already created use loadwallet) then you can getnewaddress.
#### Regtest
The first time you run the node you need to create a new wallet (it is no longer created automatically, if the walle was already created use loadwallet) then you can getnewaddress and mine some blocks.

``` bash
bitcoin-cli -rpcuser=walle -rpcpassword=password -rpcport=18443 createwallet walle
bitcoin-cli -rpcuser=walle -rpcpassword=password -rpcport=18443 getnewaddress
bitcoin-cli -rpcuser=walle -rpcpassword=password -rpcport=18443 generatetoaddress <nblocks> <address>
```

Test bitcoin node from outside container:
Walle uses rpc to communicate with bitcoin-core.
Ex:
```bash
curl --verbose -L --user walle --data-binary '{"jsonrpc": "1.0", "id": "walle", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' 0.0.0.0:18444
```

### Contributing
Join [WALL•E's Discord channel](https://discord.gg/9e9qnzQAH6) to chat with the contributors and understand next steps, available tasks and bugs to be fixed.


### TODO
- [x] BIP39 (Mnemonic generation)
- [x] BIP32 (HD Wallets)
- [x] Serialized Extendend Private/Public Key (https://learnmeabitcoin.com/technical/keys/hd-wallets/extended-keys/)
### Features
- [x] Crypto (secp256k1, ecdsa signatures, ripemd160, bech32). Everything is built from scratch.
- [x] Bip39 (Mnemonic generation)
- [x] Bip32 (HD Wallets)
- [x] BIP38 (Encrypting Bitcoin Private Key)
- [x] BIP44
- [x] ECDSA Signatures
- [x] Bip44
- [x] Serialized Extendend Private/Public Key
- [x] BTC core rpc integration
- [x] Indexer
- [x] Addresses
- [x] Segwit
- [x] Bech32
- [x] BTC Node integration
- [x] Wallet Sync
- [ ] Legacy Wallet
- [ ] Script Hash (P2SH, P2WSH)
- [ ] Transactions
- [ ] CLI
- [x] Transactions (create/sign/broadcast)

### Roadmap
- [ ] Support Legacy Wallet
- [ ] Support Script Hash (P2SH, P2WSH)
- [ ] Multisig Wallet
- [ ] Taproot
- [ ] Export private key
- [ ] Secure signature from hardware wallet

### Contributing
Join [WALL•E's Discord channel](https://discord.gg/9e9qnzQAH6) to chat with the contributors and understand next steps, available tasks and bugs to be fixed.

0 comments on commit 0db349e

Please sign in to comment.