• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

bitcoin core – How to generate coinbase transaction in Python?

Moussa by Moussa
September 23, 2025
in Bitcoin
0
peer discovery – how to obtain the IP addresses of nodes for mining pools?
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I know that on this forum a lot of questions on this topic, I have checked most of these, but can’t find the solution for my task. I am creating my own algorithm for solo mining bitcoin on Python. I wrote all necessary methods for that, including hashing the Merkle root, calculating the block header etc. But now, I am stuck for a few weeks on the coinbase transaction. I have studied the coinbase transaction page on LearnMeABitcoin.com and tried to implement all logic for it, but can’t fully understand how to make one. I want to 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 a coinbase transaction? Any information will be very helpful, hope on your help.

Also, I am 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)

UPDATE
I have greate news, I find the solution and complete this) thanks all for yout support, some later I share my code for gen coinbaseTx in python.
But left only one question, i use object for generate tx like on screen, and it have some difference with coinbase tx from generataing by Bitcoin Core using generatetoaddress only in one place, filed n in first output, and it always “00000000”, like 0 in little-endian with 4 bytes I hope. Can someone explain what it is? I use p2wpkh script for hashing address, maybe this one is type for this? When I add this value all worked fine, and I successfully gen CoinbaseTx, after build block header and full block and broadcast it to node. But just for fully understanding my code, wanna to know what this “00000000” mean) Name “n” for field was by me, just temporary name.
enter image description here



Source link

Related articles

Are there documented cases of Lightning Network being used as the payment method in scams?

August 29, 2026
Ripple Donates $300K to Support Nepal and Tibet Flood Relief

Ripple Donates $300K to Support Nepal and Tibet Flood Relief

August 29, 2026
Share76Tweet47

Related Posts

Are there documented cases of Lightning Network being used as the payment method in scams?

by Moussa
August 29, 2026
0

I'm researching whether Lightning Network is used as a payment rail in social engineering crypto scams (giveaways, fake investments, recovery...

Ripple Donates $300K to Support Nepal and Tibet Flood Relief

Ripple Donates $300K to Support Nepal and Tibet Flood Relief

by Moussa
August 29, 2026
0

Key TakeawaysRipple is donating a combined $300,000 to two relief organizations.The funding will support meals, water, and sanitation assistance.More than...

Grayscale Names 3 Cryptos That Could Gain From Surging US Debt

Grayscale Names 3 Cryptos That Could Gain From Surging US Debt

by Moussa
August 29, 2026
0

Key TakeawaysGrayscale says government debt could support three cryptocurrencies.U.S. public debt exceeded $40 trillion for the first time.Treasury buybacks address...

Bitcoin Price Retreats After Warsh’s Hawkish Jackson Hole Keynote

Bitcoin Price Retreats After Warsh’s Hawkish Jackson Hole Keynote

by Moussa
August 29, 2026
0

Key TakeawaysBitcoin fell 2.5% to $77,588 after Kevin Warsh’s hawkish Jackson Hole speech.U.S. spot bitcoin ETFs snapped a 9-day inflow...

Trump-Linked Account Rugs GOLD Token, Nets $312K Profit

Trump-Linked Account Rugs GOLD Token, Nets $312K Profit

by Moussa
August 29, 2026
0

Key TakeawaysRealtrumpcoins, an account Trump follows, controlled 82.45% of GOLD’s total token supply before the dump.Fifteen wallets tied to GOLD...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1uYW1lJTIyJTIwdHlwZSUzRCUyMnRleHQlMjIlMjBuYW1lJTNEJTIybm4lMjIlMjBpZCUzRCUyMnRucC0xJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0MlMkZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1lbWFpbCUyMiUzRSUzQ2xhYmVsJTIwZm9yJTNEJTIydG5wLTIlMjIlM0VFbWFpbCUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1lbWFpbCUyMiUyMHR5cGUlM0QlMjJlbWFpbCUyMiUyMG5hbWUlM0QlMjJuZSUyMiUyMGlkJTNEJTIydG5wLTIlMjIlMjB2YWx1ZSUzRCUyMiUyMiUyMHJlcXVpcmVkJTNFJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJ0bnAtZmllbGQlMjB0bnAtcHJpdmFjeS1maWVsZCUyMiUzRSUzQ2xhYmVsJTNFJTNDaW5wdXQlMjB0eXBlJTNEJTIyY2hlY2tib3glMjIlMjBuYW1lJTNEJTIybnklMjIlMjByZXF1aXJlZCUyMGNsYXNzJTNEJTIydG5wLXByaXZhY3klMjIlM0UlQzIlQTBCeSUyMGNvbnRpbnVpbmclMkMlMjB5b3UlMjBhY2NlcHQlMjB0aGUlMjBwcml2YWN5JTIwcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News