April 28, 2024

How to read Bitcoin data

There are many different data types in Bitcoin, most of which are alphanumericlines. These strings may seem indistinguishable from one another at first, but each data type has unique identifiers to help distinguish them.

Addresses

Addresses are the most common data type, withwhich users encounter all the time. Addresses are used to receive BTC, so they are often publicly published and displayed on the blockchain. From a privacy perspective, users are encouraged to generate and share a new address whenever they want to receive BTC. There are several types of Bitcoin addresses, each of which begins with specific characters:

  • «1…»:Addresses starting with 1 are the most common. They belong to the most common type of addresses and are intended for P2PKH transactions. Such an address is simply a hash of the public key with the number 1 added at the beginning as an identifier. P2PKH addresses use Base58 encoding, which is case sensitive.
  • “3…»:Addresses starting with 3 are also quite common. They are used for P2SH type transactions. These can be (nested) SegWit addresses or multi-signature addresses. If we are talking about SegWit, then using such an address will save on transaction fees. P2SH addresses use Base58 encoding, which is case sensitive.
  • «bc1…»:(Native) SegWit addresses begin with these characters. Sending BTC to these addresses provides the greatest savings on fees compared to the previous two address types. Often these transactions also take longer to process than the first two types of transactions. Native SegWit addresses use Bech32 encoding, which allows only lowercase characters.

What you should pay attention to:

  • “2…” Addresses starting with 2 belong to the test network and are intended to receive test bitcoins (tBTC). Never send real BTC to these addresses.

Public keys

Currently, Bitcoin users are less likely touse public keys. As a way to get BTC, they have mostly been replaced with addresses. Nevertheless, from time to time they can still be found. Public keys are much longer than addresses and also have specific initial character sequences:

  • "02 ..." or "03 ...":these are SEC-encoded standard public keys. If necessary, they can be hashed and converted into regular addresses for receiving BTC, used to create multi-signature addresses or to verify signatures. In the earliest Bitcoin transactions, public keys were used as part of P2PK transactions.
  • “xpub…”, “ypub…” or “zpub...”:these are extended public keys, or xpub. They are used to obtain many public keys as part of a Hierarchical Deterministic (HD) wallet. Although these are public keys, they should only be accessible to parties you trust, since by having access to your xpub, anyone can trace your past and future transaction history.

Blocks

Blocks are large data structures, so you rarely see raw block data. However, each block can be identified by its height and its hash.

  • Block height.Each block is numbered in ascending orderstarting from scratch. At the time of writing, there are just over 683,000 blocks in existence, so most of the block height values ​​you come across are in the six-digit range.
  • Block hash.This is the SHA-256 hash of the block data and is usuallypresented in hexadecimal format. The block hash can be interpreted as a very large number. In order to satisfy the proof-of-work requirement, the hash of a block must be below a certain threshold. Thus, all block hashes begin with a series of zeros followed by an alphanumeric string. Some block hashes have as many as twenty leading zeros, whereas earlier blocks had only eight. The number of zeros roughly reflects the mining difficulty at the time the block was published.

Transactions

Transactions are usually around 250-400 bytes in lengthand are presented in hexadecimal format. However, transactions can be recognized by the txid or the hash of the transaction. Due to the high randomness of SHA-256, no two transactions should have the same ID. Transaction IDs are 64-character alphanumeric strings. They do not have definite leading sequences of characters, but they can be identified by their length and lack of a series of leading zeros, unlike block hashes.

You can use block explorers to search by addresses, transactions and blocks. You can try the Blockstream explorer here.

Signatures

Bitcoin signatures use the ECDSA signature scheme.are between 71 and 73 bytes long and are represented using DER encoding. Bitcoin signatures always begin with the prefix ’30’. Inside the signature there are two prefixes ’02’ precede the R and S values ​​that make up the signature.

 

</p>