Questions tagged [encoding]

31 questions
42
votes
1 answer

How are transaction hashes calculated?

I'm trying to calculate the hash of transactions in bitcoin blocks, but I'm not getting the right answers. For example, the genesis block has a single transaction. Here's how I'm attempting to calculate its hash... Transactions are encoded as: a 32…
Chris Moore
  • 14,745
  • 6
  • 65
  • 87
15
votes
2 answers

What is a 130 hex character public key?

I went onto https://www.bitaddress.org and the last tab there is a place to enter a private key and it shows the various formats of public and private keys. It is strange to me that the public key can either be 33 Base58 or 130 Base16. It doesn't…
shoeless joe
  • 2,237
  • 3
  • 20
  • 26
10
votes
2 answers

What are the DER signature and SEC format

I often see those 2 elements in bitcoin documentations and tutorials but I have not yet find a proper definition on the internet for DER signature and SEC format.
Saxtheowl
  • 2,760
  • 8
  • 16
  • 34
9
votes
1 answer

Different ways to encode Bitcoin Address

What are the different ways to encode a Bitcoin Address (both private and public) and how are they calculated? I've heard of things like firstbits, mini private key format, and I`d like to know how does one convert one number into another.
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
8
votes
1 answer

Why is Ripple's base58 alphabet so weird?

In this answer I found out that Ripple uses a different base58 alphabet from Bitcoin. There aren't many materials on what that alphabet is, but I managed to find this reference: The base58 dictionary for ripple is:…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
7
votes
1 answer

How to decode raw tx hex programmatically

createrawtransaction(...) in testnet returns this…
Doug Peters
  • 1,366
  • 14
  • 23
7
votes
3 answers

In which Block was Len Sassaman memorialised?

It has been mentioned a couple times here and there that Len Sassaman was memorialised somewhere in the Block Chain. I was able to find a dump of of the tribute to him, but I can't seem to find where in the Chain did this tribute come from. What are…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
7
votes
1 answer

Was Base58 invented for Bitcoin?

Base58 is very useful whenever data needs to be written down, but I've never seen it mentioned in any context other than Bitcoin. Was it invented by Satoshi specifically for use in Bitcoin?
Meni Rosenfeld
  • 19,650
  • 35
  • 70
4
votes
3 answers

allowed DER encoding format violations for signatures in bitcoin: implications for libraries?

I have recently changed verification code in python-bitcointx to use libsecp256k1 library. In the python-bitcoinlib code (that python-bitcointx is a derivative of), openssl functions were used for signature verification. I want to be able to remove…
4
votes
3 answers

Compact integer in Scripts

I've been looking at the compact representation of integers for integer operations in the Script language. It seems that most operations produce or push byte arrays, but when integer operations are performed those arrays are interpreted using a…
Matt
  • 520
  • 3
  • 10
3
votes
2 answers

CVarint serialization format

Recently I started analyzing the UTXO set data that every full node stores in chainstate folder (a LevelDB database). By looking into the code you can learn more or less how the data entries are formatted. However, to save as much space as possible,…
sr_gi
  • 3,087
  • 1
  • 11
  • 36
3
votes
1 answer

About performing SHA-256 hashing on the public key

I am following this link, trying to perform SHA-256 on a given public key. However, I cannot get the expected result. I am using the sha256 library in python hashlib The input is…
moshaholo
  • 633
  • 6
  • 16
2
votes
1 answer

ScriptSig Conversion in Python

I'm trying to convert a scriptsig into bytes so that I can better extract R & S values, but when I try and convert, I'm missing some of elements that should be there, like x30 for example. scriptsig =…
GK89
  • 123
  • 4
2
votes
1 answer

Why does P2SH-P2WPKH use DER encoded signatures?

If we simply assumed 32 bytes of r and s each, then signatures can be 64 bytes. Now they are on average 71 bytes in DER plus an additional byte to declare their size, effectively making them use 72 bytes of space. Similarly, if we assume public key…
Jus12
  • 1,365
  • 1
  • 14
  • 24
2
votes
1 answer

from b58check to hex and back

I am manipulating (with pybitcointools) some regular addresses as well as some P2SH and stumbled upon the following: Case 1: >>> b58check_to_hex('17rq8m5SW8XoZ9dHEkQyBfc5w2XQnQvznz') '4b3d51202139ff109f6d10b637081f2de48d4b35' >>>…
hartmut
  • 671
  • 5
  • 21
1
2 3