Skip to content

Commit

Permalink
fix: print L1 desc, update esplora/l2 params
Browse files Browse the repository at this point in the history
  • Loading branch information
Zk2u committed Oct 7, 2024
1 parent a54b14d commit f2905c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions faucet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ip_src = "ConnectInfo"
seed_file = "faucet.seed"
sqlite_file = "faucet.sqlite"
network = "signet"
esplora = "https://electrs.018235aabb3fe7.stratabtc.org"
l2_http_endpoint = "https://stratareth.018235aabb3fe7.stratabtc.org"
esplora = "https://electrs.devnet-annapurna.stratabtc.org"
l2_http_endpoint = "https://stratareth.devnet-annapurna.stratabtc.org"
sats_per_claim = 1_002_000_000
pow_difficulty = 19
15 changes: 13 additions & 2 deletions src/l1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ use bdk_esplora::{
EsploraAsyncExt,
};
use bdk_wallet::{
bitcoin::{bip32::Xpriv, FeeRate, Network},
bitcoin::{
bip32::{Xpriv, Xpub},
key::Secp256k1,
FeeRate, Network,
},
miniscript::descriptor::checksum::desc_checksum,
rusqlite::{self, Connection},
ChangeSet, KeychainKind, PersistedWallet, Wallet, WalletPersister,
};
Expand Down Expand Up @@ -117,8 +122,14 @@ impl L1Wallet {
/// Create a wallet using the seed file and sqlite database.
pub fn new(network: Network, seed: &Seed) -> io::Result<Self> {
let rootpriv = Xpriv::new_master(Network::Signet, seed).expect("valid xpriv");
// let rootpub = Xpub::from_priv(&Secp256k1::new(), &rootpriv);
let rootpub = Xpub::from_priv(&Secp256k1::new(), &rootpriv);
let base_desc = format!("tr({}/86h/0h/0h", rootpriv);
let pub_desc = format!("tr({}/86h/0h/0h/0/*)", rootpub);

info!(
"L1 descriptor: {pub_desc}#{}",
desc_checksum(&pub_desc).expect("valid desc")
);
let external_desc = format!("{base_desc}/0/*)");
let internal_desc = format!("{base_desc}/1/*)");

Expand Down

0 comments on commit f2905c9

Please sign in to comment.