32

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 must accept and reject the exact same blocks, or we risk a fork. The first choice to avoid bugs that risk introducing inconsistency is to not rewrite the code from ...


27

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 applications have a large attack surface. They're meant to interoperate with a large number of untrusted endpoints while still providing reliable service to local ...


16

Pay-to-PubKey (P2PK) and pay-to-PubKey-Hash (P2PKH) were both introduced in the original Bitcoin 0.1 release. P2PK was used by default for mining and payments received using the interactive IP-to-IP payment protocol; P2PKH was intended for use in non-interactive payments---but P2PKH transactions take up more space in the blockchain than P2PK. Is this space ...


15

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 slower for our usage (large atomic batch writes, small random reads). There were reports of database corruption as well with BDB, at a time when it was used far ...


15

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, transactions that do not make it into a node's mempool -- a proxy for what we expect to be (eventually) mined -- do not get relayed to other nodes. In the Dandelion ...


14

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, which is the longest valid chain of blocks (stored in $DATADIR/blocks) that we know of. This active chain gets blocks appended to - and occasionally removed when ...


13

The book Mastering Bitcoin would be a good solid start (although it might not answer all your questions). It is also available for free.


13

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 thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or ...


12

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. Antonopoulos, which covers Bitcoin's technical aspects extensively. There is also Princeton's Free Online Bitcoin course, which goes into details on some ...


12

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-tested library for efficient elliptic curve cryptography using the curve secp256k1. Bitcoin Core switched signing to it in 0.10 and verification in 0.12 (with a ...


11

If there is a need for them, additional decimal places can be added with concensus of the network. This is why some refer to "infinite" divisibility, because we can select the level that we need as time goes on. The current level selected in the code (by Satoshi) is 8 decimal places (1 satoshi = 0.00000001 BTC) hence the nickname for the smallest unit ...


11

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 transactions that break the rules. Here are some details: Non-DER encoded ECDSA signatures These are currently non-standard, so Bitcoin Core nodes (since 0.8.0,...


11

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 appears in Core's commit history because the subtree in Core is periodically updated with the libsecp256k1 upstream source code. The reason for removal is ...


11

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 able to observe your incoming payments, but not your spending.


11

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 useful as a toolbox because it simplifies static analysis of scripts, and things like generic signing. The policy language is intended to simplify designing ...


10

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 and the Princeton Bitcoin Book. Keep in mind that the code gets updated faster than the documentation, so the code should be your source of truth. Some ...


9

At the moment in my opinion, Gavin does indeed control Bitcoin Project to some extent. He is widely recognised as the main developer behind it and could probably push his authority on a lot of subjects if he so desired. However, I am under the impression that he would not perform such actions - they would undermine the credibility of Bitcoin and be bad for ...


9

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 transaction validity, as well as anti-malleability measures. Miners with the new Bitcoin client create blocks with the version set to 3 to signal their ...


9

The Developer Documentation may also be of use.


9

Do you modify the block or do you not modify the block? If you don't modify the block, it still pays the mining reward to the same account. So you've just done what everyone wants you to do. If you do modify the block, it won't be valid anymore until and unless you mine it. That leaves you two choices: 1) You can ignore this block and mine some other ...


9

There are benefits to both users and developers to having Bitcoin Core split into separate node, wallet and GUI processes. As Alyssa Hertig outlines here the benefit to users will be being able to run the Bitcoin Core node on a different machine to the Bitcoin Core wallet rather than being forced to run them on the same machine. A user could leave a node ...


8

That's because of the QT translation files, see https://github.com/bitcoin/bitcoin/search?l=typescript I'm not sure why they are recognized as TypeScript (it's just XML), I guess it's because of the filename extension .ts.


8

My new book "A Dissection of Bitcoin" examines the original Bitcoin source code written by Satoshi. As for now, it is the first and only book available that helps you read the Bitcoin source code.


8

BIP 100: Jeff Garzik Miners vote on blocksize, constrained between 1 and 32 MB. BIP 101: Gavin Andresen Blocksize increases to 8 MB, and doubles every two years after that. (This is what XT implements.) BIP 102: Jeff Garzik Blocksize increase to 2 MB. (Intended as a fallback that everyone can agree on.) BIP 103: Pieter Wuille Blocksize increase by 17.7% each ...


8

The problem arises from the uneven propagation of information in the network. While the propagation of small blocks is fast, i.e., every miner gets to know a new block approximately at the same time, this is no longer true for large blocks. Large blocks take a lot of time to be forwarded to every node in the network, since this includes miners, these miners ...


8

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. tor: TOR. All messages related to using a TOR SOCKS5 proxy and TOR hidden service (used for receiving incoming connections over TOR). This includes messages ...


8

Dorier is correct that Neutrino/SPV nodes are not full nodes, because they do not verify the entirety of the blockchain, leaving potential room for attack. However, the portrayal that Neutrino is no better than other SPV modes is not correct. Neutrino is a form of SPV which improves greatly over other implementations in regards to privacy. All SPV modes ...


7

However, the paper is a high level overview of Bitcoin, and does not specify important parts of the protocol. That's true, and Hal Finney noted this when the bitcoin paper was published to the metzdowd cryptography mailing list. (The Bitcoin paper was published before the Bitcoin source code.) Unfortunately I am having trouble fully understanding the ...


7

In the next major release (probably 0.8), the reference client will most likely switch to LevelDB instead of BDB for blockchain data. For wallets, a different solution is needed, but we'll most likely move away from BDB for those too. BDB has several problems - that's not to say it is bad software, but our use case simply doesn't match what it's designed ...


7

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 to date and in sync. This list contains the names and usernames of everyone who I can find evidence for ever having commit access to Bitcoin Core, the dates ...


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