Skip to main content
34 votes

Why is bitcoin written in C++?

The most important reason is that the original Satoshi codebase was written in C++. A system like Bitcoin has extremely strong requirements about consistency in behaviour: all nodes on the network ...
Pieter Wuille's user avatar
30 votes

Why is bitcoin written in C++?

I gave a keynote address at cppcon 2016 about almost this exact issue. There are a variety of reasons why C++ is an excellent language choice for blockchain applications like Bitcoin. Blockchain ...
David Schwartz's user avatar
19 votes

Where is the UTXO data stored?

I assume this question is about Bitcoin Core's internal operations. This description is valid for version 0.8 and later (up to 0.14 at least). One part of the system deals with the active chain, ...
Pieter Wuille's user avatar
17 votes
Accepted

Migration from Berkeley DB to LevelDB

As someone who was involved in doing that migration at the time, I believe it was the right decision. LevelDB is far from perfect, but I wouldn't know what else to use. In particular: BDB is much ...
Pieter Wuille's user avatar
16 votes
Accepted

What is the tradeoff between privacy and implementation complexity of Dandelion (BIP156)

In my view, the main implementation detail to be worked out with Dandelion is ensuring that there are no new DoS vectors introduced. In the existing transaction relay model of Bitcoin Core, ...
sdaftuar's user avatar
  • 599
16 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 ...
Pieter Wuille's user avatar
15 votes
Accepted

Where in Bitcoin Core does it do X?

Introduction The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically ...
Ava Chow's user avatar
  • 70.9k
15 votes
Accepted

What does Bitcoin policy language offer the developer that Miniscript doesn't? What is the difference between Bitcoin policy language and Miniscript?

Both answers by James C. and sanket1729 are very good, but I wanted to give a very high-level answer: Miniscript is an intermediate more structured representation for actual Bitcoin Scripts. It is ...
Pieter Wuille's user avatar
15 votes
Accepted

What is the purpose of indexing the mempool by these five criteria?

The mempool is the short-term memory of a full node. We use its content e.g. to: exchange information with peers build block templates estimate feerates track pending payments to our wallet The ...
Murch's user avatar
  • 75.9k
14 votes
Accepted

Why is Bitcoin Core using LevelDB instead of Redis or SQLite?

Redis and LevelDB solve very different problems. We tried using SQLite and its performance was abysmal. Bitcoin Core needs a database to store the set of unspent transaction outputs (UTXOs). This ...
Pieter Wuille's user avatar
14 votes

Why does Bitcoin Core print SHA256 hashes (uint256) bytes in reverse order?

From sipa on IRC (2023-01-06): jamesob: Probably dumb question, but why does uint256::ToString() (-> HexStr()) print out the blob in reversed byte order? sipa: Because that's what it has always ...
James O'Beirne's user avatar
14 votes
Accepted

Where is the bitcoin source code is the 21 million hard cap stated?

Where is the bitcoin source code is the 21 million hard cap stated? Nowhere, because there isn't actually a 21 million cap rule. The relevant code is this: CAmount GetBlockSubsidy(int nHeight, const ...
Pieter Wuille's user avatar
13 votes
Accepted

Why is it so hard for alt clients to implement Bitcoin Core consensus rules?

Because they're not known. This may sound surprising, but you have to realize that Bitcoin's consensus rules are defined by what (economically relevant) full nodes actually enforce. We can assume at ...
Pieter Wuille's user avatar
13 votes
Accepted

What are the key differences between regtest and the proposed signet?

The main difference between signet and regtest is that signet is an actual network, as opposed to a sandboxed environment. In regtest, the network topology is entirely manual. You spin up nodes, and ...
Pieter Wuille's user avatar
13 votes
Accepted

Why many classes in the Bitcoin Core prefix with a `C` while it is prohibited in the developer notes?

These classes predate the coding style guidelines. Guidelines are a recommendation for newly added code and refactoring patches for the purpose of only changing the coding style are discouraged. In ...
Antoine Poinsot's user avatar
12 votes
Accepted

Where can I find resources for programmers to understand Bitcoin?

