What does it mean that ripples are destroyed? I learn that, whether involving the transaction fees, or in some other cases, ripples can be destroyed.

What does it mean?

If I was charged a fee, does that mean that nobody got that fee as a corresponding increase of their holdings in XRPs?

Or does it mean that there is no record of it anywhere except in my retina vision cells seeing 0.xxx less in my account and somebody else seeing more?

Nobody gets that fee, as simple as that.

To protect the XRP Ledger from being disrupted by spam and denial-of-service attacks, each transaction must destroy a small amount of XRP. This transaction cost is designed to increase along with the load on the network, making it very expensive to deliberately or inadvertently overload the network.
Every transaction must specify how much XRP to destroy to pay the transaction cost.

See the Ripple Developer Center for further details.


How to obfuscate public IP of Mining pool? How to obfuscate the public IP address of a mining pool, to protect it against DDOS attacks?

I have a yiimp mining pool running on a cloud server.

I would like to secure it with HTTPS and anti-DDOS by obfuscating the public ip using Cloudflare, while still retaining stratum mining functionality from the yiimp pool.

The domain of my website is mycoin.io and I have set up the DNS to point to cloudflare. So now the website has HTTPs and DDOS protection.

My yiimp pool server is hosted on the cloud at 149.55.55.55 and I have setup cloudflare to redirect subdomain pool.mycoin.io to that ip address.

Now my mining script can look like this:

-o stratum+tcp://149.55.55.55:3747 -u WALLET_ADDRESS -p c=BUEN

or like this:

-o stratum+tcp://pool.mycoin.io:3747 -u WALLET_ADDRESS -p c=BUEN

But this does not provide any https or anti-ddos protection.

How can I obfuscate the public IP of my pool so that:

-o stratum+tcp://pool.mycoin.io:3747 -u WALLET_ADDRESS -p c=BUEN

still works?

The Stratum Mining Protocol ist not based on HTTP, so you will not be able to mediate it through Cloudflare or a similar service, unfortunately. Cloudflare and the like are designed for web content as in web pages.


In my Bitcoin Core Wallet I see peers identified as "BitcoinUnlimited" why? Sometimes I'm checking the connected peers I today I saw one identified as "/BitcoinUnlimited:1.0.2(EB16; AD12)/" User Agent. I haven't saw this before, all I see is Satoshi User Agents.

It this the hard fork Bitcoin Cash wallet peer? I don't want to help the Bitcoin Cash network, can I ban all peers with this User Agent?

BitcoinUnlimited is fork of Bitcoin project, maintained on github.

People using BitcoinUnlmited instead of Bitcoin-core are showing that as User Agent

BitcoinUnlimited offers two builds one for Bitcoin and other for Bitcoin Cash.

So what you are seeing is people using BitcoinUnlmited client for Bitcoin.

You don't have to BAN them, as they are not on BitcoinCash network but on Bitcoin Network.


Has anyone ported the Bitcoin software to "pure" Clojure? Has there been any attempt to rewrite Bitcoin in Clojure? I know about BitcoinJ, so I imagine that should be easy to port. But what about a "pure" version? Without calling Java directly? Easily portable to Scheme or other Lisps-style languages? Thanks.

There are several Bitcoin Clojure projects, but none of them appear to have a full rewrite of Bitcoin as a goal.

Of particular interest is https://github.com/johnwalker/bitcoin-protocol , which is an implementation of the Bitcoin networking protocol. It can be used to communicate with peers within Bitcoin networks.

Rewriting Bitcoin core in another language is doable, as the btcd developers have done porting it to the Go language - https://github.com/btcsuite/btcd , however it took almost a year of development time between several developers to become fully functional.


My lightning node URI is not visible I did set up a mainnet c-lightning node by following the guide.
https://medium.com/@dougvk/run-your-own-mainnet-lightning-node-2d2eab628a8b

I noticed my node is visible on https://lnmainnet.gaben.win/ but the URI is unknown. Is there some settings I need to check on my server?

when starting lightningd, you want to add the option:

--addr=[insert your IP address here]

so maybe when starting your lightning node, at your command line you would enter:

lightningd --alias DavideRivola --network bitcoin --log-level debug --port 9735 -ipaddr 192.168.1.1

Where 192.168.1.1 you would of course, put your own IP address.

Also, since you are probably unaware of this as well, in case you want to choose the port, use the --port=9735 option and just change the port to which you want to use. Everybody pretty much uses port 9735 though. Make sure that this port is forwarded on your internet router and is not blocked by your firewall either.

Also, if you want to choose the color that represents your LN Node on the #recksplorer site, you can use the following option --rgb 00cc00 where 00cc00 is the RGB code you would like to use. (In this case I have chosen green, because, well..look at my name :) )

Use this site to find the corresponding RGB Code for the color you want to use: http://www.color-hex.com/

use the command lightning-cli listconfigs to check what you have configured for your node to make sure everything is right after it is up and running.


How do you make a coin resistant to soft forking? Soft forks are probably worse than hard forks, since it is hard for a client to reject a soft fork (indeed, that is the point of soft forks). The only way to do so is either to gain 51% of the hash power, or to do a hard fork rejecting it.

How can you make an altcoin resilient to soft forking (or only allow certain types of soft forks)? I think doing this is in general might be impossible, but making it harder would be good. Having no soft fork policy built into the coins philosophy would help, but probably isn't good enough.

You can't prevent miners from enforcing more rules than the rest of the network is. However, to actually turn that into a soft fork, a significant portion of the network also needs to start enforcing it.

However, the only way a softfork can affect users of the system in a negative way is by disallowing certain transactions that used to be useful. That problem is nothing more than the inherent censorship rights a majority of miners have over the system. The solution to that problem is not trying to prevent enforcement of rules (which is not possible; miners can do it even without announcing it), but by improving the privacy of the system. If miners cannot see what transactions are doing, they cannot selectively block.


What means "fallbacks" in LN invoices? Just saw a "fallback" property in LN invoice. Never seen before. Can you please describe what that means and how I can make an invoice with same property?

I am using c-lightning. This is what i had decoding invoice:

{
   "currency" : "bc",
   "created_at" : 1564513459,
   "expiry" : 3600,
   "payee" : "03efccf2c383d7bf340da9a3f02e2c23104a0e4fe8ac1a880c8e2dc92fbdacd9df",
   "msatoshi" : 1000000000,
   "amount_msat" : "1000000000msat",
   "description" : "satoshis-tennis-1564513459.3110697",
   "min_final_cltv_expiry" : 10,
   "fallbacks" : [
      {
         "type" : "P2SH",
         "addr" : "3MXqbMwf457U4Jaw35WnJdnL99mq7Q8oQQ",
         "hex" : "a914d9a625fb64a9faa4600548ae97e8efda9294dd0a87"
      }
   ],
   "routes" : [
      [
         {
            "pubkey" : "0276e09a267592e7451a939c932cf685f0754de382a3ca85d2fb3a864d4c365ad5",
            "short_channel_id" : "557233x2338x0",
            "fee_base_msat" : 1000,
            "fee_proportional_millionths" : 9,
            "cltv_expiry_delta" : 14
         }
      ]
   ],
   "payment_hash" : "de210472f7e9513358a22db99ee5b987e9fe96d523d0d833fd900837aa71199a",
   "signature" : "3045022100c79fc20087480d302a68c3b92b34de935956202c0499cf8acc182837c871923202200879fd3979aa688a46703c31f7e56ea5e7917f4820da42177d31fc2a9290c91a"
}

I am in particular interested in the following part:

    "fallbacks" : [ { "type" : "P2SH", "addr" : "3MXqbMwf457U4Jaw35WnJdnL99mq7Q8oQQ", "hex" : "a914d9a625fb64a9faa4600548ae97e8efda9294dd0a87" } ],

As can be read in BOLT 11 of the lightning protocol spec

  the f field allows on-chain fallback; however, this may not make sense for tiny or time-sensitive payments

it is one of the fields encoded into a BOLT 11 invoice

  f (9): data_length variable, depending on version. Fallback on-chain address: for Bitcoin, this starts with a 5-bit version and contains a witness program or P2PKH or P2SH address.

In case a payment can't be routed it is possible to pay this invoice with an onchain bitcoin transaction instead of opening a new channel. This obviously can't be done for sub dust payments and even for tiny payments above the dust limit this might not be economically viable.


Who are the key developers, and where can I follow their progress and decision making? I want to follow the most up to date developments of Bitcoin, (such as M of N transaction confirmation).

Who are the primary developers of Bitcoin and what is the most efficient way to track the progress of this and similar activities?

I'm interested in reading either a detailed activity view, or a high level bullet point of key developments.  Ideally someone would offer both information formats as an answer.

A nice summary view would include the following ideas and a status on testnet and on the production network:

IPv6 support
Zero confirmation AKA miner promise

The core developers are listed on the main Bitcoin page, while everyone that contributed code are listed on the About page. Probably the most up-to-date info on what is happening with the code would be on the GitHub repo.


Can't find Multibit wallet file after closing wallet I closed a wallet in the 0.5.x version of Multibit for Mac.  Now I can't seem to open it. When I use Open Wallet in File the file name comes up, as does my home library, but I can't figure out where it is stored. Thank you for your help.

On a Mac the wallets are stored by default in the user data area:

/Users/"user name"/Library/Application Data/MultiBit

The default wallet file name is "multibit.wallet".


How do I move my wallet from Windows 7 to a new Windows 10 machine? Previous answers say set up a new wallet with new address and transfer bitcoins to new address, is this the only way of doing it? I don't want to wait days for the new wallet to download blockchain and verify when I already have that on the Windows 7 machine.

First - you didn't specify if you use Bitcoin Core or any other program for maintaining your wallet, so the answer below presumes you used Bitcoin Core.

The short version: it stores all of its data in %AppData%\Bitcoin
This folder usually translates to C:\users\\AppData\Bitcoin

Underneath that folder you will find there the 'wallet.dat' file.
This is the file that has all of your addresses (including private keys). This is the file you'll need to copy.
You will find in that folder also a subfolder 'blocs' which is your local copy of the entire block chain.

On both Win7 and Win10 those files reside under the same folder - %AppData%\Bitcoin.

So - simple copy instructions:

