-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including the latest rust-wallet and rust-bitcoin as dependencies causes errors #25
Comments
Also, ExtendedPrivateKey from rust-wallet is not compatible with rust-bitcoin, but again this is fixed when using extern crate bitcoin_wallet;
use bitcoin_wallet::account::{MasterAccount, Unlocker};
use bitcoin_wallet::mnemonic;
extern crate bitcoin;
use bitcoin::Network;
use bitcoin::secp256k1::Secp256k1;
use bitcoin::util::bip32::ChildNumber;
fn main() {
const SEED_PHRASE: &str =
"great rice pitch bitter stay crash among position disease enable sell road";
const EXTENSION: &str = "helloworld";
const PASSPHRASE: &str = "";
let master = MasterAccount::from_mnemonic(
&mnemonic::Mnemonic::from_str(SEED_PHRASE).unwrap(),
0,
Network::Regtest,
PASSPHRASE,
Some(EXTENSION)
).unwrap();
let unlocker = Unlocker::new_for_master(&master, PASSPHRASE).unwrap();
let secp = Secp256k1::new();
let tweakable_pubkey = unlocker.context().private_child(
unlocker.master_private(),
ChildNumber::from_hardened_idx(0).unwrap()
).unwrap().private_key.public_key(&secp);
} Error when
|
I worked around this issue by completely separating rust-bitcoin and rust-wallet. So for example using rust-wallet's seed phrase code to obtain random data as [u8] and then passing that to rust-bitcoin. And never using a struct from rust-wallet like PublicKey and passing it to a function rust-bitcoin. Luckily my project only uses small parts of rust-wallet so this was possible. |
@chris-belcher Have you published your project? |
Hello everyone, does anyone have any update on this problem? I also ran into it and - frankly - don't really know how to resolve other than downgrading to the last compatible version across my program. |
The resulting error:
Changing the line in
Cargo.toml
tobitcoin = "0.21"
make the code correctly compile, however then you're missing the latest updates of rust-bitcoin. Anythingbitcoin = "0.22"
or above results in the same error.What's going on here? (I'm slightly new to rust so would appreciate a explanation) How to fix or work around this?
I've noticed when searching github that everyone actually uses
bitcoin = "0.21"
in combination with rust-wallethttps://github.com/search?l=&p=2&q=bitcoin-wallet+filename%3ACargo.toml+fork%3Atrue&ref=advsearch&type=Code
The text was updated successfully, but these errors were encountered: