Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Kostelooscoin on August 27, 2022, 02:02:45 PM



Title: How to decrypt hex rawtx
Post by: Kostelooscoin on August 27, 2022, 02:02:45 PM
Hello, I would like to know how to decipher this

and what values would change for the next block ?

01000000010000000000000000000000000000000000000000000000000000000000000000fffff fff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1 1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf6 21e73a82cbf2342c858eeac00000000

01 version ect......

thanks


Title: Re: How to decrypt hex rawtx
Post by: BlackHatCoiner on August 27, 2022, 02:18:23 PM
Hello, I would like to know how to decipher this
You mean how to decode it? Like this:
Code:
$ bitcoin-cli decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000
{
  "txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
  "hash": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
  "version": 1,
  "size": 134,
  "vsize": 134,
  "weight": 536,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "04ffff001d0104",
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 50.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
        "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
        "type": "pubkey"
      }
    }
  ]
}

Download Bitcoin Core (https://bitcoincore.org/en/download/) if you haven't already.

and what values would change for the next block ?
What values, regarding what? Please be more specific. Ask the question like we're next to you.


Title: Re: How to decrypt hex rawtx
Post by: o_e_l_e_o on August 27, 2022, 03:30:48 PM
You don't need to download Bitcoin Core just to decode a raw transaction. Plenty of tools to do it online, such as: https://live.blockcypher.com/btc/decodetx/

and what values would change for the next block ?
I think what OP is asking is what would change between this transaction and the coinbase transaction on the next block. Well, let's take a look. Here is the transaction OP has shared (coinbase transaction from block 1) with the coinbase transaction from block 2 directly below it:

Code:
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d010bffffffff0100f2052a010000004341047211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073dee6c89064984f03385237d92167c13e236446b417ab79a0fcae412ae3316b77ac00000000

And let's break it down.

01000000Version
01Number of inputs
000...000 (32 bytes)TXID of the first input (in this case null data since it is a coinbase transaction)
ffffffffOutput index number (again irrelevant here due to being a coinbase transaction)
07Size of ScriptSig - 7 bytes
04ffff001d0104ScriptSig - could be any arbitrary data between 2 and 100 bytes
ffffffffnSequence
01Number of outputs
00f2052a01000000Value of first output (this is 5000000000 sats (50 BTC) encoded in reverse byte order)
43Size of script (67 bytes)
410...eeacScript
00000000nLocktime

So the only things which change are the input script (which doesn't matter since we are not unlocking any outputs in a coinbase transaction) and the output script, which changes the destination the coins are sent to.