Questions tagged [source-code]
The source-code tag has no usage guidance.
71 questions
0
votes
0
answers
59
views
What is wrong with this JSON-RPC? (via BTC.com)
The subscribe message works. But the authorization does not. I was wondering why I cannot get this to work. The expected outcome is to have a miner that is logged in and has no errors in authorization,...
0
votes
2
answers
60
views
Are crypto servers updated with code in transactions?
If the code used to run your crypto coin node needs updating, how is it done? Is the code sent as a patch as a transaction? Does the node code know how to receive and apply this patch? Or does ...
2
votes
1
answer
369
views
Issue listing regtest wallets
Questions:
Should it be assumed if you're testing with bitcoincore you should always have a separate datadir per version/bin?
Based on weirdness below, (not being able to list regtest wallets), does ...
2
votes
1
answer
94
views
What is CCoinsCacheEntry in the Bitcoin Core?
CCoinsCacheEntry is implemented here.
/**
* A Coin in one level of the coins database caching hierarchy.
*
* A coin can either be:
* - unspent or spent (in which case the Coin object will be ...
1
vote
1
answer
715
views
Early version of bitcoin and poker
How can we locate the code for an online poker game in version 0.1.0 of Bitcoin, which multiple articles on the internet claim was included by Satoshi Nakamoto? Furthermore, how can we verify that ...
3
votes
1
answer
128
views
ThreadOpenConnections and break versus continue: why the one versus the other?
In the inner loop of ThreadOpenConnections() in net.cpp sometimes there is a break to the outer loop and sometimes a continue. This is my understanding of the decision between break and continue in ...
2
votes
1
answer
160
views
Why does the bitcoin client send transaction's txid and wtxid in 'inv' process?
I'm reading the source code of Bitcoin Core, and I found that in the inv process, nodes will relay both txid and wtxid to other peer nodes. I have the following questions:
Why does the node send ...
1
vote
2
answers
140
views
What is the backup plan for the social organization surrounding Core development?
The question of GitHub alternatives has been raised and closed. Alternative, backup repos exist.
That said, I have not seen any contingencies for planning the social move to those repos and organizing ...
2
votes
1
answer
266
views
Why Bitcoin Core source code use #include bracket syntax instead of quote syntax
Why Bitcoin Core source code use #include <rpc/wallet.h> bracket syntax instead of #include "rpc/wallet.h" quote syntax. Can intellisense C++ editors understand this option and not ...
2
votes
2
answers
231
views
How can I configure Vim to work with bitcoin core C++ source code and have Intellisense like functionality?
I use Vim for editing, I installed Conquer Of Completion (COC) plugin and now I can edit C++ projects with Vim taking advantage of syntax highlighting, autocompletion, inline error messages, etc. But ...
0
votes
1
answer
63
views
What is the FeeReason enumeration in the Bitcoin Core?
There is enumeration called FeeReason. What is it? What is its use cases?
/* Enumeration of reason for returned fee estimate */
enum class FeeReason {
NONE,
HALF_ESTIMATE,
FULL_ESTIMATE,
...
1
vote
1
answer
48
views
what is the mapBlocksUnknownParent variable?
I was reviewing this pull request. It was an attempt to remove the global variable mapBlocksUnknownParent. I found the definition here. In the CChainState::LoadExternalBlockFile function.
// Map ...
6
votes
2
answers
828
views
What is the purpose of indexing the mempool by these five criteria?
In the bitcoin source code in txmempool.h, a comment says that unconfirmed transactions are indexed by five criteria:
* mapTx is a boost::multi_index that sorts the mempool on 5 criteria:
* - ...
3
votes
1
answer
213
views
where does the main.cpp moved to in recent versions?
I was reading this article about bitcoin-core. It is an explanation of bitcoin-core source code version 0.3, and it described a file named main.cpp. In the recent versions this file does not exist (or ...
2
votes
2
answers
465
views
Does bitcoind validate every block for every time it starts?
When running bitcoind, it starts downloading the blockchain and validate every block in a row. It stores the blockchain in the ~/.bitcoin/blocks directory. And when we break daemon and restart it, ...
3
votes
1
answer
82
views
Is commenting on github as reviewer good place to ask questions about source code?
I'm not sure even this question is off-topic or not. But bear with me.
Currently I have a good knowledge of bitcoin protocol and network but know very little about its source code and implementation ...
8
votes
2
answers
635
views
Was the addition of OP_NOP codes in Bitcoin 0.3.6 a hard or soft fork?
I'm doing some deeper research into historical consensus changes and it seems like most folks consider the addition of the OP_NOP codes to be a hard fork. Here's the diff for their addition: https://...
0
votes
1
answer
379
views
Scripthash from bitcoin address with Golang
I broke my head looking for a solution.
I want use bitcoin address for electrumx
Take bitcoin address from docs example: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
And i need convert to ...
9
votes
2
answers
361
views
Satoshi's coding quality
I have little knowledge about C++, so I want to ask two questions from "expert" (C++) programmers here:
Why Satoshi wrote Bitcoin in C++ and not in (for example) C language? any technical ...
0
votes
1
answer
421
views
Where's the code that bitcoin core uses to generate private keys
I was looking through the repository but theres just too many folders to go through
https://github.com/bitcoin/bitcoin
Wheres the code bitcoin core uses to generate private keys?
0
votes
1
answer
55
views
Trying to validade a bitcoin block
So I'm trying to validade a bitcoin block just for curiosity, let's take for example bitcoin block #1 (https://bitpay.com/insight/#/BTC/mainnet/block/...
2
votes
3
answers
198
views
Why are there limitations between educational and real world usage?
This link looks very practical and "hands in the dirty". But in the example of Python code for node discovery and connections, it often gives warning about the fact it is of "...
0
votes
2
answers
171
views
What's the relationship between Bittorrent and Bitcoin?
I know both implementations make use of decentralization, but is Bitcoin using any technology that was developed by Bittorrent?
0
votes
1
answer
184
views
How do I get circulating supply and total supply for cryptocurrencies?
How can I get circulating supply and total supply for cryptocurrencies?
I am not talking about using coinmarketcap's API, I want to get the data myself. Should I get it from the source-code?
1
vote
0
answers
274
views
How to reset bitcoin testnet / signet / regtest in newest bitcoin core
The testnet data directory is not ~/.bitcoin but rather ~/.bitcoin/testnet3. ~/.bitcoin holds the data for the main Bitcoin blockchain.
the files are still there but deleting them wont work anymore.
...
0
votes
1
answer
661
views
Building Bitcoin Core on Linux/Ubuntu with Visual Studio Code
Does anyone developing Bitcoin Core use VSCode for compilation and debugging on Linux/Ubuntu?
How can one configure VSCode to compile Bitcoin Core?
0
votes
1
answer
289
views
bitcoin file function folder location testnet setgenerate true
can somebody help me to point out where and in wich file the setgenerate true testnet function is located and controlled is it in chainparams.ccp or somewhere else ? and where to change the bitcoin ...
1
vote
1
answer
343
views
How exactly does bitcoin code change happen in a decentralized system [duplicate]
I have long been under the assumption that bitcoin was just a "protocol" or a "contract“. Different nodes run their own implementation, on different hardwares. Some are efficient, some ...
1
vote
1
answer
69
views
Where change the size of the window in Bitcoin code?
I already try changeing the height and width parameters of the forms in src/qt/forms but nothing changes, where else i need to look?
0
votes
2
answers
349
views
Who approves the feature and bug code reviews in Bitcoin?
I see a list of Bitcoin feature and pull requests here. How do all million plus users agree to these feature/bug requests? Do all users of Bitcoin have to approve them, or who represents them in ...
1
vote
1
answer
66
views
Educational sample of minimal working mining code
I would like if someone could point me to a minimal program source code that does solo minig on a CPU. (Can assume a running bitcoind/full node)
Something that in theory (obviously not in practice) ...
0
votes
1
answer
2k
views
I have forgotten my Blockchain account password and 12 word recovery. I have the wallet id and password to the wallet. Can i get my funds back?
I have forgotten my Blockchain bitcoin account password and 12 word recovery(possibly didn't even create one). However I do have my wallet id and the password to the wallet. Is there a way to get the ...
2
votes
1
answer
165
views
Is the entire blockchain kept in memory?
Putting aside pool mining, does the Bitcoin mining program keep the entire blockchain in memory? Including transactions?
I've been reading through the original Bitcoin code and it looks like the ...
1
vote
1
answer
311
views
How to improve bitcoin-qt when downloading blockchain? (very technical, dev views appreciated)
GitHub suggested discussing here before bothering developers with an issue.
So be it! :)
I'm running Bitcoin Core Version v0.20.1 and Linux Mint 18.3 on crappy old hardware. Pruning blockchain to 2 G ...
0
votes
2
answers
129
views
What are some of the GitHub alternatives that you consider for Bitcoin Core and other Bitcoin related projects? [closed]
Time for Bitcoin Core and other bitcoin related projects to look for GitHub alternatives?
Some of the issues:
https://techcrunch.com/2019/07/29/github-ban-sanctioned-countries/
https://twitter.com/...
1
vote
0
answers
96
views
How can I add the MySQL C++ connector to Bitcoin Makefile?
I'm trying to add a custom function to my bitcoin client that queries a mysql db. I followed this guide for the basic: https://technology.finra.org/code/compile-run-customize-your-own-bitcoin-client....
3
votes
2
answers
190
views
What is a good approach to learning the Bitcoin codebase?
I've read Mastering Bitcoin and other high level resources and I believe I have a decent understanding of Bitcoin. I'd now like to read and understand the source code. However, I'm very new to cpp and ...
1
vote
0
answers
33
views
How can I get stealthVersion from bitcoin's source code?
I found that a library called Bitcoinkit use stealthVersion.
Network.swift
public class Mainnet: Network {
...
override var stealthVersion: UInt8 {
return 0x2A
}
...
I tried to ...
0
votes
1
answer
56
views
Bitcoin create TX. What is 'hash_type'?
https://bitcoin.stackexchange.com/a/5241/92798
What is the meaning of item 13?
Why is this value chosen? What does it mean?
1
vote
1
answer
374
views
where in the source code is the the proof of work checking the blockheader hash and nonce?
Where in the source code do we check whether
hash(blockheader*nonce) < Difficulty
In fact, the line I found is as follows:
https://github.com/bitcoin/bitcoin/blob/v0.17.0.1/src/pow.cpp#L87
My ...
1
vote
1
answer
71
views
Why Ardor does not use Maven?
Are there some reasons why maven and standard maven directory layout are not used in Ardor?
0
votes
1
answer
351
views
Representation of coordinates in signature. OpenSSL
I want to calculate the v-value from the signature obtained using the OpenSSL ECDSA_do_sign function. I found that this value is calculated using the parity of y-coordinate of r. Here I also found ...
2
votes
1
answer
1k
views
Bitcoin ECDSA signature in the compact format
I would like to understand how to get Bitcoin ECDSA signature in a compact format, when it's exactly 65 bytes.
In the bitcoin-core repository, secp256k1_ecdsa_recoverable_signature_load is ...
1
vote
0
answers
98
views
What is the best way to test new consensus protocol?
I wanted to test a new consensus protocol. However, the bitcoin core is a large codebase (>100k lines). Is there any small codebase which is designed to test new consensus protocols and includes only ...
0
votes
1
answer
104
views
Is it true that only one message can be sent at a time in Bitcoin Core?
I looked into Bitcoin Core client code, and it seems that there is a lock that allows only one thread to send data (Block, TX, etc.) at a given time point. If this is true, it means that transactions ...
1
vote
0
answers
43
views
What is the behavior of the try catch statement in lines 1707-1729 in the ui.cpp in the release 0.1?
In the first public release, ui.cpp has this code on the lines in the subject:
void CSendingDialog::OnReply3(CDataStream& vRecv)
{
int nRet;
try
{
vRecv >> nRet;
...
2
votes
3
answers
252
views
Bitcoind does not like ECDSA (r, s) pair produced by OpenSSL
I am writing transactions manually and have stumbled across a rather bizarre situation.
Only one in a few of the transactions I broadcast to bitcoind is accepted, otherwise I get a REJECT_NONSTANDARD ...
3
votes
1
answer
58
views
How is bitcoind "shy" when exchanging `version` packets?
This is more of a technical/programming question.
I am referring to this line of code: https://github.com/bitcoin/bitcoin/blob/be992701b018f256db6d64786624be4cb60d8975/src/net_processing.cpp#L1699
...
1
vote
1
answer
125
views
Where in the source code are transaction validation checks implemented?
I understand that consensus (mining) and transaction validation are different concepts. Correct me if I'm wrong, but I believe each full node validates transactions and puts the valid ones into its ...
21
votes
1
answer
1k
views
How does the most recently found critical vulnerability (CVE-2018-17144) work?
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)?
Why can't this be done by a non-miner?
Also, ...