Questions tagged [serialization]

Serialization is the conversion of information into a standard form that can be used to communicate that information. Network protocols typically specify the serialization to be used.

Serialization is the conversion of information into a standard form that can be used to communicate that information. Network protocols typically specify the serialization to be used.

For example the Bitcoin network has a specific binary serialization for block and transaction data that is sent between Bitcoin nodes and which becomes part of the blockchain. This serialization includes, for example, the use of Big-endian unsigned integers and a special compact-integer that stores integers as a variable-length data item.

15 questions
6
votes
1 answer

What is the maximum size of a DER encoded ECDSA signature?

I've been told by a seasoned Bitcoin contributor that signatures in Bitcoin could be up to 75 bytes. I'm curious to find out how that maximum comes to pass. According to this answer on Why the signature is always 65 (1+32+32) bytes long?, the…
Murch
  • 71,155
  • 33
  • 180
  • 600
3
votes
1 answer

How can I recognize an OP_RETURN transaction looking only at the hex?

Looking at these two transactions for example: tx1 and tx2. tx1 is an OP_RETURN trasaction, tx2 is a normal transaction. raw hex from tx1 (OP_RETURN):…
2
votes
1 answer

What is prepended to the front of a ScriptSig and ScriptPubKey of a P2PKH transction?

In some educational materials on bitcoin P2PKH transactions, I'll see 2 digits included in the front of what would be considered the ScriptSig. For example, what is the 8b in the front of the ScriptSig below…
2
votes
1 answer

Failing to construct transaction that unlocks P2WSH

I am trying to unlock the P2WSH output of the following transaction: https://blockstream.info/testnet/tx/b435b180c936564cc902ce3d7011643836a74d671159d494f59536e70d977cd2 The script that I'm paying to is a non-standard script, which can be unlocked…
2
votes
1 answer

Why does a script length of 254 need three bytes?

I'm looking at some raw txs (P2SH in that case) for learning, and I have one question about a particular tx: tx hash 0aeae24fa55544da49ba06ec338c9beee592ab4bea71eb8085908f377dd46084, i use this tool for…
cc1cc1
  • 21
  • 1
2
votes
1 answer

How can I get the destination address from raw transaction data?

I am writing a program that reads Bitcoin transactions from .blk files and performs some analysis on them. I would like to get the transaction destination addresses (like in some transaction explorers: link. Raw transaction data looks like this and…
1
vote
1 answer

Difference between 2 way of serialization in the Bitcoin Core

This answer, explains what are SERIALIZE_METHODS and DESERIALIZE_METHODS macros in the Bitcoin Core. They prevent duplicate code for implementing the serialization and deserialization logic. But I've seen some classes in the Bitcoin Core which do…
Amir reza Riahi
  • 1,133
  • 7
  • 22
1
vote
1 answer

How to convert a compressed public key into uncompressed one in Python?

I've searched really hard for a Python script that coverts a compressed public key into uncompressed one, since I don't know how to code this. I stumbled upon these…
1
vote
1 answer

What are the parts of a Bitcoin transaction in segwit format?

I know that pre-segwit transactions looked like the following (This is the hash of the transaction in block 170 - the 10000 bitcoin pizza…
Jamo
  • 157
  • 4
1
vote
1 answer

In what format does a block store the transaction data?

Does it store the raw transaction data literally like (excuse the formatting inaccuracies): 0x24134i59435ej3...9 sends 0x9wri03vw3sdfsd...i 26.00000023423 Bitcoin. Or is it stored differently?
Jamo
  • 157
  • 4
0
votes
0 answers

Obtain raw hex transaction data from Transaction-Id (in Rust)

Trying to find some way to make that serialization but I do not know if it is possible. I try bdk or bitcoin crates and I am not able to get anything right. I would like that my function would do the following one: Add as input the txId…
0
votes
1 answer

How to get the hex for a tx input (for btcdeb tool)

I am trying to understand how btcdeb (Bitcoin script debugger from Bitcoin core) works. In the usecase of btcdeb --tx= --txin=, how does one obtain the hex of the input of interest? In the example there: $ btcdeb…
Alec Matusis
  • 143
  • 4
0
votes
0 answers

Generate tx_hex from decode transaction?

I have BTC data dumps from Blockchair. These have almost all the data I need, however they do not include the raw transaction hex. Is it possible to generate the tx_hex from this data in Python? or would I need the private key to do that? The…
fpghost
  • 127
  • 1
0
votes
1 answer

What Serialization format is used in Bitcoin?

What serialization format is used in bitcoin network? I know in Ethereum, there is the RLP which has been replaced with SSZ. Polkadot has it's own serialization format called SCALE, but I have not been able to find information on what serialization…
Finlay Weber
  • 123
  • 3