33
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 ...
- 94.2k
28
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 ...
- 51.2k
18
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, ...
- 94.2k
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 ...
- 94.2k
16
votes
Accepted
What contributions have Blockstream developers made to the Bitcoin project?
Disclosure: I'm a Blockstream co-founder
Major feature contributions to Bitcoin Core:
Greg Maxwell, Andrew Poelstra and myself (as well as several other contributors) worked on libsecp256k1, a well-...
- 94.2k
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, ...
- 391
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 ...
- 94.2k
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 ...
- 68.6k
14
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 ...
- 65.6k
14
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 ...
- 94.2k
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 ...
- 321
13
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.
- 2,254
12
votes
Accepted
Where to find help understanding Bitcoin's source code in C++?
I am not aware of an extensively commented version of the Bitcoin sourcecode, but you could check out the Bitcoin Developer Reference and you can read online the book Mastering Bitcoin by Andreas M. ...
- 68.6k
12
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 ...
- 94.2k
11
votes
Accepted
How much of BIP 62 ("Dealing with malleability") has been implemented?
Most of the fixes have been implemented in Bitcoin Core's master branch, or earlier versions, as standard transaction checks that prevent default Bitcoin Core nodes from relaying or mining ...
- 11.5k
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 ...
- 8,772
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 ...
- 65.6k
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.
...
- 65.6k
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 ...
- 94.2k
11
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 ...
- 94.2k
10
votes
Accepted
Parameters in UpdateTip - calculation of log2_work
FYI the code under discussion is available here on GitHub.
-> is a member access operator in C++, just as . is. They both expect the name of an object's member on the right (e.g. a member function ...
- 2,463
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 ...
- 12.7k
10
votes
Accepted
What are version bits?
In the Bitcoin blockchain, each block has a 32-bit field called version. Right now, it takes on simple small values like 2 or 3.
As an example of changes, block version 3 introduced new rules about ...
- 883
10
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 ...
- 2,481
10
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 ...
- 1,256
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 ...
- 188
10
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 ...
- 94.2k
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 ...
- 65.6k
9
votes
Accepted
What does OP_CHECKSEQUENCEVERIFY (OP_CSV) do?
OP_CHECKSEQUENCEVERIFY (a.k.a OP_RELATIVECHECKLOCKTIMEVERIFY) can do relative lock times (used for sidechains and lightning).
It basically checks, if an input's sequence number is smaller than the ...
- 5,972
9
votes
Where can I find resources for programmers to understand Bitcoin?
The Developer Documentation may also be of use.
- 1,578
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
bitcoin-core-development × 564bitcoin-core × 213
bitcoind × 81
blockchain × 40
transactions × 25
client × 24
bitcoincore-review × 22
c++ × 21
script × 19
taproot × 19
testing × 19
functional-test × 19
block × 17
development × 17
p2p × 16
source-code × 16
wallet × 14
consensus × 14
debugging × 13
bitcoin-cli × 11
python × 11
altcoin-development × 11
protocol × 10
signet × 10
transaction-fees × 9