29 votes
Accepted

How are bitcoin transactions and the blockchain transferred over the internet?

The Bitcoin P2P network The Bitcoin P2P network is a randomly-wired gossip network. This means that all nodes make arbitrary connections to other peers (using various ways to discover new addresses) ...
28 votes

What is TxIn's sequence?

Note that the accepted answer is outdated. Currently, sequence numbers are mainly used for signaling RBF - replace-by-fee - that allows you to resend a transaction with a higher fee. See https://...
  • 2,655
20 votes
Accepted

Can bitcoin protocol be changed to add economic incentives to validating nodes?

I don't think it is possible. There are a few problems to incentivizing the operation of nodes. When you pay people to run nodes, people running multiple nodes provide less value but earn more for ...
  • 68.6k
18 votes
Accepted

How is the target section of a block header calculated?

The target section of the block header is called nBits in the code. nBits is a 32-bit compact encoding of a 256-bit target threshold. It works like scientific notation, except that it uses base-256 ...
15 votes
Accepted

Bitcoin protocol and Wireshark

Someone wrote a Bitcoin protocol decoder for Wireshark, several years ago. I assume it was included in the Wireshark distribution. Wireshark simply knows about the Bitcoin protocol. There is no magic ...
12 votes

What is relation between scriptSig and scriptPubKey?

I had the same question as well and spent forever trying to understand it and finally cracked it. "The sender (A) only has the Bitcoin Address of the recipient (B), so how does he get the pubKeyHash ...
11 votes

What is the coinbase?

David has already given a good explanation of the term coinbase, but I'd like to give further details on the coinbase transaction. The coinbase transaction is a special type of transaction. Every ...
  • 68.6k
11 votes

Why don't the timestamps in the block chain always increase?

There is no requirement that blocks have a timestamp after the previous block. The only requirement is that the timestamp is greater than the median timestamp of the last 11 blocks. So this means that ...
  • 65.6k
11 votes

Explanation of what an OP_RETURN transaction looks like

If you want to write OP_RETURNs to the blockchain without getting into the internals of how transactions are built, an easy way is to use our libraries for PHP and Python: https://github.com/...
9 votes
Accepted

What is the P2P technology/protocol used by Bitcoin to find nodes and distribute messages across them?

Bitcoin has its own custom wire protocol using TCP. Peer discovery is by address rumoring, where connected nodes gossip about other potential available peers. When a node is new and has nobody to ...
  • 15.3k
9 votes
Accepted

Is it possible to "unmine" particular coins?

Technically, yes it's possible to do this. Practically, doing this would probably break everyone's trust in Bitcoin. One of Bitcoin's principle guarantees is that nobody can confiscate anyone else's ...
9 votes
Accepted

Why was an insecure merkle tree implementation chosen?

As with many things in Bitcoin, it is likely simply because it worked well enough, and such an attack was not immediately obvious. Several of the choices made in the early days of Bitcoin don't have ...
  • 16.7k
8 votes
Accepted

Why is it not possible to replay transactions?

Transaction inputs use Unspent Transaction Outputs (UTXO). UTXO are created by transactions. They are uniquely identified by the transaction id and the output position in the transaction that created ...
  • 68.6k
8 votes
Accepted

What are the differences between Bitcoin and Libra?

This question might be considered too broad and too opinion based according to the rules of this forum. However, tackling it from a technical standpoint based on facts rather than opinions might be on-...
  • 7,163
8 votes
Accepted

What does the little-endian notation improve for Bitcoin?

Almost all CPUs these days work natively in little-endian. To operate on big-endian numbers, additional byteswap instructions are needed. For most things, I think this effect is negligible. Network ...
7 votes

What is an "unspent output"?

Bitcoin is a distributed system that enables users to receive, store, and send money. Value is transmitted by submitting a payment order to the network called a transaction. Transactions are ...
  • 68.6k
7 votes
Accepted

Why does getheaders P2P API return more than getblocks?

Really getblocks should have been called getblockhashes , as the response contains just block hashes, not full blocks. Every block can be observed in three different ways: The full block, containing ...
7 votes
Accepted

How does bitcoin prevent DDoS amplification via the `addr` p2p message type?

For a long time, there was a restriction to strongly prefer connecting to addresses with port 8333. This restriction was recently removed in PR 23542 and PR 23306, although a list of "bad ports&...
  • 476
6 votes
Accepted

Why must UTXO be completely consumed?

I've looked into this before, and I've never been able to find an explicit rationale from Satoshi, but there are a couple of possible reasons. For: Simplifies SPV verification Imagine that rather than ...
6 votes
Accepted

what is the "Banlist" (Bitcoin Core)

It is a blacklist of erroneous nodes' IP addresses which has accrued a certain amount of banscore due to "misbehaviour". To check what sort of erroneous behaviour is considered "misbehaving", you can ...
  • 2,388
6 votes

At which point and how does the miner who successfully solved hash get coins?

The block subsidy isn't awarded by anyone. It is taken by the miner, by virtue of creating a block that gives himself money. The system's role in this is restricted to permitting blocks to indeed ...
6 votes
Accepted

How would the gossip protocol announce channels from a channel factory?

Pretty much everything would stay the same. If you look at the relevant messages channel_announcement and channel_update we have the following formats: channel_announcement type: 256 (...
  • 9,044
6 votes
Accepted

Why raw Bitcoin transaction are in hex format?

Because unlike addresses, hex raw transactions aren't meant to be seen or used by end-users. Hex is easy to encode and decode (every two character in hex represents one byte*, whereas in base64 one ...
  • 10k
6 votes
Accepted

does bitcoin have omni layer?

Question 1) why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github. As Murch said, Omni uses Bitcoin as its immutable database. So Omni is like a ...
  • 10k
5 votes

How is the bitcoin 21 million cap implemented?

An updated answer. First, check out the block subsidy calculation: https://github.com/bitcoin/bitcoin/blob/v23.0/src/validation.cpp#L1417 CAmount GetBlockSubsidy(int nHeight, const Consensus::Params&...
5 votes
Accepted

Does an OP_RETURN script always need another output within the transaction?

If you want to retain any change, yes you will need two outputs to return unspent Bitcoin to yourself. If you are spending for example a 0.0001 BTC output, 0.0001 to fees, then a single 0 BTC ...
  • 15.3k
5 votes
Accepted

Adding «Donate» Bitcoin button in README.md file GitHub repository

1. Demonstration Click to donate button on page: https://github.com/KristinitaTest/KristinitaTest.github.io/blob/master/donate/README.md Link must be opened in your Bitcoin client, example: 2. ...
5 votes
Accepted

Can I rely on multisignature addresses being future proof?

Multisig transaction types use standard CHECKMULTISIG opcodes (which have been present in Bitcoin since its initial release in January 2009) and P2SH addresses (standardized in BIP13 in October 2011). ...
5 votes
Accepted

Merkle Root for 1-transaction block!

The merkle root of a block is the hash of all of the transactions. If there is one transaction, then the hash of all of the transactions is the hash of that one transaction. So the merkle root and the ...
  • 65.6k

Only top scored, non community-wiki answers of a minimum length are eligible