Questions tagged [rust-bitcoin]
6 questions
4
votes
2 answers
Signing taproot key-path transaction from rust-bitcoin
I'm trying to make a taproot HTLC using rust-bitcoin for an atomic swap protocol. My plan is that in the "happy case" of my protocol, the coins are spent with the key-path, and then there is a tapleaf for the "refund" case (after n blocks, the…
rijndael
- 43
- 3
3
votes
2 answers
Code for computing SigHash for various input types
I am looking for code examples (in rust-bitcoin, but even in Python) of how to calculate sighash for various input types. Specifically, I need to calculate the sighashes for M of N multisig unlocking script inputs for these transaction types: P2MS,…
Alec Matusis
- 143
- 4
3
votes
1 answer
Why is the Bitcoin Core HWI written in Python? If it was rewritten in Rust should the Python HWI still be maintained?
Why is/was the Bitcoin Core HWI written in Python?
What have the challenges been of having the HWI written in Python?
There seems to be interest and rationale(s) to write another HWI in Rust. Would there be a strong rationale to continue to maintain…
Michael Folkson
- 14,337
- 3
- 11
- 45
3
votes
1 answer
How do you commit to the previous output's amount when signing a segwit input with rust-bitcoin?
I'm trying to sign a segwit transaction in rust-bitcoin. To start with, my transaction setup looks as follows:
let previous_output = OutPoint::new(Txid::from_hex("991ab2b13f6bc6c13002d79d5e9775626a5e7328e14cd16837d50d1cc637dc6a").unwrap(), 0);
let…
arik
- 218
- 1
- 9
2
votes
1 answer
Having issues properly generating a p2pkh address in Rust code. (for research purposes not for real use)
I have followed the steps to generate a p2pkh compressed base58 address and am consistently checking it to find that I get an invalid checksum.
I am using this python code to check the address:
(Checked the solution against the python code and an…
Poseidon
- 599
- 2
- 20
0
votes
1 answer
Using the Bitcoin Crate to Sign a Segwit Transaction
Using the Bitcoin crate, I'm trying to create a transaction programmatically in Rust that spends an output associated with a P2WPKH address. This is the relevant code snippet:
fn sign_transaction(
own_public_key: &[u8],
own_address:…
THLO
- 1
- 2