What is Bitcoin? What is a Bitcoin Block? What is a Bitcoin transaction? And how do LI.FI intent prove Bitcoin fulfillments? This page contains all the information required to understand how LI.FI intent can interact with BTC.
0xD9B4BEF9
and then continues describing the new state of the network, including listing all newly included transactions. The Bitcoin block also describes a block header. The block header is a self-contained description of the newly added state. If you only care about a subset of all transactions in a block, the block header is a more efficient description of the block itself.
For the purpose of validating transactions outside the noise of the core network, block headers are perfect. Satoshi Nakamoto designed block headers to be self-describing; that is, if you have a list of block headers, it is possible to verify if a new block header belongs to the list. A block header is 80 bytes and consists of:
Version(4B) | PrevBlock(32B) | MerkleRoot(32B) | Time(4B) | Bits(4B) | Nonce(4B)
https://en.bitcoin.it/wiki/Block_hashing_algorithmBy checking if the hash of the Bitcoin hash is sufficiently low compared to the specified
Bits
, the header can be authenticated as correctly mined. By checking if PrevBlock
is the same hash as the leading transaction in your list, it can be verified to extend your list. Lastly, Bits
must be checked to ensure it follows the difficulty rules.
You will have noticed that these checks do not assert any validity of the included transactions within. The performed checks can be viewed as the least amount of work required to authenticate a Bitcoin block. This technique is very fittingly called Simplified Payment Validation.
P2PKH
output script:
OP_DUP | OP_HASH160 | PUSH_20 | {publicKeyHash} | OP_EQUALVERIFY | OP_CHECKSIG
If you need to pay to a P2PKH
address, the output script needs to have the above format. Additionally, publicKeyHash
defines who the spender is. To fully generate an output script, you thus need the target publicKeyHash
. This is what the address is. A P2PKH
address is 00 + publicKeyHash
encoded with Base58Check
. A Bitcoin address has 2 purposes:
Version | Name | Encoding Scheme | Prefix | Hash Length |
---|---|---|---|---|
0 | Unknown | Ignore | ||
1 | P2PKH | Base58Check(00+PKH) | 1* | 20 |
2 | P2SH | Base58Check(05+SH) | 3* | 20 |
3 | P2WPKH | Bech32 | bc1q** | 20 |
4 | P2WSH | Bech32 | bc1q** | 32 |
5 | P2TR | Bech32m | bc1p** | 32 |
P2PKH
transaction, this is the public key & signature of the transaction.
Importantly, the sum of all inputs must be greater than the outputs. The difference between the two is the fee and will be claimed by the miner.
Size | Conf. |
---|---|
$0k - $20k | 2 |
$20k - $100k | 3 |
$100k - $200k | 4 |
$200k - $1m | 5 |
$1m+ | 6 |