Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bitcoincore-development]

This tag should be used for questions regarding Bitcoin Core development. This includes questions about the source code and development of Bitcoin Core.

1
vote
0answers
64 views

How to obtain Block number of transaction?

Is there any function in bitcoind which when given the transaction(CTransaction& tx)/ transaction hash, returns its block number ?
1
vote
1answer
111 views

Accessing Bitcoin core software through a mobile phone with no internet connection

I am new to to Bitcoin and was allocated a project to develop a (middle-man)service that can allow a person (using a mobile phone with no Internet connection) to use Bitcoin. Since Bitcoin Core is the ...
2
votes
1answer
155 views

What is “trickling” in terms of bitcoin?

In the Bitcoin (0.10.0) source code I'm coming across the term "trickle". Could someone please give short but accurate explanations on following instances and tell what they're used for? bool ...
14
votes
6answers
18k views

Where to find help understanding Bitcoin's source code in C++?

I am looking to understand the Bitcoin C++ source code on GitHub. The Python one is simpler, but even that is too complicated for a beginner. Could someone guide me to some good resources on the ...
0
votes
2answers
142 views

Naming Convention In Bitcoin Source Code

Is there specific reference for naming conventions in Bitcoin Core source code? I see regularity in class naming with prefix "C" (Chain, CInv etc.) or pointer naming with "p" (pprev, pnode etc. ) and ...
3
votes
2answers
883 views

How to make genesis block transaction spendable?

I read this question Why can’t the genesis block coinbase be spent? . It says because of some quirk (the genesis block coinbase transaction is not added to the global transaction database) genesis ...
1
vote
1answer
373 views

Trouble running bitcoin unit tests with test_bitcoin on Ubuntu

From Bitcoin Core's test directory (bitcoin/src/test), the executable test_bitcoin is supposed to run the unit tests. When I run test_bitcoin, however, I get: replication requires locking support ...
8
votes
1answer
3k views

Where is the UTXO data stored?

When a new transaction is received it is added to the memory pool (after checking for conflicts). While mining, only the transactions which are in the pool are considered. What happens to the ...
2
votes
0answers
61 views

Which function is called to mine a block, broadcast the newly mined block & receive a newly mined block?

I am trying to understand the control flow and handling of transactions in the memory pool.
4
votes
1answer
600 views

Parameters in UpdateTip - calculation of log2_work

I looked up log2_work inside main.cpp and I can't follow its calculation by log(chainActive.Tip()->nChainWork.getdouble())/log(2.0). a) What is -> explicitely indicating? (I'm at basic level of ...
2
votes
3answers
294 views

Which files do you recommend I start with to learn Bitcoin?

In the bitcoin/src, which files are the "main" files I should start with if I want to learn how Bitcoin works? In other words, where's it good to branch off from? I'm new to C++, but can code okay in ...
1
vote
1answer
157 views

What caused CVE-2012-2459? How was it fixed?

Gavin Andresen made an announcement about this denial of service issue in 2012 here, but it's light on technical details.
4
votes
1answer
1k views

What is meant by “relaxed standards” for P2SH redeem scripts in Bitcoin Core 0.10.0?

From the Bitcoin Core 0.10.0 release notes: Standard script rules relaxed for P2SH addresses The IsStandard() rules have been almost completely removed for P2SH redemption scripts, allowing ...
1
vote
0answers
64 views

Blockchain (lack of backwards) compatibility in Bitcoincore 0.10.x

From Bitcoincore release notes: Because release 0.10.0 makes use of headers-first synchronization and parallel block download (see further), the block files and databases are not backwards-...
1
vote
2answers
566 views

How do I see what version of bitcoin core my wallet uses

I use the multibit wallet which I understand doesn't download the whole bitcoin core i.e. the entire block chain, but it must use the bitcoin core protocol right? So how do I see which version of the ...
2
votes
1answer
2k views

Difference between createmultisig and addmultisigaddress?

