- Right now BDK has a policy module: when creating a transaction I can specify which policy I want to use to spend my utxos
- or(and(A,B), C): either A+B or C by themselves
- when I create the transaction, I decide if I want to spend with the A+B path, or if I want to spend with the C path
- UX is not great, specifying which policy to use can be difficult
- Replacing the policy module with this planning idea
- Instead of specifying the policy I want to use to spend, I specify the “assets” (keys, timelocks, hash preimages) I have/want to use, and the planning module will find out the cheapest way for me to spend my coins
- or(and(A,B),C), I tell the planning module that I own the keys A, B, C
- The planning module will tell me to spend using the key C -> it’s cheaper than using A+B
- or(A, and(B, older(10))), I tell the planning module I only have B
- or(and(A,B),C), I tell the planning module that I own the keys A, B, C
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 has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |
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
syntax on | |
set nocompatible " be iMproved, required | |
filetype indent on | |
set expandtab " use spaces | |
set shiftwidth=4 | |
set softtabstop=4 | |
set autoindent | |
set smartindent | |
set relativenumber | |
set number |
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
backend = "glx"; | |
glx-no-stencil = true; | |
paint-on-overlay = true; | |
vsync = "opengl-swc"; |
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
digits = "31622776601683795" | |
def find(n): | |
k = 0 | |
last_2 = 1 | |
last_5 = 1 | |
while True: | |
if first_n_digits(last_2, n) == digits[:n] \ | |
and first_n_digits(last_5, n) == digits[:n]: | |
return k |
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
daemon = false | |
log_level = "trace" | |
data_dir = "./data/coordinatord_data" | |
postgres_uri = "postgresql://revault:revault@localhost/postgres" | |
managers = [ | |
# REPLACE ME | |
"60eefc8ffef57c9e3d36d68a7ffdde21b10d3ec5cdcfa9e9a5e24349ef51cc0a", | |
] |
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
use bdk::{Wallet, SyncOptions, FeeRate, SignOptions}; | |
use bdk::wallet::AddressIndex; | |
use bdk::database::MemoryDatabase; | |
use bdk::blockchain::ElectrumBlockchain; | |
use bdk::electrum_client::Client; | |
use bdk::bitcoin::{self, Address}; | |
use std::str::FromStr; | |
use bdk::blockchain::Blockchain; | |
fn main() -> Result<(), bdk::Error> { |
In questo (si spera corto) tutorial proveremo a spendere alcuni Bitcoin utilizzando bitcoin-cli
.
In questo tutorial uso la rete signet, ma ovviamente gli stessi passaggi funzionano anche per mainnet, testnet, e regtest.
Prerequisiti:
bitcoind
avviato e syncato- Avere alcuni sats da spendere con
bitcoin-cli
(potete ottenerli con un faucet se siete su signet/testnet, o minando su regtest)