@danielabrozzoni - pleb.fi 2022
A piece of software that shows you how many sats you have, lets you receive new ones, and (eventually) lets you spend them
You might want to build...
Building a bitcoin wallet from scratch is tricky
Things you need to take care of:
{ from scratch }
Not the worst part
Well you just have to hash the script
It's easy right?
Ohh, so you want a 1 out of 10 multisig and you don't have the slightest idea how to write the script? Too bad
Easy and boring
fn boring_sync() -> Result<(), Box<dyn Error>> {
let client = connect_to_some_blockchain_backend()?;
let new_utxos = client.did_i_receive_new_utxos()?;
somehow_update_my_internal_state(new_utxos)?;
// yay done
Ok(())
}
If you want your app to support multiple backends you write the code multiple times ugh
How do I select coins
Ok it doesn't seem a shitshow but trust me it's hard
What should I put in the script sig
What should I put in the witness script
Wtf do I do to spend from taproot
What should I set the nLockTime to
What's the nSequence lol
No one gets RBF rules
Make the receive/spend funds part slightly easier
Dev writes policy instead of Bitcoin script
Miniscript compiler takes policy, gives back descriptor
When you need to receive or spend, miniscript figures outs most of the difficult stuff (generates the address, helps with building the tx but doesn't really do everything)
<A> OP_CHECKSIGVERIFY <B> OP_CHECKSIG
and_v(v:pk(A),pk(B))
and(pk(A),pk(B))
Library to build bitcoin wallets that makes everything super easy yay
Builds on top of miniscript
Basically does everything for ya 😘
Modular - you can customize many parts of the wallet, leave out pieces of code you don't like, add your code without forking the lib
You know LEGO? ->
Custom database
Custom coin selection
Custom blockchain backend
Custom signer
We're doing a BDK workshop later 11.30AM
It's going to be cool
Don't miss it
Download Rust tho