Sunday, December 22, 2024

bitcoin core – How one can generate coinbase transaction in Python

I do know that on this discussion board numerous questions on this subject, I test this all (not all however most) and may’t discover the answer for my activity. I’m create my very own algorithm for mining Bitcoin on Python, this one for solo mining. So, I wrote all essential strategies for this, together with hashing Merkle root, calculate block header and many others. However now, I stack about few weeks on coinbase transaction. I test supplies from right here (https://learnmeabitcoin.com/technical/mining/coinbase-transaction/) about this and attempt to implement all logic for this, however cannot absolutely perceive the way to make this. I wanna embrace new guidelines (BIP34 – block header, BIP141 – SegWit tx) on this algorithm, however my data about hashing this isn’t sufficient 🙁
Can somebody present perhaps extra supplies, some samples of code, or describe particulars about producing coinbase transaction? Any info will probably be very helpfull, hope in your assist.
Additionally, I coaching on Bitcoin core in regtest mode, and after I use “generatetoaddress” technique (for generate blocks) this one does not gen coinbase tx with BIP34 & BIP141 necessities, perhaps I would like set extra config for this one? I discovered somebody say about blockversion arg, is it true?
Thanks all ^^
P.S. If i miss some particulars about my activity, fell free to ask and I present all information which I’ve, of pattern of code which I’ve (it is not working)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles