Bitcoin Forum
November 19, 2024, 09:09:18 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Coinbase input script  (Read 1261 times)
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
April 10, 2013, 03:35:56 PM
 #1

This is the sig script to unlock the input into the coinbase transaction.  However, since the coinbase doesn't have an input, it was initially undefined.  It looks like the input transaction needs to be set to 0 though.

Since BIP-34 was accepted, the start of the coinbase transaction's script is the block height, i.e. 0x03 (the length) and then the height.  This was to make sure every coinbase transaction hashed to a different value, even if they paid out to the same address.

What is the rest of the coinbase script used for?  Is it just random data or do miners has some system for deciding what to set it to?  Why not leave it as short as possible, since that would make the transaction smaller?

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
April 10, 2013, 03:42:21 PM
 #2

It has an extraNonce in it, and is also these days used for flagging features that the miner supports.
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
April 10, 2013, 03:45:56 PM
 #3

It has an extraNonce in it, and is also these days used for flagging features that the miner supports.

What kind of features?  Is that other BIP's that use it for miners to "vote"?

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
April 10, 2013, 04:22:27 PM
 #4

Another question about coinbase transactions, do they have to be the first transaction in the block?

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Zeilap
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
April 10, 2013, 04:51:18 PM
 #5

Another question about coinbase transactions, do they have to be the first transaction in the block?
Yes - in fact they must be, and all others must not be coinbase.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!