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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
33 views

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 ...
DustInTheSilence's user avatar
0 votes
1 answer
47 views

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=<tx hex> --txin=<txin hex>, how does one obtain the hex of the input ...
Alec Matusis's user avatar
0 votes
0 answers
73 views

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 ...
fpghost's user avatar
  • 127
2 votes
1 answer
65 views

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 ...
jiamijiang's user avatar
2 votes
1 answer
69 views

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 ...
msinkec's user avatar
  • 23
2 votes
2 answers
164 views

Is there a set length that a signature can be?

I'm reading this page which describes the following method of creating a stack: OP_0 <A sig> <B sig> OP_2 <A pubkey> <B pubkey> <C pubkey> OP_3 Sig Stack Pubkey ...
bitcoinluvr6969's user avatar
3 votes
1 answer
211 views

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): ...
luisschwab's user avatar
1 vote
1 answer
60 views

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 ...
Amir reza Riahi's user avatar
0 votes
1 answer
64 views

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 ...
Finlay Weber's user avatar
1 vote
1 answer
515 views

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 links: https://stackoverflow.com/...
Maltoon Yezi's user avatar
1 vote
1 answer
1k views

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 exchange): ...
Jamo's user avatar
  • 157
1 vote
1 answer
425 views

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's user avatar
  • 157
2 votes
1 answer
100 views

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 ...
cc1cc1's user avatar
  • 21
2 votes
1 answer
474 views

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:...
zigak's user avatar
  • 21
7 votes
1 answer
5k views

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 ...
Murch's user avatar
  • 71.6k