Close Menu
  • Home
  • Bitcoin
    • Bitcoin Atm Machines
    • Bitcoin Books
      • Bitcoin Jobs
        • Bitcoin Price Prediction
        • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gifts
    • Bitcoin Gift Card
    • Bitcoin Mining
    • Bitcoin Wallets
  • Technology
  • Shop
    • Bitcoin Atm Machine
    • Bitcoin Coins
    • Bitcoin Coins, Wallets,Shirts,Books,Gifts
    • Bitcoin Mining Machine
    • Bitcoin Mining Machine Full Set Up
    • Computers and Accessories
    • USB Flash Drives
    • Mini Bitcoin Mining Machine
What's Hot

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

Tesla’s China Rivals Report Steady August Sales Performance Amid Intense Price Competition: What Investors Should Know – XPeng (NYSE:XPEV), NIO (NYSE:NIO), Li Auto (NASDAQ:LI)

March 18, 2025

IEEE President’s Note: Why Students Should Stay with IEEE

March 18, 2025
Facebook X (Twitter) Instagram
  • Bitcoin
  • Bitcoin Books
  • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gift Card
Facebook X (Twitter) Instagram
farm-bitcoin.com
  • Home
  • Bitcoin
    • Bitcoin Atm Machines
    • Bitcoin Books
      • Bitcoin Jobs
        • Bitcoin Price Prediction
        • Bitcoin Coin
  • Bitcoin Farm
  • Bitcoin Gifts
    • Bitcoin Gift Card
    • Bitcoin Mining
    • Bitcoin Wallets
  • Technology
  • Shop
    • Bitcoin Atm Machine
    • Bitcoin Coins
    • Bitcoin Coins, Wallets,Shirts,Books,Gifts
    • Bitcoin Mining Machine
    • Bitcoin Mining Machine Full Set Up
    • Computers and Accessories
    • USB Flash Drives
    • Mini Bitcoin Mining Machine
farm-bitcoin.com
Home » mining theory – How to create coinbase? How to use witness?
mining theory – How to create coinbase? How to use witness?
Bitcoin

mining theory – How to create coinbase? How to use witness?

adminBy adminMarch 18, 2025No Comments2 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email


BIP141 adds a new rule called “witness commitment”. The document says: “The commitment is recorded in a scriptPubKey of the coinbase transaction.” I didn’t quite understand what that meant, Therefore, I directly placed the ‘default_witness_commitment’ provided by the block template in the scriptPubKey location when creating coinbase. Here’s my code:

def makeCoinbase()->None:
    global coinbase,tmpl
    version=pack('

The variable tmpl is the template obtained using the “getblocktemplate” command.I’m testing my code in regtest. When I submit a block, Bitcoin Core does create a new block. And my balance did go up.
However, when I checked coinbases in the newly generated block, the result was as follows:

{
    'txid': '9cb794f3292d1ece3af6c1d3055cf6fb26cf2126ff48b39b229bfec5ec651ec4', 
    'hash': 'de081b2a9552ac559d3501ed0669f675530fe9890e27d263c1aff65e678ddc4e', 
    'version': 1, 
    'size': 153, 
    'vsize': 126, 
    'weight': 504, 
    'locktime': 0, 
    'vin': [{
        'coinbase': '016c54686520477265617420476f642050616e', 
        'txinwitness': ['0000000000000000000000000000000000000000000000000000000000000000'], 
        'sequence': 4294967295}], 
    'vout': [{
        'value': Decimal('50.00063100'), 
        'n': 0, 
        'scriptPubKey': {
            'asm': 'OP_RETURN aa21a9edb14717ddf39dacad0babfff4d8d951c076e95d11d2b1f328632c32f98c015d2c', 
            'desc': 'raw(6a24aa21a9edb14717ddf39dacad0babfff4d8d951c076e95d11d2b1f328632c32f98c015d2c)#psf60z3m', 
            'hex': '6a24aa21a9edb14717ddf39dacad0babfff4d8d951c076e95d11d2b1f328632c32f98c015d2c', 
            'type': 'nulldata'
        }
    }], 
    'hex': '010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff13016c54686520477265617420476f642050616effffffff017ce8062a01000000266a24aa21a9edb14717ddf39dacad0babfff4d8d951c076e95d11d2b1f328632c32f98c015d2c0120000000000000000000000000000000000000000000000000000000000000000000000000'
}

As you can see, it contains only one vout. And that vout does not contain address. But I look at coinbase for blocks in the main network, and it always contains more than one vout, and the vout contains the address.My question is am I building coinbase the right way? If not, how do I fix it? Although the Bitcoin core did not report errors, I always suspected that I had lost the miner’s address.



Source link

Post Views: 71
Coinbase Create mining theory Witness
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
admin
  • Website

Related Posts

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

PEPE Whales Set Out To Be Bullish With FOLKI and Mpeppe (MPEPE) With 500x Gains Between Them

March 18, 2025

private key – Safest way of long term holding

March 18, 2025

Restoring trust and equity in the digital age through decentralized AI

March 18, 2025
Add A Comment
Leave A Reply Cancel Reply

Subscribe to Updates

Get the latest creative news from farm-bitcoin about crypto, bitcoin, business and technology.

Please enable JavaScript in your browser to complete this form.
Loading
About Us
About Us

At Farm Bitcoin, we are passionate about unlocking the potential of cryptocurrency and blockchain technology. Our mission is to make the world of digital currencies accessible and understandable for everyone, from beginners to seasoned investors. We believe that cryptocurrency represents the future of finance, and we are here to guide you through this exciting landscape.

Top Insights

Artificial Superintelligence Alliance Whales Purchase Mpeppe (MPEPE) Before Its Enters Stage 4

March 18, 2025

Tesla’s China Rivals Report Steady August Sales Performance Amid Intense Price Competition: What Investors Should Know – XPeng (NYSE:XPEV), NIO (NYSE:NIO), Li Auto (NASDAQ:LI)

March 18, 2025

IEEE President’s Note: Why Students Should Stay with IEEE

March 18, 2025
Get Informed

Subscribe to Updates

Get the latest creative news from farm-bitcoin about crypto, bitcoin, business and technology.

Please enable JavaScript in your browser to complete this form.
Loading
Facebook X (Twitter) Instagram Pinterest
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
Copyright 2024 Farm Bitcoin Design By Prince Ayaan.

Type above and press Enter to search. Press Esc to cancel.

Go to mobile version