Install Bitcoin on the new (win10) machine (and don't start it yet)
Stop Bitcoin on the old one
Copy %AppData%\Bitcoin\wallet.dat from old to the new one
You may also want to copy the entire %AppData%\Bitcoin\ folder with the rest of the files and block chain, or you can download it again (it's "only" 20+ gigabytes)
Once you're done with the copying you can start Bitcoin Core on the new computer.

That's all.

See https://en.bitcoin.it/wiki/Data_directory for more details.


Is bitcoin mining completely automated? What I mean by "completely automated" is, if all the below are taken care of by the client, no human effort is involved.

Collecting the transactions
Creating a new block

If possible can someone explain or redirect me to a resource explaining the whole mining process in detail with technical specifics.

Can a miner choose which transactions should go in which respective block?

Yes, these tasks are normally taken care of by Bitcoin Core or equivalent mining software.

I suppose in principle some miner could patch their software so that it asked a human operator to approve each transaction before adding to a block, or to participate in some other way.  But I can't imagine why anybody would want to, or what a human would look for in a transaction that wouldn't be easier to script.

For more general information about mining, see What exactly is Mining? The main source of technical information about Bitcoin is the wiki at https://en.bitcoin.it/wiki/Mining (or a mirror).


Stress test? Whats it for? How long does the stress test usually last on the blockchain? Also what is it for? I'm fairly new to bitcoin and was having trouble processing transactions in a fair amount of time earlier.

It's not a standard occurrence, it's just a company of dubious origin deciding that they will spam transactions to somehow prove a point about block sizes. Interestingly it proves the opposite of what they intended, rather than showing that the block size needs to be bigger, it shows that no matter how big you make the blocks people can spam enough to fill them.

If you have trouble getting transactions confirmed, you need to pay a fee for them rather than relying on the charity of miners. A transaction paying more than an absolutely rock bottom fee will be prioritized over the spam.


Two blocks, two transactions, same hash Would a block containing a transaction with an identical hash as a previous transaction be considered valid? That is, if someone made a transaction for generating Bitcoins and solve two blocks with the same coinbase transaction, would the second block using that transaction valid?

The transaction would be valid - there is nothing in the protocol that forbids this.

This is also the cause of the "duplicate coinbase" bug in the Satoshi client which I discovered a few months ago. If you create a block with a duplicate coinbase and that block then becomes orphaned it will cause the both the original and duplicate tx to be removed from the database.


What are the transaction fees with Ripple.com? https://ripple.com/how-ripple-works/

  While Ripple does not charge a typical fee for profit, each
  transaction does require a small portion of a ripple (equivalent to
  ~1/1000th of a cent) for security.

This seems to assume a certain conversion rate between Ripples (XRP) and real world money. How much in XRP is the TX fee?

The default fee for a transaction is 0.00001 XRP.

But the fee is not fixed. Quoting the wiki:

  Transaction fees are adjusted based on two factors: base fee and load
  fee

  base fee: long term fee adjustments
  Since transaction fees are
  paid in XRP and the price of XRP may change overtime, to keep the
  price of transactions affordable, Ripple uses an adjustable "base fee"
  to specify the cost of transactions.

  load fee: short term fee adjustments
  The "load fee" can rise quickly to protect the network
  from attacks and keep the network functional under heavy load.

The fee schedule is changed using consensus, quoting. D.Schwartz:

  A node can introduce a transaction to change the base fee. If a
  trust-weighted majority of nodes vote "yes" on the transaction, it
  will be incorporated into the ledger and the fee will be changed.


Are Bitcoin ASICs good for anything else other than mining? If I purchase an ASIC (hypothetically) and then for whatever reason Bitcoin disappears, becomes defunct or otherwise, is there anything else I could possibly use it for, such as SHA256 cracking - or is there no other possible use and does it become an elaborate doorstop?

No, Bitcoin ASICs can not be reused for any other purpose, unless something were created that uses the exact same hashing technique.

Unlike what some ill-informed radio talk show hosts say, the mining network is cryptographically incompatible with SHA256 password cracking, the block chain itself is not a conspiracy by the Russians as a rainbow table.

Besides most hashed passwords use a salt, and the manner it is typically done is incompatible with what is being done in Bitcoin.

So, no.  The ASIC will forever be exclusive to the Bitcoin unless another RFC or standard requires a proof of work (a la Hash Cash) for some other purpose.


Where are new addresses stored? When a user generates an address using Bitcoin Core, is that address by default stored on the blockchain or will it only be stored after it is used in a transactions

will be stored only after any transactions occur ?

Wallet addresses are not technically seen in the blockchain until they are used in a transaction, but that does not mean that they have not been generated/belong to someone. A Bitcoin "address" is derived using the public key (and the public key is derived from the private key, using ECDSA) and are really used for simplicity and readability through Base58 encoding (imagine needing a user's full 32 byte public key!).

A private key can be used to derive a public key and likewise the public key can be used to derive an address. Due to the nature of hash functions/ECDSA, these values are "computationally infeasible" to reverse. Meaning you cannot take the address and obtain the public key nor can you calculate the private key given the public key.

As the wiki states:

  A Bitcoin address is a 160-bit hash of the public portion of a public/private ECDSA keypair. Using public-key cryptography, you can "sign" data with your private key and anyone who knows your public key can verify that the signature is valid.

Anyone with the private key necessary to meet the spending condition (scriptSig) of a transaction will have the means to spend it's output(s).


How do we know that the algorithm of Bitcoin does not embed bugs since inception? I'm new to Bitcoin. My understanding as a trained economist (and not a programmer or IT expert) is that the key selling point of Bitcoin is the assignment of monetary policy prerogatives to an algorithm distributed across a P2P network. What this means is that people do not have to rely on a human politician (and his promises) to protect the value of the currency (which, philosophically, represents their past work) by not printing new money discretionally. Instead, they would give this task to an algorithm distributed over a P2P network, which, by definition, will KEEP its promises and will not be under the control of any one single person.

Now, my questions are:

How do we know that the algorithm cannot be modified to gain control over the expansion of the monetary base? After all, I don't think that there exists a man-made software that cannot be hacked.
Many discussions on this forum flag that suck a type of attack would be extremely expensive if not impossible. However, how do we know that such type of bug isn't already in the algorithm? See question 3
How do we know that Satoshi hasn't left a bug in his software (or purposely left out some important protective codelines) that will allow him to artificially steal or claim bitcoins at his/her discretion? After all, Satoshi, the inventor of the software has not revealed himself (or herself).
Even if Satoshi did not actually steal the money for himself, but simply left an option for himself to increase/decrease the speed of expansion of the monetary base, that would still give him a 'soft', yet enormous power, making him a de facto central bank (and people would not necessarily be aware of this). How do we know that this could not happen?

I'm going to answer your questions directly although I know you've selected another answer. It's for all those who come across this question.

  How do we know that the algorithm cannot be modified to gain control over the expansion of the monetary base?

These are part of the config settings of the Bitcoin protocol. It can be changed but all you would be doing is changing your own node. You would have to convince all the other nodes to change their settings too and additionally you would have to be able to mine coins faster than anyone else to guarantee that you were generating the coins. Without getting too technical, this is the power of a p2p distributed network, the crowd matters, not the individual.

  After all, I don't think that there exists a man-made software that cannot be hacked.

Nobody is saying that one day in the future we won't find a way to hack the security of bitcoin. But if we do then everything is broken, including the internet. The type of security that is used to send your bank details between servers, or when you log in to secure https websites relies on the same type of security. Even the NSA rely on this security. But if it does happen, we just move to the next level, and send our coins to a new address. (It's a little more complex but I summarise).

  Many discussions on this forum flag that suck[sic] a type of attack would be extremely expensive if not impossible. However, how do we know that such type of bug isn't already in the algorithm? See question 3

We know because anyone can look at the code. It's open source. If someone found a bug it would have been exploited already, it is the biggest financial prize in history, you don't think people are trying all the time? They have been trying for 5 years. It may happen if and when a new function is added which is why the core developers need a lot of support from the community.

  How do we know that Satoshi hasn't left a bug in his software (or purposely left out some important protective codelines) that will allow him to artificially steal or claim bitcoins at his/her discretion? After all, Satoshi, the inventor of the software has not revealed himself (or herself).
  Even if Satoshi did not actually steal the money for himself, but simply left an option for himself to increase/decrease the speed of expansion of the monetary base, that would still give him a 'soft', yet enormous power, making him a de facto central bank (and people would not necessarily be aware of this). How do we know that this could not happen?

Just because the developer chose to be anonymous doesn't mean he has anything to hide. Also see my answer above, the code is open source.

The only thing that Satoshi could do that may cause problems is dump his coins on the market. That might spook people and the price might drop considerably, but the whole mechanism is pretty robust and it does what it is supposed to do. So unless there is a real problem, people will just scoop up the cheap coins and we'd all carry on with the mission.

EDIT I just want to add that although Satoshi is revered, his coding style has been criticised for various reasons, and some would say he was not an out and out programming expert. Indeed bugs were discovered early on and corrected, by everyone involved at the time.


Is it possible to change to protocol, mine lots of blocks offline, and then change it back? Is it possible to make changes in Bitcoin protocol and then start to mine faster than 1 block in 10 minutes?

What happens when someone makes those changes and "mines offline" blockchain that is longer than current one. And after that changes protocol back to "normal" and appears back to online network?

Is it even possible?

Such an attack is not possible:

The protocol contains a rule how to calculate the difficulty to succeed in mining a new transaction block. This difficulty expresses in the form that a hash must fulfil (number of leading zeroes) in order for other network participants to accept it as valid.

There is no other way to arrive faster at a hash that fulfils the difficulty requirements than to try out as many as possible as fast as possible.

Now, you could easily reduce the difficulty requirement in your client's protocol and mine thousands of blocks every second, but these blocks would not be accepted by the other network participants. Firstly, of course, because you don't fulfill the difficulty and secondly, because the length of the blockchain is measured not in the number of blocks, but in the combined difficulty of the blocks.


How to compute double sha256 shown in examples of bip 143? How do I compute the double sha256 shown in example of bip 143?

The example in Native P2WPKH

  hashPrevouts:
     dSHA256(fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a01000000)
     = 96b827c8483d4e9b96712b6713a7b68d6e8003a781feba36c31143470b4efd37

I tried

  export PREV_OUT=fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a01000000
  echo -n $PREV_OUT |openssl dgst -sha256 -binary |openssl dgst -sha256

This is what I am getting

  cf4cff3b2196ae87636af6088736f0f9102106375f306c032804845a2d3b92d4

Do this:

echo -n $PREV_OUT | xxd -r -p | openssl dgst -sha256 -binary | openssl dgst -sha256

Explanation

You want to do this:

  prevout (raw bytes) -> sha256 -> sha256 -> convert to hex

You're doing this:

  prevout (raw bytes) -> convert to hex -> sha256 -> sha256 -> convert to hex

xxd -r -p reverses the hex conversion.


What is burning coins, who benefits, and who does it Kindly explain. The one that i'm confused is not the "burn" after ICO but rather when its established.

AFAIK "burning" is to decrease circulating supply and (supposed) to increase price (assuming constant demand). I believe this is why investor benefits from the activity.

The requirement to burn is to own the coin and send it to unspendable address. It is clear that the coin is lost. Afterwards, the value of burned coins transformed to an increase in price.

However, who does it? And why they do it if they are losing their possession?

Burning coin is performed in the early stages of a new cryptocurrency in order to avoid that early users hold the largest portion of supply in the market, so that they won't be able to manipulate the market itself or that the coin is a scam. If you hold the largest share of supplies you can control its price fluctuation and this is not good for the health of the currency since that would mean that the market could be rigged, causing users to flee from the market. Burning your coins is a way to show your commitment to the currency on the long term and to earn trust from the users that want to join the market.


How to redeem a private key in case it is compromised I know MtGox allows me to redeem a private key, but that doesn't necessarily ensure that all the value is extracted from that address in a timely manner. Is there no simple way to send the entire value of a private key to another address in case you believe the private key has been compromised? My real use for this is in having offline/paper wallets. I would like to transfer my bitcoins to an offline "savings" address, then when I want to make a withdrawal, be able to transfer the entire value of that private key to a new address because, having entered the private key somewhere to redeem its value, its privacy could have been compromised.

This seems like a very common use case for paper wallets. Am I missing something? It should be easier to spend the value from a particular address. Why can't I use my bitcoin client to spend a specific address? I can import private keys into bitcoin v0.7.1-beta (although even that is an obscure debug window) function, but it looks like sending from a specific address is also an obscure debug function (sendfrom). Why is this so obscure when it seems like such a common case? What is one to do if they suspect a particular address' private key of being compromised?

Also, how can I tell how much value is available on my various addresses to make sure I extract the full value? Blockchain.info seems to do a good job, but it's Dutch -- isn't there an English site or bitcoin client function to determine an address' value. That too seems really basic. I have tried blockexplorer.com, but that site rarely seems to work.

I feel like I'm trying to accomplish the most basic of tasks, and the tools just aren't there, so I must be missing something.

P.S. I am using also Android devices with BitcoinSpinner. I would be interested to know if some more sophisticated clients allow this more easily -- scanning both a private key as a source and a public key as a destination -- to create a transaction.

P.P.S I'm also not clear on how to use the backup provided by BitcoinSpinner. I tried to import it as a private key into bitcoin v0.7.1-beta on my desktop, but it didn't work. The only way I could figure out how to essentially get a backup of BitcounSpinner into my desktop's client was to import the private key, which I know is wrong. There must be some way that backups are supposed to work.

If you want to redeem all funds from a private key and never use it again - you can for example create a new wallet file, run a bitcoin client, import the private key, let the client fully synchronise, and then send all your available funds to another address you own. After that, you can move your old wallet back where it belongs and use the new funds transferred. The redeemed key will not interfere with your normal wallet and you will have your funds.


Where is the bitcoin automatic address generation? I have head of the automatic bitcoin address generation feature for every transaction. I have done multiple transaction, but I still have the same addresses (I have two addresses). I would like to enable the automatic address generation feature. Where is it? I am using the original bitcoin-qt client.

The standard Bitcoin software up to version 0.4.x had a GUI based on wxWidgets rather than QT. For version 0.5 it was merged with the then-separate bitcoin-qt.

The older version allowed you to select an address to be displayed in the overview. If you received funds to an address while it is selected, Bitcoin would automatically generate a new address.

I don't believe this functionality still exists in the QT version. It does however still generate new addresses for change.


Why can't the block size upgrade be trialed on testnet with an organised "stress test" A stress test was run on mainnet to see the effect of exponential demand in Tx volume.

Why can't a testnet "stress test" be organised to look at the implications of the 20Mb block size (and other variables?)

I can't understand how there's so much speculation when a test environment would solve some of it by delivering actual metrics.

There are a number of more complex alternatives under discussion which involve more elastic limits (instead of the hard limit which currently exists), automatically adjusted limits based on some metric in the blockchain, or some combination of both.

More complex alternatives mean more complex code and more potential for bugs. They certainly could and should be tested on testnet.

With the "just raise the hard limit" option (and even with some of the other alternatives), most metrics you could glean from a testnet test aren't very interesting and are already easy to calculate. E.g., it's easy to understand what the worst case bandwidth, CPU, and disk space requirements are, and it's not too difficult to simulate (without testnet) how added block propagation time will (or will not) affect miner efficiency.

It's the external effects which are causing most of the controversy, e.g.:

Will the additional requirements drive more people away from running full nodes, increasing centralization?
Will Moore's Law, Nielsen's Law, and the current Kryder Rate continue into the future, and will they help to improve decentralization despite larger blocks?
Will a "don't do anything until it's an emergency" approach drive people away from Bitcoin when tx confirmation times begin to significantly increase (and Bitcoin Core nodes begin crashing)? Or will tx space scarcity simply cause tx fees to gradually increase (which will also drive users away if they increase too much, increasing centralization)?
What effect will the blocksize limit have in the future (e.g. on tx fees) as the block subsidy decreases?

I'm not trying to list all of the controversial questions/issues (I doubt I even know them), only to demonstrate that there are far more which can't be answered by testnet than can.


Is there a Bitcoin bank, which gives interest on my deposit? Is there any Bitcoin bank I can place my Bitcoins in that will give me a decent interest rate. It should be at least 1% for it to be worth it.

Please Take Note: Flexcoin has been hacked and is no longer operating.

Original Post shown below:

Right now, the closest thing you can find to a bank is Flexcoin. If you keep your money there, you will receive a variable interest (they call it discount for legal matters) every month. They also have a user defined cold storage service available for those who want to keep their funds offline.

Here is how it works. Every time you withdraw money from Flexcoin, you pay a fee:

  Fees:

  Flexcoin to Flexcoin = FREE
  Bitcoin to Flexcoin = FREE
  Flexcoin to Bitcoin = 0.01 BTC or one half of one percent of the transaction amount (whichever is greater)
  Cold Storage Transaction Fee (outbound) = 0.02 BTC or one percent of the transaction amount (whichever is greater)
  Cold Storage Transaction Fee (inbound) = 0.01 BTC or one half of one percent of the transaction amount (whichever is greater)

This fee is used to pay miner fees and keep the service running. The rest of it is distributed among clients:

  Discount Payout:

  70% of the fees collected are disbursed to the account holders as
  discount payments on any fees already paid or any potential future
  fees, based on the following formula…

  (your account balance / total balance of all flexcoin accounts) *
  ((all fees collected – miner fees) * 0.7)

Here are two bitcointalk threads about the discount payments for the first two months.

As a final note, I would like to say that I personally think that this kind of service is not very useful right now because the Bitcoin price is too unstable. For example, yesterday the price dropped 15%. Any interest you might earn becomes irrelevant in this scenario.


Do mining pools expose attempted nonces to the public? Do mining pools expose attempted nonces to the public?
I would think no because it would be counter competitive.
I can let a giant mining farm tell me what nonces not to use.
But let's say the nonces attempted were public to everyone. Would it be faster to

continue attempting random nonces
storing the nonces previously attempted in memory and finding them in a sorted array

This is a 'Big O' type question.

Do mining pools expose attempted nonce to the public ?

No, that's pointless and would be completely infeasible. The combined network tries over 100 billion billion nonces per second (as of december 2020, it's around 120 exahash/s).

I would think no because it would be counter competitive. I can let a giant mining farm tell me what nonces not to use

That's irrelevant. They are trying to find nonces for a different block candidate than you are (at the very least, they're trying to mine a block that pays them; you're trying a block that pays you).

Would it be faster to continue attempting random nonces

No, every block candidate + nonce is a completely independent attempt. Nobody will ever try the same combination again (because the timestamps change, the composition of transactions changes, and the payout depends on the miner). It doesn't matter in what order you or anyone else tries nonces - only how many you try per second matters.

or storing the nonces previously attempted in memory and finding them in a sorted array

No, same reason.


What prevents hackers from guessing seed phrases? If seed phrases are generated from a finite list of mandatory words, what prevents someone from randomly generating seed phrases that might work?

What prevents hackers from guessing seed phrases?

Nothing.

The problem for the guesser is that 204812 is a very big number (204824 more so).
It is roughly 5,000,000,000,000,000,000,000,000,000,000,000,000,000
Let's say a hundred million different people have Bitcoin wallets and have money.
Lets say a million attackers each guess a million phrases a second.
How long is the average time for the guessers to strike lucky?
Wouldn't that be something like 50,000,000,000,000,000,000 seconds? That's about 1,726,445,291,328 years and the Earth is only 4,543,000,000 years old so that's  380 times the age of the Earth.
Of course, the first guesser might strike lucky with their first guess. But the odds are hugely against them.
Note that the above is not intended to be accurate, just to give a very rough idea of the scales of numbers involved. For example, I haven't looked at how many seed-phrases result in the same seed-number or how many seed-numbers can't be reached from any seed-phrase, I just used a 1:1 correspondence - which is likely wrong.


Question about "mining" in bitcoin Hello I am a student who is trying to understand bitcoin mining and block chain technology. As I read the articles and papers about bitcoin mining, mining is the process of adding transaction records to Bitcoin's public ledger of past transactions. And its average solving time is around 10 minutes and whoever solve the fastest will be awarded to 25 BTC. So if there are more and more people using bitcoin and sending their bitcoin to each other, then more and more bitcoin has to be awarded to whoever solved it right? Is that why the predicted time for last Bitcoin to be mined is becoming sooner and sooner? If Bitcoin becomes a major currency and millions and millions of people use bitcoin everyday then are there any possibility that the last bitcoin will be mined way sooner than expected date which is May 7th, 2140? Thank you

Mining is the process of extenting the chain with new blocks containing (or not) new transactions. The block reward and any tx fees for that block goes to the miner, who found  a nonce such that the hash meets that block's difficulty target.
In Bitcoin the difficulty retargets every couple weeks I believe. This means that if more miners start mining, they will indeed cause blocks to be found faster than the 10 minute starget on average, until difficulty retargets, where it will go back to about 10 minutes (and possibly go up or down depending on whther new miners arrive, or existing miners leave).

Due to thus two weeks retargetting, there should be only minimal change to the expected time of the last block reward (accumulation of each two weeks period's drifts).

Last, the number of txes do not influence the number of blocks. The miner does get a bit more due to the tx fees, but whether blocks are full or empty or the the middle, the target is still 10 minutes.


Is there a difference between bytes and virtual bytes (vbytes)? In an Optech newsletter, size is referred to using vbytes. Is there a difference between vbytes and bytes? If so, what is the difference?

Yes, they are referring to two different metrics: size and virtual size (vsize).

The size in [bytes] of a transaction refers to the raw byte length of its serialized format. It is used to measure the data footprint of transactions when relayed on the network or stored on disk.

The vsize in [vbytes] refers to a transaction's weighted size under segwit's rules. It is used to compare how much blockweight needs to be allocated to confirm a transaction.

Block weight limit
Bitcoin blocks are limited in their transaction capacity. Before Segregated Witness (segwit) was activated, blocks were limited to a blocksize of 1,000,000 bytes. Under that paradigm, the size of a transaction corresponded to the byte count of its serialized format.
The activation of the segwit softfork replaced the blocksize limit with a blockweight limit of 4,000,000 [weight units (wu)]. The new protocol rule defines the weight of a transaction as the sum of the witness bytes counted at a factor of one and non-witness bytes counted at a factor of four.
weight [wu] = 4 [wu/B] × non-witness length [B] + 1 [wu/B] × witness length [B]

Since non-segwit transactions don't have any witness data, this results in equivalent rules for non-segwit blocks before and after the rule change:
1 B / 1,000,000 B = 4 wu / 4,000,000 wu

One byte is the same portion of the previous blocksize limit as four weight units of the new blockweight limit. Transactions without witnesses, non-segwit transactions, take exactly the same portion of the blockweight as they took of the blocksize prior to segwit activation. This allowed segwit to be introduced as a forward compatible soft fork.
Segwit Discount
For segwit transactions, which do include witness data, the resulting transaction weight is strictly smaller than 4 × size due to the witness bytes contributing at a lower factor. This results in a lower relative portion of the blockweight to include a segwit transactions than an equivalent non-segwit transaction. The adoption of the segwit output format results in an effective capacity increase. Segwit blocks may exceed raw byte sizes of 1,000,000 bytes, with e.g. the biggest block to date achieving a raw byte size 2,377,364 bytes.
Feerates and their units
Before segwit activated, users measured transaction sizes in [bytes] and feerates in [satoshis per byte]. Since segwit activated, the protocol measures transactions by weight in [weight units]. At the protocol level, this shifts the range of feerate values by a factor of four.
Segwit introduces the measure virtual size (vsize) in [virtual bytes (vbytes)] to ease comparison of feerates before and after segwit activation. The vsize is calculated by dividing the transaction weight by four: vsize [vB] = weight [wu] / 4.
The range of values of fee per vsize thus matches the range of the pre-segwit fee per size. To this day (Oct 2020), it remains popular to track feerates in [satoshis per vbyte].
If you are looking for an approachable example, check out this detailed comparison with concrete values:
How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?


How to reduce disk-space requirements of Bitcoin Core wallet? I want to install Bitcoin Core wallet on my computer, but his blockchain is too big (more 230 Gb).

How to reduce Bitcoin Core wallet?

You can use a prune option to specify the amount of disk space you would like Bitcoin Core to use. This option allows you to keep only the latest block information instead of storing all the data.

find your configuration file bitcoin.conf (here you can find the list of possible locations depending on your operating system);
set prune parameter to the desired target size in MiB (for example, prune=2048);
restart the wallet.


Miners forego revenue in order to 51% attack the Bitcoin protocol by rejecting blocks I was recently listening to Mike Green and Anthony Pompliano debate the future of Bitcoin on RealVision. And Mike raised an interesting point regarding Bitcoin (I'm paraphrasing). "Scenario: Let's say the majority of miners, which are no longer bound by financial incentives, decides to attack the Bitcoin network by continuously rejecting blocks, could they do it? Could you essentially reject-spam Bitcoin's network?"
That, I found to be an interesting question to which I haven't been able to find an answer. Is anyone able to shed light on the plausibility of this scenario?

Bitcoin nodes consider the chain with the most work the best chain. Whenever a miner finds a new block that extends the best chain, they broadcast it to the network and all nodes update their chaintip as they hear about it. Miners could ignore that new blocks are found, but this would not affect any other network participants.
They could however instead provide a competing chaintip. As your scenario states that the attackers have a majority of the hashrate, (among other things), they could build a chain of empty blocks, i.e. blocks that only pay the block subsidy to the miners, but don't confirm any transactions. This would allow the attackers to collect the block subsidy, but they would no longer be collecting transaction fees, reducing their revenue by (currently) about 15%. However, the delay in confirmations would drive up the feerates of the waiting transactions, and the lost revenue would quickly increase.
Note that the attackers must continue to mine blocks in order to maintain their denial of service, or they would be out-competed by the minority eventually. So, the attacker is still spending energy cost (and has already invested in hardware). Depending on how the scenario exactly specifies "no longer bound by financial incentives", I'd surmise that the rising transaction fees would eventually entice miners to break rank from the attack.


How do I implement an escrow service using Bitcoin contracts? I can see that Bitocin can provide escrow contracts. https://en.bitcoin.it/wiki/Contracts#Example_2:_Escrow_and_dispute_mediation

Can someone provide a worked example or even better a pointer to a code example.

The functionality is not yet implemented in Bitcoin. On October 18 Gavin created 3 Bitcoin Improvement Proposals that would support the functionality, Bitcointalk:OP_EVAL proposal.

M-of-N Standard Transactions
OP_EVAL
Address Format for OP_EVAL


How to buy Bitcoin in Iran So I'm trying to buy Bitcoin in Iran and I want to use my Iranian Bank Account which unfortunately isn't accepted by PayPal or other online payment websites.
So is there any way for me to buy Bitcoin(under one Bitcoin) using my Iranian Bank Account( Melli Bank or any other bank)?
Thanks for any help!

You will need to find an exchange that accepts your bank account or method of transferring from your account to the exchange.

A number of exchanges out there not personally sure which would accept your bank, but another option is Local Bitcoins

Here is the link for Iran https://localbitcoins.com/country/IR

UPDATE 1st June 2019: Local bitcoin is now banned due to new sanction.

Iranian can't use localbitcoin in Iran anymore but they can buy and sell here as an alternative:
https://www.keepchange.io/buy/bitcoin/IRR?


How to check the balance of a person when his public keys are different on different input transactions? A person can use a different public key/private key generated from his eWallet for each transaction. How the miner check the balance of that person from his multi-input transactions with different public keys?

Contrary to popular belief, Bitcoin does not use an accounts system with balances nor do addresses actually exist on a technical level.

A transaction spends transaction outputs and it creates transaction outputs. It directly references which transaction outputs it is spending, so when verifying a transaction, you just need to lookup what the previous transaction output is. There is no need to know any balances (except that of the transaction output which is provided in the output itself) nor anything else about the wallet of the sender(s).


Does bitcoin core node relay those child-pay-for-parent transactions? I am trying to understand how the relay mechanism works in bitcoin?

I understand how CPFP transaction works, but how those transactions get relayed to miner nodes in the first place? the reason is that some inputs of those transactions are not in UTXO. Should standard nodes discard it in the first place?

(updated based on Pieter's comments below)

There are (essentially) two sets of UTXOs at play. One is constructed from the blockchain itself, by reading the blocks on disk and updating with any new blocks that are broadcasted. This set is saved to disk, and can be reconstructed from the blockchain data if erased.

Another UTXO set is the mempool itself. Each output in the mempool is considered a valid UTXO, unless it is already spent by another mempool tx. Moreover, any outputs consumed by mempool transactions from confirmed transactions are considered spent in the other UTXO set. This mempool UTXO set is not saved to disk, and only exists when there are transactions in the mempool, while the node is running.

You can see existing CPFP transactions by calling getrawmempool with the verbose option. This produces a json array in which you can see if an unconfirmed tx depends on an existing unconfirmed tx:

...
"fdb9bed320457e8ff606bdf1e4a6fa980bc65d9ad8525e75abba30af1363ef8e": {
    "size": 256,
    "fee": 0.00001923,
    "modifiedfee": 0.00001923,
    "time": 1527988568,
    "height": 525693,
    "descendantcount": 1,
    "descendantsize": 256,
    "descendantfees": 1923,
    "ancestorcount": 4,
    "ancestorsize": 964,
    "ancestorfees": 7212,
    "depends": [
      "4b2541774140a6afe58606f8a97cca9d1aef0dff5f769ee1dcdcb834b50aeb97"
    ]
},
...


Can I move my wallet.dat from Ubuntu to Mac OS? I want to run Bitcoin Core on Mac OS.
Can I move my existing wallet.dat file from Ubuntu and use it in Mac OS?
I am using Bitcoin Core.

If you are using release binaries, yes. You must make sure to shut down Bitcoin Core cleanly before moving the file over, though.

If you're using self-compiled versions, this is only possible if both versions are compiled against the same BDB library.


Why is Bitcoin's unconfirmed transaction count rising and what effect does it have on the network? I see that blockchain.info is reporting a large and steadily growing number of unconfirmed transactions.

I assume that these are all transactions broadcasted to the network but never confirmed as a result of low fees.

What does this mean long-term? Given my understanding of the blockchain, only transactions on the blockchain are considered confirmed and don't exist on the blockchain if they are not confirmed - and instead, exist only in the mempool.

According to blockchain.info's mempool size chart, the mempool size has increased considerably since genesis, and some initial research shows that the size does grow with abnormal network conditions (high volume spikes, etc).

At the time of writing, the number of transactions is 285,565, totaling about 228.71450055 BTC that are tied up in fees.

That means about 0.0008009192322 BTC per transaction on average. However, following the rule of 20 satoshis per byte, on average, each transaction would need only 0.00002 BTC in fees - about 40 times less than what is currently tied up in BTC fees.

What's going on here? Will the number of unconfirmed transactions die down over time? Will it increase uncontrollably? Will this ever out-scale the number of miners on the network?

Or am I completely missing something here?

Yes, you are correct.
In mempool = Unconfirmed.
Blockchain = Confirmed.

A transaction with 1 input and 1 output is approximately 192 Bytes.
Using 20 Sat/Byte will result in 0.0000384 BTC in transaction fees. However in real-life, most transactions have more than 1 input and 1 output. So on average the fees are much higher.

If you take a look at Johoe's Mempool Statistics, you can tell that about 1/4 of the transactions in the mempool are sent with 50Sat/Byte or lower. These transactions will probably be stucked for a long time, or dropped gradually when they reach their mempool expiry time(default 2 weeks for Bitcoin Core v0.14.0 and later).

  Will this ever out-scale the number of miners on the network?

Not in the sense that the network will go down, the target solve-time of a block is 10 minutes. It doesn't matter if there are 10k miners or 10 million miners, the mining difficulty will over-time be adjusted so that the average block time approximate to 10 minutes given the total hash rate of the network.

At this rate, where there are more incoming transactions than what the network can process. The network will be more and more congested and eventually a lot of nodes mempool's will be saturated(if they have set a max cap), and new transactions will be rejected.


How does a wallet rebuild itself from its seed? How does it identify the addresses and transactions on the blockchain in order to rebuild the history of that wallet?

If by seed you are referring to a mnemonic phrase (12 or 24 words is common) then the process goes something like this:

The phrase is hashed (or some other process) to produce random or pseudorandom bytes we will call the "seed"
The byte array seed is passed into BIP32 HD master key algorithm to create a BIP32 master key.
Following a standard like BIP44, the wallet then derives sub-keys sequentially in order. Checking for transaction history of each key's output.
If left alone, this loop would last forever, so standards like BIP44 specify a "gap limit" which means that if gap limit = 20, then "If I generate 20 addresses in a row that all have 0 transactions in their history, I will stop checking addresses" For receiving paths, 20 seems common, for change paths 1 is standard.

Continue this loop until the gap limit is reached.

This type of methodology doesn't work for merchants or large exchanges, so the gap limit logic of "how far do we keep checking" may vary.

But most HD wallets rebuild themselves in this way.


Transfer BTCs without fees I currently have BTC 0.38 in a wallet on a computer and I want to transfer all those Bitcoins on another machine.

As I have the Bitcoins on a relatively new address (it has received 1 payment and also some Bitcoins through the move API call), it wouldn't let me transfer the Bitcoins without paying a fee.

I don't want to pay this fee, as it is pretty high for what I'm trying to transfer.

Do I just have to wait some time before spending them again to be able to do so without this fee? Or should I do something else?

The fact that you need to pay a transaction or not is determined by the priority of a transaction.

Currently the priority of a transaction is calculated with this formula.

priority = sum(input_value_in_base_units * input_age)/size_in_bytes

The minimum transaction priority for free transactions is actually 57,600,000.

Because you have all the coins in the same transaction output and I guess you will send them to one unique address the transaction size will be about 250 bytes. You have:

min_free_input_age = (min_priority_for_free_tx * size_in_bytes)/input_value_in_base_units
min_free_input_age = (57600000 * 250) / 38000000
min_free_input_age = ~378

So you have to wait 378 blocks (~3 days) before you can spend your coins without TX fee.
But note that once sent it will probably take 2 or 3 days more before the transaction will be added in a block.

Please correct me if there is a calculation error.


why does Indian Bitcoin exchanges offer huge spreads( Bid and Ask)? Why does Indian bitcoin exchnages are offering huge spread and why not international exchanges(ex:bitstamp,btc-e)

Both Bitstamp and BTC-e are international exchanges that focus on worldwide customers.  Because of that, the market is much larger and more liquid and the spreads are more narrow.  However, none of these exchanges will convert rupee (INR) or provide local deposits and withdrawals.

The local bitcoin exchanges do significantly less volume, so they have to charge a bit more. In addition, they provide services such as bid/ask in INR and integration with local Indian banks.

As more competition comes to the local exchange market, spreads will likely narrow, but still not match a Bitstamp or btc-e.


How Does the SPV merkle path form of multiple transactions in Merkle block looks like? While I'm studying about the Bitcoin, I've wondered how many merkle paths should be contained in merkle block.
From the point of view of Merkle path, it is generated as the form of containing hashes of counterpart stepping up from bottom to top.
For example, if I have 4 transactions(let me use tx1, tx2, tx3, and tx4) in a block, then the hashes of them(h1, h2, h3, and h4) will be located at the bottom as the leaves. The parents of them will be (h12 and h34), after all, the merkle roots will be (h1234). So, if a SPV node want to verify that the tx2 is in the block, the full node can offer h1, h34 as a merkle path (as well as block header), so that they can prove as the step of hashing will lead them to the merkle roots which is contained in block header.
However, If I requests to verify multiple transactions in a block (e.g. using Bloom filter), then what would be contained into the merkle block (which contains merkle path and block header)?
Does they have multiple merkle paths for each transactions which are interested in, so that the transactions can be verified respectively? or adapted merkle path to be included which encompass all transactions related? (e.g. if we want to verify tx1, tx3 then generating h2, h3; though this exmample seems not to be guaranteed to show the order of transactions)

bip37 has fallen out of use, and isn't a default option in Bitcoin Core anymore, so therefor filtered blocks aren't really a consideration for new designs. You could conceivably have a format for describing multiple transactions and their intersecting (or not) paths within a block, but this was never supported by the Bitcoin p2p protocol.


Altcoin Wallet Warning: Virus Alert Coinstealer in it! Why? I have compiled this Altcoin completetly from Source:

https://github.com/globaltoken/globaltoken

After i got a Compiled .exe File I uploaded it to Virustotal.
The Result was nothing, Clean Wallet :)

Some days later i checked again the same file and got this:

Why does it shows Coinstealer now?
The Source Code is based on Bitcoin and is visible on Github, where should this Files be in Source what are infected an includes "Coinstealer"?

Thanks in advance.

its sounds like a false positive,the same was happened on Bitcoin core https://bitcointalk.org/index.php?topic=1694796.0 to be sure you have to options 1 check their source for backdor etc,2 or raise an issue on GitHub


Bitcoin transaction fees and how to handle it Lets say I set a very low transaction fee for a bitcoin transaction(from one of my own wallets to another). I also have mining equipment which is mining for bitcoins. Is there anyway to get that transaction request directed towards me ? In other words can I process my own transactions by giving it priority?
If so how do I do this?

Yes, you can. This is the exact purpose of the RPC command prioritisetransaction.


Dogecoin daemon (dogecoind) returning "Method not found" error I am trying to play with dogecoin deamon useing node-dogecoin library.

Unfortunately most calls I try return "Method not found" error

for example :

 dogecoin
.auth('MyUserName', 'mypassword')
.getNewAddress()

The only method I've managed to run successfully so far is :

.getmininginfo();

which makes me feel that deamon is working.

what could be the problem?

thanks.

Edit : debug.log file.

2015-02-16 05:47:57 GetNextWorkRequired() : RETARGET; target: 60, actual: 150, modulated: 71, before: 1b3b3a63, after: 1b461628
2015-02-16 05:47:57 UpdateTip: new best=7db9ae84010185d708f5f1236dd5102b5b4c904bb1099c388485721d2e5b449e  height=194311  log2_work=59.309095  tx=9406440  date=2014-04-24 07:24:42 progress=0.292254
2015-02-16 05:47:57 ProcessBlock: ACCEPTED
2015-02-16 05:47:57 ProcessBlock: ORPHAN BLOCK 152, prev=793c3f50e6725b056963fae977131f16b15b0d1b7e1c9c550fe8cec9a092f126
2015-02-16 05:47:57 ProcessBlock: ORPHAN BLOCK 153, prev=d54393112610200c1d47fb7ced2f9eb8d33f241fec209dfb2cc4502b462b5cb3
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 154, prev=3a2c422d3996c80bceef7e0a6901178ddf84d00c97d08990be63b4028e99abf7
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 155, prev=2dbaee58af92c0c92ea500bf88992c02ddddfb5ca7e3c2a1416b27c4f1b9cb9d
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 156, prev=9058c7d4c4439c074ffb58213a169ed524c142877230cb1823a637c468aec544
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 157, prev=012a8d8caa54c4115d05433390c060af3ed9d35f4761487bdf94a47aada02335
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 158, prev=0840f526c0828e6fe1dc9513dfd34acbf3bae8e8bbef719807d7f50180bf3c80
2015-02-16 05:47:58 ProcessBlock: ORPHAN BLOCK 159, prev=4b2ae3b0e5d79b8eb01146128ce98f608d42c450dca75aebe47d8ea072e144ff
2015-02-16 05:47:59 GetNextWorkRequired() : RETARGET; target: 60, actual: 29, modulated: 57, before: 1b461628, after: 1b42950c
2015-02-16 05:47:59 UpdateTip: new best=67981a7bdbbf610ce6bc35ac7065aadbb02c66bbfdb811a133692bc44731aec4  height=194312  log2_work=59.309103  tx=9406445  date=2014-04-24 07:24:56 progress=0.292254
2015-02-16 05:47:59 ProcessBlock: ACCEPTED
2015-02-16 05:47:59 ProcessBlock: ORPHAN BLOCK 160, prev=3872f8f2114d76d82fce03f96a9183f2e623627f0395b0166ecacd4bd604bc47
2015-02-16 05:47:59 ProcessBlock: ORPHAN BLOCK 161, prev=92f508ebcd8f8c5495d14cfbde46a82a6fd40ba00278b8f6d9547df1fb478e99

w.

In case anybody has similar problem in the future. It seems that my dogecoind build was somehow incomplete. node-dogecoin was trying to call methods that were not available for some reasons. Building from scratch again solved the problem.

As for the log, it seems that it grows at the beginning but stabilize after a while.


How are past transactions validated (when there have been softforks)? Let's say I run a bitcoin client for the first time. It downloads a copy of the blockchain from the very beginning and starts validating all the transactions included in all the blocks.

Since there have been some softforks during Bitcoin's timelife, how does the client know which validation rules needs to apply to validate each transaction?

Even if there are some checkpoints so that there is no need to validate the whole blockchain, how does the client handle different rules for different transactions?

Are there different sets of rules included in the source code, together with block heights indicating when they should be used?

Four methods have been used to decide whether a softfork should apply:

The softfork applies to all blocks, past and future.
Example: The softfork to remove the integer overflow bug.
The softfork applies to all blocks with a timestamp after a flag day.
Example: The initial form of BIP30 was applied to all blocks with a timestamp later than 1331769600. (March 15, 2012, 00:00 UTC)
The softfork applies to all blocks except some grandfathered-in blocks.
Example: The current form of BIP30 is applied to all blocks, except two that violate it.
The softfork applies to all blocks created after a successful miner vote. A Bitcoin client can determine if a softfork applies purely by looking at the blockchain.
Example: BIP34, which required block height to be placed in the coinbase in all new blocks.


Trying to understand the mempool and how transactions are picked I am very new to blockchain and try to understand it completely. What I think I understood is,
that every transaction is going to the mempool first and these transactions are getting picked by miners. With a bunch of transactions and the previous block hash a new hash needs to be calculated. And as soon as the desired hash is calculated a new block is mined.
What I dont understand:

Is one transaction only picked by one miner or is it possible, that more miners can pick the same transaction?
If only one miner can pick a transaction, what happens if this miner has weak hardware?
If more miners can pick a transaction, what happens to the other miners(that couldnt calculate the hash first).

I googled a lot and couldnt find an answer to this questions.
Hope this question meets the criteria and you guys can help me :).
Thanks in advance.

Solo Miners

Is one transaction only picked by one miner or is it possible, that more miners can pick the same transaction?

Each miner is free to pick whichever transactions they want. They have no knowledge of what other miners are working on. Miners might pick different transactions, some the same and some different or all the same. There is no explicit coordination.
Only when the rate of new transactions is low, it is likely that each miner will have the same set, or nearly the same set, of transactions to work with.

If only one miner can pick a transaction, [...]

Not applicable.

If more miners can pick a transaction, what happens to the other miners(that couldnt calculate the hash first).

When they see another miner has produced a new block, the others stop their work and start on the next block based on the new block produced by the other miner. They first remove from their mempool any transactions included in the other miner's new block.

Mining Pools
Things are a little more complicated for mining pools. Members of a pool coordinate their work cooperatively. But you can think of each separate pool as a separate miner and the above applies.
Stratum v1: Pools and solo miners are the only entities that are constructing block templates. Regular miners cannot because they don’t have the transaction sets to build the blocks.
Stratum v2: Every miner (who has it implemented in their firmware & a pool that supports it) will have the option to prioritize transactions however they want without impacting the other miners in the pool.

Further reading

Slides about basics of Bitcoin Mining by Daniela Brozzoni
What exactly is Mining?
What are bitcoin miners really solving?


Am I seriously going to have to keep this clunky old infernal machine running for weeks upon weeks to sync the blockchain? Yesterday, I dug up my old computer, set it up physically, installed Linux Mint with full disk encryption, installed Bitcoin Core through its software manager, started it, immediately selected "pruned mode" in the settings (kept it at default 2 GB since I have no idea if it's good or bad to increase/decrease it), closed it and started it again, to let it sync from scratch to 100%...
When I went to bed, it seemed awfully unresponsive, with mouse movements taking several seconds before they showed up on the screen. When I woke up, and looked at the progress, it was still at 21%, with "10 weeks left". It now would not at all react to any attempts to close it or click on anything. I had to "hard-cut" the power to the machine and restart it. It's been running in the same sluggish, unresponsive state, still stuck at 27.x%, since.
Today, after desperately reading online for a solution, I changed the default "dbcache" to 6000 MB as somebody online said was the maximum where it matters. Seems to have no difference.
It's connected directly to 100/100 Mb/s fiber, and the hardware is 3 GB RAM and a 2011-era Intel CPU of 3 GHz or so. Dual core something. The HDD is 250 GB and mechanical. (Which is why it was not a choice to store the entire blockchain and I had to use pruned mode right away.)
It's a noisy, clunky machine which takes up a lot of space, and I really need to set up this wallet. It's important. This whole process is really dragging on and on and I did not expect this extreme slowness. I really can't express how frustrating this is. I don't get what the problem is. This isn't ancient hardware. It's just a few years old. And it's not a budget/cheap machine like a Raspberry Pi or something. Why is it going so insanely slowly?
Looking at the Linux Mint GUI tool to see system usage, it doesn't even seem to be using much of the CPU cores, but does write and read a lot on the disk... But it's always unclear (regardless of the OS) what actually is happening.
And reading online, apparently, Bitcoin Core has become much more efficient with syncing over the years! Perhaps it's offset by the increasing size of the blockchain? Either way, this is truly unbearable, and I don't know how much longer I can go on looking at that screen which seems to be forever stuck at "4 years and 13 weeks behind"...
I'd hate to have to give up and forget about it, but I have a feeling that even the "4 weeks" may increase further and that it's just going to take longer and longer. I expected it to be on overnight and perhaps most of today. Not weeks upon weeks with seemingly no progress being made after ~27%...
Oddly, even with the recent surge, this Bitcoin category on SE seems completely dead. I have no idea what people are doing, but they certainly don't seem to be looking for Bitcoin questions to answer...

It sound’s like the bottleneck is I/O on your hard drive. A couple of suggestions:

Copy the data directory from you other machine which you have already synced, this will skip you the initial sync entirely.

A lot of read/write is happening in the chainstate directory and full disk encryption probably doesn’t help. You can move the chainstate directory (around 3GB) to an SSD. If your computer doesn't have an SSD you can use an SSD thumb drive. There are instructions on how to do that here


Does the miner machine get any other type of reward except confirmation of transaction in bitcoin? Does the miner machine get any other type of reward except confirmation of transaction in bitcoin?(The answer precedes another question)

As a result of mining, miners receive income from two sources

The mining reward per block, which halves approximately every 4 years.
The transaction fees for the transactions the miner includes in the block.

Nothing else.
The miner includes as the first transaction in the block (the "coinbase" transaction) a transaction with no inputs and with outputs to one or more addresses of their choice with a total amount which is less than or equal to the sum of other included transactions fees and the current mining reward .


Can I independently verify the integrity of the network with only block headers? Section 7 of the official Bitcoin paper "Reclaiming Disk Space" explains that only block headers are needed to verify transactions. Essentially by making sure that the transaction has been buried behind enough blocks. Why is the block chain so big then? It seems like we could all just store headers and reclaim a lot of disk space. Can I independently verify the integrity of the network with only block headers?

Reclaiming disk space describes what is nowadays called pruning. After downloading the entire block chain, you can safely throw most of it away because old spent transaction outputs are never needed again. This is not yet fully supported in Bitcoin Core, but it probably will be possible in the next major release.

From the paper (my emphasis):

  Once the latest transaction in a coin is buried under enough blocks, the spent transactions before it can be discarded to save disk space

You're talking about simplified payment verification (SPV), the next section in the paper. With SPV, you use just headers and Merkle trees to verify that a transaction has a certain number of confirmations. A transaction with a high number of confirmations is probably safe, but you can't be 100% sure without downloading and verifying the entire block chain. SPV clients trust that the majority of miners are honest, which full nodes do not need to do in most cases. Today, SPV is used by many lightweight clients such as MultiBit and Bitcoin Wallet for Android.


BTC-e international wire transfer in USD from Russia I tried to make a wire transfer in USD, but the bank refused. Their reason was that the supporting documents should be provided for such transaction.
Payment details which BTC-E provides do not contain both the basis and the reason of the payment (which should be specified too). As far as I know any wire transfer to a company from a person should be supported with documents.
Has anyone made a successful wire transfer from Russia with those details?

I contacted another bank and was reassured that any wire transfer from a Russian resident to any person or company could be made without supporting documents if it is under 5000 USD or equivalent.
As for the reason of the payment it could be filled with something like "transfer of personal funds"

Edit: However, the so called currency control, which is an inner bank department, demands documents anyway. Normally it's a customer agreement which could be simply downloaded from the website and some kind of a document showing that you're an account holder.


How is the encoding of extraNonce done in the genesis block? You can see here the coinbase of the genesis block

txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));

Broken down into hex it looks like this

Size of nBits as varint

0x04

nBits themselves

0xffff001d

Satoshi's message in HEX

0x5468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73

And between the nBits and Satoshi's message we have these three bytes which should be the extraNonce

0x010445

Which correspond to the code CBigNum(4), since 4 is an integer, it's 4 bytes, if this was encoded as a varint, it's value is < 253 as such it would've taken only 1 byte, but as you see there are three bytes.
Upon asking the bitcoin developers on IRC, they told me it's because the BigNum library encodes bits differently.

I started poking around in the Bitcoin source code, specifically the Bignum wrapper, I found many overloaded constructors and operators, but ultimately failed to find how these three bytes are calculated and returned because of my little experience with C++.

However, I believe it's this function

void setulong(unsigned long n)
{
    if (!BN_set_word(this, n))
        throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed");
}

However it's still not returning these bytes. So my question is, how is the integer 4 which should still be 0x04 in hex encoded to be this sequence of bytes 0x010445(big-endian) so that I can do it in C?

Looks like you're misinterpreting the code.

CBigNum is just a class that stores numbers. CBigNum(4) simply stores the number 4, and CBigNum(SHA256(block)) would store the hash of a block as a number (after all, SHA256 gives us numbers). CBigNum does what it says: it stores a big number. As it has a function that exports the number as big endian, it's useful here, and the Bitcoin source will often use it to concatenate numbers in a data stream.

Let's take a quick look at the genesis block's script, without looking at the code. Please open the relevant wiki page: Script

04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73

Part of this can be interpreted as :

04 -> PUSH 4  bytes (FFFF001D)
01 -> PUSH 1  byte  (04)
45 -> PUSH 69 bytes (The Times 03/Jan/2009 Chancellor on brink of second bailout for banks)


Do Bitcoins mined in a pool automatically transfer to your wallet? I've installed the GUIMiner app and the Multibit app.  I am in a mining pool, and I have about 17 shares thus far. Do the Bitcoins transfer to my MultBit wallet automatically or do I need to do it manually?

Generally, no.  Usually you have to specify the address in your wallet and the threshold minimum so the pool sends your funds.

Most pools require some kind of registration; Eligius.St only requires your wallet's payment address.


Get transaction fees per transaction via gettransaction For a research project I need to analyse all transactions that happened in 2015. All I care about are volumes transacted, fees paid and a timestamp per transaction or corresponding block.

Getting this data via APIs over the net creates lots of overhead and lets me run into rate limits (I cannot just run 50 million+ queries against blockchain.info or the coinbase-API).

So I would like to get the data out of my local instance of bitcoin-core.

Unfortunately running gettransaction  fails both programatically and via the commandline, despite the fact that I'm running bitcoind with the -reindex flag enabled:

{ [Error: Invalid or non-wallet transaction id] code: -5 }

I resorted to using getrawtransaction  1 which, unfortunately, only returns the transacted volumes per output. I take the txid of inputs and query the local instance again. A tedious-error prone process, I would like to know whether there is an easier way.

So, can somebody please help me with getting gettransaction working?

If you want to get the gettransaction command running, you would need to enable the txindex via bitcoind -reindex -txindex. Note this takes a few hours.

Alternatively, you can do the following:

run bitcoin-cli getblockhash <block number>
run bitcoin-cli getblock <result from 1>

This will give you the block time and all the transactions within the block in a nice JSON format. Iterate through all the txid's via:

bitcoin-cli getrawtransaction

Unfortunately, you'll have to look up all the inputs and see how much is in them in order to calculate the transaction fee using this method.


Getting started progmatically Does anyone know of good resources to get started with working with bitcoin? Mostly involving transactions, eg: creating and storing wallets and moving coins from one wallet to another, etc. This will probably be server software like for a website. I'm new to this and would appreciate some direction. Thanks.

There is a testnet for this sort of thing so you don't lose any money playing around.
See https://en.bitcoin.it/wiki/Testnet and
http://sourceforge.net/projects/bitcoin/files/Bitcoin/testnet-in-a-box/

After that you'll have to decide what approach you want to take. Are you integrating bitcoin into a larger project, or do you want to play with the internals? You can run a live bitcoind node and interact with the network through RPC commands if you just want to integrate it as a payment method. See https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) for whats available.

This won't get you into the nitty gritty of the protocol though. For that the best place to go would be bitcoinj. https://code.google.com/p/bitcoinj/

I would also suggest looking into Armory's software if the purpose is interacting with wallets in an online environment.


How to connect to Terraminer via USB? Does anybody know how exactly to connect to Terraminer machine via USB?

First of all, did you read the manual?

http://cointerra.com/wp-content/uploads/2014/02/TerraMiner-User-Guide-1.pdf

This is a miner with a mining controller on board, specifically the beaglebone black. This allows the miner to do 'standalone mining', meaning it does not need a computer to control it, it has it's own microcontroller to connect to a pool and get the necessary information to start hashing away.

If you do want to connect the miner to a computer:

Accessing the TerraMiner via Serial Port
You can access the TerraMiner by connecting a USB cable between a computer and the TerraMiner’s
serial port and using a terminal program. The login is root and the password is cointerra.

But the manufacturer does say:

NOTE: Accessing the TerraMiner through the serial port is unsupported by
CoinTerra. The Technical Support team will not be able to answer any inquiries
regarding serial port access. Accessing the TerraMiner via the serial port and
modifying the software will invalidate the product warranty.

Edit after comment:

I do not own this machine myself, so I can't say this out of experience. But from what I can read, the miner has a Beaglebone board inside of it, as the miner controller. A beagle bone has a micro USB connection, so plugging in a USB cable into the Beaglebone would allow you to connect to it.


What benefit or incentive is there for someone to run their own ripple client or ripple server? What incentive is there for someone to run their own Ripple client/server in order to make it an actual decentralized system? With Bitcoin, you can mine to generate new bitcoins and collect transaction fees. Is there a Ripple equivalent?

There is no mining in Ripple. The incentive to run a client is to use the Ripple network. There are several incentives to running a server. The main one, as Lohoris suggested, is to support the network. This is the same reason Bitcoin nodes relay transactions.

From the wiki:

Anyone whose business relies on the network:
    Gateways
    Merchants
    Arbitragers
    Day traders
Anyone who wants to support currency choice:
    Digital rights groups
    Libertarian groups
    Individuals
Anyone who wants to support the underbanked:
    Organizations
    Individuals
Anyone who wants to provide a public service:
    Universities
    Anyone who provides hosting services for open source projects

As a high-volume merchant or arbitrager, running a node is the most efficient and reliable way to participate in the network. If nodes feel you aren't pulling your weight, they can either disconnect you or impose a proof of work requirement on you to remain connected to them. This is because legitimate high-volume queries are indistinguishable from abuse. As a fully-participating node, you can see transactions before they're voted into consensus sets.


I don't know how to export a private key from blockchain.info I am trying to make a raw transaction which requires a private key but i can't seem to find a way to get it from blockchain.info.

The exact steps can be found quite easily via Google. This GitHub page was the first result when I searched for it. Quote:

  Login to your wallet on Blockchain.info
  Goto the 'Settings' Menu on the left
  Goto the 'Addresses' Submenu under 'Settings' Menu
  On the right side find the section named 'Imported Addresses'
  Click on 'Manage Addresses'
  On the new screen find the address you want to export the private key from
  Click on the 'More Options' on far right side of that address
  Select 'Private Key' and then 'Continue'


how to cancel unconfirmed transaction in blockchain.info Ok I know this is a much asked question but I have looked at the other answers and none of them were helpful.

I sent almost $2000 in BTC from my blockchain.info wallet to a mixer that has an input address that is only valid for 24 hours.  The fee blockchain.info recommended was 0.000079 which seemed a bit low so I upped it to 0.00011 but apparently that amounts to about 57 sat/B which is way too low to get confirmed in a timely manner.

If it takes more than 24 hours to get confirmed then I assume I've lost $2000.

There doesn't seem to be any facility in blockchain.info to kill an unconfirmed transaction.

Am I totally screwed?  I have an electrum wallet, is there any way I can import my blockchain.info wallet without the unconfirmed transaction?  i.e. Get my original balance back.  Is there anything I can do?

I know similar questions have been asked but I couldn't find any answer that applies, or maybe there isn't one.  My HUGE mistake was placing any trust at all in the blockchain.info wallet recommended fee.  Yeah I'm a newbie idiot but wow this has been an expensive lesson.

UPDATE

I have contacted the mixer and much to my relief they say the receiving address will be valid for a week for unconfirmed transactions.  So my question becomes what happens with a blockchain.info wallet, if a send remains unconfirmed for a few days?  Will the send be cancelled?  Is it likely a 0.00011 fee be enough for it to ever be confirmed?

I upped it to 0.00011 but apparently that amounts to about 57 sat/B which is way too low to get confirmed in a timely manner.

According to the 21.co fee estimator:

https://bitcoinfees.21.co/

A 57 satoshi per byte transaction should be confirmed within 35 to 600 minutes (10 hours). It should go through.


Can a mobile be protected against the "Linode problem"? The "Linode problem" I'm referring to is where an external trusted party has administrative control over your device.

Mobile phones are essentially managed devices.  They can be fully controlled by someone other than the owner of the device.

Yes, they are managed by the carrier but possibly that carrier has people that cannot be trusted or, something just as bad, has people who don't maintain secure systems themselves such as what reportedly is what happened at Linode.

The importance is this.  Consider Safaricom's M-Pesa mobile payments system used widely by those in Kenya.

An attack that defrauds M-Pesa's users en mass means that at some point Safaricom figures out that there's a problem, halts all affected systems to prevent further losses, and in the end eats some, most or all of the customer's losses.

With a mobile app like BitcoinSpinner, or My Wallet from BlockChain.info or even a hosted service like Paytunia's online wallet, the risks are quite different from M-Pesa's.  The carrier doesn't promote the Bitcoin app nor offer any guarantees.  A similar attack through the managed services of the mobile carrier's network to steal bitcoins from mobiles would cause the finanical losses to afflict the individual mobile user alone.

Just like how Linode disavowed any responsibility to Slush, Bitcoinica, etc. for the tens of thousands of bitcoins lost, carriers such as AT&T, Vodafone and Safaricom would likely maintain the same type of position.

So, this is a fundamental question -- is the practice of storing bitcoin private keys on the mobile something that exposes it to so much risk that it shouldn't even be considered (at least, not for amounts greater than the amount of cash one might carry in a back pocket?)

Or are there ways to secure a mobile device so that even if some piece of malware is deployed by a carrier's rogue employee that the bitcoins would still be secure?

If your private key is compromised your coins are gone

So the short answer is that the "Linode problem" where your entire private key is at the mercy of a third-party capable of root access to your system is somewhat intractable. As others have stated you can limit your key's exposure, but malware is patient.

Off topic, but possibly of interest, is a project by the MultiBit team to use a HP50G scientific calculator as an item of trusted hardware capable of signing transactions. Not much use out in the field like a mobile would be, but handy for a small business reconciling small volumes of transactions.


P2SH transaction signing I'm trying to redeem a 2of2 p2sh unspent output. I have the complete multisig redeem script, a single input and a single p2pkh output.

My understanding is that I should replace the ScriptPubKey of that single input with the unhashed redeemscript, serialize the Tx with SigHashAll at the end, and sign it with each of the required public keys.

This should yield an input with a signed ScriptPub of OP_0 [Sig][Sig][RedeemScript]. However, this fails to yield a valid signature. I'm using compressed keys in the redeemscript.

Each Sig is of the form OP_PUSHDATA/Size+1[DER encode Signature]

Is there something else particular about the way the transaction needs to be serialized and signed? Should I only be using uncompressed keys?

I solved this, redeemscript wasn't prefixed with pushdata which is necessary as the whole script gets pushed.


Error connecting to RPC server Ok, so my bitcoin node (0.15.1) is running, and fully synced up with the network. I'm using python and the 'bitcoinrpc' package. I want to access the RPC server from outside my network. I have RPC set up on the normal port 8332 which is opened up on my router. I have rpcallowip configured to the address of the computer I'm connecting from.

When I run my python program I get the following error, which I am having a hard time tracking down. (my program is called 'PollForAddress.py')

  File "PollForAddress.py", line 46, in <module>
    mempool = nodeRPC.getrawmempool()
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 139, in __call__
    response = self._get_response()
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 187, in _get_response
    'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)})
bitcoinrpc.authproxy.JSONRPCException: -342: non-JSON HTTP response with '403 Forbidden' from server

any ideas whats going wrong?

it looks like the server rejected the connection from  client, try use this rpcallowip instead and see if it helps.

rpcallowip=0.0.0.0/0

Above decrease the rpc security but will allow all connection reguardless their ip address


How to understand Bitcoin source code I am not a C++ pro. I read C++ as a part of my undergrad school course. I am very passionate about the future currency i.e. Bitcoin.

But I don't understand the source code structure. How to read the source code? As I already told I am have very basic knowledge of C++.

However, I can google on the way if don't understand something(functions, libraries, headers).

The actual problem I am facing is inside src/ directory. I don't understand the flow of files and directories in src/. Which is the first file that I should probably start reading. Can any one explain me all of flow of all the project in some sort of tree like structure?

~/GitHub/bitcoin/src
❯ ls                                                                   ✔ master
Makefile.am     coincontrol.h       miner.h         script
Makefile.bench.include  coins.cpp       net.cpp         secp256k1
Makefile.qt.include coins.h         net.h           serialize.h
Makefile.qttest.include compat          netbase.cpp     streams.h
Makefile.test.include   compat.h        netbase.h       support
addrman.cpp     compressor.cpp      noui.cpp        sync.cpp
addrman.h       compressor.h        noui.h          sync.h
alert.cpp       config          obj         test
alert.h         consensus       obj-test        threadsafety.h
amount.cpp      core_io.h       policy          timedata.cpp
amount.h        core_memusage.h     pow.cpp         timedata.h
arith_uint256.cpp   core_read.cpp       pow.h           tinyformat.h
arith_uint256.h     core_write.cpp      prevector.h     torcontrol.cpp
base58.cpp      crypto          primitives      torcontrol.h
base58.h        dbwrapper.cpp       protocol.cpp        txdb.cpp
bench           dbwrapper.h     protocol.h      txdb.h
bitcoin-cli-res.rc  hash.cpp        pubkey.cpp      txmempool.cpp
bitcoin-cli.cpp     hash.h          pubkey.h        txmempool.h
bitcoin-tx-res.rc   httprpc.cpp     qt          ui_interface.h
bitcoin-tx.cpp      httprpc.h       random.cpp      uint256.cpp
bitcoind-res.rc     httpserver.cpp      random.h        uint256.h
bitcoind.cpp        httpserver.h        rest.cpp        undo.h
bloom.cpp       init.cpp        reverselock.h       univalue
bloom.h         init.h          rpcblockchain.cpp   util.cpp
chain.cpp       key.cpp         rpcclient.cpp       util.h
chain.h         key.h           rpcclient.h     utilmoneystr.cpp
chainparams.cpp     keystore.cpp        rpcmining.cpp       utilmoneystr.h
chainparams.h       keystore.h      rpcmisc.cpp     utilstrencodings.cpp
chainparamsbase.cpp leveldb         rpcnet.cpp      utilstrencodings.h
chainparamsbase.h   limitedmap.h        rpcprotocol.cpp     utiltime.cpp
chainparamsseeds.h  main.cpp        rpcprotocol.h       utiltime.h
checkpoints.cpp     main.h          rpcrawtransaction.cpp   validationinterface.cpp
checkpoints.h       memusage.h      rpcserver.cpp       validationinterface.h
checkqueue.h        merkleblock.cpp     rpcserver.h     version.h
clientversion.cpp   merkleblock.h       scheduler.cpp       wallet
clientversion.h     miner.cpp       scheduler.h     zmq

I'm in my final year of college and I remember being in your exact situation 2 years ago. In my view you can adopt 2 strategies at this stage.

You need to understand the protocol first, and reading Satoshi's orginal paper, or any of the easier options is essential. It also helps a lot to understand the conceptual differences between bitcoin and other currencies like Ripple and Peercoin.

If your intention is to learn as much about the bitcoin implementation as possible, I would suggest you give up on bitcoin-core and shift to one of the python implementations. Now, there are a few quirks about the python implementations, but your learning would be much faster and you'd be in a much better position to understand the cpp code later.

If you want to stick to bitcoin-core, and are willing to tolerate a steep learning curve, there are still a few resources to sweeten it. You need to understand that it's not just cpp that you need to master to understand bitcoin core, but a lot of the GNU build system, the makes and the autoconfs and such stuff.

Now to help you understand the structure of the code in src, you could check this out.

Edit (7:7:2016):A lot of the new discussions in the bitcoin:core world, revolves around the CPP language itself. CPP itself undergoes considerable change every 4 years and there are many discussions around which CPP language features can be implemented/ incorporated into bitcoin-core. So it is required that you have a thorough understanding of CPP along with new language features that keep getting added, and their relations to the previous features.


How does the bitcoin transaction fee get paid to miner(s)? According to https://bitcoinfees.info/

The current "cheap" rate for a bitcoin transaction is $22.

How does this get paid to the miners? Is it just one miner that verifies the transaction, puts it into the next block, and collects the $22?

I understand proof of work. But I don't quite understand how a transaction fee gets paid out to a miner. Thanks.

The very first transaction in every block is called a coinbase transaction. This coinbase transaction is created by the miner themselves, to pay them the block reward and the fees from the transactions in that block. At the time of writing, the block reward is 12.5 BTC, and then the total of all the fees is added to that, and the coinbase transaction is created to pay themselves that total.


How do I set up GUIMiner to use my cpu? I'm using GUIMiner. It's not using my CPU. My CPU is at a very low utilization (~10%).

What I can do to use my CPU?

Why isn't CPU mining turned on by default?

CPU mining ended in 2011. You will earn less than what the electricity costs, so the more you mine the more money you lose. You will never earn the minimum amount required to cash out from a pool, so you actually won't be earning anything at all, just burning electricity.

This is why CPU mining is disabled, and why noone should use it.


How to change RPC port for bitcoind? (rpcport=xxx in bitcoin.conf doesn't work) I'm running a testnet bitcoind node and I have been doing RPC calls on the default port 18332.

I have added this line to ~/.bitcoin/bitcoin.conf:

rpcport=19832

And restarted the bitcoind service. I even restarted the whole machine.

But for some reason it is still accepting RPC calls on port 18332, and trying the same on port 19832 gives "connection refused".

It is definitely using the settings in bitcoin.conf, for example if I change rpcuser or rpcpassword (and restart again) I have to use the new user+password in RPC calls, the old ones don't work anymore.

But somehow the port does change.

Am I doing something wrong? Is the setting called something else than rpcport=xxx ?

I know I can probably also define the port manually on the cmd line (using bitcoind -rpcport=xxx or something) when starting bitcoind, but I want to have everything configured in bitcoin.conf (where it belongs) and have it all started automatically.

P.S. I am connecting on localhost, i.e. on the machine itself. I am also running the ufw firewall, and it is configured to accept connections on both 19832 as well as 18832 (so it's definitely not the firewall that's blocking things here).

(edit) FYI here's the complete bitcoin.conf file:

testnet=1
server=1
daemon=1
txindex=1
rpcuser=XXXXXXXXXXXXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
rpcport=19832
onlynet=ipv4
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

And here is how I perform RPC commands:

curl http://XXXXXXXXX:XXXXXXXXX@localhost:18332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getwalletinfo","params":[]}'

This works OK although note it connects to 18332. If I change localhost:18332 into localhost:19832 it doesn't work anymore (Connection refused).

In case my version is relevant, the result of getwalletinfo contains "walletversion": 169900.

Found the solution: rpcport needs to be in the [test] section

Please update your original config file to read:

testnet=1
server=1
daemon=1
txindex=1
rpcuser=XXXXXXXXXXXXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
onlynet=ipv4
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
[test]
rpcport=19832

And restart the daemon. Also take a look at Can't specify rpcport for testnet for related changes to other options. We were being warned what to do in the log file. ~/.bitcoin/testnet3/debug.log includes the line Warning: Config setting for -rpcport only applied on test network when in [test] section.

We could have picked this up faster had (we read the log file! And if) the example bitcoin.conf made a mention of now requiring sections.

Would be great if you could make this the ticked solution instead!


Are there alternatives to Bitcoin which take a different approach? Are there any alternative approaches to decentralized, electronic currencies?

Bitcoin was built with certain technical characteristics in mind. I'm hoping to see if there are alternative approaches. I don't mean things like Namecoin or other adaptations of the blockchain concept.

There are "digital bearer certificate" systems, which are an older concept.  They require a centralized issuer in order to prevent double-spending.  You can think of the certificates as electronic IOUs for a commodity (such as gold) held by the issuer.

Some DBC systems implement Chaumian blinding to anonymize transactions.

Open Transactions is a recent DBC system that has gained some interest.  It could be used with Bitcoin as a backing commodity, taking advantage of the properties of both systems.


Is there any academic research on the influences of Bitcoin's long term valuation? Is there any academic research or theories about what future events and metrics will most influence BTC's long term valuation relative to fiat currency?

There are some research papers out there, including about bitcoins economical viability. A wonderful (a pleasure for hours) and fairly complete list can be found on the wiki. A random chosen abstract:

  Bitcoin has emerged as a fascinating phenomenon of the ﬁnancial
  markets. Without any central authority issuing the currency, it has
  been associated with controversy ever since its popularity and public
  interest reached high levels. Here, we contribute to the discussion by
  examining potential drivers of Bitcoin prices ranging from fundamental
  to speculative and technical sources as well as a potential inﬂuence
  of the Chinese market. The evolution of the relationships is examined
  in both time and frequency domains utilizing the continuous wavelets
  framework so that we comment on development of the interconnections in
  time but we can also distinguish between short-term and long-term
  connections.

Have fun! :)