Want to interact with the Bitcoin network through a DIY app? Look no further, this library is about doing it with Elixir in a very abstract way. It keeps the cryptography jargon to a minimum, while sticking to the Bitcoin glossary.
The easiest way to start is to try the wallet operations livebook.
This library is being built in the wild according to these principles
Arguably, the most important part is that it is unbiased
.
If you want to keep it that way, and want to promote its active development, please send donations
here: bc1qs0hd8wws09jm68fg4ymnsdvxdjggsg3jg09xh4
That address, along with the private key that goes with it have both been created using the current lib. The same will apply for very transaction created to spend said funds.
Thank you!
First, make sure you've got elixir set up and that you know the language's basics.
Then, create a project and add the dependency in mix.exs
.
def deps do
[
{:bitcoinlib, "~> 0.4.7"}
]
end
Finally, head to the private key creation documentation to get started.
Here are the most useful links
xprv
, yprv
, zprv
)xpub
, ypub
, zpub
)Address Type | Description | Starts With | Supported |
---|---|---|---|
P2PKH | Pay to Primary Key Hash | 1 |
✅ |
P2WPKH-nested-in-P2SH | Nested Segwit | 3 |
✅ |
P2WPKH | Native Segwit | bc1q |
✅ |
P2TR | Taproot | bc1p |
Eventually... |
A bip is a Bitcoin Improvement Proposal. Here is a list of those that are at least partially implemented in this library:
$ mix deps.get
$ mix test
$ mix dialyzer