How to generate coinbase transaction in Python

I know that on this forum a lot of questions on this topic, I check this all (not all but most) and can't find the solution for my task. I am create my own algorithm for mining Bitcoin on Python, this one for solo mining. So, I wrote all necessary methods for this, including hashing Merkle root, calculate block header etc. But now, I stack about few weeks on coinbase transaction. I check materials from here (https://learnmeabitcoin.com/technical/mining/coinbase-transaction/) about this and try to implement all logic for this, but can't fully understand how to make this. I wanna include new rules (BIP34 - block header, BIP141 - SegWit tx) in this algorithm, but my knowledge about hashing this is not enough :( Can someone provide maybe more materials, some samples of code, or describe details about generating coinbase transaction? Any information will be very helpfull, hope on your help. Also, I training on Bitcoin core in regtest mode, and when I use "generatetoaddress" method (for generate blocks) this one doesn't gen coinbase tx with BIP34 & BIP141 requirements, maybe I need set more config for this one? I found someone say about blockversion arg, is it true? Thank you all ^^ P.S. If i miss some details about my task, fell free to ask and I provide all info which I have, of sample of code which I have (it's not working)



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/liOQGys
via IFTTT

Popular posts from this blog

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitwise Clients Pour $69M Into Solana as Bulls Fight to Reclaim $200 Resistance Zone