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.
You have to generate a legacy
address type and use it in your tx.
bitcoin-cli getnewaddress "label" "address_type"
Thank you @Alko89! It’s a little bit helped. Now instead segwit type tx I have pubkeyhash. So in the result I didn’t get scriptSig filled again
I’m not sure if I wrote your command correctly:
First I wrote
bitcoin-cli -regtest getnewaddress "label" "scripthash"
But got the error Unknown address type ‘scripthash’.
Then I wrote:
bitcoin-cli -regtest getnewaddress "label" "legacy"
It worked but the type became pubkeyhash.
Could you tell me please where is the error?
@Alko89 I’ve got scripthash type after this command:
bitcoin-cli -regtest getnewaddress "label" "p2sh-segwit"
But in the end I still got empty scriptSig.
The only difference between my transaction and Filip transaction in the video that he has
"reqSigs":1
And in my transaction there is no that value at all:
Is that causing a problem?
you guys need to make an update for this video. Microsoft is killing Atom in December 2022 (https://www.opensourceforu.com/2022/06/atom-text-editor-will-officially-be-terminated-later-this-year/#:~:text=On%20December%2015%2C%20Microsoft’s%20GitHub,focus%20on%20cloud-based%20software ), I suppose any editor would work. but since this video is done on powershell, will nano work?
i’m unable to parse the transaction into the createrawtransaction function for any of these inputs, I read through several other forums, they all suggested this should work, any help please:
‘[{“txid”: “c7acc9171a4bde000cd3f82bf265d55b4a426cb25a57fb4419b268391477eafe”, “vout”: 0,}]’ ‘{“bcrt1qscfmx58ggy37p0m32eejwrwxf4sqj3afk0eh8u”: 49}’
“[{“txid”: “c7acc9171a4bde000cd3f82bf265d55b4a426cb25a57fb4419b268391477eafe”, “vout”: 0,}]” “{“bcrt1qscfmx58ggy37p0m32eejwrwxf4sqj3afk0eh8u”: 49}”
‘’’[{“txid”: “c7acc9171a4bde000cd3f82bf265d55b4a426cb25a57fb4419b268391477eafe”, “vout”: 0,}]’ ‘{“bcrt1qscfmx58ggy37p0m32eejwrwxf4sqj3afk0eh8u”: 49}’
after numerous trial and error the follow works:’[{“txid”: “c7acc9171a4bde000cd3f82bf265d55b4a426cb25a57fb4419b268391477eafe”, “vout”: 0}]’ ‘{“bcrt1qscfmx58ggy37p0m32eejwrwxf4sqj3afk0eh8u”: 49}’
I had an extra , after vout: 0.
also spacing is needed and important
Hi how can i get Raw Transaction in binance & Blockchain platform