Does bitcoind generate address using the same private key from wallet.dat? When I run:

bitcoin-cli getnewaddress

My bitcoin node returns me a brand new address. If I send BTC to this address, does the payment go to my main wallet.dat wallet (address generated from old/same private key). Or does bitcoind generate a new wallet/private key?

A wallet is not a single private key; it is an ever-growing collection of private keys.  Each address has a private key stored in the wallet.  Each time a new address is generated, so is a new private key.  This is even true for HD wallets, albeit the private keys are generated and stored differently.


What's the exact formula where I can calculate my liquidation price on Bitfinex for a leveraged position? The following variables are given:

Exchange: Bitfinex

Funds: $10,000 USD
BTC Price: $1000
Use Leverage of: 2x = $20,000 USD

Say I wanted to go long Bitcoin thinking it would be above $1000 in the next 6 months. I buy 20k USD worth of BTC (20 btc) at the $1000 price.

What does the price of btc have to drop before I lose my initial investment of $10,000?
What is the formula for something like this when using Bitfinex exchange?

Old question, but I wanted to work this out myself.

The exchange will liquidate your account as soon as it becomes insolvent. There are exchange dependent parameters fees, interest and maybe a threshhold to take into account. I don't know bitfinex values for these.

Ignoring them for now, the general equation works out like:

p(t) = btcusd at time t

p(0) = 1000

leverage = m = 2

initial usd = d0 = 10000

assets(t) = d0*m/p0*p(t)

liabilities(t) = d0 - md0 = d0(1-m)

Liquidated when assets(t) + liabilities(t) = 0, i.e. when d0*m/p0*p(t) + d0*(1-m) = 0

=> p(t) = -(1-m)*p0/m

=> p(t)/p0 = (m-1)/m

For p0=1000, m=2, you liquidate when p(t) drops to 1/2 of 1000 = 500

If anyone has the exchange-dependent data for bitfinex, I'll try to incorporate into the equation.


What's an efficient model for redistribution of coins between wallets? Let's say I have 50 addresses which have an average of 0.5 BTC. Some have two or three times the average balance, while others have less than 0.1% of the average. Many times per day an address is selected to either receive or send some amount of coins, fueling the inequality.

What's an efficient, cost-effective method of rebalancing a large number of addresses such that each contains roughly the average balance?

(Assume the algorithm to select a keypair with which to transact is fixed and cannot be modified for argument sake.)

Once a day, take the addresses with balances more than some multiple (say, twice) of the average, and create a transaction that sends money to the lowest-value addresses. E.g. let's say the average is 0.5 and call the addresses A-Z:

A: 2.0 BTC
B: 1.5 BTC
C: 1.0 BTC
...[other addresses with under 1 BTC]
X: 0.1 BTC
Y: 0.05 BTC
Z: 0 BTC

Transaction would send from A, B, and C to X, Y, and Z so that each has the same amount (0.775 BTC).


Could the Ripple protocol be modified to allow funding your initial account with BTC? See How can you buy XRP with BTC if you don't have any XRP?

Currently, there's no way to open an account with direct access to XRP. Could the ripple protocol be modified to include a way to open an account with BTC instead of XRP? The BTC would be exchange to XRP in the distributed exchange using the best available exchange rate.

The problem is that you need an account to hold BTC in the Ripple network. There is no known practical way to allow Bitcoins to transact directly on another network without a central authority to hold the keys that release the Bitcoins on the Bitcoin blockchain.

Hopefully, this should only be an issue for a short period of time. Once billions of XRP have been given away, there shouldn't be any significant difficulty in getting enough XRP to open an account.

Update: The gateway protocol could be used to do this, allowing you to do your initial account funding right from a Bitcoin account.


what are "transaction fees" used for? if I set a transaction fee from multibit for example, is it a fee I'm paying or is it a fee that the other party is paying; and to whom does that fee go to?

The fee goes to the miners and is deducted from your wallet.  Including a fee in your transaction improves the chance that your transaction will quickly be included in a block.


What part that control coin's total supply and give initial coins to specific wallet? As title,

Max coins supply.

From github's bitcoin source, where is line or function that define coin's total supply? Like bitcoin's case, 21,000,000.
I found that amount.h  file has above number, so then revise this number only and all done? What is maximum number this can be? int's max value, 2,100,000,000?

Give initial coin.
How to give initial coin to developer, marketing team member? And to pre-sale ICO customers? Where is that code?

You will probably not find the number 21,000,000 in the source code. The reason is that there are not really 21,000,000 BTC. It's a bit less. You need to sum up the block rewards. It's 210,000 * 50 + 210,000 * 25 + 210,000 * 12.5 ... < 21,000,000


What prevents one from replaying a BCC transaction by nulling the SIGHASH_FORKID bit? BCC transactions are "replay-protected" by the SIGHASH_FORKID 0x40.
However why can't I take one such transaction, flip off the 0x40 bit and here's a valid transaction on the BTC chain?

I guess that bit enters into the signature somewhere, but where?

First of all the sighashType field with (or without) any bit fields is used in source data while for signing. The signature does not sign itself, but it signs sighashType. So, changing sighashType invalidates signature.

Second, the data for signature is created in different manner.


How to read an exchange order book? I am new to trading. On the left side is the order book and on the right, the trade history.

I can see that the order book keeps updating. The number in the market size column increases and decreases, but I don't see any update in the trade history. May I know why? Does the trade history only reflect part of all trades?

Irrespective of bullish or bearish outlook, there are two attitudes a trader can have in the market: active or passive.

Limit orders and stop orders are "passive" trades because they don't move market price. These types of orders are offers to buy or sell bitcoin at a certain price. Passive orders are placed in the exchange order book and remain waiting there until cancelled (by the trader) or consumed by another trader.

Market orders are "active" trades because they consume limit and stop orders in the order book. A market order is executed immediately and moves market price ("last" price) to the level of the last order it consumes. Market orders are not shown in the passive order book, instead they are shown in the trade history column to indicate market activity

Example

Three traders: A, B and C. Market price is at $1,200.

A wants to sell 1 BTC at $1,201 and places a limit sell order in the order book and waits.

B wants to sell 0.5 BTC at $1,202 and also places a limit sell order and waits.

C wants to buy 1.4 BTC as soon as possible at any price near market price. Because C doesn't want to wait, C executes a market order for 1.4 BTC. It consumes A's order for 1 BTC and consumes 0.4 BTC of B's order at $1,202.

After execution of C's buy market order:

last price moves to $1,202
C has bought 1.4 BTC
A has sold 1 BTC
B has sold 0.4 BTC

C's market order for 1.4 BTC is entered in the trade history as the latest buy.

A's order is removed from the order book since it has been "filled".

The remaining (unconsumed) 0.1 BTC of B's "partially filled" limit sell order remains in the order book until another buyer consumes it, or until B cancels the order.

Summary

Traders who intend to buy or sell at specific price levels place their offers to buy/sell in the order book as passive orders. Active buyers and sellers consume passive orders via immediate market orders. Market orders move price and are entered in the exchange's trade history.

"Market size" is the total of all passive orders waiting in the order book. As traders place and cancel passive orders, market size changes.

"Trade volume" is the total of all active trades (market orders as reflected in the trade history) for a particular period of time.


Does anyone know which country has the most bitcoins? I was wondering if there is any stats out there that tell you how many bitcoins a country is holding. I want to make a presentation so i can persuade people to buy bitcoins, but i want to make sure they are really informed. Anything will help that is statistical related.

Finding out which country has the most Bitcoin's is not something that you can easily calculate it is very difficult as it involves geolocating the IP addresses. But with the way they get transferred it could be very different the next day. Also a lot of Bitcoin users are concerned about privacy and security and it may be difficult to acquire the actual geolocation data.

On the other hand.I can give you the numbers for Top five countries for Bitcoin downloads as of Today
1.US (1,207,661)
2.China (505,904)
3.Germany (270,043)
4.UK (236,523)
5.Russia (226,680)

Hope this helps


Namecoin - How to Find Block Height via Block Hash? Is it possible to use namecoind to determine the block number from a block hash?
Going from height to hash is easy:

namecoind getblockhash

But going from hash to height appears to be impossible...

Height is not an attribute on each block and no method appears to return it.

The closest two are:

namecoind help getblockcount
"Returns the number of blocks in the longest block chain."

namecoind help getblocknumber
"Returns the block number of the latest block in the longest block chain."

This is close, but I don't want the single, largest height value, I'm looking for a way to look up any block's height via its hash.

So there are two methods which do the same thing (return greatest height) and no methods that take a block's hash and return that block's height.  Block height is also not a block attribute.

Is there something I'm missing here?  Other coins do not appear to lack this basic functionality.

At the time of asking, this functionality wasn't supported in Namecoin. I've written a patch that adds this and a few other properties to Namecoin's getblock RPC call.

https://github.com/namecoin/namecoin/issues/87
https://gist.github.com/ryancdotorg/5e610e9ee546beed367d


Why future Bitcoin Core release shouldn't be in python? Python offers various advantages including simplified rules of coding and ease of readability. It offers OOP, cross platform compatibility and has numerous libraries that have been added over time. It can be understood why the original Bitcoin Core client was in C++ as python was not that popular as it is now.

Apart, from having to tear down the entire code, and re-write it in python and check for vulnerabilities, why aren't the core bitcoin developers thinking of migrating the entire reference client implementation language to python?

Apart, from having to tear down the entire code, and re-write it in python and check for vulnerabilities,

This is what is known as a self-answering question. The obstacles you list are not trivial.

There is a considerable cost, a great deal of effort that could instead be spent on functional improvements to existing code.

There is also the matter of losing core developers who are skilled in C++ but may not care to use Python

Also if you are going to switch languages, it would be sensible to evaluate a much larger range. You advocate Python, I like Go, others may push for Rust, Haskell, Java, C# or any of a huge number of other possibilities.

This isn't a can of worms anyone would open lightly.


Getting Started With Script I would like to manually write a few locking and unlocking scripts to get a deeper feel for that part of the network.  What is the simplest step-by-step set of instructions to set up everything needed to use Script in Windows, on regtest or some other testnet?  Is it possible to do this in Bitcoin-qt, or is working in the command-line a necessity?

You might want to check out btcdeb from kallewoof. It's a set of tools used to construct or debug bitcoin script.


Help with very old wallet.dat file and keys, next steps? recently I found a very old wallet.dat file back from 2011 (I did some mining back then). I was able to run pywallet to export the keys into JSON file, this file includes private keys and all, so i assume it was not encrypted. The structure is as follows, there are bunch of these.

    {
        "addr": "",
        "compressed": false,
        "hexsec": "",
        "private": "",
        "pubkey": "",
        "reserve": 1,
        "sec": "",
        "secret": ""
    },

The question is - what do I do with this now? I want to check if there any coins that I have mined but i have no idea what the next step is.

I have tried copying the value of "private" into Bitcoin Core's console with "importprivkey" but i get "Invalid private key encoding (code -5)"

Thanks for your help!

You don't need to import the keys to see if they have a balance or not. Just copy the content of "addr" and use a Bitcoin blockchain explorer such as https://blockchain.info/ to check if there is any BTC on the address.

And i guess you could just import the wallet.dat on Bitcoin Core directly if there is any BTC on any of your addresses.


Full node of bitcoin I would like to have Bitcoin Core running as a full node. I thought it is like plus 100 GB. But on the web site it says it is no more than 20 GB. When I run Bitcoin-Qt is it enough to run full node or do I add any parameters before I start the program ?

You may run bitcoin-qt the very first time just executing bitcoin-qt.exe (I assume you are windows user) and make changes later

Yes, there are some useful options. For example, I do not like that this program creates database on my disk [C:] under the \users\user...\folder

I like to keep my bitcoin database in D:\bitcoin

So, I have created file bitcoin.bat with the following contents:

start bitcoin-qt.exe -datadir=d:\bitcoin

There are other options, but I think that you will find them yourself later. Default options are quite good.


Is there an API that supports different Bitcoin wallets? Is there an API that has sending and receiving functionality of different Bitcoin wallets such as Coinbase, Bitcoin wallet, etc...

Or would I have to manually incorporate each wallet API myself?

I found out about Coinkite after I posted this. I send an email to their support team asking:

"With this platform, will I be able to have a user link their wallet and be able so send bitcoins to another users wallet, regardless of what wallet they use?"

I got a response of "Yes" and they sent me a link to their docs


.csv file of every block timestamp in btc history i am looking for a .csv file of every block timestamp in bitcoin history with the block height. i can get one day at a time from bitcoin.info but i dont fancy manually copying and pasting over 3000 days worth and cleaning that data up. Does anyone know an efficient way to obtain this? i'll even settle for the daily block count, as long as its back to the genesis block and in .csv format.

You can use https://blockchair.com/bitcoin/blocks.
It is limited to 1 million cells for free, but as you only need "Time" and "Height", just:

deselect all checkboxes but "Height", and click on "Export" selecting then "csv". Open this file with your spreadsheet app.
deselect "Height" and select only "Time". Export.
Open the file from (2), copy the column, and paste it next to the first column in file from (1).
as the results are both ordered by time, rows coincide and you already have the desired data!


What sources of information are there available to follow news about Bitcoin? What sources of information are there where you can follow possible changes, announcements of forks, protocol updates etc...

Since Bitcoin is decentralized, everybody claiming to be an authority is highly suspect. One early site is still going strong in providing independent practical (pro-Bitcoin) information:

https://www.bitcoin.org

Make sure to stay away .com variant!


What is the smallest sensible transaction? While the smallest fraction of bitcoins currently implemented is the Satoshi (10-8 BTC or 10 nBTC (nano-bitcoins)), due to transaction fees there seems to be a minimum amount of BTC to be spent that is larger than one Satoshi. What is currently the smallest amount of BTC one can spend at comparably little to no fees. i.e. what is currently the smallest sensible unit of microtransactions?

I personally think that the most smallest and sensible transaction is at least 0.0001

HOWEVER NOTE: If you want a confirmation in 10 or 20 minutes, you will need to post a minimum transfer fee of 0.0001

So technically If you want to transfer 0.0001 to a account you will need at least 0.0002

If you want to transfer a bigger amount, the transaction fee will not need to be changed
e.g. If you want to transfer X amount to a account you will need at least X amount + 0.0001

I have tried to transfer 0.00005593 with no transaction fee, and there is still no confirmations: https://blockchain.info/tx/15ee5484920eed92457643a1709629d8ff579b15fc805b0060a9cf0efdcbb8ed

Transfer More faster = Pay a Higher transfer fee

Just to note: transfer fee same as Miners Fee same as transaction fee


If lightning network transactions are "off chain", can we still see the transaction history then? If the lightning network is a off chain system. Are the transactions private or public? And does that mean once you send bitcoin to a lightning network address, it can possible get hidden in a payment channel? Or is that not possible?

Are the transactions private or public?

Mostly private. If you are not involved in a transaction (i.e. not a sender, receiver, or intermediary), you really won't know anything about the transaction. Transactions occur off chain so there is no permanent record of a transaction happening. All that outside observers will see are the channel opening and closing transactions.

  it can possible get hidden in a payment channel?

Yes, you can have a payment channel which no one else knows about, at least until it closes.. These could even exist today and it would not be obvious until the channel closes. And if a channel is closed cooperatively, it will look just like any other 2-of-2 multisig transaction. So even then it is not clear whether a transaction is a closing transaction for a payment channel.


Bech32-P2WSH BIP32 derivation path I know that the deriving path for Bech32 is 84, but what about P2WSH addresses path is it the same?

I've been reading https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki but nothing on there.

For example, I'm using path 84 to derive P2WSH addresses, but electrum uses that path to derive P2WPKH addresses. I would like to know the correct path that I should use, so my mnemonic phrase becomes compatible with other platforms. Something like 44 and 49 paths.

P2WSH addresses have no deriving path since a P2WSH output does not send to a public key and P2WSH encodes a script, not a single public key.

Thanks to @Pieter Wuille for clearing up things.


How do I calculate mining profit from shares in Litecoin? I'm getting around 4 shares a minute (mining at 100Mh/s but I don't mind that much because the number of shares is what actually matters, right?) and since LTC/USD is 2 and it pays 50 LTC for every block reward, it should pay 100USD for every 713 shares (diff as I type) so I should be getting like $100 every 3 hours (which is pretty good indication my math is wrong) and that's because diff is just so low!

When I do this math for BTC it works just right. Aren't the mechanisms supposed to be very similar?

It should pay 100USD for every 713 shares (diff as I type).

That refers to shares of a certain difficulty: diff 1 Litecoin shares or diff 65,536 shares according to some mining clients (notably CGMiner).

Each found share has its difficulty. If the share's difficulty is equal to or higher than the worker's difficulty, it gets submitted by the worker and accepted by the pool.

At 713 difficulty, it will take on average 713 * 65,536 = 46,727,168 diff 1 shares to find a block. Likewise, it would take 713 * 65,536 / D diff D shares.

Note that, if you submit a diff 256 share at 128 worker difficulty, you get paid for a diff 128 share. So, assuming your worker difficulty is constant (LTC pools tend to use variable difficulty), your expected payout would be numbers of shares * worker difficulty * 50 / difficulty LTC, where both worker difficulty and difficulty should use the same metric (just use the values the mining client reports).

  Aren't the mechanisms supposed to be very similar?

For Bitcoin mining, a diff 1 share (lowest possible worker difficulty) is found for every 232 hashes that are calculated. Since Litecoin's scrypt algorithm is about 1000 times slower than SHA256, mining Litecoins would have a very high variance if the same metric of worker difficulty was being used.

Therefore, pools and mining clients implemented shares with worker difficulty lower than 1, e.g., diff 2-10.

In order to avoid dealing with fractional difficulties (I assume), mining clients labelled diff 2-16 shares diff 1 shares, so actual diff 1 Litecoin shares become diff 65,536 shares.

  Litecoin difficulty is very low!

Since computing hashes is 1,000 times slower for Litecoin mining, a difficulty of 713 for Litecoin mining is more or less equivalent to a difficulty of 713,000 for Bitcoin mining.


Payment for Orphan blocks I know that miners don't get paid for orphan blocks. But what do they not get paid , transaction fees or block reward or both ?

They are paid nothing. An orphan block is wasted time and energy. A miner must put some effort into maintaining good connectivity to all the other nodes to avoid wasting money.


Can a multi-sig address also be a vanity address? If so, do the three separate parties have to agree on the character sequence?

Yes, that's possible.

In fact, the party that creates the address is the only one who needs to agree on the character sequence.

Suppose you have an address that can be spent with 2-of-3 multisig. This is a pay-to-script-hash address (starting with 3 instead of 1). Your script would probably look something like this:

2 <pubkey A> <pubkey B> <pubkey C> 3 OP_CHECKMULTISIG

This works, but this script's hash (with overwhelming probability) will be rather boring.

Suppose party A wants a more interesting address. She knows her private key k_A, and her public key Q_A, as well as everyone else's public key. All she has to do run the following algorithm:

while not interesting(address):
    Q = Q + G
    k = k + 1
    address = hash160('2 <Q> <pubkey B> <pubkey C> 3 OP_CHECKMULTISIG')

At which point her public key is Q, and her private key is k. G is the generator point for the secp256k1 curve. Then Alice reveals this script to Bob and Charlie, who verify that the script contains their public keys and that it hashes to the expected address.

Bob and Charlie cannot distinguish between an address generated in this special way, and Alice getting lucky on the first try in her choice of private key.

vanitygen already implements something like this for 1-of-1 signatures when you tell it to generate address starting with 3.


Can a malicious majority miner rewrite history? Is it the case that a malicious miner with the majority of hash power (say, 99%) can perform a double-spending attack by rewriting history?

If so, I can't understand how. If not, under what circumstances is double-spending possible at all?

Consider the following simple assumptions:

A malicious miner M controls 99% of hash power
M does not control much "relay power" (e.g. it only operates a single node in the network)
The current legit blockchain (before the attack) is forkless, and consists of block B0,B1,...,B10, and 100% of the nodes in the network agree on that.
The attacker wants to void blocks B6-B10
The attacker mined alternative blocks B6' (on top of B5), B7', ..., B11'.

How can the attacker carry out the attack?