What is the functional difference between createmultisig and addmultisigaddress in bitcoincore (v 0.10)? To be clear, I understand how both function. ie. multisigCmd n ["address1 public key as hex", ...
1
vote
2answers
409 views

Bitcoin nodes voting

I'm just watching Adam Back & Gregory Maxwell: Blockstream and Sidechains interview, and wondering how the decision of further Bitcoin core development are made. I know about Bitcoin Foundation, ...
12
votes
2answers
685 views

How much of BIP 62 (“Dealing with malleability”) has been implemented?

BIP 62 lists nine source of malleability: Non-DER encoded ECDSA signatures Non-push operations in scriptSig Push operations in scriptSig of non-standard size type Zero-padded number pushes Inherent ...
3
votes
2answers
171 views

Why are chain parameters hardcoded rather than defined in a configuration file?

I'm interested in running a private test network to experiment with various chain parameters. These are hardcoded in chainparams.cpp. https://github.com/bitcoin/bitcoin/blob/master/src/chainparams....
2
votes
2answers
1k views

How are change addresses treated differently by Bitcoin Core?

I understand the reasons for wanting to use new change address for each transaction, but am unsure as to how they are treated by the Bitcoin core client. Is the address deleted as soon as the funds ...
1
vote
1answer
87 views

Is there a BIPs roadmap somewhere?

Which BIPs are already implemented by bitcoin-core and which are scheduled to be supported by the client in the scheduled releases? I found these questions to be relevant: Where can I find out ...
3
votes
1answer
314 views

Is it necessary for blocks to record the nBits difficulty parameter?

The next difficulty to solve a block is determined from how fast blocks were solved before it. In addition, the difficulty only changes once every two weeks or so. So, couldn't every node keep track ...
1
vote
1answer
183 views

Bitcoin GetBlockWork() function

The implementation of GetBlockWork() in the bitcoin v0.9.3 source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/main.h#L815-L822) seems strange to me. The code is given below for convenience. ...
1
vote
0answers
60 views

What is the format of the databases that are used in the core bitcoin client? [duplicate]

This question tells what each of the files in the bitcoin directory are, but it doesn't explain the structure of the databases used. What is the table structure (columns, data type, etc) for each of ...
6
votes
2answers
1k views

What is OP_CODESEPARATOR used for?

Looking at the bitcoin source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/script.cpp#L843-L847, specifically), I ran into the the use of the OP_CODESEPARATOR. Am I right in interpreting this ...
6
votes
1answer
212 views

Which block() method does what?

In the main.cpp bitcoin code, there are a few different functions for managing blocks. ProcessNewBlock() AcceptBlock() CheckBlock() ConnectBlock() DisconnectBlock() What is a good summary for what ...
4
votes
1answer
483 views

How to specify ECDSA nonce used in bitcoin signing code?

Below is the CECKey::Sign() code (v0.9.3). bool Sign(const uint256 &hash, std::vector<unsigned char>& vchSig) { vchSig.clear(); ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&...
2
votes
1answer
122 views

Why does the bitcoin mining code have the same if statement twice?

From the v0.9.3 miner.cpp source (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/miner.cpp#L598-L604): if (GetTimeMillis() - nHPSTimerStart > 4000) { static CCriticalSection cs; { ...
1
vote
1answer
404 views

Explain this comment on nNonce from the bitcoin miner.cpp source?

This comment is in the 0.9.3 miner.cpp bitcoin source, right above the ScanHash_CryptoPP definition. // // ScanHash scans nonces looking for a hash with at least some zero bits. // It operates on ...
9
votes
1answer
3k views

Why does the default miner implementation use pay-to-pubkey?

Looking at the v0.9.3 source in miner.cpp: CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) { CPubKey pubkey; if (!reservekey.GetReservedKey(pubkey)) return NULL; ...
3
votes
1answer
235 views

Can there be more than one result of decoding a raw transaction?

I was looking in rpcrawtransaction.cpp and came across the signrawtransaction rpc method. While reading through this method, I thought these lines seemed strange: vector<CTransaction> ...
2
votes
2answers
126 views

Who specified the Bitcoin protocol?

I went through the original paper by Satoshi, which outlines the Bitcoin protocol. However, the paper is a high level overview of Bitcoin, and does not specify important parts of the protocol. Who ...
1
vote
1answer
162 views

Which part of code (function) handles received transactions?

I was trying to understand the flow of control between functions (operations performed and their order) when a transaction is received.
4
votes
1answer
480 views

Is there a class or sequence diagram for BitcoinCore?

I'm looking at the code located at https://github.com/bitcoin/bitcoin/tree/master/src Does anyone have a basic diagram of what calls what, just a sequence chart of how all the classes piece together ...
0
votes
2answers
276 views

Bitcoin Transaction within source code

I am messing with the Bitcoin sourcecode. Normally when you want to send some BTC you type : ./bitcoind sendtoaddress 1ADRESSS 0.001 How would you do this in the sourcecode on a recurring basis? ...
0
votes
1answer
99 views

Where is the code that receives blocks that miners have just solved

I was just looking through the Bitcoin code but since I am relatively new to C++ I was wondering, if anybody could tell me where the code responsible for receiving blocks that have just been mined by ...
5
votes
1answer
162 views

Where is the code that sends generated Bitcoins from mining to the wallet?

I was just looking through the Bitcoin code but since I am relatively new to C++ I was wondering, if anybody could tell me where the code responsible for sending coins generated through mining to the ...
0
votes
1answer
259 views

No submitblock in altcoin?

I'm trying to figure out how I'd submit a block in many alt-coins. I originally found this issue in bbqcoin but have since found it in many others. I have bbqcoin (and others) installed from gihub ...
2
votes
1answer
78 views

Where is the code that specifies when a block is released?

I'm not sure how this exactly works. So roughly every 10 mins a block is released to the network. How is this done? Does my bitcoin client signal this? Would that mean in theory if there was just one ...
7
votes
1answer
1k views

Why does Github say that the Bitcoin project is 74% TypeScript?

For the Bitcoin project on Github clicking "Show language statistics" shows that the source code is almost 74% TypeScript. Why is this so when ostensibly Bitcoin is written almost entirely in C++. ...
7
votes
1answer
1k views

Where exactly is the “off-by-one” difficulty bug?

I read through How is difficulty calculated? and want to understand where the "off-by-one" bug is in calculating difficulty. Here is a Matlab snipet I wrote to calculate difficulty. What are the ...
2
votes
0answers
85 views

Debug bitcoin protocol implementation

When I'm trying to send a "VERSION" message with my custom bitcoin client, I get: Warning: Local node 127.0.0.1:56425 misbehaving (delta: 1)! What does it mean? How do I know what exactly is wrong ...
3
votes
1answer
77 views

How the Bitcoin community will handle attacks on a Client's code?

I have some thoughts about the following scenario. The brightest future. The Bitcoin becomes a very popular and liquid currency all over the world. Some serious financial or political parties may ...
9
votes
1answer
149 views

How can vulnerabilites in bitcoin be responsibly reported?

I am wondering if someone discovers a bug/exploit in Bitcoin software or protocol, who should it be disclosed to? Who is the authority? What would happen if the bug went public? Has it occurred in the ...
2
votes
1answer
156 views

Is there a bitcoin source, fork available that does not include a GUI?

I would like to try to download and compile a barebones variation of the Bitcoin daemon. Specifically, I'd would prefer to not have a copy of the code with any GUI implementation. Does such a ...
7
votes
1answer
2k views

Where, in the code, in the Satoshi client is 21 million cap implemented?

Which fragment of the Satoshi client is verifying if announced block has a valid reward? I mean, we now live in the 25 BTC reward period. I guess client after receiving a newly minted block, does ...
9
votes
3answers
1k views

Do “the official bitcoin developers” control Bitcoin?

Is there one person or organization that controls Bitcoin? What if Gavin Andresen, the lead developer, or Bitcoin Foundation, "the official bitcoin organization", decide to change something? What if ...
12
votes
4answers
3k views

Who controls the Bitcoin software?

Is there anything comparable to a "board of directors" for Bitcoin or is the software on complete cruise-control?