The book Mastering Bitcoin would be a good solid start (although it might not answer all your questions). It is also available for free.
karask's user avatar
  • 2,540
11 votes
Accepted

Is there developer documentation for the Bitcoin Core source code?

To understand Bitcoin Core, the best resource is probably the source code itself: https://github.com/bitcoin/bitcoin To help understand what is going on in the code, try the developer documentation ...
Jestin's user avatar
  • 8,812
11 votes

How to understand Bitcoin source code

I have a different approach to it. You can use this too. Bitcoin uses Doxygen comments to explain the code. You can take the most recent copy of the code, build class hierarchy yourself using ...
thenakulchawla's user avatar
11 votes
Accepted

Why was the Schnorr code removed from Bitcoin Core?

The Schnorr implementation was never in Bitcoin Core. Rather it is in the libsecp256k1 library that is a subtree in Bitcoin Core. The commit you reference is actually a commit in that library which ...
Ava Chow's user avatar
  • 70.9k
11 votes
Accepted

What are the debug categories?

net: Networking. All messages related to communicating with other nodes on the network, including what P2P messages were sent and received and to whom and other information about the network messages. ...
Ava Chow's user avatar
  • 70.9k
11 votes
Accepted

BIP44: What's the use of internal addresses?

The separation between internal and external addresses comes from BIP32. Using a different chain for each permits you to give out an xpub for just the external ones to an auditor. They would then be ...
Pieter Wuille's user avatar
11 votes

What does Bitcoin policy language offer the developer that Miniscript doesn't? What is the difference between Bitcoin policy language and Miniscript?

Miniscript doesn't compile down to script. It encodes a subset of all Bitcoin script. It is a (very crafty) template language which reduces the Bitcoin script language to specific script expressions ...
James C.'s user avatar
  • 2,521
11 votes

What does Bitcoin policy language offer the developer that Miniscript doesn't? What is the difference between Bitcoin policy language and Miniscript?

At a high level: The policy is compiled to Miniscript. Miniscript is encoded to Bitcoin Script. (One to One Mapping) Bitcoin Script is decoded back to Miniscript. (One to One Mapping) Policy and ...
sanket1729's user avatar
  • 1,402
11 votes
Accepted

Why are transaction input and output indices called `vin` and `vout`?

The original Satoshi codebase used a programming style called "Hungarian notation", where variable names are prefixed with letters that indicate the data type they contain. v in particular ...
Pieter Wuille's user avatar
10 votes

Is there a reference, authoritative resource or book on Bitcoin programming?

I was asked by Hasan Hasan, a junior developer, which of the following three books I'd recommend. Personally I think all three books are fantastic (I would recommend them all) but they do approach the ...
Michael Folkson's user avatar
10 votes

What are the key differences between regtest and the proposed signet?

Signet is more comparable to testnet than it is to regtest. Regtest is for private use and testing things. Even if signet were available, it is still useful to have your own blockchain for testing ...
Ava Chow's user avatar
  • 70.9k
10 votes
Accepted

Why is the Bitcoin Core wallet database moving from Berkeley DB to SQLite?

The introduction of descriptor wallets presents an opportunity to introduce a new database backend as descriptor wallets are backwards incompatible. The following is taken from Andrew Chow's blog post ...
Michael Folkson's user avatar
10 votes

What is the purpose of indexing the mempool by these five criteria?

Just adding onto Murch's answer, which does a great job at explaining the uses of each index. But I can't understand the need for sorting them based on txid and wtxid (while they are hash output, so ...
glozow's user avatar
  • 313
10 votes
Accepted

Why isn't the taproot deployment buried in Bitcoin Core?

The Taproot deployment is buried insofar as consensus no longer checks its status to determine whether to enforce the Taproot rules. The Taproot rules are enforced from genesis now, with the (...
Ava Chow's user avatar
  • 70.9k
9 votes
Accepted

Is there a list of core Bitcoin committers?

Here is a list of people who have had commit access to Bitcoin Core. This list can also be found on Bitcointalk and on Reddit (it's the same list just in two different places). All lists are kept up ...
Ava Chow's user avatar
  • 70.9k

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