Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I'm trying to spend coins put in a P2SH address (custom script).
I've built a transaction (call it dummytx) with the same output as the one I'd like to send, and the same input except for the scriptSig. This is the message that will be signed and used as part of the actual scriptSig.
Here are my updated questions:
- serialised dummytx already has [1,0,0,0] in the end, should I add that again before hashing twice and signing?
- I've tried various combinations as scriptSig for dummytx, but all result in wrong signatures, what should I use? The scriptPubKey of the output I'm about to spend (so something like OPHASH160 scripthash OPEQUAL) or the custom script that generated script hash?
Slightly unrelated: about the Script Builder in Rust, is there any particular method to push the signature? Just push_slice? (this is from the elements version but should be the same in bitcoin-rust)
let script_sig = elements::script::Builder::new() .push_slice(&sig_bytes) .push_slice(redeem_script_bytes) .into_script();
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments