Hi
I’m trying to figure out part 3 - signing the transaction.
I’ve followed the video and decoded the hex transaction but for some reason I’m unable to generate the scriptSig?I’ve attached a screenshot of this.
Thank you.
Hi
I’m trying to figure out part 3 - signing the transaction.
I’ve followed the video and decoded the hex transaction but for some reason I’m unable to generate the scriptSig?I’ve attached a screenshot of this.
Thank you.
You have to sign the transaction using signrawtransactionwithwallet
command.
This is a segwit tx, so you have a txwitness field instead. Have you tried sending the tx and see if it works?
It worked. Thank you
worked on my mac
thanks
actually going to the bitcoin IDE from the first parts of filip’s lectures and running my scriptSig (for vin, i.e. input transaction, of proposed transaction we just signed and decoded, i.e. signature and public key) in my case:
“asm”: “30440220229b40844d1761e3c7534786ebd3d2df94404ee81a52ef2271c6fb09ddab1745022021611dbb8ccd421b89e988c4abad7505e732322e8d3ecc648317f8c954e93ca3[ALL]”,
OR
“hex”: “4730440220229b40844d1761e3c7534786ebd3d2df94404ee81a52ef2271c6fb09ddab1745022021611dbb8ccd421b89e988c4abad7505e732322e8d3ecc648317f8c954e93ca301”
…
THEN
my locking script from (got by using gettxout on -->) the transaction used as input to the transaction we’ve been creating and just signed / decoded, in my case
“asm”: “0332bf5017af7179fecdc412d14dfd073dc28a490f747fb5fd802b8cd149be3f87 OP_CHECKSIG”,
“hex”: “210332bf5017af7179fecdc412d14dfd073dc28a490f747fb5fd802b8cd149be3f87ac”,
“type”: “pubkey”,
“addresses”: [“mvr1Ap2d8atomSMDmgjsxmDUecKgoFYaa1”
…
so that my code looked like this in the IDE
30440220229b40844d1761e3c7534786ebd3d2df94404ee81a52ef2271c6fb09ddab1745022021611dbb8ccd421b89e988c4abad7505e732322e8d3ecc648317f8c954e93ca3
0332bf5017af7179fecdc412d14dfd073dc28a490f747fb5fd802b8cd149be3f87 OP_CHECKSIG
, which turned out to successfully execute, was very encouraging in making sure i understood what was getting checked where and why.
Hello,
I am getting tx fee error:
error code: -25
error message:
Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)
Reading the past messages, I restarted the node and put fallbackfee but it didn’t fix the isse
$ bitcoind -regtest -printtoconsole -fallbackfee=0.001
Also, I tried to setting the fee from cli
$ bitcoin-cli -regtest -rpcwallet=testwallet settxfee 0.00001
true
but same result…
Any help would be appreciated thanks.
@Alko89
The fallback fee doesn’t count when creating raw transactions because you’re setting the fee yourself by sending the change yourself (remember inputs - outputs = fee).
Did you forget to set the change output or set it on a to low value making the fee really large?
Hello @Filip i followed every single instruction you gave, but unfortunately, whenever i execute the code ./bitcoin-cli - retest gettxout “TXid”
After executing this, your own result contained the unlocking script, but my result didn’t, my result was showing json object beside scriptpubkey and it showed (string) beside “asm” where the unlocking script should be.
Attached to this message is a screenshot of my result and your own result as it should be.
I’d appreciate and look forward to your response, thanks.
From what I see you didn’t include the n
parameter at the end.
Thank you very much sir, what’s the N parameter? The 0?? Cause the only thing i see is the comma and 0
Yes the 0 or vout number.
Big announcement everyone: special thanks to Mr alko89 i have passed this situation that have kept me stuck:joy:thank you so much Mr. Alko.
Hello, i have decoded a transaction and not all of the elements apears, i’m a little bit confused. It worked but not the same way as filip !
Can someone help me if i got something wrong or is it normal ?
PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest decoderawtransaction "0200000001fe460765f7468ba99ecce24b51b3e635cc24d7eeefe875f602ecce5309d0c7440000000000ffffffff010011102401000000160014534762b1e20ef159f4de6977b708975026bbec3600000000"
{
"txid": "4e23caeb72c213654d8fe55087af41b07ef289b3afcdd3b06aaa74c45f2f97b3",
"hash": "4e23caeb72c213654d8fe55087af41b07ef289b3afcdd3b06aaa74c45f2f97b3",
"version": 2,
"size": 82,
"vsize": 82,
"weight": 328,
"locktime": 0,
"vin": [
{
"txid": "44c7d00953ceec02f675e8efeed724cc35e6b3514be2cc9ea98b46f7650746fe",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 49.00000000,
"n": 0,
"scriptPubKey": {
"asm": "0 534762b1e20ef159f4de6977b708975026bbec36",
"hex": "0014534762b1e20ef159f4de6977b708975026bbec36",
"address": "bcrt1q2drk9v0zpmc4nax7d9mmwzyh2qnthmpk6k6gc4",
"type": "witness_v0_keyhash"
}
}
]
}
Guys, I’m getting error message:
PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest createrawtransaction ‘[{“txid”: “e6c414fcd9ddd5891c4d9a3a5525ca9679c91ab3e8894088ccde0efa58a4818b”“vout”: 0}]’ ‘{“bcrt1qc8zkatk7uglsgtnr0ea56597z59ccez2gj0n0f”:49 }’
error: Error parsing JSON: [{“txid”: “e6c414fcd9ddd5891c4d9a3a5525ca9679c91ab3e8894088ccde0efa58a4818b”“vout”: 0}]
Could anyone advice me on what I’m doing wrong? Thank you!
Hi @filip!
On the step of decoding the transaction I’m getting “type”: “witness_v0_keyhash” instead of scripthash.
Have no idea how to fix it. All the next steps are causing different results than in the video.
Does anybody know why I’m getting witness_v0_keyhash type and how to make it scripthast?
You missed comma after “e6c414fcd9ddd5891c4d9a3a5525ca9679c91ab3e8894088ccde0efa58a4818b”
This is fine because you have a segwit type tx so the scripthash is in another field.