27

If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin? Where in the source code is this exactly (link)? There are two components to CVE-2018-17144. There is a crash bug and an inflation bug. Both are triggered by almost the same scenario: a transaction contains an input multiple times. In general, how this ...


5

2008 We don't know if Satoshi Nakamoto is an individual or a group, but Satoshi Nakamoto asked for professional crypto geeks to review his project in 2008. The original source files were therefore distributed privately through email. 2009 Unsure if Satoshi Nakamoto used any kind of source control before the source codes were available to the public. You ...


4

Recall that vanitygen allows you to list several patterns and search for addresses that match any of them. It looks to me like for each prefix, we compute the range of hash160 values that, after base58 encoding, would match the desired prefix. (Conveniently, the checksum only affects the end of the address, so we don't have to worry about it.) These ranges ...


4

Satoshi made many design decisions that are now criticized (like signatures in transactions, 2-week difficulty period, halvings, etc..). He also made some maths error in the whitepaper. Satoshi wasn't a perfect designer and his C++ code was not up to the highest standards. We will maybe never know for sure why he chose what he chose, but I'd personally ...


3

That's not quite right. There are two main threads involved in the network code, the network thread and the message handler thread. The network thread receives data from peers, parses it into messages, and puts those messages on per-peer queue for processing. It only serves one peer at a time, but is not restricted to processing full messages. For example ...


3

But how is difficulty changes if suddenly 90% of hash rate disappears* ? It will change as it normally does, after 2016 blocks. There is no provision for adjusting the difficulty if the hashrate suddenly drops. *recent BCH fork had difficulty adjusted quicker than 2016 blocks. As part of their hard fork, they added a provision for cases where blocks are ...


3

extern before function prototypes does not have any effect. If it were a variable, it’d be needed to specify that the variable was declared somewhere else. void noui_connect(); void noui_connect() {/*something*/} ^^^The compiler can easily find which is the prototype and which is the implementation of the same function. However, // main.h int a; // main....


3

I see the max coin supply being 21.000.000 (million) under the variable called MAX_MONEY. MAX_MONEY is not what controls the maximum coin supply. It is just a variable for use elsewhere that estimates the coin supply. The actual coin supply is regulated by the halving interval and the starting generation amount. CAmount COIN CAmount CENT The base ...


2

idx = index, as in the index of an array/list or similar data structure, usually (and in most cases such as this one) an index is zero-based, meaning the first element of the array has an index of 0, the second has an index of 1, and so on.


2

It is referenced relatively, namely by using the parameter BIP102HeightDelta. The hardfork is 3 months after the block that Segwit was actived and the number of blocks after is equal to 90(days)*144(blocks/day)(https://github.com/btc1/bitcoin/blob/385cbc994f35d36cefdab8c1c00ebfaceb55cfc6/src/chainparams.cpp#L78) Try to look for that parameter. It will ...


2

You are confusing the two kinds of tests. Unit tests are compiled into a separate binary and run by make check. Functional tests are testing the RPC commands and have to be run explicitly using the test_runner.py script. test_framework.log is only created by the functional tests. The documentation for the unit tests can be found here. To print messages in ...


2

In order for a bitcoin node to start connections with other nodes, it first needs a seed node. A seed node can be any node (listening) connected to the bitcoin network. Once the node has connected to the initial seed node, it can then retrieve information about other nodes in the network and start connections with those ones as well. The names you are ...


2

The value r is just a number and doesn't explicitly store or encode any point coordinates. In a signature, r is set to the X coordinate of the point R, which is really k*G, where k is the secret nonce used during signing, then reduced mod the curve order. In secp256k1, this usually means that r is in fact the X coordinate (because r itself is usually very ...


2

Where in the source code do we check whether hash(blockheader*nonce) < Difficulty The function you are looking for is in pow.cpp: bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params) { bool fNegative; bool fOverflow; arith_uint256 bnTarget; bnTarget.SetCompact(nBits, &fNegative, &...


1

There are several reasons for this: We don't want a dependency management tool to automatically download software from the web. There is always a risk of some backdoor inserted by someone malicious in case we do not manually verify each 3rd party component. We would like to keep the build scripts as simple and low level as possible to maintain full control ...


1

What you are looking at is just an implementation detail that you really don't need to worry about. It's just converting from an internal format (which may use different coordinate systems and bit lengths, especially for tests) to the standard output format. Within the library itself, the data in the signature may be easier and more efficient to handle when ...


1

A possible reason is that Bitcoin Core expects a low S value. Try changing s with N-s if s > N/2 (N is the curve order). Source here


1

First the peer who chooses to connect shares their version. Each of the peers can only send one version message. PushNodeVersion is used to send the version message. It is called by two functions 1) PeerLogicValidation::InitializeNode when the connection is outbound. 2) ProcessMessage when a message is received. It looks like this: bool static ...


1

Your general understanding is correct. Mining doesn't perform any additional checks then any other full node. Mining serves the function of giving transactions an ordering which is difficult to undo, but validation is just a function performed by every node. Some tests are in miner.cpp because creating a block that matches some set of rules needs ...


1

Because regtest is supposed to be test network, it has to be pretty similar to mainnet. Thus there really isn't separate code for regtest only, most of the code is shared between the two networks. The differences are really only defined by a few parameter changes which can be found in chainparams.cpp.


1

Those hosts are DNSseeds. When your node starts if it find itself unable to successfully connect to the network within 11 seconds it will query those DNS names which are run by technical people in the Bitcoin community, and get back a lists of recently working nodes. The use of DNS improves your privacy somewhat since DNS caching can prevent the operator's ...


1

genesis.GetHash(""); This is incorrect. GetHash does not take a parameter, as said in the compiler error. This should just be genesis.GetHash();. I have checked the debug.log but i dont see new values for hashGenesis and Merkel root. The debug.log file is only modified when you run the program, and because it isn't even compiling, when you run it, you ...


1

The oldest one is from Feb 14, 2016 but I'm sure historically significant changes to the code were done since. Indeed, date opened is not always a good indication of controversy or significance, it could also mean a change which has received very little review due to its insignificance, or very little rebasing/nit-fixing due to lack of time by the creator. ...


1

Thanks to Chak's answer, I was able to find the (unofficial) github repo hosting https://github.com/benjyz/bitcoinArchive which contains the original bitcoin source code. For those who are interested in review the source code in git, this will help. You may find Bitcoin v0.1 released announcement by Satoshi Nakamoto and Bitcoin v0.1 source code hosted in ...


1

These values appear for the regtest chain only. It looks like these values are supposed to state the time window during which deployment of a particular protocol change is allowed to happen. For regtest that window is set to be from times 0 to 999999999999, maybe so that you can do it whenever you want. For your coin, you presumably either want these ...


1

look at core's getblocktemplate RPC call https://en.bitcoin.it/wiki/Getblocktemplate


1

The coinbase transaction is like every other transaction except it has only 1 special coinbase input which you can read about here: https://bitcoin.org/en/developer-reference#coinbase. The outputs must have a value which sum to the block subsidy (currently 12.5) plus any transaction fees in the block. Those are the only stipulations for a coinbase ...


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