Mastering Bitcoin

PDF Publication Title:

Mastering Bitcoin ( mastering-bitcoin )

Previous Page View | Next Page View | Return to Search List

Text from PDF Page: 209

In block 277,316 we see that the coinbase (see Example 8-4), which is in the “Unlocking Script” or scriptSig field of the transaction input, contains the hexadecimal value 03443b0403858402062f503253482f. Let’s decode this value. The first byte, 03 instructs the script execution engine to push the next 3 bytes onto the script stack (see Table C-1). The next 3 bytes, 0x443b04, are the block height encoded in little-endian format (backwards, least significant byte first). Reverse the order of the bytes and the result is 0x043b44 which is 277,316 in decimal. The next few hexadecimal digits (03858402062) are used to encode an extra nonce (See “The Extra Nonce Solution” on page 210), or random value, used to find a suitable Proof- of-Work solution. The final part of the coinbase data (2f503253482f) is the ASCII-encoded string “/ P2SH/”, which indicates that the mining node that mined this block supports the Pay- to-Script-Hash (P2SH) improvement defined in BIP0016. The introduction of the P2SH capability required a “vote” by miners to endorse either BIP0016 or BIP0017. Those endorsing the BIP0016 implementation were to include “/P2SH/” in their coinbase data. Those endorsing the BIP0017 implementation of P2SH were to include the string “p2sh/ CHV” in their coinbase data. The BIP0016 was elected as the winner, and many miners continued including the string “/P2SH/” in their coinbase to indicate support for this feature. The code example Example 8-6 uses the libbitcoin library introduced in “Alternative clients, libraries and toolkits” on page 56 to extract the coinbase data from the genesis block, displaying Satoshi’s message. Note that the libbitcoin library contains a static copy of the genesis block, so the example code below can use retrieve the genesis block directly from the library. Example 8-6. Extract the coinbase data from the genesis block /* Display the genesis block message by Satoshi. */ #include #include int main() { // Create genesis block. bc::block_type block = bc::genesis_block(); // Genesis block contains a single coinbase transaction. assert(block.transactions.size() == 1); // Get first transaction in block (coinbase). const bc::transaction_type& coinbase_tx = block.transactions[0]; // Coinbase tx has a single input. assert(coinbase_tx.inputs.size() == 1); const bc::transaction_input_type& coinbase_input = coinbase_tx.inputs[0]; // Convert the input script to its raw format. 190 | Chapter 8: Mining and Consensus

PDF Image | Mastering Bitcoin

PDF Search Title:

Mastering Bitcoin

Original File Name Searched:

05db7df4f31840f0a873d6ea14dcc28d.pdf

DIY PDF Search: Google It | Yahoo | Bing

NFT (Non Fungible Token): Buy our tech, design, development or system NFT and become part of our tech NFT network... More Info

IT XR Project Redstone NFT Available for Sale: NFT for high tech turbine design with one part 3D printed counter-rotating energy turbine. Be part of the future with this NFT. Can be bought and sold but only one design NFT exists. Royalties go to the developer (Infinity) to keep enhancing design and applications... More Info

Infinity Turbine IT XR Project Redstone Design: NFT for sale... NFT for high tech turbine design with one part 3D printed counter-rotating energy turbine. Includes all rights to this turbine design, including license for Fluid Handling Block I and II for the turbine assembly and housing. The NFT includes the blueprints (cad/cam), revenue streams, and all future development of the IT XR Project Redstone... More Info

Infinity Turbine ROT Radial Outflow Turbine 24 Design and Worldwide Rights: NFT for sale... NFT for the ROT 24 energy turbine. Be part of the future with this NFT. This design can be bought and sold but only one design NFT exists. You may manufacture the unit, or get the revenues from its sale from Infinity Turbine. Royalties go to the developer (Infinity) to keep enhancing design and applications... More Info

Infinity Supercritical CO2 10 Liter Extractor Design and Worldwide Rights: The Infinity Supercritical 10L CO2 extractor is for botanical oil extraction, which is rich in terpenes and can produce shelf ready full spectrum oil. With over 5 years of development, this industry leader mature extractor machine has been sold since 2015 and is part of many profitable businesses. The process can also be used for electrowinning, e-waste recycling, and lithium battery recycling, gold mining electronic wastes, precious metals. CO2 can also be used in a reverse fuel cell with nafion to make a gas-to-liquids fuel, such as methanol, ethanol and butanol or ethylene. Supercritical CO2 has also been used for treating nafion to make it more effective catalyst. This NFT is for the purchase of worldwide rights which includes the design. More Info

NFT (Non Fungible Token): Buy our tech, design, development or system NFT and become part of our tech NFT network... More Info

Infinity Turbine Products: Special for this month, any plans are $10,000 for complete Cad/Cam blueprints. License is for one build. Try before you buy a production license. May pay by Bitcoin or other Crypto. Products Page... More Info

CONTACT TEL: 608-238-6001 Email: greg@infinityturbine.com (Standard Web Page)