If he publishes B6' first, wouldn't all nodes reject it for being built on top of a block other than the last, thus preventing the attack?

If he publishes B11' first, wouldn't all nodes reject it for being built on top of an unknown block (not seeing B10' yet), thus preventing the attack?

Let's assume for a minute that your theory is true, and that actual nodes on the network would not accept this new, valid, and longer block chain.

That on itself would be a bug. Maybe it isn't obvious for a 5-block reorganization, but if it was a 2-block deep one (which actually occurs in practice), your argument would be equally true. If there was no means to accept a 2-block deep reorganization, nodes would be stuck in their shorter chain. This is actually exploitable too: someone may intentionally try to get you in such a state, as you will not see new payments on the chain that might conflict with a payment the attacker is trying to send you.

This is true for any depth of reorganization. If we don't accept 12-block deep reorganization, the network would remain in a very sore state if there would ever be a few-hour partitioning of the network. Being able to accept the longest valid chain under every condition is absolutely required for making Bitcoin converge.

So: we need a mechanism to reorganize pretty much any depth. How it is accomplished changed in Bitcoin Core 0.10 with the introduction of headers-first synchronization.

Before 0.10, the attacker would broadcast B11' first, which the victim doesn't know about. It will do a getblocks message to request the hashes of blocks between B5 (using a block locator) and B11'. When it receives these hashes, it will download them one by one using getdata, see they have a missing parent, place them in the orphan pool (the set of blocks without known parent), and when they're all received, notice that they connect, and switch to it.

Since 0.10, the attacker would inv B11'. The victim will use a getheaders message to request the block headers between B5 and B11' and getdata for the block B11' itself. When the headers arrive, they are validated on the fly (in order of increasing height, so they always connect). By the time B11' arrives, we already know about its parents, and know that (assuming the parents are valid) this will in fact be the new best chain. We will then start fetching the actual blocks B6' through B10' to fill in the gaps, and when they have all arrived, switch over to that chain.


Database error when installing Coinbase's Toshi with Docker I'm trying to install toshi over docker and am using an AWS RDS DB for postgres. After running docker build -t=coinbase/toshi . on an AWS ec2 instance I attempt to run:

sudo docker run -e REDIS_URL=redis://toshi-001.ithq2b.0001.use2.cache.amazonaws.com:6379 -e DATABASE_URL=postgres://username:password@toshi-db.adfgsdsadfd.us-east-2.rds.amazonaws.com:5432/toshi -e TOSHI_ENV=production coinbase/toshi foreman start

Which starts up the process but inevitably fails

00:22:59 web.1                | started with pid 11
00:22:59 block_worker.1       | started with pid 12
00:22:59 transaction_worker.1 | started with pid 14
00:22:59 peer_manager.1       | started with pid 15
00:23:01 web.1                | [11] Puma starting in cluster mode...
00:23:01 web.1                | [11] * Version 2.9.0 (ruby 2.1.2-p95), codename: Team High Five
00:23:01 web.1                | [11] * Min threads: 1, max threads: 16
00:23:01 web.1                | [11] * Environment: development
00:23:01 web.1                | [11] * Process workers: 3
00:23:01 web.1                | [11] * Phased restart available
00:23:01 web.1                | [11] * Listening on tcp://0.0.0.0:5000
00:23:01 web.1                | [11] Use Ctrl-C to stop
00:23:02 peer_manager.1       | /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sequel-4.13.0/lib/sequel/adapters/postgres.rb:161:in `async_exec': PG::UndefinedTable: ERROR:  relation "peers" does not exist (Sequel::DatabaseError)
00:23:02 peer_manager.1       | LINE 1: SELECT * FROM "peers"
00:23:02 peer_manager.1       |                       ^
00:23:02 peer_manager.1       |     from /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sequel-4.13.0/lib/sequel/adapters/postgres.rb:161:in `block in execute_query'
00:23:02 peer_manager.1       |     from /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sequel-4.13.0/lib/sequel/database/logging.rb:33:in `log_yield'
...

So it seems that for some reason the DB is not able to migrate. When I run the same command without specifying that DB name toshi at the end of the postgres connection url I get a different error:

Unable to find image 'coinbase:latest' locally
Pulling repository coinbase
FATA[0000] Error: image library/coinbase:latest not found

Any ideas what could be causing either of these errors?

I think i had the same problem when running locally.
Forgot to do the initial DB migration.

bundle exec rake db:migrate

after this, it worked for me


How would I need to change ElectrumX to use FIFO selection of UTXOs? By default, UTXOs are picked randomly in ElectrumX. I want to change this behaviour and spend UTXOs on 'FIFO' basis. What changes do I need to make?

By default, UTXOs are picked randomly.

You mean in Bitcoin Core's wallet? No, they're not picked randomly. There are a number of strategies, but in general the aim is to avoid change if possible, avoid transaction outputs with few confirms if possible, and otherwise create a match close to the amount intended to be sent.

  My want to change this behaviour and spend UTXOs on 'FIFO' basis. What changes do i need to make?

That's possible - the wallet already knows the timestamp when transaction outputs were created, so you don't need to make any changes besides changing the coin selection algorithm. In particular, you don't need to add timestamps to UTXOs.

However, FIFO isn't known to be a very good strategy. Mark Erhardt's thesis does a comparative study to analyse various coin selection strategies. There is ongoing work in Bitcoin Core to adopt some of the outcomes of this research, some of which is already completed. In particular, the master branch as of writing (April 2018) includes the Branch and Bound strategy for change avoidance.


How could you initiate a new Exchange Market? Supposing I want to "initiate" an exchange market. Is the only way to get some bitcoins IN  to buy them from another exchange and trying to sell them? (or to wait for people starting trading, correct?)
Thanks

As the name "exchange" suggests, an exchange does not buy or sell bitcoins themselves. They merely function as an exchange between sellers and buyers.

So what you will have to do is wait for people to start trading. But people won't come by themselves, so you will have to give users a reason to come to you instead of an existing exchange. It may also help to trade on your own site in the beginning both to not completely rely on new user's transactions and to generate some trade volume.


How can I specify transaction fee size when creating a raw transaction? Question: Am I able to specify the transaction size in a raw transaction without having to send "change" back to myself?

I get some unspent bitcoins

listunspent()

I grab the txid, vout, and scriptPubKey for each
Then I get the list of all the addresses and quantities that I want to send to

createrawtransaction(source, destination)

Let's say my total unspent is 1.00000000 BTC, the total I want to send out to all the addresses is 0.50000000, and it'll be about a 3100 byte transfer that I need to pay 0.00040000 fees for.
The way I currently build the destination addresses is to place the address it's coming from (myself) as unspent - tx fees - outgoing, so that would be 0.49600000, the destinations would all be specified, and the fee remains unspecified but deduced by the remainder.

So, this is working for my purposes, but is a little inconvenient. The amount that I'm not sending to anyone sends back to myself and has to be reconfirmed so the funds aren't available until then.

If I had a single unspent address with 100 BTC and needed to send 1 BTC to 15 people, it doesn't seem to make sense to temporarily lock up 85 BTC in the process. If I were to use a client and manually send 1 BTC at a time, the unused funds would remain available, so I feel pretty confident what I'm asking for is possible.
Any assistance would be most appreciated.

NOTE: I'm using bitcoind now.

The fee is the difference between the inputs and outputs, so you can specify the fee by leaving that amount unaccounted for in your transaction.

Be careful though, this has lead to 200BTC transaction fees in the past when someone forgot to include a change address: http://www.reddit.com/r/Bitcoin/comments/1lb5my/asicminer_refunds_the_accidental_200_btc/


How is it that concurrent miners do not subvert each other's work? Every time a new block is added on top of block chain, the miners have to restart their work because the next block has to have a proper reference to previous block.

Let's suppose that there is some nonce for each block such that there is also sufficiently small hash (smaller than target). In general, there are 2256 possible hashes. Let the target be t. The target can be also understand as a number of acceptable hashes. So there is t / 2256 probability to find a proper hash in each try i.e. to find a block.

The number of unsuccessful tries before a block follows a geometrical distribution with parameter p=t/2256. The expected value of a variable following such a distribution is EX = 1/p = 2256/t. So, each mining pool has to spend 2256/t tries in average to find a block.

How is it that concurrent mining can be efficient, providing that each time some pool publishes a new block all other pools have to restart their work and thus throw out their tries on blocks that now can't be used any more?

Note: Please be a bit detailed. I've already read explanations like: Every try has equal chance to success. But I can't get it from such short hints.

The number of hashes a miner has tried in the past does not affect the probability that a miner will get the correct hash in the next immediate calculation. Thus, it does not matter for the miner from an efficiency viewpoint if he starts work on a new block since the probability of getting the correct hash is exactly the same as if he kept working on the old block.

Think of this coin flip example: The first goal is to try to get heads. You failed the first several flips and than the goal changes to getting tails. The probability of you meeting your goal is still exactly the same.


Can synchronization time be reduced? I'm trying Bitcoin for the first time, so I'm about 7 years behind. As far as I understand every bitcoin user has a copy of the entire transaction record that has happened for all time for all accounts. So, when I initially install Bitcoin Core which I am going to use for my wallet, it has to synchronize with a history that is already 7 years old.

This seems to take a lot of time and as far as I know will only get worse as

the number of users increases and
time since the first transaction increases.

Are there any methods to mitigate this?

No, this is a fundamental concept in Bitcoin. You must download and verify the entire history of the network in order to be sure that it is valid and untampered with. If your situation doesn't allow this it is possible to use SPV wallets which only do weak validation, sacrificing security and privacy for sync speed. Electrum and Multibit are examples of SPV wallets.


Why are Virtual Machines used in Ethereum? I'm wondering why the Ethereum Virtual Machine (EVM) is used?

What if they didn't use it?

Why don't we have them in Bitcoin?

note: I might be wrong

The EVM is actually the core of Ethereum. All contracts are written in EVM bytecode. This doesn't mean that Ethereum includes an actual virtual machine in the sense of Hyper-V, Vmware or Xen. It contains something[*] that can execute EVM bytecode (that something can either be interpreter, jit or aot). So, VM in this case is just a name for emulating the bytecode.
Without the EVM, all transaction types would have to be hardcoded (this would limit capabilities, but would also be much safer).
Why do you think that Bitcoin does not have a VM? It actually has. Script is Bitcoin's bytecode, you can read more about technical details here: https://en.bitcoin.it/wiki/Script


BTG from BTC in BlockChain Wallet Is blockchain wallet able to give us BTG once have BTC in the wallet on the 25th of October 2017?

I haven't found any confirmation from them and in the btg website there is no info about blockchain.info only other wallets.

You can recover your seed phrase from their website (Settings > Security > Backup Phrase)

You should be able to use this phrase to restore your BTC and BTG in another wallet.


cannot connect via 8333 port on website MY bitcoind is on: http://207.12.89.181/ yet I cannot connect via any port, I've tried 8333 and 8332 any reason why? it's a ubuntu server. Im using that server to connect to from another server.

You need to add the rpcallowip setting to your bitcoind.conf file.

You can use a single IP or allow all. for example

rcpallowip=192.168.0.2

or

rcpallowip=*


What is the best practice for listening to payments on the RPC api? I have a docker instance running a bitcoin node and would like to listen to deposits, generating a new address each time a user requests to deposit then increment the users account balance on success.

Bitcoin has walletnotify feature that will notify you when an address you own in your wallet receives a transaction, and a second notification when the transaction confirms.

You can set it in your bitcoin.conf

walletnotify= curl http://yoururl.com/endpoint.php?tx=%s

%s will contain the transaction id. What you do from there is up to you.


Dogecoin daemon (dogecoind) not responding to RPC requests I have the dogecoin daemon running successfully on Ubuntu, started with this command:

dogecoind -daemon

It's listening on port 22556, as verified by netstat.

I can also pass commands to it directly via the Ubuntu terminal, like so:

dogecoind getinfo

However, passing RPC requests to it through HTTP does not work.  The daemon doesn't refuse the connection (and I can verify that it does refuse the connection if I use a port other than 22556); instead, the connection hangs, with no data being sent to the client making the HTTP request.  Directly connecting to

http://a:b@127.0.0.1:22556/

makes the web browser sit and wait for data.  Similarly, making an RPC request via a PHP script, and then accessing that script in a browser, makes the browser wait for 30 second before PHP spits out an error stating that the maximum execution time of 30 seconds was exceeded.

I have my ~/.dogecoin/dogecoin.conf file as such:

server=1
rpcuser=a
rpcpassword=b

(I know the username and password I typed there are insecure; those are temporary until I can at least make a connection.)

I've tried adding the line

rpcallowip=127.0.0.1

to the end of the config file, but that didn't change the behavior at all.

What am I doing wrong -- why isn't my Dogecoin daemon accepting RPC requests (or any from-an-actual-browser HTTP requests, for that matter)?

edit: Also, I can verify that the daemon is caught up with the blockchain.

Figured it out.  It had to do with adding rpcallowip lines to the config file.  Adding these three lines solved it:

rpcallowip=127.0.0.1
rpcallowip=192.168.1.*
rpcallowip=0.0.0.0

The last line is what eventually allowed it to work.  I'm not sure why, but netstat said it was listening on 0.0.0.0:22556, so adding 0.0.0.0 to the rpcallowip list solved it.


Can anyone use your private key if its encrypted on bitcoin core? I bought cold storage coins with private keys engraved. After I import and encrypt the wallet in bitcoin core, can just the private keys be used to access the wallet or would you also need the passphrash i encrypted it with?
In other words, can the manufacture access my wallet with the private keys if i encrypt the wallet on bitcoin core?

If you trust someone else to provide a private key for you, it doesn't matter if you encrypt your wallet. They will forever be able to control and spend your money at their leisure with no regard to any password you add.


Why aggregating transactions into blocks? I'm just wondering why do we need blocks. I mean, I could have my tx (signed), with its outputs/inputs, make a hash of it and broadcast it. Basically 1 tx per block, if you want to see it like that.
Then, a miner could run a lighter version of PoW (or any alternative, e.g. PoS) over the single transaction (with low difficulty). This way, we wouldn't have to wait over 10 mins/block to be created. Couldn't this achieve more TPS on a blockchain? (not talking about Bitcoin specifically).
Probably the answer is no, but I just want to know why. I found several related questions here but no one seems to solve my question...
PS: I read about the relay times on the Bitcoin network to be about 14s. My question is ignoring this delays.
Thanks :)

The Problem is that the nodes in the peer to peer network need to synchronize after every block. That means every new block needs to be shared with every participant in the network. This takes some time.
If someone on the other side of the world creates a block it might take a few seconds until this block reaches you. Even if this block contains only 1 tx. That's because latency does not reduce, if you reduce the block size.
Therefore you would have to give the network at least a few seconds time to synchronize after every transaction. This would reduce the overall tx per second drastically compared to aggregating multiple tx in a block and producing a block every 10 minutes on average.


Are transactions in the mined block validated by other nodes on the network? After successfully mining a block, the block and the solution is broadcast to the network. The nodes on the network in turn verify the solution. Aren't transactions that belong to the broadcasted mined block validated?

This has been covered before (I can't give links at this juncture as I'm on mobile device), but:

each block references the previous block, preserving manipulation of blocks through POW
each Tx references it's corresponding UTXO hash
each UTXO requires a cryptographic puzzle (script) solution to spend the UTXOs

I'm sure someone will refer you to further information if I haven't edited this myself later on.


Is there a minimum number of transactions in a block? What encourages Bitcoin miners to include lots of transactions in blocks in the Bitcoin blockchain?

It seems like you could quickly add a block with just a single transaction and get the block reward from it.

Is there some incentive for miners to include lots of transactions in blocks?

A block may contain only one transaction: the coinbase transaction. However, the time it takes to mine a block is not affected by the number of transactions in that block, so mining blocks with fewer transactions does not benefit the miner. On the other hand, miners collect fees from the transactions they include in a block, so by including more transactions in a block, they may collect more fees.


Can bitcoin system get itself into resonant oscillations I assume that the PoW system has been designed in the way it controls itself. If the difficulty is too high and mining hash rate is low, then it takes more time to mine a block. The system detects that and adjusts the difficulty so the mining is easier. And vice versa.

What if the decrease in difficulty would be too large? Then the block generation rate would rise quickly. The system would sense that and next raise of difficulty would be so large, that it would be greater than it was before it was lowered. Repeating this would cause the system to go into resonant oscillations and it would cause the difficulty to go into level that it would not be possible to mine a block and whole system would overload.

Is the block mining system protected from such scenario?

Yes, there are protections.

For example, Bitcoin restricts both the frequency and size of difficulty changes: the difficulty is re-assessed after each 2016 blocks, and is adjusted by no more than a factor of 4.

The adjustment is also reactive rather than proactive: it looks at how fast the last 2016 blocks were generated, and sets the difficulty to the value that would have generated those blocks in 14 days, rather than trying to guess at a difficulty that will generate the next batch in 14 days.  Assuming that trends in available mining power are consistent over the short term (generally decreasing or generally increasing), this means that the adjustments are uniformly too small rather than too large, preventing oscillations and giving the historic trend that blocks are mined about every 9 minutes rather than the 10 minutes the system was intended to produce.


How will Ripple affect Bitcoin exchanges? Will every Bitcoin exchange be under pressure to also operate as a Ripple gateway in order to gain access to the additional liquidity that Ripple creates for markets?

As Ripple appears to allow one to create exchange listing for any pair of currencies, it might very well server as an exchange unto itself. It is possible that the project will replace the traditional exchanges, possibly turning them into Gateways to put money in and out of the system instead.

Then again, that might be far in the future - at the present time there is a healthy amount of scepticism surrounding how safe the Ripple system is, so not a lot of people would be willing to abstract their money even further with it than they are used to.


How exactly would compromising a private key cause you to lose your coins? When someone sends me coins, they must send it to my wallet address, which is nothing but my public key hashed. It's generally understood that losing your private key implies losing access to your transactions.

Can we please elaborate on the how and why? Because so far all we got is a transaction with a destination of my wallet address. How does the private key allow me or someone else to take control of my unspent outputs?

For P2PKH addresses (1.. addresses), the address is the hash of your public key and your public key is derived from your private key. When you spend, you must provide a cryptographic signature and the public key for your address. This cryptographic signature can only be created by using the private key. This is what makes it so that only you can spend your Bitcoin; you have the private key that makes a valid signature so you can make the spending transaction. If you lose that private key, you cannot make the signature and thus cannot make the spending transaction. However anyone who obtains your private key (i.e. steals your private key) can also make that signature and spend your coins, which is why you must keep it safe.


moving money without fees what's the best way to move money within your own wallet between your own accounts and/or addresses without incurring fees?

  setaccount

  Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account.

^ That is the closest I can see but the address creation part in my opinion should instead produce a help/warn message.

If I had dust sitting on an address and wanted to move it into a larger pile on my address labeled 'main address' how would I do this?

You are asking two questions which might seem to be related but are actually very different.

To move coins between addresses, you have to create a transaction and get it included in the blockchain.  Just like any other transaction, this might require you to pay a fee.  (You might be able to send the transaction without a fee, depending on the priority and/or whether your transaction finds its way to a generous miner.)

Accounts, however, exist only within the Bitcoin Core client.  They are just a bookkeeping device to group your funds.  You can move coins between accounts with the move command in the Bitcoin Core console.  This updates the client's internal records to adjust the balances of those accounts, but doesn't actually cause any coins to move between addresses, so it has no fee.


Bitcoind server spontaneously shutting down I'm running the latest version of the headless bitcoind server on an Ubuntu micro instance on AWS and every hour or so it spontaneously shuts down. It's hard to get any meaningful data from the debug log because it seems to happen completely randomly. This is a brand new install on a brand new AWS box. I'm also running the testnet, by the way.

If you can think of meaningful data I can provide, please tell me, but I'm at a loss here! Does anybody know what could be going on?

Edit:

After some more research, I think it's because of the limited memory in a micro EC2 instance:

https://bitcointalk.org/index.php?topic=21451.0

Add some swap space and your problems will disappear.


How do I reset my wallet (bitcoin qt) I lost my wallet pass, but thankfully didn't have any money there. How do I reset this thing and get a new fresh wallet with a new password?

Go to Bitcoin's Application Data directory (in Windows 7 it's UserFolder\AppData\Roaming\Bitcoin) and delete the wallet.dat file.


Can stolen or otherwise tainted coins be laundered through mining fees? Do chain analysis techniques consider the fee portion of block rewards as tainted funds?
e.g. if known stolen funds are moved in a certain block, the fees the sender pays end up "polluting" the block reward. I want to know how much weight this taint actually gets when it comes to chain analysis. Would the largest exchanges accept these coins as deposits?
If so, then a thief could launder the funds by colluding with a miner. e.g. do a self transfer that pays 10% in fees; don't broadcast the tx, just pass it to the colluding miner who mines it and later returns a portion of the fees to the thief out of the block reward.
If not, then a thief could taint every block's reward by simply self transferring a minimal amount with sufficient fees for next block. Then none of the blocks rewards can be deposited in any heavily regulated exchange. I guess miners could censor those txs if the thief's UTXOs are well known, but it's still an attack vector I guess.

I cannot look into the chainalysis code but if someone cooperates with a miner by paying unusual fees with tainted coins then the high fees are suspicious and I'm pretty sure analytics will monitor this.
Usually it's not a question whether or not the funds on a bitcoin address are from a criminal source, it's a question of what % is polluted. If you go inbound in the transaction trees of an address back to the miner rewards then you might have 1000 addresses and a little percentage will be polluted. So e.g 1.5% of the starting addresses funds are from a criminal source. It's the same with the bills in your wallet or with your ancestors. Going 10 generations back we have upto 1024 great...grandparents and if 10 of them were criminal then we could say that 1% of our ancestors were criminal.
So the criteria aren't the same at all exchanges but I assume that only addresses with a relatively high percentage of pulluted 'ancestors' will be rejected otherwise the exchange would have to stop it's business.


Why a flip a bin before hashing in this script? From How can I make this PHP merkle root script recursive?

function binFlipByteOrder($string) {
    return implode('', array_reverse(str_split($string, 1)));
}

Why a flip?

Hashes are big endian by standard, and most computers use little endian, so it's probably just for convenience. See Why does the Bitcoin protocol use the little-endian notation?


Recurring Bitcoin or Altcoin Payments as a Service? I was wondering are there any recurring payment services aside from the obvious coinbase one out there. I want to be able to have a finer grain control. Say I wanted to send X amount of btc/altcoins to an address every 1week until it reaches a total of # of btc/altcoins or USD value.

I haven't done this but couldn't you run a manual transaction script that runs like a chron script weekly with a wallet and a preset amount of addresses?  it would have to keep its own internal balance and from there would have to calculate the balance.  I guess that answered your question - there is currently no out the box wallet or service that does this.


Bitcoin Energy Consumption and Carbon Footprint a good long term investment? How can Bitcoin a good long term investment, given one transaction is equivalent to carbon footprint of 986,125 VISA transactions?
If they use the Lightning network which takes transactions Off the Blockchain, wouldn't that defeat whole purpose of having ledger transaction?
https://digiconomist.net/bitcoin-energy-consumption/

I have read somewhere that every Bitcoin transaction is "equivalent to the power consumption of an average U.S. household over 22.86 days.". Is that true? Isn't that horrible?
tl;dr: Most people don't value Bitcoin as a payment mechanism, and even if they
were, most payments are not recorded on-chain. So calculating the energy cost of
a transaction is as impossible and nonsensical as it would be for gold.
It's true in a similar way that the lack of pirates is causing global
warming.
Yes, this is a valid estimation of Bitcoin mining's energy use divided by a
valid estimation of on-chain transactions, compared to a probably valid
estimation of household electricity use.
However, connecting these three figures in this way doesn't yield any insight
beyond shock and awe. That's because Bitcoin's primary value is not as a payment
network, so the number of on-chain transactions is not an interesting metric for
it. This can be seen easily: On one hand the number of onchain
transactions
has always been limited — and that limit has been pretty much hit constantly
since at least 2019. On the other hand, the value of Bitcoin, as well as the
estimated number of its users, has been rising over many orders of magnitude
since 2009. How can this be possible?

In recent years, long term store of value has become Bitcoin's main use case. That is, people use it more for storing their savings than for paying for goods and services.

Its current usage is thus more comparable to gold, which is also rarely used in transactions. I have never seen anybody calculate the energy cost of gold mining plus handling divided by the number of physical gold shipments. Probably because that's as misleading a number as the equivalent in Bitcoin.

Just as with gold, there are ways to make even small transactions quickly and cheaply with Bitcoin. Most real-world transactions use one of these off-chain methods. Probably the most popular today are custodial services like exchanges. Sending bitcoin from one customer to another on a service like this just requires changing two numbers in their database and is the equivalent of gold in a bank changing owners. It's hard to say how many such transactions there are, since there are many "bitcoin banks" and their numbers are proprietary, but it's safe to say they dwarf on-chain transactions by orders of magnitude.

Unlike gold, there are methods of transacting Bitcoin off-chain that require less trust in intermediaries, such as the Lightning Network or Blockstream's Liquid federation. With a growing demand in transactions, such alternatives are refined and gain popularity, without this being reflected in the above numbers. With the Lightning Network, it's even difficult to estimate how many transactions are being performed, since there is no central ledger recording them all.

But I have read that Visa transactions are much more economical!
That's because these are very different things. Visa transactions are just a few
companies changing a few numbers in their databases. It's basically just a fancy
way of signalling an intent to spend something. It's not final. There might not
be a real transfer of value happening at all (all the "money" is still debt in
the same bank, just on another account).
On the other hand, a Bitcoin onchain transaction is a real transfer of a bearer
instrument, comparable to a gold shipment from one central bank to another.
Those are also quite expensive, I imagine. It's total overkill if you want to
buy a coffee. For that, it might be enough to just update some numbers in a
(Bitcoin) bank. Or use the Lightning Network.
If you have a little time, Nic Carter has explained it much better than me.
If you have more questions regarding Bitcoin's carbon footprint, I recommend the FAQ at netpositive.money


Coinbase to Block Chain Transfer Delay I recently sent a friend of mine around $950 in BTC from Coinbase to his BTC wallet on BlockChain.info.

The transaction is showing up as completed in my account, but he claims he has not received the money yet...

I'm not sure why this issue is occurring. Can someone please help? Obviously, with an amount like $950, I can't just lose that money...

Since there is no dispute about the address, you can check whether the transaction has confirmed on any of the blockchain explorers freely available, such as blockexplorer.com or the aforementioned blockchain.info.

If the transaction shows up as confirmed there, and the receiving address matches the address that he told you, the money has been successfully signed over to his control. That's sufficient to prove that you paid.

If the payment is still not showing up in his wallet, the problem is on his side, and he should either look into what's wrong with his wallet or check in with the customer support to fix his access to his funds.


Where and how to buy Petro? The Venezuela is about to launch the pre-sale (at 12:30pm GMT) of its Petro cryptocurrency.

For that, they release a buyer manual in Spanish. Do you know where I could find the document translated in English? What is the procedure for participating in the pre-sale?

The presale is available for venezuelan citizens for the moment only paíd in euros, dollars , btc and eth


Ich habe bitcoin-qt auf neuen Computer installiert und komplette blockchain runtergeladen. Wie verbinde oder oeffne ich meine alte Wallet? Ich habe bitcoin-qt auf neuen Computer installiert und komplette blockchain runtergeladen. Wie verbinde oder oeffne ich meine alte Wallet die auf alten Computer erstellt wurde?

Close bitcoin-qt
Copy your old wallet.dat file into the directory that contains the wallet.
If you installed with standard path, it will be:
c:\users\yourpcusername\AppData\Roaming\Bitcoin\wallets
just rename or delete the old wallet.dat file.
Restart bitcoin-qt. It will now rescan, this will take a few hours.


Can a bitcoin be destroyed? Its the hypothetical future and BTC2 is being designed. Everyone loves BTC2 and no-one wants the old BTC1 any more.

People who have BTC1 would be annoyed that their assets are suddently worth a lot less because there's no demand for their BTC1 any more, so the designers of BTC2 want to include a simple way to convert their BTC1 into BTC2.

For this to work, the BTC1 world would need a way for coins to be put beyond use within the BTC1 world, in a way that everyone can be reasonably sure that no-one can use the evaporated BTC1 assets any more.

Does such a mechanism exist? If not, could/should one be added?

Sorry Alex, but you're wrong on the question being asked.  It's trivial to put bitcoins "beyond use" so that they can never be spent again.  All you would have to do is send the bitcoins to a made up address, which no one would have a key to.  This has already been done, since coins have been sent to addresses which are almost certainly unowned (like the lowest possible hash that is a valid address).

So specifically in your situation, the BTC2 people could use a public method of creating an address that no one owns the private keys to, then design their system to credit people who send BTC1 bitcoins to that address.  One reason someone might want to do this despite the open-source nature of Bitcoin would be to create a new, incompatible protocol that grabs some of the user base of BTC1 without forcing anyone to leave, allowing the two to coexist and compete quite fairly.


When does freebitco.in cash out? I found a web site where you can win bitcoins, freebitco.in. How do they work? Do they use JavaScript to mine for bitcoins on your client?

And when do you get the mBTC you win there?

According to the website, if you click on "Auto Withdraw Enabled", you see:

"Payments are automatically sent every Monday to all accounts with a balance greater than 0.00005460 BTC".

For example, yesterday I received my most recent payment around 1 AM on Tuesday EST.  They send the BTC with a note saying:

They state that it can take a while to get the payment approved.  From my experience with the site, I find they are pretty reliable.  They basically only check to make sure you didn't try to cheat somehow with referral exploitation or programs trying to modify the gambling feature they have.


Is "previousblockhash" always returned from getblock RPC calls? Does the getblock(hash) RPC call always return a "previousblockhash" field and if not: under what conditions does it not return this?

Background: many algorithms suggest using this field as a way to step back in the blockchain when an orphan or reorganization occurs but the C++ code would indicate this field isn't always present.

if (blockindex->pprev)
        result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));

Would that be due to chain reorganizations and orphans? Can anyone explain what dynamics would make this check fail and what the next step would be if it does?

It will only ever not be present for the genesis block.

A block is not added to the block index until all its ancestors are in there too.

The block index is conceptually a tree: every block can have multiple decendents but only one ancestor. A reorganization is switching from one branch of the tree to another, and does not affect this.

Orphan blocks (in the meaning of blocks without known parent) don't exist anymore since Bitcoin Core 0.10 (we only download blocks after validating their headers, so the parent is never unknown), and even before that, orphan blocks were just stored in a queue in memory and not actually added to the index until their parents were found.


Does Ripple require users to input their ID and personal data? Currently all the USD to crypto currency exchanges require personal identification before withdrawing to USD. Does Ripple require this? How about the Ripple Gateways that do the currency conversions?

Ripple has no such requirements, nor could it. It is designed to function without any central authorities. A Ripple account is created just by sending a small amount of XRP to it. The account's owner authenticates using a public/private key pair.

In principle, you could get USD into or out of Ripple without going through a gateway directly. You can meet someone in person anonymously, hand them a $50 bill, and they could give you a $50 Ripple balance. In reverse, you could sell a Ripple balance in person anonymously for cash. But in practice, to get money into and out of Ripple, you'll typically use a gateway's issue and redeem functions, and they will have identity policies.

Gateways can also require you to provide them identification just to hold balances from them on Ripple. To my knowledge, no gateway currently does this.


any faucet that can give even 1 satoshi of BTC immediately? Is there any faucet that can give even 1 satoshi of BTC immediately without waiting til you have some amount, and without faucethub account?

A faucet could not pay out 1 satoshi, because it falls below the dust limit that is used by the majority of nodes on the network. Further, the fees required to send a transaction would total far more than 1 satoshi, so even if it was possible to confirm such a transaction, it would cost more to do so than the amount transferred.

If you had a lightning network node with the appropriate incoming capacity, you could accept a lightning network payment on 1 satoshi. It is worth mentioning that if the channel were closed with just 1 sat on your side, you would not be able to receive an on-chain tx for this amount, due to the dust limits mentioned above.

Note that service recommendations are off-topic here, so I won't comment on the current availability of such a faucet.


What is the difference between a market and limit property in the MTGox API? I'm using the MTGox API to get data about historic trades.

When I run https://mtgox.com/api/1/BTCGBP/public/trades?since={trade_id}, I get the latest 500 trades since that {trade_id}.

Now I have for example these two trades returned:

Trade #1
{
    "date":1342135345,
    "price":"4.77728",
    "amount":"5107.98029213",
    "price_int":"477728",
    "amount_int":"510798029213",
    "tid":"1342135345801755",
    "price_currency":"GBP",
    "item":"BTC",
    "trade_type":"bid",
    "primary":"Y",
    "properties":"market,mixed_currency"
},

Trade #2
{
    "date":1342136454,
    "price":"4.78",
    "amount":"0.02000488",
    "price_int":"478000",
    "amount_int":"2000488",
    "tid":"1342136454726203",
    "price_currency":"GBP",
    "item":"BTC",
    "trade_type":"bid",
    "primary":"N",
    "properties":"limit,mixed_currency"
},

Note the different properties: "market,mixed_currency" & "limit,mixed_currency".

What is the difference between a market and a limit property? What do both mean? (I couldn't find it here https://en.bitcoin.it/wiki/MtGox/API/HTTP/v1)
what does it mean for a trade to be mixed_currency?
Bitcoincharts does seem to include all trades regardless of the limit/market/mixed currency, is this the right approach if you want to have a honest view of all markets?

A limit order is an order to buy or sell at a specific price or better. As in "sell these coins if I can get at least X USD per bitcoin."

A market order is an order to buy or sell at the best available price. As in "sell these coins for whatever people are willing to pay right now."

Not 100% sure about this, but I believe mixed_currency means the buyer and seller are using different currencies. If you buy bitcoins using EUR from someone selling for USD then MtGox will do a conversion.

And yes, the best view of the market would be with all trades included.


Paying only 6 satoshis/vbyte ($0.18 cents) per input in transaction fees? I understand transactions are given priority based on the fee per vbyte of transaction data included in the transaction.
When I look at a Fee Calculator I see different quotes based on the desired block confirmation time. For example, to get confirmation within two blocks the fee is calculated as 72 satoshis/byte or $34.31 for 10 inputs and 2 outputs ($3.40 per input). For confirmation within 144 blocks (24 hrs) the rate drops to 6 satoshis/vbyte which turns out to $1.86 for 10 inputs and two outputs (or 0.18 cents per input).
The assumption that a transaction will be included for 6 satoshis/vbyte is based on speculation that the block size will not continue to be clogged with other transactions that pay a higher fee per vbyte over the course of the next 24 hrs. If the rate of incoming transaction continues to remain the same the transaction should never get confirmed.
Why is it assumed that the number of transaction will decline to the extent that the fee of 6 satoshis/vbyte will be adequate to outdo other transactions? How do they know how many transactions will hit the blockchain in the next 24 hrs and more importantly what sort of fee will be attached to those transactions?
Thanks

All fee calculators rely on statistical modelling of the mempool. There is no assumption that future transaction producer behavior is identical to what was observed in the past, but it's the best data available to produce an estimate with.


Where are the BTC from my paper wallet gone? https://blockchain.info/de/address/12PDCamPFJexx7aVAhy6nFDxJaq7TihH6b

Hi! I got a newbie question. I sent 0,00025 BTC by Jaxx on my iPhone to a paper wallet created on bitaddress.org. The wallet pub key was 12PDCamPFJexx7aVAhy6nFDxJaq7TihH6b. I can see this transaction on blockchain.info

But now my paper wallet seems to be empty. Where are the BTCs gone? I see an outflow to 1BLgeYFimGM7Dj7PDwaN55auLv7RPevY6P, but what is this?

Thanks for your help.

It seems someone obtained your private key. If you are sure you did not authorize this transaction, consider that paper wallet compromised and never use it again. If you generated the wallet online (just by opening the website), your keys may have been stolen by malware / keylogger of some kind.

If you need to generate a paper wallet, a better way is to download the source code and run it on a computer disconnected form the Internet. Disable all browser extensions or use a freshly installed and up-to-date browser (e.g., if you usually use Chrome, install Firefox just for this task). Check your computer for viruses.


No Dig option in Dogecoin-QT? I have seen, in numerous screenshots of Dogecoin-QT, a "dig" pane (equivalent to "mine" in some others):

However, my client has no such pane:

Does anyone know where that option has gone? Was it removed in an upgrade?

Yes, it was removed in an update. The developers have decided to hide it as a way to discourage users from wasting CPU time. CPU mining this big of a coin will get you no where.

It's suggested to mine using an external mining program like CGMiner or practically any miner recommended for Scrypt. Check out Litecoin wiki's Mining Software list and look into Scrypt mining guides such as the Dogecoin wiki's 'Beginners guide'.


How is the Output script formed? I read about Input and output scripts on the wiki here:

https://en.bitcoin.it/wiki/Transactions

Let's say, I use my Bitcoin - QT Program, I go to "Send Coins" tab, enter a Bitcoin Address, BTC amount and then click Send.

Is the output script generated by my program?

For an output script, we need the Value, The destination Address and the scriptPubKey. My client program has all this data.

scriptPubKey refers to Public Key of? My public key or the person I intend to send the Bitcoins to?

So, now, once the output script is formed, is it broadcast over the Bitcoin Network?

Where does the Input Script come from?

the scriptSig in Input Script refers to the Public Key and Signature of whom?

When I am sending Bitcoins to a Bitcoin Address, the input Script is automatically generated by what?

Even though the wiki gives details about Input Script and output Script, I was unable to correlate it to a real time scenario where one person sends BTC to another.

Is the output script generated by my program?

Yes.

  scriptPubKey refers to Public Key of?

Whoever you're sending the bitcoins to.

  So, now, once the output script is formed, is it broadcast over the Bitcoin Network?

After it's signed, yes.

  Where does the Input Script come from?

It is composed of two pieces - your public key, and a valid signature corresponding to that public key. So, you make it.

  the scriptSig in Input Script refers to the Public Key and Signature of whom?

You.

  When I am sending Bitcoins to a Bitcoin Address, the input Script is automatically generated by what?

Your client, after looking at your wallet.

  Even though the wiki gives details about Input Script and output Script, I was unable to correlate it to a real time scenario where one person sends BTC to another.

There are two parts to a bitcoin transaction - the part where you prove that you own some bitcoins, and the part where you designate someone else to be able to prove they own some bitcoins.

  So, the Public Key in scriptPubKey differs from the Public Key in scriptSig?

scriptPubKey is very poorly named, because when you're sending bitcoins to an address, you only know the 160-bit hash of the public key. A scriptPubKey looks like this:

OP_DUP OP_HASH160 06f1b670791f9256bffc898f474271c22f4bb949 OP_EQUALVERIFY OP_CHECKSIG

The 06f1b6... is how your client specifies who it's sending to. The parts around it are scripts that tell the bitcoin client how to validate the transaction.

  Also, we only have the Bitcoin Address of the person we intend to send the Bitcoins to. How do we get the Public Key of the recipient?

We don't need to. We can tell the network the 160 bit hash, and the person you're sending to can show the public key to the network when they want to spend their bitcoins.


How exactly would anyone know from where I got a given "bit of Bitcoin", or who I send it to? Let's say I buy 0.1 BTC using Bisq. Okay, so the person I bought it from will know my name since I have to give it up to make the international bank transaction. And I will know their name because that's how Bisq works and apparently has to work. Alright.

Us two strangers know each others' identities.

So, does this mean that the person I bought the 0.1 BTC from now can track exactly how I spend it? How? Isn't the truth that, at best, they can see when I spend it (if ever) and which "receive address" received it? Which tells them exactly nothing whatsoever?

Ever since I first heard about Bitcoin, over a decade ago, I've been trying to get clear answers on the most fundamental questions, but never receive anything but assumptions/guesses or such technical and in-depth explanations that they might as well be made up and I couldn't tell the difference between that and the truth.

The most common "explanation" is to vaguely state that "it's completely trackable and 100% non-anonymous", but that seems to be utter nonsense to me. It actually seems to be very anonymous. The person I bought the 0.1 BTC from cannot possibly know if I'm selling it, paying for something, or just moving it to another wallet of mine. They have no clue. It's just a gibberish string of computer-generated characters -- not a full name and address and photo id in a neat little digital package.

I seriously believe that only a handful of people in the world truly understand how Bitcoin works on any deeper level, and that all the others are just pretending in order to not be seen as "stupid". Like the old tale of the naked emperor.

All Bitcoin transactions are public information, and each transaction is uniquely identifiable via its txid. Each piece of bitcoin (called a transaction output) is uniquely identifiable as well by means of the transaction that created it, and the index of the output on the transaction. This makes the "outpoint" txid:vout the unique identifier of a UTXO.

So, what your trading partner learns is your name via the bank transfer, the address you gave them, and the transaction output they created for you. That alone is not very informative as you noted, but it can become useful in combination with large swaths of other information. For example, if multiple of your counterparties on Bisq collected the names of whom they trade with, they could cluster your addresses and unspents to the same name. They can also track your on-chain activity: when you spend the funds, they will assume that any other funds used in the same transaction are also owned by you, clustering the other addresses to you. When you send to a recipient and receive the remaining funds back as a change output, they may be able to guess which of the two outputs went to a recipient and which went back to you. In that case, they will be able to probabilistically associate your next payment to you as well. They may have information on the address that you sent to, because you paid into a KYC'ed entity like a payment provider or Bitcoin exchange. In that case, they learn more about the purpose of your payment, or potentially could even look up other account activity if you deposited into an account.

So, basically your bitcoin activity is generally private, in that no personally identifiable information is directly collected in the bitcoin network, yet it is also inherently pseudonymously associated with you which reduces your anonymity set depending on how traceable your activity is. However, since the blockchain is a permanent record, anyone sufficiently motivated and well-connected may be able to fill in the transaction graph to trace back step by step to you.

If you want to read more about privacy in Bitcoin, I would recommend this excellent treatise on the Bitcoin wiki: Privacy


At what time will the payment be taken when buying bitcoin on an exchange? So for example if you place a order for BTC when it is in a small dip (for example some minutes),
Will the usd dollar price you pay be equal to the price at the time you placed the order or when it it is actually confirmed? (when the dip is probably gone and you effectively bought bitcoin at a higher price)

What I really would like to know whether it is possible to effectively trade BTC (or other coins) on a minute to minute timescale.

Thanks for your answer,
Roror

Conceptually, orders arrive at the exchange and are processed one at a time.  The fate of your order depends on the previous orders which are on the books when yours is processed.  So what matters is the state of the market at the instant when your order "arrives" at the exchange.  There will of course be some delay between the instant at which you place the order and the instant when it arrives at the exchange.  The length of this delay would depend on internet latency, the speed of the exchange's computers, etc.

If you place a limit order, then the price will be whatever you wanted it to be.  The order will be filled if there is a matching order already on the books at the instant of arrival; otherwise your order will be placed on the books and may or may not be filled by some later order.

If you place a market buy (/ sell) order, the price will be whatever the lowest ask (/ highest bid) is on the books at the instant of arrival.  Of course, this could be a different price than what you saw when you placed the order.  That's an inherent risk of market orders.


Can sendtoaddress use account other than ""? sendtoaddress is using the "" account by default. Is it possible to make it use any other account name?

Accounts are deprecated and labels are the alternative for accounts.
I'd recommend using latest Bitcoin 0.17.0 which has multi wallet features which can isolate each user, further read:

https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Multi-wallet_RPC_calls
https://github.com/bitcoin/bitcoin/pull/13058


Public key management There is something i am not sure to understand on bitcoin private/public keys and addresses.
A new bitcoin user "U" first generates a private key.
He can compute several public keys from this private key.
When he wants to receive bitcoins, the user should generate an address. I do not understand if this address is a public key or if it is 2 different things.
If my "U" user should receive bitcoin from 10 different people, he can generate a single common address for this 10 peoples but they will be able to see "U" balance, and see that he receives 10 transactions.
The solution is to generate 10 different addresses. With this solution, each sender will only see its own transaction and won't see the 9 others. I am wrong ?
So, to shortcut, can we say "U" generates 10 "virtual accounts", linked to its private key ?
If so, i do not understand how "U" can computes its own balance: Is there a way for him to recover all public/address he generates from its private key ? Or should user keep all the addresses he generates in a file ?
Thanks

A modern Bitcoin wallet program can generate many private-keys, each private-key has a public-key. For the most common transaction types, a Bitcoin-address is derived from the public-key.
As you say it is normal to generate a new address (i.e. a new set of keys) for each transaction. This is because all the transaction data is public knowledge - it is in the replicated journal of transactions we call the blockchain. Anyone can see all transactions for a specific address, so if ten people each pay you 1 BTC to the same address, they can all see that you have received 10 BTC in total at that address. This is a privacy concern. If the addresses are all different, they can't tell which belong to the same person.
In the Bitcoin network there are no accounts, no virtual accounts and no balances.
A wallet can read through the whole transaction journal and add up all the unspent amounts in transactions where the receiving address is one for which the wallet knows it has the corresponding private-key. That way it can present a total amount to the user. People refer to this total as a balance but that's misleading. The Bitcoin network does not keep a record of people's balances. The Bitcoin network does not know how much money anyone has in total. The US Mint does not know how many US one-cent coins I have sitting in a plastic bag on my shelf, it doesn't keep track of my balance or have an account in my name.
The terminology for Bitcoin is a bit muddled. Bitcoin was designed as digital cash. Accounts and balances are associated with banks, not with piles of dollar bills under your mattress or in your leather wallet. If you were talking about cash in the form of paper money and metal coins you wouldn't think about accounts and balances. You'd just want to know the total amount of money you have in paper banknotes and metal coins.
Modern wallets are what is called Hierarchical Deterministic (HD) wallets. From the initial private key (or seed phrase) it is possible to generate all the subsidiary keys and addresses in a predictable and repeatable way. You don't need to make a backup of each generated key and generated address.


Multibit HD: how much fee for cheap way to transfer bitcoin to other wallet? I have 0.015161 BTC in my Multibit HD wallet and now I want to move them all to Electrum wallet. So, how much fee to set for this transaction as a cheap way?
And how long I must wait?
The default value I see in Multibit HD is 0.0005 BTC/kb

https://bitcoinfees.21.co can give you an estimate of transaction fees based on the current network activity. It's recommended rate at the moment is 0.0026 BTC/kB to have a good chance of being included in the next block, but this changes often. Lower fees will take longer to confirm typically, but it's hard to be sure how long. At the rate multibit suggests, the website estimates it will take 4-28 blocks to be included, it estimates it could take up to 6 hours in the worst case.


Why Bitcoin fees are changing? Why the network fee is changing suddenly from one day to the next? One day transaction fee costs ~20USD, the next day it's already ~30USD. Why is that happening? I always thought that the fee is constant.

A Bitcoin block can contain only 1 mb of data. A transactiom averages around 255 bytes. A block is built about every 10 minutes and the blockchain forces the difficulty to do so. So per hour, only around 6mb worth of transactions can pass, however there's a much higher demand due to Bitcoin's popularity. If only X transaction can fit in a block but five times X would like to do a transaction, only the highest bidding  X number of transaction will proceed. At this point it's basic supply and demand understanding.


Bitcoin without mining Several months ago I've stumbled an interesting question about the Ripple system: How does Ripple solve the double-spend problem?

Specifically about how double-spending is solved in Ripple. As you can see only @David Schwartz replied to my comments and only he was able to give an answer, given that I think he works for Ripple.

But if he's right, this would be revolutionary in a way, since Bitcoin electricity wasting mining could be replaced by this system.

In any case, my question is: can Bitcoin mining be replaced by a Ripple sort of system? How would that work?

Both Bitcoin and Ripple are systems made of many components. One such component is a method to synchronize transactions and secure against double-spending; Bitcoin uses mining based on proof of work for that, while Ripple uses a consensus mechanism. Another component is the initial issuing of coins - Bitcoin uses mining for that as well, while Ripple uses central issuing. Of course, the key component of Ripple, which Bitcoin lacks, is a credit network with pathfinding.

You could build a system which is like Bitcoin in every way except that it uses consensus for synchronization rather than mining. It is likely that the total energy spent on generating new coins will be lower than the total energy spent on synchronizing transactions; so replacing that part with a mechanism that requires less energy is welcome. However, the consensus mechanism is not as proven as the mining mechanism, and is less decentralized thus less consistent with Bitcoin's overall vision.


What's the size of the last Ripple ledger and the indices to search through it? What is the size of the current ledger and all indices required to efficiently search through it or query it? Also, how will this size grow relative to the number of Ripple users?

Side-question: what database technology is used by rippled to store the ledger?

Ledger 8470000 in JSON format (without inner nodes) is 115 MB large. You can get it if you issue the "ledger" API call on a rippled that you own - it's an admin-only call, as it takes lots of ressources to assemble it.

If you are asking about the size of the databases rippled uses in the backend, these are about 9 GB (ledger headers + validations archive) ~100 GB (transactions) and ~320GB (RocksDB node store, snappy compression enabled) on my node.

Rippled can utilize several backends, the most mature/recommended is RocksDB, a LevelDB adaption by facebook. In general rippled just needs a high performance key-value store for the largest chunk of data (nodes), transactions and other stuff is stored in SQLite databases.


How to make a block explorer? I need to make a block explorer for some alternative cryptocurrencies. I'm using Litecoin for testing, but JSON-RPC requests through PHP are very slow. Maybe JSON-RPC isn't the right thing for such purposes? What other tools you can recommend?

Index the blockchain in a database and keep the database that has the blockchain updated as blocks come in, you would be essentially running a modified node that's really good at keeping data.


IBM Blockchain platform specifications So I saw an ad for IBM's blockchain platform, specifically the campaign they have to "turn plastic into money" by way of exchanging recyclable materials for digital tokens.

I was just wondering if anyone knows the specifications of their blockchain. I assume with it being IBM that it's all very centralized and hush-hush, though if you're willing to go the extra mile, or already have an IBM account you can download a technical brief of their platform. Does anyone have this, or know what their consensus mechanism(s) is/are or basically any information pertaining to the technical specifications of the platform?

Thanks in advance!

First IBM Blockchain is IBM's branded version of it's Hyperledger Fabric blockchain software (which is Apache 2-licensed open source under the Linux Foundation). They are basically the same, with the exception of add-on services and configuration.

Unlike Bitcoin, Hyperledger Fabric is an enterprise blockchain intended for private use (such as consortiums).

The "plastics into money" is just marketing--it's an example of using blockchain in a "proof of concept" application.


Why is the hash rate pumped near difficulty calculations? My question concerns Litecoin, but could apply to any other cryptocurrency.

I was inspecting the Litecoin difficulty chart and saw a pattern that seems to occur regularly: a dip in the hash rate just before a retarget, then a large, artifical pump to set the difficulty higher than it "should be". An example:

Why would miners do this? For maximum profitability, shouldn't miners attempt to keep the difficulty as low as possible? Additionally, why the regular dip just before a retarget?

It's more likely either a quirk of the difficulty calculation, or just coincidence. There's no reason, and indeed no way someone would make spikes like that, short of having massive amounts of reserve hashing power for the opportunity. There's no positive or negative of this sort of behaviour, so it's hard to believe anybody would.


How do I remove hard coded seeds from the bitcoin source code? I'm experimenting with blockchains at home and in my debug logs are lots of errors showing that my nodes are trying to get addresses from the hard coded seed nodes, I know I can use connect to turn off this behaviour but I don't want to have to include that in my bitcoin.conf file.
I am using Bitcoin v0.10.

Any hints greatly appreciated :)

There are a few ways to do it, I personally went into src/net.cpp and commented out the if condition that triggers the lookup starting at line 1266.

// if (addrman.size() == 0 && (GetTime() - nStart > 60)) {
//     static bool done = false;
//     if (!done) {
//         LogPrintf("Adding fixed seed nodes as DNS doesn't seem to be available.\n");
//         addrman.Add(Params().FixedSeeds(), CNetAddr("127.0.0.1"));
//         done = true;
//     }
// }

Another effective fix was to remove all the encoded seed nodes from the two arrays located in src/chainparamsseeds.cpp


Does ethereum run on the bitcoin blockchain? If not, what is the relationship, if any, between Ethereum and Bitcoin and/or the Bitcoin blockchain?

Bitcoin and Ethereum have different and unique blockchains. They have no relationship (other than the fact that Ethereum and all other cryptcurrencies based their design on the Bitcoin blockchain).


How are block rewards claimed in merged mining? How do you claim a block reward on a merged chain?

If I understood it right: let's say you are mining Bitcoin and Namecoin. When you find the solution to a BTC block, you include a transaction in the block to give you a block reward.
If the hash of this block is also a solution for the Namecoin chain, where is the transaction giving you the Namecoin block reward? Where is the Namecoin address getting this reward? Or are Bitcoin addresses also valid Namecoin addresses?
And if you are only mining Bitcoin, can you claim the Namecoin block reward for a solved Bitcoin block afterwards?

The point of mining is to secure the blockchain. Before you mine, you must compose the block you are trying to find a nonce for. That block will include a transaction to pay you.

If you are merged mining Bitcoin and Namecoin, you do the following:

1) You compose the Namecoin block you are trying to find a nonce for. This includes a transaction to pay you the finder's fee.

2) You compose the Bitcoin block you are trying to find a nonce for. This includes a transaction to pay you the finder's fee and a transaction to secure the Namecoin block.

3) Now you try to find a nonce. If it meets the Bitcoin difficulty, you've mined a Bitcoin block. If it meets the Namecoin difficulty, you've mined a Namecoin block.

You submit a Bitcoin block the normal way. The information from the Namecoin block is ignored by the Bitcoin system.

You submit a Namecoin block along with enough information from the Bitcoin block and Merkle tree to prove that the nonce secures the Namecoin block.


Is it possible to accurately map hashing power to network size? Let's say we have a network with n nodes in it. Is it possible, when the hashing power of the network is calculated after a proof-of-work, to accurately estimate n with an algorithm taking the calculated hashing power into account?

There is no correlation between hash-power and number of validating full-nodes in the network.

Consider the following:

Hashrate is necessarily anonymous. Therefore, there is no way to determine how many miners are operating on the network. Furthermore, a miner may operate an arbitrary number of full-validation nodes, from which it creates its candidate blocks.

It is possible to approximate the global hash-rate from recent block intervals/difficulty, but this only captures hash rate that was working on the current strong-chain, not hash rate working on another branch (e.g. selfish mining). Even if we could approximate global hash-rate, it has no relation to the number of full-validating nodes.

Hash-rate is proportional to the demand for Bitcoin transactions. Higher confirmation demand will lead to higher fees in the fee market, resulting in new hash rate joining the market. One may assume that that higher confirmation demand may lead to higher full-validating node count, but that too is not guaranteed, if the node-validation is too costly (big blocks) and becomes centralised (custodial services).


Need an explanation as to why the exchange of BTC for USD is legal Many have asked if the exchange of BTC for USD is legal, and they will cry "legal" and simultaneously cite FinCEN's regulations for a MSB.

However, they never explain if an individual trading BTC for USD (at, say, Mt. Gox or something of the like) is considered an MSB.

Could someone EXPLAIN why it is legal/illegal for an individual to exchange (not run an exchange, but be the customer) BTC for USD.

Thank you.

Right now Bitcoin is the round peg in the regulator's square hole.

If Bitcoin is deemed to be a security, then certain restrictions might apply on how it is bought, sold, and held.  But Bitcoins themselves are not a debt, or a promise, or anything similar so it probably isn't a security.

If Bitcoin is deemed to be a commodity, then certain restrictions might apply on how it is traded, if delivery to the buyer is at some point in the future -- as is the nature of most commodity transactions.

If Bitcoin is deemed to be a foreign currency, then certain restrictions could apply there as well.   FinCEN has explicitly stated that it does not see Bitcoin as a foreign currency.

But almost nowhere is there a restriction about acquiring a good, such as like what Bitcoin exchanges provide.


Creating a Deterministic Keychain from BIP32 master public key I'm trying to create a bitcoinj determinstic key chain from a BIP32 master public key. This is the code that I have written so far:

val xpub = "xpub661MyMwAqRbcGiwzoCu93MuL6H91qANYUoYBwD4xSH8bRKJVNXsP1FUnNYiWUiu4trHbs3tavhbr4ih9bwNeVBmdQAnrA5SwSEVVCFza8dy"
val keyChainSeed : DeterministicKey =  DeterministicKey.deserializeB58(null,xpub, MainNetParams.get)
val w = Wallet.fromWatchingKey(MainNetParams.get, keyChainSeed)

but I get the following error:

No key found for absolute path M/0H.
java.lang.IllegalArgumentException: No key found for absolute path M/0H.
    at org.bitcoinj.crypto.DeterministicHierarchy.get(DeterministicHierarchy.java:94)
    at org.bitcoinj.crypto.DeterministicHierarchy.deriveChild(DeterministicHierarchy.java:152)
    at org.bitcoinj.wallet.DeterministicKeyChain.initializeHierarchyUnencrypted(DeterministicKeyChain.java:590)
    at org.bitcoinj.wallet.DeterministicKeyChain.<init>(DeterministicKeyChain.java:384)
    at org.bitcoinj.wallet.DeterministicKeyChain.<init>(DeterministicKeyChain.java:393)
    at org.bitcoinj.wallet.DeterministicKeyChain.watch(DeterministicKeyChain.java:444)
    at org.bitcoinj.wallet.DeterministicKeyChain.watch(DeterministicKeyChain.java:436)
    at org.bitcoinj.wallet.KeyChainGroup.<init>(KeyChainGroup.java:115)
    at org.bitcoinj.core.Wallet.fromWatchingKey(Wallet.java:260)
    at com.suredbits.core.bitcoin.WalletTest$$anonfun$2.apply$mcV$sp(WalletTest.scala:84)
    at com.suredbits.core.bitcoin.WalletTest$$anonfun$2.apply(WalletTest.scala:80)
    at com.suredbits.core.bitcoin.WalletTest$$anonfun$2.apply(WalletTest.scala:80)

I'm not sure why this isn't working, as bitcoinj supports BIP32. Can anyone spot what I am doing incorrectly?

It looks like you're trying to get a key from a seed, rather than deriving a key using a path. This uses the default derivation settings, which attempt to derive a hardened key, which can't be done using an extended public key.

Try an explicit, non-hardened derivation instead:

val xpub = "xpub661MyMwAqRbcGiwzoCu93MuL6H91qANYUoYBwD4xSH8bRKJVNXsP1FUnNYiWUiu4trHbs3tavhbr4ih9bwNeVBmdQAnrA5SwSEVVCFza8dy"
val keyChainSeed : DeterministicKey =  DeterministicKey.deserializeB58(null,xpub, MainNetParams.get)
DeterministicKey key = HDKeyDerivation.deriveChildKey(
         keyChainSeed, new ChildNumber(0, false));
val w = Wallet.fromWatchingKey(MainNetParams.get, key);

P.S. You should read the BIP32 spec if you haven't already.


blockchain.info seems to source transaction money from an address not in my wallet Today, I have send a transaction with too low a fee:

https://blockchain.info/tx/84eb8a6c6562a9cfedc0e82c7fbe3355615b8154e376db0a325b4ae4f26180b2

I have retrieved the twelve word pass phrase from my wallet on blockchain.info, and calculated the private keys for the addresses in my wallet. However, the address

1PUBmT2fzVMtNWg58K67knqoz58MmCJ8pn

is not amongst these, and it is also the only address that does not show up in my blockchain.info wallet. Therefore it I can only double-spend part of my first transaction (so to void it). What is happening here?

It is likely that the address in question is a change address. Change addresses are generated using a different key derivation path than your other addresses so you will not see it if you only generated the keys at only one derivation path.

The "normal" key derivation path (a.k.a the "external keychain") is m/44'/0'/0'/i. However keys for change addresses are typically generated on a so called "internal keychain" which has a derivation path of m/44'/0'/1'/i. It is likely that you only looked at keys on the external keychain and not the internal keychain so you did not see this address.