Author

Topic: Need Help on clarifying Coinbase transaction: (Read 768 times)

sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
So the wiki can be edited.
newbie
Activity: 1
Merit: 0
You won't find such blocks because Bitcoin Core rejects all blocks whose first transaction is anything else but the coinbase transaction (src/main.cpp line 2300).
sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
I don't know that's why I want to crawl the blockchain to find out.
Gol
newbie
Activity: 47
Merit: 0
not sure i understand...is there a situation that the first tx is NOT coinbase?
sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
Well, now we have to find if there are any blocks whose first tx is not the coinbase.

blockexplorer.com/b/0

blockexplorer.com/b/1

python

Code:
from urllib2 import Request, urlopen, URLError

prompt = '>>'

print "Enter block height"

height = raw_input(prompt)

key = 'http://blockexplorer.com/b/%s' % height

request = Request(key)

try:
response = urlopen(request)
block_data = response.read()
print block_data
except URLError, e:
    print 'whoops', e

mmm need to iterate the block height.  but first im going to figure out how to check if the coinbase is the first tx in a given block.  
Gol
newbie
Activity: 47
Merit: 0
bump...
Gol
newbie
Activity: 47
Merit: 0
Hello all.
i did some reading here:
https://en.bitcoin.it/wiki/Protocol_specification.
came across:
"A special kind of transaction, called a coinbase transaction, has no inputs. It is created by miners, and there is one coinbase transaction per block. Because each block comes with a reward of newly created Bitcoins (e.g. 50 BTC for the first 210,000 blocks), the first transaction of a block is, with few exceptions, the transaction that grants those coins..."

any info about: "few exceptions" will be much appreciated.

Cheers,
Gol.
Jump to: