Bitcoind, Multisig, and the default account "" I've been attempting to do transactions to and from a multisig address for a couple of days, but I'm finding that my default account "" keeps paying for things, even though I'm explicitly saying other accounts should pay for things via the txid field in createrawtransaction.

For a quick example, if I create a transaction like:

bitcoind createrawtransaction [{\"txid\":\"504aa16418fbb871d307249448bcecdaa5699872a4d22b84d170ae64a2fe89ca\",\"vout\":0}], {\"2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh\":50}

(It's formatted this way because I'm running this in a windows command prompt at the moment, hope to be able to run linux soon!)

the account associated to the address in the transaction's vout where n=0 is "test", but after I sign and send this raw transaction and check listaccounts, "" is debited 50 instead of "test".

If it helps at all, 2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh is a 2 of 3 address of which "test" is a part of.

Am I doing something wrong, or is this just how bitcoind handles situations where all of the addresses in a (multisig) transaction are associated with accounts in my wallet? And if so, why??

It's also all being done in regtest mode, but I wouldn't expect bitcoind to handle transactions differently in that mode.

If anyone is looking for the answer, Gavin Andresen posted it on bitcointalk.org.
https://bitcointalk.org/index.php?topic=567321

Transactions send via sendrawtransaction are always debited from the default "" account. Raw transactions and accounts are not designed to work together, use one or the other .
And preferably not accounts: unless somebody steps up and volunteers to make the accounts feature "industrial-strength" (scalable, integrates with whatever back-end database your company is using to track user information, can be robustly backed up, etc) it is very likely it will be deprecated and then dropped.


How come a company partners with Bitcoin? I was checking out the Bitcoin website, and I've noticed something that I can't stomach :

  The Bitcoin network is growing at an impressive rate and Bitcoin.com
  is forming new and lasting partnerships within the industry. Here
  are some companies we are working with who are fostering a healthy
  ecosystem.

I believe that Bitcoin is not a private company and it's owned by its community, right ? How is it possible for a company to partner with Bitcoin ?

I was checking out the Bitcoin website

There is no such thing. There are various communities and privately-run sites, but they are all distinct, and none are authoritative.

  I believe that Bitcoin is not a private company

That's correct.

  it's owned by its community

That's a matter of perspective. I would say it's not owned by anyone - not even any specific community.

  How is it possible for a company to partner with Bitcoin ?

They're not partnering with Bitcoin. They're partnering with bitcoin.com, a privately-owned and controversial website.


Do all wallets use specific explorers? Do all wallets use specific explorers? If so, is there a way to identify which explorer the wallet is using? Most of the major-mid tier wallets seem very ambiguous or don't seem to mention this at all.

Given the tags you're setting on your question, I believe you're confusing currencies, wallets, and explorers.

Bitcoin (BTC) and Bitcoin Cash (BCH) are currencies with an associated blockchain.

Wallet/node software is what you use to interact with that currency.

Software that interacts with BTC includes Bitcoin Core, Bitcoin Knots, btcd, Electrum, Greenbits, ...
Software that interacts with BCH includes Bitcoin ABC, BUCash, Electron Cash, ...

Explorers are independently run websites that visualize information in particular blockchains. They are unrelated to wallets, and generally something you should avoid for anything but debugging purposes. Relying on a specific website as your source of truth is dangerous as the website may lie. Wallet software generally performs some level of local validation of transactions (or even full validation, meaning that no invalid transactions will ever be accepted). Some explorers have associated wallet software, which relies on that website for information, rather than directly connecting to the network. These are generally discouraged for the same reason.


RPC addmultisigaddress call I tried the following RPC call via the debug window:

addmultisigaddress 2 '["0304a7aadeb1ae96482a10fa634825d86d80dbad8d43cd9177664eaf6f0ff7d890", "022426f087fd017db9f29759efb9d7ff6101a075e46fb591466208a6a6beb321c7"]'

The output was:

3MGYcBNapbmYkvfj9CD4hBykzWxukEE61w

This is a P2SH address, right?

The RPC call just gave the public keys, though, so my wallet won't actually be able to spend any funds sent to that address, correct?

Why even have an RPC call here that let's the user make an address they won't be able to spend from? Is this method just a utility if the private keys aren't known, and the result won't be used in the actual wallet at all?

I guess just an explanation of 'addmultisigaddress' that is more descriptive than the help via the console would be helpful.

You are correct in your understanding: the arguments to the RPC call are just public keys (or addresses, which are hashes of public keys), and if you don't hold all the corresponding private keys, you won't be able to spend coins sent to the resulting address.

But it's far from useless.  The main application of multisig addresses is to require the approval of multiple people in order to spend them, rather like needing two signatures on a check.  In that case, it's desirable for no one person or computer to ever be in possession of all the corresponding private keys  (because then anyone with sufficient access to that computer could spend the coins unilaterally).  Rather, when it's time to spend the coins, the key holders affix their signatures one by one, without ever sharing their private keys with one another.  So in fact, if addmultisigaddress required all the private keys to be available, it would be nearly useless.

For further details on multisig addresses and how to use them, see the rather extensive answer by almel to How will multisig addresses work? And as with any open-source software, the ultimate documentation is the source code.


Bitcoin RPC returning 401 I am using node-bitcoin-rpc to do some api calls to bitcoind, but I am getting 401 error. I know this simply means unauthorized, but I have no authorization enable in my config file.

Howerver I can query bitcoin client using vitcoin-cli --regtest listaccounts, I get the results.

My bitcoin.conf file is pretty simple

rpcport=8332
rpcconnect=127.0.0.1
regtest=1
debug=rpc

PS: I didn't have any bitcoin.conf initially, so I create above one inside .bitcoin folder in home directory.

The RPC interface is an authenticated interface. You need to provide a username and password in order to send RPC commands. These are usually specified in the bitcoin.conf file with the rpcuser and rpcpassword options or the rpcauth option. There are also temporary RPC credentials stored in the .cookie file that can be found in the datadir.

The reason that you have no problems with bitcoin-cli is because it looks up the RPC credentials from the bitcoin.conf file or the .cookie file..


Hot wallet and cold wallet If you have a online site that accepts bitcoin deposits and users can withdraw their balance, Is  it possible to have the deposits go to the watch-only address of a cold storage and the withdraws come from the hot wallet?

If yes, then basically I'll have to give a programmer my private key for the hot wallet and just the master public key for the watch only-address on the server. Am I correct?

The Answer is No, you can not do this. Reasons are below.

It seems you may be confused.

The point of a cold wallet it to store the coins offline, adding a watch-only address to a cold wallet does nothing, other then letting you see that address.

(I could add your address as a watch-only and see your balance as well, but that doesn't give me access to your coins)

If the coins are in the cold wallet then you have to send them from there, generally by creating and signing an offline transaction.

If they are in the hot wallet (even if being watched by the cold wallet) they you can send them from the hot wallet.


!setBlockIndexCandidates.empty() !setBlockIndexCandidates.empty() Bitcoin Core 0.11 error

Hello,

I have a problem with the Bitcoin Core v. 0.11 software!!!

I installed the software today and after a long wait (downloading block source - 5 years) I closed the application and when I tried to start it again I received this error:

"Assertion failed!
File: main.cpp, Line 2287
Expression: !setBlockIndexCandidates.empty()"

If I click Ignore on the error window the program start but with "No block source available" so it can't continue the download. And when I close the program I receive a FATAL ERROR message: "see debug.log for details"

Can somebody tell me how do I fix this error or what do I do next?
And another thing...
I was sent today some Bitcoins and I am asking if the sun can be recovered somehow?

Thanks!

debug.log

I had exactly the same problem with litecoin 0.15.1 and it helped me to run it with --reindex option on the command line. I only had to do it once...


Who was the person that told Satoshi "You will not find a solution to political problems in cryptography"? I think this answer to a statement by Satoshi in the cryptography mailing list is one of the most interesting and revealing things he's said:

The original statement:

  You will not find a solution to political problems in cryptography.

Satoshi's answer:

  Yes, but we can win a major battle in the arms race and gain a new territory of freedom for several years. Governments are good at cutting off the heads of a centrally controlled
  networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own.

source:
https://www.mail-archive.com/cryptography@metzdowd.com/msg09971.html

However, it seems like the original statement in the mailing list that Satoshi is replying to seems to have been made off of the mailing list thus the full message and the identity of the person is unknown. Who was this person and what was his full message?

It seems that no-one except Satoshi and the original author knows, as indeed the correspondence was not made on the mailing list and the rest of the message was not made public.


Why does Bitcoin keep transactions in a memory pool? Why does Bitcoin keep (unconfirmed) transactions in a memory pool? What would happen if these were stored on disk instead?

A large part of those transactions only needs to be kept for a limited time, in the order of 10 minutes. Once transactions are in a block they are removed from the mempool and the whole block is written to disk.

However while the transactions are in memory they are actually consulted quite often. For every newly incoming transactions checks need to be done to see for example whether it conflicts with any of the existing transactions or whether it's a child or parent to an already existing one.

Writing and reading them from disk will cause quite a bit of overhead. Which is actually important not just because it's a bit of overhead. For example it might open up DOS attacks where hostile nodes can create patterns of transactions that maximise reading and writing disk.

Also for transaction and block propagation speeds it is important that transactions are validated as quickly as possible.

Another point is that the amount of memory used by the mempool isn't actually huge anyway. Work is being done on better filtering of which transactions are allowed into the mempool in the first place (minimum fees and Child Pays for Parent etc.). As well as expunging older and/or low fee or otherwise lower interest transactions out when the mempool nears full.


Does the percentage of fluctuation remain the same regardless of the value in all wallets? This was initially going to reference this question here

I, as well, have $10 bitcoin in my wallet, I notice the value does fluctuate. However, will the value fluctuate the same in a $100 wallet, as if it were $10?

In other words, my $10 is now $11.72, does that mean the value of a $100 wallet will be $101.72, or will the value be much higher?

if your bitcoin equivalent value of 10$ became 11.72$, then 100$ will be 10 times the value - at 117.20 (not 101.72 - I assume this was just a typo).


What is the relationship between the Ripple secret key and the wallet name/passphrase? The Ripple client has both a wallet name/passphrase and a secret key, and to the newbie it's not clear why there are two secrets. The client advises the user to write down the secret key and keep it safe so the funds can be recovered if the wallet is lost. If the funds can be recovered using just the secret key, then why does it have a wallet name/passphrase as well?

Is the wallet name/passphrase just for convenience (easy to remember)?

Why can't the wallet name/passphrase be changed?

Why not generate the secret key from the wallet name/passphrase so that the user has only one secret to keep safe?

Is the wallet name/passphrase just for convenience (easy to remember)?

Yes. Because anyone trying to steal your funds would first have to get hold of your wallet file before he could use the passphrase, it doesn't have to be quite as secure as the secret.

  Why can't the wallet name/passphrase be changed?

Because then you'd have two passphrases you'd have to keep secure forever to protect your account. The decrypted wallet yields the secret and the secret owns the account. There's generally no way to be sure you've destroyed every copy of your wallet.

  Why not generate the secret key from the wallet name/passphrase so that the user has only one secret to keep safe?

That would defeat the point of the passphrase because it would no longer be able to be any less secure than the secret. Anyone could try common name / passphrase combinations at a very high rate to see if any of them matched existing accounts.


Script for sending funds to a multisig address Does sending funds to a multisig address require different script than the one used for ordinary addresses? If yes, how should this script look like? (Under multisig address I mean Bitcoin script hash which starts with 3 instead of 1).

I write a bitcoin library in Scala for research purposes which can be found here: https://github.com/ahahaebat/BitScala. Current code creates correct transactions for ordinary addresses but fails to do so for multisig ones.

Currently the script is the same for both types of addresses:
OP_DUP, OP_HASH160, address_hash, OP_EQUALVERIFY, OP_CHECKSIG

Should I change it somehow for multisig addresses?

Yes. Script for P2SH should be:

OP_HASH160, address_hash, OP_EQUAL


what is the difference between eatch coins wallet address,what is the coin public id/salt? i looked at the link: http://brainwallet.org/

witch generate offline wallets for all major coins,
i noticed that the same Passphrase generate different  [Private Key&Address] pairs for eatch coin type, witch means eatch coin has a public shared id (or salt) added to the mix of the hash, am i right?

so how can i get that public coins key? and how can i edit the javascript  to support other scrypt coins?

eatch time i change coin in the menu a function is called,
i got that code of the page:

  PUBLIC_KEY_VERSION = parseInt($(this).attr('data-target'));
  PRIVATE_KEY_VERSION = (PUBLIC_KEY_VERSION+128)&255;
  ADDRESS_URL_PREFIX = $(this).attr('href');
 ....
    var eckey = gen_eckey;
    var compressed = gen_compressed;
    var hash_str = pad($('#hash').val(), 64, '0');
    var hash = Crypto.util.hexToBytes(hash_str);

    var hash160 = eckey.getPubKeyHash();
    var h160 = Crypto.util.bytesToHex(hash160);
    $('#h160').val(h160);

    var addr = new Bitcoin.Address(hash160);
    addr.version = PUBLIC_KEY_VERSION;

    $('#addr').val(addr);

when addr is the wallet address....

and the data-target  for the links are:

bitcoin : 0x00
dogecoin: 0x1E
litecoin: 0x30
namecoin: 0x34
.
.
.

is this is the uniqe identifire of the coin? is if possible?
it's just a single byte...

if not than what is?, and if yes how can i get the identifier of other coins, not listed (any way to extract it from the network/wallet software)?

thanks

Yes, currencies like Bitcoin typically have a version byte that gets stored in the address which would be the PUBLIC_KEY_VERSION in the code you found.

More information here:

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

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

There is another byte used for private keys as well. See:

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

These bytes can't really uniquely identify a coin but they should make it harder for users to accidentally send Bitcoin to a Dogecoin address or make other mistakes like that.


Can someone explain nLockTime? I'm having a hard time understanding how nLockTime works. The Bitcoin wiki has an explanation that is confusing to me:

  nLockTime is a parameter that can be attached to a transaction, that mandates a minimal time (specified in either unix time or block height), that before this time, the transaction cannot be accepted into a block.

Can someone explain it in plain English, with an example?

From the wiki it basically states that you can make a transaction to another bitcoin address and add nlocktime. The way that this would work in real life would be if you get paid on salary and are paid bi-weekly, the bitcoins will be on the network but won't reach you until the nlocktime is up
Edit: read example 1 from https://en.bitcoin.it/wiki/Contracts


64: non-mandatory-script-verify-flag (No error) (-26) What does this error mean?

I've manually constructed a transaction, and I get this error when I try to insert it in to the network.

From the source code:

// Check whether the failure was caused by a
// non-mandatory script verification check, such as
// non-standard DER encodings or non-null dummy
// arguments; if so, don't trigger DoS protection to
// avoid splitting the network between upgraded and
// non-upgraded nodes.

It sounds like maybe your transaction signature isn't standard.


GUI Miner no responses to getwork, and Verification failed I just starting with mining today I have everything set up for slush pool on
GUIMiner - v2012-12-03 .  I'm not sure what is wrong but this is what the console says

2013-06-21 01:37:26: Listener for "GPU Miner" started
2013-06-21 01:37:28: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:28, checking for stratum...
2013-06-21 01:37:28: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:28, started OpenCL miner on platform 0, device 0 (Juniper)
2013-06-21 01:37:28: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:28, no response to getwork, using as stratum
2013-06-21 01:37:39: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:39, Verification failed, check hardware! (0:0:Juniper, a4627d39)
2013-06-21 01:37:51: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:51, Verification failed, check hardware! (0:0:Juniper, 9fcd8ac2)
2013-06-21 01:37:52: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:52, Verification failed, check hardware! (0:0:Juniper, 87fcf304)
2013-06-21 01:37:55: Listener for "GPU Miner": stratum.bitcoin.cz:3333 21/06/2013 01:37:55, Verification failed, check hardware! (0:0:Juniper, 5aa4b0f1)!

I also took a screenshot of the settings I have chosen here.

An answer can be found on bitcoin talk

https://bitcointalk.org/index.php?topic=177855.msg1852355#msg1852355

Quote from deepceleron on bitcoin talk

  This is your GPU returning invalid hashes from it's kernel. This is
  because new drivers are crap for older cards.

  Uninstall AMD APP SDK
  Uninstall AMD Catalyst Install manager: choose "uninstall all software", make sure you have only a VGA driver after restart.
  Manually remove these files not removed by the installer; any other obvious ATI files with the same file date:
  C:\Windows\System32\amdocl64.dll   C:\Windows\System32\amdoclcl64.dll
  C:\Windows\System32\OpenCL.dll   C:\Windows\SysWOW64\amdocl.dll
  C:\Windows\SysWOW64\amdoclcl.dll   C:\Windows\SysWOW64\OpenCL.dll
  Install just the Catalyst 11.11 driver package (no SDK is needed; the AMD APP runtime is included with driver)
  Mine just a bit slower on your 6870 than a 5830 would.

  Better:
  - use cgminer
  - set phatk worksize to 256 and underclock GPU RAM to 300MHz for best power efficiency and higher hashrate

The big thing to take away from this:
set phatk worksize to 256 and underclock GPU RAM to 300MHz for best power efficiency and higher hashrate

A suggestion i can give you is that bitcointalk can be a great place to find the answer to a lot of off the wall questions related to bitcoin or any alt-coin.


Someone want to mine with my bitcoin (www.elitecoinmine.com) Promises? I just signed up to ask this Question. Shoort story about me: I don't know much about crypto currency, just spend 50Eur once to buy some Dash.

Anyway, there's a guy writing me via my instagram and then via whatsapp since almost a year, he always ask me to buy Bitcoin (about 150$ at least) and he will be my manager and www.elitecoinmine.com will be using my bc to mine, and he talks about very fast profit (in about 48 hours).
So I asked one of my close friends who is more into crpyto currency and he was lauginh about it, like "How can someone mine with your bc, thats rediculious".

Now I want to ask you guys, is it even possible that someone mine with my bc?? or is this a bad joke at all, i can see that i might rent some equipment to do mining, which i would never do, but using my bc to mine??

He always talks about that they work with antminers S9 (whatever that means)

and yes it's all about www.elitecoinmine.com, if someone got some expirience please let me know, i'm very puzzled since I don't know that much about it.

Thanks in advance

This is a scam.  Block all contact with this person and do not send any money, passwords, keys, or anything else.

Your friend is right, there is no such thing as mining "with" somebody's Bitcoin.  Mining requires specialized hardware (such as the AntMiner S9, which is a real device) but if one has that hardware, one doesn't need access to additional coins or anything else.

The scam will probably be organized in a way that it looks like you keep control of the coins throughout the process, and such that it is not obvious that your coins have been transferred to the scammer.  But in the end, when you try to get them back, you will find that you can't.


How would an Auditor ("m") of BIP32 audit the keys generated by the master? Suppose an auditor needs to review all the incoming Tx for a given wallet... or many wallets.  What are the logical steps the Auditor needs to do?

Do they need to pre-generate a list of all possible public keys and watch new blocks for those transactions?

Assuming that there is no limit to BIP32 keys, that means the auditor would need an infinite amount of resources to audit a key (pre generation, and then cross referencing each incoming Tx).  What are some appropriate ways to constrain this auditing?

Do they need to pre-generate a list of all possible public keys and watch new blocks for those transactions?

Essentially.

  Assuming that there is no limit to BIP32 keys, that means the auditor would need an infinite amount of resources to audit a key (pre generation, and then cross referencing each incoming Tx). What are some appropriate ways to constrain this auditing?

Deterministic keys are used sequentially. Currently a client will scan up until they hit a sequence of unused addresses in a row and assume none past this gap have been used.


How Bitcoin mining contributes to confirmations? Based on my knowledge I know (maybe wrong) when a miner is doing hash, he is inputting any arbitrary values, in order to get a value that can be hashed into something with certain preceding zeros. When he got that value, he put that value into the blockchain and generate a new block.

Then how is this contributing, or say, relating to the confirmations? Since the miners are just guessing arbitrary values to get the 0000000 preceded hash.

I think I must have some misunderstanding. I want to know how the hash-guessing is related to confirming the transactions.

he is inputting any arbitrary values, in order to get a value that can be hashed into something with certain preceding zeros. When he got that value, he put that value into the blockchain and generate a new block.

It happens in reverse.
First the miner builds the new block itself. Then builds its header, then hashes that header. Also what the miner looks for is not preceding zeros, but instead is a number (hash result interpreted as integer) that is smaller than the target.

The steps are something like this:

Take 0 to max (to fill the block) number of transaction from mempool
Build the mandatory coinbase transaction
Build the hashMerkleRoot based on 1&2
Fill the block header fields: Version, hashPrevBlock and Bits are unchanging; hashMerkleRoot, Time and Nonce can change
Start a loop and change the variables on its iterations and hash the header.
Convert the result of the hash to an integer and compare it with the target.
Break out of the look and publish the result if hash <= target or if someone else were luckier and found and published the same block.

You can find more information in these links:
https://en.bitcoin.it/wiki/Block_hashing_algorithm
https://en.bitcoin.it/wiki/Proof_of_work

  Then how is this contributing, or say, relating to the confirmations?

Confirmation is when a transaction is included in a block that was found. 1 confirmation means the transaction is inside the last found block, any subsequent number shows the depth of the transaction compared to the block height of that time and is an indication of how hard it would be to perform a double spend.  https://en.bitcoin.it/wiki/Confirmation


When importing a wallet from private key or seed phrase, how do you guess the correct address format? I am building a bitcoin wallet. I can derive addresses using the derivation paths. How do I determine the derivation path for the seed when importing it?

How do I determine the derivation path for the seed when importing it?

I don't think you can determine the derivation path from the seed phrase, you have to ask the user to choose one from a list or input it if not listed. You can build in a list of derivation paths for popular wallets, the user then has to know the name, and maybe version number, of the wallet that produced the seed they are importing.

or do i just do a wallet address lookup based on the supported derivation paths and keep searching for about 20 address if it has any transactions on the blockchain ?

That would work in many cases. It assumes you have access to a full copy of the blockchain indexed by all addresses with non-zero balance. It needn't be local but a non-local source might make your seed-importation take a long time.


About a change in 0.8.6 - free transactions with less than 0.01 outputs // This code can be removed after enough miners have upgraded to version 0.9.
// Until then, be safe when sending and require a fee if any output
// is less than CENT:
if (nMinFee < nBaseFee && mode == GMF_SEND)
{
    BOOST_FOREACH(const CTxOut& txout, tx.vout)
        if (txout.nValue < CENT)
            nMinFee = nBaseFee;
}

The above if clause was as below:

if (nMinFee < nBaseFee)

Gavin explains this change as:

  Remove the rule that all outputs of free transactions must be greater
  than 0.01 XBT. Dust spam is now taken care of by making dusty outputs non-standard.

I don't see any other code change in the same commit. How is dust spam taken care of? Was it made non-standard in a previous version?

Initially, "dust" transactions were made nonstandard in commit 8de9bb53:

  Define dust transaction outputs, and make them non-standard


How do I install a specific version of bitcoin-core I need to run bitcoind version 0.17, however the latest available version is 0.18, if I follow the instructions from this link it installs the latest version.

The below links lists the packages for the version I need however I am not sure how to use it, I mean how to install it on my local machine as apt-get install command does automatically.

https://bitcoincore.org/bin/bitcoin-core-0.17.1/

Can someone help me with this please?

If you're building from source, you can select a specific version as follows:

First, review the build requirements, dependencies, and instructions for your OS:

https://github.com/bitcoin/bitcoin/tree/master/doc

Once that is done, use git to pull the source code and select a branch:

## clone the bitcoin repository
$ git clone https://github.com/bitcoin/bitcoin.git

## change folders
$ cd bitcoin

## check which versions are available
$ git tag

## find your desired version in the list, and then 'checkout'
$ git checkout v0.x.x

## now you can build:
$ ./autogen.sh
$ ./configure
$ ./make
$ sudo make install

Once you have finished the install and booted up bitcoind, you can confirm the correct version of the client and daemon are running:

bitcoin-cli getnetworkinfo

bitcoind --version


How resilient are Proof of Stake (PoS) mechanisms to brute force quantum computing attacks? The article called "Bitcoin vs. The NSA’s Quantum Computer" was a great read pertaining to Bitcoin, and computing minimum thermodynamic energy required to brute force attack public key to discover the companion private key, Elliptic Curve Digital Signature Algorithm (ECDSA) vulnerabilities to quantum computing, and how Bitcoin public addresses hide public keys until money is spent.

If the SHA256 and RIPE160 cryptographic hashing mechanisms are impervious to inversion (due to information collapsing loss - black hole operations) by whatever computing means used to create them, then the Bitcoin Blockchain should be fine a long as quantum computing mining does not gain much more than a 51% computing advantage for populating the Blockchain with Bitcoin's Proof of Work (PoW) mechanism.

How will the integrity of an "energy efficient" PoS Ledger fare (during the advent of quantum computing) if it is overly reliant upon traditional digital signature technology for implementing its staking mechanism?

The main ways in which Bitcoin uses crypto algorithms are the following:

Hashing (2 x SHA256) of the block header for proof of work.
Hashing (SHA256 + RIPE160) of the public key to obtain an address (followed by base58 encoding but that's not crypto per se)
ECDSA to generate and validate signatures, allowing you spend an output.

The 2 first ways don't use ECDSA and so are not exposed to quantum computing attacks (assuming no mathematical breakthrough in prime factoring).

ECDSA signatures on the other hand may be breakable using quantum computing. So given an ECDSA public key and a quantum computer, one may be able to discover the private key.

However, public keys are only embedded in inputs when spending an output. The output itself only includes the hash of the public key, which is safe (one would need to break both ECDSA and hashing to recover the public key).

So to summarize, if a quantum computer was to be invented and assuming it could break the ECDSA asymetric encryption, the attacker could acquire all Bitcoins on addresses that have been reused (as the public key is known). Bitcoin addresses that have only been used once and proof of work should be safe. Same applies to proof of stake.


Why isn't Bitcoin using public key extraction from signature to reduce the blockchain size? Why doesn't Bitcoin use public key recovering from the signature in order to reduce the Blockchain size? This would save 32 bytes per transaction input.

The author of wxBitcoin was most likely unaware of the ability to do this, there's other inefficiencies like the original use of uncompressed points and BER encoding for signatures which also would have been good to eliminate.


Quick and easy mining on OS X I am new to Bitcoins, and I'd like to get started mining, but I'm on OS X. I've tried several different mining applications, and none of them have worked for me. I've got nothing but errors. Is there a mining application that has quick and easy setup?

I have tried DiabloMiner, RPC Miner, and one other that I can't remember the name of. I will put it up here if I find it.

Try the DiabloMiner app. It uses an older version of Diablo Miner that should work. The developers behind bitcoin mining software usually do not put much effort into Mac compatibility mainly because of two aspects:

Most Macs (iMac/Macbook/Macbook Pro) are not suited for mining because they have poor ventilation, which causes overheating issues.
Apple's OpenCL implementation is not very good. There are constant complaints about its inefficiency and incompatibility with mining software.


How does an SPV wallet use the headers that it downloads? My understanding is that an SPV wallet downloads "headers only". These headers are not enough to get a UTXO set, so it has to rely on another data source when it comes time to move bitcoin. If thats the case, then why does it even need the headers?

The SPV uses the Merkle Root in the header to verify transaction information full nodes provide. As a header refers to the previous block by hash, an SPV wallet can be somewhat sure that it has real blockchain information.

To hear about transactions relevant to it, an SPV requests to get information about any transactions involving a provided set of public keys (some of which actually belong to the SPV, but not all) from a full node. The full node does the look-up, then tells the SPV which blocks have transactions that are relevant for it. Now, the SPV doesn't have all transaction information, and if it only got transation C, it would have no way of knowing that this information is accurate. However, this is where the Merkle root comes into play, as a way to provide minimal information to verify the existence of transactions.

An Example:

Let's say this block X has three transactions A, B, and C; the transaction C being relevant to the SPV.

See the following picture for an overview how the Merkle Root is derived from the three transactions.

Now, if the full node would just provide C, the SPV would have no idea if the transaction is actually in block X, but by providing also H(A|B), the SPV can re-derive the Merkle root, allowing it to verify that C is in the block.

To read more about some shortcomings of SPV wallets please refer to Bitcoin's answer.


Anyone could teach me more detail about version prefix In this post Does the version prefix of an address force the type of transactions the address may treat?, I saw "the version byte doesn't actually appear in the final transaction."
I don't understand why? Could anyone can help to tell more detail about that?

The address prefix determines how a wallet will interperet the address. Let's look at an example.

Generate a P2PKH address

Take a public key, e.g. 023cba1f4d12d1ce0bced725373769b2262c6daa97be6a0588cfec8ce1a5f0bd09
Apply HASH160: 3a38d44d6a0c8d0bb84e0232cc632b7e48c72e0e
Prepend the version prefix for P2PKH (0x00): 003a38d44d6a0c8d0bb84e0232cc632b7e48c72e0e
Base58Check encode it: 16JrGhLx5bcBSA34kew9V6Mufa4aXhFe9X

See How to Generate a Bitcoin Address — Step by Step for command line steps.

Prefixes

Bitcoin has 2 main address prefixes (mainnet):

P2PKH (Pay to Public Key Hash): 1
e.g.: 17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem

P2SH (Pay to Script Hash): 3
e.g.: 3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX

Addresses are just representations of the information necessary (scriptPubKey) to create a transaction output, which is part of the transaction and which is validated and stored on the network. It is only used by wallet application software, addresses are not stored on the Blockchain in this format.

The wallet will determine, based on the address prefix, when it is decoded, how to construct this scriptPubkey. For P2PKH this would be in this form:

OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

Where you will notice, the only info it needs is the pubKeyHash which is contained in the decoded address (step 2 above). However, the format for a P2SH scriptPubkey is OP_HASH160 <scriptHash> OP_EQUAL. If you used the wrong prefix, the wallet would create the wrong script and a tx will most likely burn those coins because no one will be able to guess keys/scripts that will successfully satisfy the scriptPubkey.


What is the Lightning Network proposal? What problem is it trying to solve? We already have a few questions about technical details of Lightning network, however, …

What is the Lightning network proposal in the first place?
What problem is it aiming to solve?

Two issues with Bitcoin's design
Scalability of "everyone checks everything"
Bitcoin is a gossip network:
P2P nodes connect mostly randomly to each other and pass-on new information to each other as they receive it. That way, information floods through the network quickly: each step further increases the nodes that were informed exponentially (until most are).
In Bitcoin every node receives and checks every piece of blockchain data, currently some are relayed even more than once. While this is a manageable problem at 1 MB blocks, this setup has a real cost: bandwidth usage, CPU load for verification, and storage-footprint on the hard drive.
At 1 MB, the Bitcoin network can support about 3 transactions per second (tps). To scale up to Visa-levels we'd likely need around 3,000 tps. To serve all internet commerce, a multiple of that. While there are some gains possible with more efficient use of the space we have (CoinJoin, Schnorr Signatures, …), it is obviously a much harder challenge to manage ~1 GB blocks every ten minutes. At that point, relay bandwidth would be a multiple of that, verification of 144 GB blockchain data per day would take a significant portion of an average home computer's computing power, and hard drives would tend to fill up fairly quickly.
It follows that there is a limit to what can be done with pure on-chain scaling.
Instant payments
Early Bitcoin merchants were comfortable to take the risk of accepting zero-confirmation transactions. The "first-seen" principle was firmly established as a node policy and even transactions without fees would confirm eventually.
Since then, blockspace demand has increased, some miners changed their policy to mine the transaction with the most fees instead of the "first-seen", and zero-fee transactions have become infeasible.
Meanwhile, payment processors and some merchants still take the calculated risk of accepting transactions before confirmation, but generally, a transaction is only reliable after it is confirmed.
Lightning Network
The Lightning Network (LN) proposal describes a structure to provide secure, instant transactions negotiated only among the involved users.
LN leverages payment channels, a type of multi-signature construct, to create jointly managed balances between pairs of users. By re-negotiating the balance's payout shares, the users can instantly transfer balance to each other. Each re-negotiation is recorded as an update to the smart-contract securing the funds of both parties.
By having multiple connections in the network at once, users can receive balances from one partner and forward them to another. Leveraging this network, Lightning Network is promising instant payments to every other LN participant and increased transaction capacity at a low-cost.
Should a user wish to close a payment channel, the smart-contract's current state can be executed on the Blockchain as a regular transaction.
Interested to read more? See → How does the Lightning network work in simple terms?


What IDE to use for Bitcoin development? I want to experiment with Bitcoin's code (both Core and Unlimited, if it makes a difference).

I really wanted to use CLion, but was unable to compile it and make it work (something to do with using a different Make?)

I am weaker on the "setting up stuff" side, and I usually don't use C++, so a detailed explanation how to do something like printing "Hello World" every time a new block is received will be my dream come true.

Thanks!

Bitcoin Core uses the autotools build system, but CLion only supports projects using CMake, so you can't use Core with CLion. You should be able to use Core with Eclipse CDT and NetBeans as those support Autotools. You may need to do some special configuring for it to work properly. Most people who work on Core just use text editors, command line build commands, and gdb instead of an actual IDE (at least that is what I use, and I have heard some others do too).

If you want to add debugging print statements to the code, just add lines like this:

fprintf(stderr, "some text here\n");

and that will print some text here to the terminal if you are running it from the terminal. fprintf is a standard C function so you can look up how to use it to include more information in the output.


Mining software not using Json-RPC? Is there some mining software out there that doesn't use Json-RPC as a communication method with the mining pool? If so, what protocol are they using?

Jeff Garzik wrote a binary protocol for pushpool originally.

BitPenny uses a proprietary protocol to get p2pool-like benefits.


Create an OP_RETURN tx and validate it's existence in Regtest A part of my MSc thesis is storing the hash of a string with OP_RETURN tx in the Blockchain to exist as a proof.

My main concerns are:

-how can i send this tx successfully to my regtest network

-how can i see (with a RPC) if this tx happend

I have already stored the string to a file and hash it afterwards. But I have difficulties with connecting my Java with the Regtest network.

Here is my code:

public class Main {

public static RegTestParams params = RegTestParams.get();
static BlockStore bs;
static Block b;

public static Context context = new Context(params);
public static WalletAppKit bitcoin;

public static void main(String[] args) throws InterruptedException, ExecutionException, BlockStoreException {

    WalletAppKit kit = new WalletAppKit(RegTestParams.get(), new java.io.File("."), "test");
    kit.startAsync();
    Wallet wallet = new Wallet(params);

    BlockChain chain = kit.chain();
    bs = chain.getBlockStore();
    Peer peer = kit.peerGroup().getDownloadPeer();
    b = peer.getBlock(bs.getChainHead().getHeader().getHash()).get();

    peer.addWallet(wallet);

    Address myAddress = new Address(params, "n4MN27Lk7Yh3pwfjCiAbRXtRVjs4Uk67fG");

    Writer w = new Writer();
    final File results = new File("C:\\Users\\Maria\\workspace\\blockInfo\\results.txt");
    File writtenFile;
    Sha256Hash resultHash;

    // write the results of my draw to a file
    writtenFile = w.writeToFile(results);

    // hash the contents of the file
    resultHash = w.hashTheFile(writtenFile);
    System.out.println(resultHash);

    SendRequest req;
    Transaction transaction = new Transaction(RegTestParams.get());

    // the following statement will help to create an OP_RETURN with
    // resultHash as the message
    transaction.addOutput(Coin.ZERO, ScriptBuilder.createOpReturnScript(resultHash.getBytes()));
    req = SendRequest.forTx(transaction);

}

}

I'm not familiar with the Java API you are using but here are the steps and a C# code sample that I used to create a valid transaction on regtest. The sample and steps are from my rough and ready dev notes so there may be a few leaps of faith (hopefully not).

You'll need to adjust the steps below for your own paths/OS/set up.

Step 1: The command line used for the local bitcoin full node in regression test mode (https://bitcoin.org/en/developer-examples#regtest-mode):

"C:\Program Files\Bitcoin\daemon\bitcoind" printtoconsole -datadir=f:\temp\bitcoind -server -regtest -debug=1

Step 2: The command line used to request the bitcoin daemon to generate a 101 height blockchain:

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest generate 101

Step 3: If the bitcoin server node was initialised with an empty blockchains the getbalance command should now display a 50.00000000 which represents the coin base amount from the first block following the genesis block.

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest getbalance

Step 4: To find the transactions available for spending.

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest listunspent
["C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest getrawtransaction  true]

Step 5: To get the private key to sign a spend transaction (MAKE SURE -regtest IS SPECIFIED OTHERWISE YOU COULD EXPORT YOUR LIVE PRIVATE KEY AND POTENTIALLY LOSE $$$).

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest dumpprivkey

Step 6: After sending a transaction check whether it was accepted as valid and added to the mempool.

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest getrawmempool

Step 7: If the transaction is successfully validated and accepted into the mempool then the next step is to generate a block that includes it.

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest generate 1

Step 8: The address that the coins were sent to can then be checked to verify that the coins were received (not you can't use getbalance unless the send to address's private key is imported into the wallet).

"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest importaddress mssuKhM1CMDgcCm3LyGunA1o6129FnkHyk rescan
"C:\Program Files\Bitcoin\daemon\bitcoin-cli" -datadir=f:\temp\bitcoind -regtest getreceivedbyaddress mssuKhM1CMDgcCm3LyGunA1o6129FnkHyk

In the code sample below you need to replace the keys with the ones you extract using the bitcoin-cli steps above. There's undoubtedly an easier way to do this and these notes are from my first couple of weeks mucking around with Bitcoin.

using System;
using System.Threading;
using NBitcoin;
using NBitcoin.Protocol;
using log4net;

namespace SpendTransaction_WithCli
{
    class Program
    {
        static ILog logger = log4net.LogManager.GetLogger("default");
        static Network _network = Network.RegTest;

        static string _unspentTxId = "5d1db816efc865ab33eb8d5c9f0238501dfd849fc67cc941565236b36e43b234";    // Need to get this from bitcoin-cli (see Step 4 above).
        static string _unspentScriptPubKey = "03c1a1a614c8549373b2ec35f586aa8b33a3bf5ac3e0a1b8cf27e650bdb5a126f0 OP_CHECKSIG"; // Need to get this from bitcoin-cli (see Step 4 above).
        static string _sendFromPrivateKey = "cQYdUpoeJZP7FmxUeiaKSLPo9eHsDAYbWs17DgY44yHX2sATK2Cw";         // Need to get this from bitcoin-cli (see Step 5 above).
        static string _receiveToPrivateKey = "cR7X4Nd5WqA5mNwgX67th4Jo3K9vTTm28w8njLL9JT8hHPdbstL8";        // This is an arbitrary key that is used to send some coins to.

        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();

            // Set up the private keys and addresses for the sender and receiver.
            Key sendFromPrivKey = Key.Parse(_sendFromPrivateKey, _network);
            BitcoinPubKeyAddress sendFromAddr = sendFromPrivKey.PubKey.GetAddress(_network);

            Key receiveToPrivKey = Key.Parse(_receiveToPrivateKey, _network);
            BitcoinPubKeyAddress receiveToAddr = receiveToPrivKey.PubKey.GetAddress(_network);

            logger.DebugFormat("Sending from {0} to {1}.", sendFromAddr, receiveToAddr);

            logger.Debug(sendFromPrivKey.ScriptPubKey);
            logger.Debug(sendFromPrivKey.PubKey);

            // Create the transaction to spend the bitcoin.
            OutPoint spending = new OutPoint(uint256.Parse(_unspentTxId), 0);
            Script spendScriptPubKey = new Script(_unspentScriptPubKey);

            var spendTx = new Transaction();
            spendTx.Inputs.Add(new TxIn(spending, spendScriptPubKey));
            spendTx.Outputs.Add(new TxOut(Money.Parse("49"), receiveToAddr.ScriptPubKey));

            spendTx.Sign(sendFromPrivKey, false);

            logger.Debug(spendTx.ToString(RawFormat.BlockExplorer));

            // Send the transaction to the local bitcoin node.
            using (var node = Node.ConnectToLocal(_network))
            {
                node.VersionHandshake();
                node.SendMessage(new InvPayload(InventoryType.MSG_TX, spendTx.GetHash()));
                node.SendMessage(new TxPayload(spendTx));
                Thread.Sleep(500);
            }

            Console.WriteLine("Press q to quit...");

            while (true)
            {
                var keyPress = Console.ReadKey();
                if (keyPress.KeyChar == 'q')
                {
                    break;
                }
            }

            Console.WriteLine("Exiting...");
        }
    }
}


Is Cointellect a scam? I downloaded coin Miner from Cointellect.com on my PC and I started mining.
I have some questions:

Is the software a scam?
Has anyone gained real money from this software?

When I read forums, some people talk about scam and trojan viruses installed on their machines; others show money gained.

This is undoubtedly yet another scam. It's intent is the only question.

Your first port of call seems obvious; Google Is cointellect a scam?
Answer: yes.

Explanation:

Pooling the CPU resources of every miner using this software would be a fraction of the power for even the oldest ASICs.

As an analogy, the site is saying individuals need to dig an open cut mine with their spoons while mining rigs (ie 50ft tall trucks) are carting away pay dirt to process. Pool all the spoons you like, there's simply no feasibility of any reward - but assuming the improbable, if a block was mined, how is the ฿25 distributed? If you can't answer that then that's indicative of a scam.

As far as the "debate" about some users saying they've seen returns; this is how scammers operate. They use shills (fake positive reviewers) claiming profits which never occurred.

Whether the scam is fruitlessly using CPU to try and mine is possible, but it's astronomically more likely the software is a vector for Trojans to steal your Bitcoin. These types of malicious "mining" software are simply identifying newbie Bitcoin users, infiltrating the OS with a Trojan/RAT/keylogger, then stealing your wallet / private keys if/when they become available.

Assuming a Windows installation, you're basically screwed. The software likely already has your login info, passwords, private keys, credit card details; any and all are likely compromised. I'd immediately disconnect from the Internet and do a fresh install of your OS.

Please, research these things beforehand because so many of these services are popping up. Let's hope the Bitcoin Savings And Loan retroactive prosecution of running a Ponzi scheme sets a precedent and scares some would be scammers straight.

EDIT:

Virus analysis of software
SSL certificate owned by unknown
Company name similar to banking conglomerate but not that company

Take this info as you like. It's fact. Not libellous.


Bitcoin from an economic standpoint? Anybody have any good resources to learn about bitcoin from an economic standpoint?  Specifically discussing the debate around its deflationary nature?

From what I gather, the deflationary aspects of Bitcoin are tied to the limited supply and  lack of central regulation. I'm still learning about it but here is a collection of articles I put together on the subject: http://wayfinder.co/pathways/530d0adaa30064b367000088/an-economic-primer-on-bitcoin


Please Help! !Unconfirmed transfer for over 12 hours using recommended fee? I have been waiting for over 12 hours for this transaction to confirm:
https://blockchain.info/tx-index/76621daadefc4b5756e23ada1358ca4544683a6af0edda1766b1713ed9224188?show_adv=true
it is unfortunately pretty important. I am using multibit and using the recommended fee, perhaps I need to update. Will mulit bit keep resending the transaction or should it cancel at some point?

It is confirmed now.

The fee for that transaction should be little more than 0.0001 btc.

Click "Settings" in Multibit and increase the fee to about 100 satoshi per byte to get fast confirmations.


Is blockchain protected from history spaming? As I understand, full nodes accept block even if it is not mined on top of most recent block and store it as alternative chain as long as it fullfills protocol rules.

What would happen If one start mining millions (or more) of new versions of block height 10 (based on block 9) and keep sending them to the network? Could this cause full nodes to fill their hard drives and make them inoperational?

In other words - is there a limit for side chains enforced somehow by Bitcoin Core or protocol rules?

Full nodes use checkpointing: they decide a past block (and all the blocks before it) to be definitive. Any block relayed to them that'd have happened before that checkpoint would be ignored. See this article for more details.


Why did they have to expand the nonce value range? My understanding is that at a certain point, once hardware passed the 4 GH/s level, the 4 billion possible values for the nonce became insufficient in bitcoin mining, because a good rig could exhaust them all in less than a second, and then had to wait until the next second for the timestamp value to change and then try the next 4 billion.

The thing I don't get, though, is why they couldn't adjust the timestamp in increments of less than one second? What about milliseconds and nanoseconds? Why not adjust that input instead of the nonce range?

Edit: Is it that the timestamp has a fixed format that ends at seconds, and changing this would be more difficult / less efficient than simply appropriating space from the coinbase transaction?

They didn't. Nonce is still 4 bytes [1]. Miners don't have to wait when they run out of nonces. Miners just adjust another nonce (the extraNonce) in the first transaction (i.e., in scriptSig of the coinbase transaction [2]). That gives them another ~4 billion tries for the first nonce.


Are Bitcoin addresses case sensitive? I sent $20 to my wallet ex. bc1qa4dk0fqvw7jfpvzgy9xpf7572kv9env9y748ct.
But instead I sent it to that address in all caps.
I haven't received the money and it's been 3 hours.
Are BTC addresses cap sensitive?
And what should I do?

Segwit addresses like the one you posted are case insensitive. Assuming your wallet is up to the spec, it should be able to send the BTC just fine.
If you have a transaction ID, look it up on an explorer to see if it has been confirmed.
If you don't have a transaction ID, and you have the private keys for the wallet, you should simply be able to make another transaction.
If this is a custodial wallet like an exchange or other wallet service, you will need to contact them.

To elaborate a little on the question in the title:

base58 encoded addresses (1... and 3...) are case sensitive - however, getting the casing wrong will result in a checksum error, and a well designed wallet will not let you send a transaction to an incorrectly entered address
bech32 addresses like the one involved here are case insensitive but, as pointed out by Murch, must be entirely uppercase or lowercase - a compliant wallet should reject a mixed case bech32 address.


Giving bitcoins to people as gifts I am interested in buying bitcoins and giving bitcoins to babies as "birth gifts" and birthday presents.

Assuming I've purchased the necessary bitcoins and they are in my wallet, how do I go about giving bitcoins to someone who doesn't have a wallet?

Probably the most appealing way to do that would be by using Physical Bitcoins - they look nice as coins, and since they can hold Bitcoins, it's another bonus. It's definitely better for casual people than giving them Bitcoins in a normal way - at least coins are something they can physically grasp, rather than trying to understand what a cryptocurrency is.


How can I generate addresses for all altcoins? I want to develop my own exchange website having all the altcoins addresses. I am doing research from past few days and I came to know that I need a copy software client of all the altcoins, and then address can be generated by making rpc calls to these clients.

Do i need to setup these clients on my server (i.e VPS, AWS etc)?

If yes ? then what would be the best server configuration to handle the exchange and do I have to download these client one by one and then implement each ?

If no then how can I implement this ?

Currently I am running a bitcoin client on vps.

You don't have to just create addresses. You have to track what's happening on each network and make sure that you actually have received funds before you can credit deposits to your customers' accounts. There are easier ways to just create addresses, but you would very much want to run at least one full node of each network under your own supervision to track the networks.


How can determine the fundamental theoretical value of the Bitcoin based on steady state daily velocity (BTCDD)? The VISA network (VisaNet) supports 4.4 Trillion dollars of commerce per year (2009). If we assume (somewhat arbitrarily), that the Bitcoin Days Destroyed metric approaches 50% (half of all coins are used every day, on average, to facilitate transactions),
then the value of the Bitcoin required to support 10% of the transactional volume in the VISA network (once all coins are minted) is $4.4T * 10% = $440B / 365 days/year / (21M BTC * 50%) = $114.80.

Does this approach seem valid? 50% BTCDD is arbitrary. 10% of the VISA network, is arbitrary but seems like a reasonable goal. What needs to be changed to improve this estimate, and what would a better way if any to compute the imputed value of the BTC based on its use as a transactional currency, rather than a speculative store of value?

"Bitcoin days destroyed" seems like a bogus metric. Transactions in the block chain do not always represent an actual economic trade. Wallets routinely resign the remainder of a coin to a new private key and it's very hard to determine what is the transaction and what is the change. You could spend 0.5 BTC from a 50 BTC block mined 10 days ago, and resign 49.5 BTC to yourself - you have "destroyed" 500 bitcoin days as far as the metric is concerned.

You don't have to care about the proportion of currency circulating, just the average velocity. Us dollar M1 velocity is in the 8 - 10 range. That means that on average a dollar changes hands every 1-1.5 months. If we assume a similar dynamic for say 10 million bitcoins (2 years from now?), we get about $4400/BTC for 10% of your quoted Visa volume.

But 10% of that is very, very much. It includes 1500bln in cash/ATM and 1700bln in credit purchases. The online commerce part of that than Bitcoin could target is maybe 200bln dollars and 10% of that brings the price of one bitcoin to 200$.

And all this assuming the deflation does not choke the velocity - which it will, bringing the actual volume down and with it the incentive for businesses to invest in bitcoin support.


What happens to rejected transactions ( i.e double spend or invalid transactions)? Do they get put in an orphaned block or not get put into any block at all?

Invalid transactions are never included in valid blocks. They can be included in a block, but that block would be rejected as invalid (and not classified as an orphan block).


JSON RPC call from webpage to Bitcoin Core I want to make API calls to my Bitcoin Core wallet from my webpage but when I try to connect it gives me Internal Server Error

I'm using easybitcoin.php JSON from Github.

I'm trying with this JSON RPC call:

require_once('easybitcoin.php');
    $bitcoin = new Bitcoin('myusername','mypassword','myip','8332');
    $bitcoin->getinfo();

My bitcoin.conf file has:

listen=1
maxconnections=15
server=1
daemon=1
rpcuser=myusername
rpcpassword=mypassword
rpcclienttimeout=60
rpcport=8332
rpcallowip=0.0.0.0/0 (Before I put my IP address here but it didn't solve too)

When I use bitcoin-cli.exe client to send commands to my Bitcoin Core server via 127.0.0.1 (localhost) it works perfectly.

What I'm doing wrong?

Make sure your 8332 port is open using ufw. Some VPS providers only have very few open by default for security. Digitalocean, for example doesn't have it open by default anymore.

sudo ufw allow 8332

Easybitcoin library uses cURL, and it's not always enabled or installed by default.

With PHP 5, you can easily install it by running  apt-get install php5-curl command.
With PHP7, sudo apt-get install php-curl

Once installed make sure its enabled. Locate your php.ini file and uncomment ;extension=php_curl.dll this line by removing ;(semi colon).

Run a test page with phpinfo(); and make sure curl is installed and enabled.  Restart Apache, sudo service apache2 restart.

If you still can't get it to work go back to your php.ini file and turn on all error reporting and let us know what the error is. Be sure you turn the error messages off again before you go live.


How does Exodus wallet (or other wallet) exchange bitcoin to other cryptocurrency? I have been using Exodus wallet for a very short time. And it shows that I can exchange bitcoin to many other cryptocurrencies and wise versa. I still couldn't find a good answer on how this exchange of currencies works and if there are any risks associated with it. Please excuse me if any of the questions don't make much sense to you.

If anyone knows about it, please help me to understand this process better?

If I exchange bitcoin to litecoin/ethereum, does the wallet software itself
send the request the buy order of litecoin/ethereum to some other exchange?
If there is no litecoin/ethereum exchange in my country (Australia) what will
happen in exchanging litecoin/ethereum back to bitcoin? I don't know whether it needs to have a litecoin/ethereum exchange in the country to do so...
In case if I want to exchange litecoin/ethereum back to bitcoin, how does the
Exodus wallet software handle it OR how does a wallet software generally handle it?
Basically, what are the risks associated with the exchange between
cryptocurrencies, other than their price going down?

If I exchange bitcoin to litecoin/ethereum, does the wallet software itself
  send the request the buy order of litecoin/ethereum to some other exchange?

Yes.

  If there is no litecoin/ethereum exchange in my country (Australia) what will happen in exchanging litecoin/ethereum back to bitcoin? I don't know whether it needs to have a litecoin/ethereum exchange in the country to do so...

Cryptocurrencies are international. The wallet does not know nor does it care about where you are located. There is only one exchange the Exodus uses anyways: Shapeshift (it isn't really an exchange though).

  In case if I want to exchange litecoin/ethereum back to bitcoin, how does the Exodus wallet software handle it OR how does a wallet software generally handle it?

It uses Shapeshift. It sends a request to Shapeshift, sends some of one coin to Shapeshift and Shapeshift sends you an equivalent value in the other coin.

  Basically, what are the risks associated with the exchange between cryptocurrencies, other than their price going down?

Because you are only exchanging between cryptocurrencies, there are little to no risks (other than financial) as few or no countries are regulating cryptocurrency to cryptocurrency exchanges.


DDoS on big mining pools: a quick way to 51%? Slush's Pool, the second biggest mining pool around, is currently down, allegedly due to a DDoS attack:

  News
  16.04.2013
  Pool is under DDoS attack. I'm working on recovering the service back to operation.

This means the entirety of its miners are currently offline, and this for sure lowers the difficulty of gaining 51% of the total network hashing power.

Now, I don't know anything about the hardware/software design of mining pools, how many servers do they employ to centrally manage all miners, how much bandwidth do they have, etc.; but I'm quite sure that nuking one of them would require a lot less computing power than actually obtaining more than 50% of the total Bitcoin network hashing power under its normal operation.

Thus, the question: aren't big mining pools a critical point of failure for the Bitcoin network? If a malicious attacker was to place several of them offline, all of their miners would be instantly disconnected, and then a not-even-so-big mining farm (or maybe a rival pool which engineered the attack in the first place...) could easily overcome the whole network.

How much likely is such a scenario?
How can it be avoided?
Should the Bitcoin community invest more into protecting pools, or, better, make a joint effort into moving from a "few big pools" model to a "many little pools" one, in order to be safer from similar attacks?

There's no cooperation involved in mining, and they won't be trying the same hashes because (for example) they have different transaction pools and (possibly) different destination addresses. Mining pooling is just like non-pooled mining, except that the revenue is spread over time instead of getting blocks of 25BTC.

Even when the pooled miners have a backup set that sends them to the largest pool (BTC Guild), that's acceptable for short periods of time. But miners are still people, and if something like that happens they'll quickly correct the issue.


Can a competing cryptocurrency make Bitcoin obsolete? If a new cryptocurrency is created, with some unknown property that Bitcoin does not have, can Bitcoin be adapted to include this property, or will Bitcoin become obsolete?

(I believe I know the answer, but I still think it's an important question. Spurred by this reddit post)

If it is a feature for the client that doesn't affect the Bitcoin network (like say, stronger wallet encryption or something like that), it is not a problem.

If the feature is related to the cryptographic security (say, SHA-2 becomes somehow obsolete), then adoption might be problematic. First of all, the developers would have to prepare the change and schedule it in advance (for example, "Starting with block X, we will be using SHA-3"). This would require all the clients, both standard and alternative, to get updated before that time or risk not being able to connect to the network.

Moreover, if the change is related to a vulnerability of a cryptographic algorithm of Bitcoins, then the entire network might get compromised before the update could happen. For example, if securing the old coins would require one to send them to a new address, then in a short period of time before everyone would do it, someone could potentially steal a lot of coins. Luckily, a scenario like this is very unlikely.

All in all, adopting new features into Bitcoin is possible, although time and consideration is required. Bitcoin's value is in its stable nature, so revolutionary changes could only destabilize it.


BIP38 or Brain wallet? I have seen many videos about paper wallets and different ways to store BTC. And I have choose to store using a cold wallet (paper wallet). But I am not sure what option I should choose: a normal BIP38 encrypted paper wallet, or a brain wallet printed in paper.

And plz tell me the differens with BIP38 and brain wallet.Thanks for your answer :D

P.S: Which one is securest?

BIP38 wallets are significantly more secure and are resistant to brute-force attacks when a decent passphrase is used.

Generally the term "Brain Wallet" refers to one in which the private key is derived from a phrase you make up.  These have been shown to be insecure because humans are bad at entropy and generally anything easy enough to remember is not safe.

Note: modern BIP39 wallets will generate a 12, 18 or 24 word "seed" phrase from which unlimited keys can be derived.  These may look like a brain wallet, but are completely safe as long as they were created securely. Remembering these words can be challenging though, so generally better to write them somewhere and store securely.


Transaction is not Picked I am new to block chain technology. I am struggling to understand below concepts:

What if my transaction is not picked by the miners and what is the criteria for miners to pick? How can I rely on blockchain to settle/do fund transfer if it is not getting picked?
Are block chains closed distributed networks? I mean, does each company runs its own blockchain. Do I need to register multiple blockchains and pay fees.
To do fund transfer via blockchain,do I need to publish my account balance in public ledger?If yes then where is confidentiality...

What if my transaction is not picked by the miners and what is the criteria for miners to pick? How can I rely on blockchain to settle/do fund transfer if it is not getting picked?

You are at the mercy of miners to pick your transaction if you do not try to mine it yourself (which currently would require a substantial investment). Typically, miners will maximize the fee rate (satoshis/kB) for the block they are mining. This means you need to make sure you have a competitive fee based on the size of your tx in bytes.

  Are block chains closed distributed networks? I mean, does each company runs its own blockchain. Do I need to register multiple blockchains and pay fees.

Blockchains were created to avoid the need for centralized servers or control. It is a way to establish consensus on a distributed network which is open to the public, which is how Bitcoin was designed. Closed blockchains do exist, however, in various forms such as completely centralized or as federated networks.

  To do fund transfer via blockchain,do I need to publish my account balance in public ledger?If yes then where is confidentiality...

Every transaction is available for anyone to validate, this is important in order to prevent double spending. The information that is public only includes your public key, transaction value, and signature(s). If nobody knows you own the public key or address associated with a transaction, then you can remain anonymous, but transactions can be traced back to previously used addresses. There are various methods to maintain privacy such as using different addresses for each transaction. Coinjoin is another example, which allows you, for example, to pool your transaction outputs with others in a single transaction to obfuscate which funds were sent where.


Predict multi signature transaction size I was looking for answer everywhere.
Basically is there any way of calculate multi-sig transaction size when the transaction is creating, before the signing procedure? I was trying to find any pattern for that, with no results.

Informations I have:

num of inputs;
num of outputs;
num of required signatures

I will appreciate any clue to solve this problem.

pubkeySize=33
sigSize=72

SizeOfRedeemScript = 1+n*pubkeySize+1+1
SizeOfScriptSig = 1+m*(1+sigSize)+SizeOfVarIntFor(RedeemScript)+SizeOfRedeemScript
sizeOf(input) = 32+4+SizeOfVarIntFor(SizeOfScriptSig) + SizeOfScriptSig + 4

SizeOfScriptPubKey = SizeOfVarIntFor(SizeOfRedeemScript) + len(script)
sizeOf(output) = 8 + SizeOfScriptPubKey

sizeOf(tx) = 4 + SizeOfVarIntFor(numInputs) + sum(SizeOfInputsArray) + SizeOfVarIntFor(numOutputs) + sum(SizeOfOutputsArray) + 4

Basically, once you know m & n (for your multisig), whether public keys are compressed (pubkeySize), plus the number of inputs and outputs, plus the types of outputs, you can come up with a pretty accurate figure for the size.


Which peers does a node broadcast a new block to? In the Bitcoin network, when a miner discovers a new block, he needs to broadcast it to other nodes. Does the node only broadcast to outbound connections or does it broadcast to inbound connections as well? I hope to get the result according to the source code and it would be great if the answer would point out the file of the corresponding code.

All peers are treated equally when relaying chain-extending blocks (as James C. stated in a comment on another answer). The node will announce the block to all of its peers and since that block was just found, all of the peers should request the new block.
Many miners will also announce new blocks on Fast Internet Bitcoin Relay Engine (FIBRE) in addition. Any new block on FIBRE will be immediately broadcast to all participants in a compressed format based on compact blocks (BIP152).


Bitcoin P2P API getBlocks always returns 500 inv items I'm trying to build a mini full node so that I can understand exactly how they operate. I've managed to get a few parts of the P2P api working however I am stuck with basic things like 'getblocks' and 'getheaders'

For example I have the following block hashes I am interested in:

block_hash = "000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7"
block_stop = "000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5"

Command: getblocks
Request: 0b110907676574626c6f636b73000000450000002a0af9950100000001000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5

My question is: Why am I getting back 500 inv items when the stop hash is only 1 block away from the block locator ? (Btw the same thing happens to me when I'm using getheaders instead of getblocks)

EDIT

Ok so I have swapped the endian-ness of the data I'm sending. I also had to swap the block locator and stop around in order to get a response (so the stop hash is at a block height lower than the locator) which makes me feel like I'm making more mistakes here.

When doing this I still receive 500 inv on the example above, however if I use these two instead:

block_stop = "0000000000000049a7ce260de7fcf63f34acf3fe1c5b2040ae77b9bdaf1abb38"
block_hash = "000000000000013d8a77f222805b1dca31d0fb48d60b29098c77609de5f93811

ACTUAL MESSAGE: 0b110907676574626c6f636b7300000045000000a83c12f901000000011138f9e59d60778c09290bd648fbd031ca1d5b8022f2778a3d0100000000000038bb1aafbdb977ae40205b1cfef3ac343ff6fce70d26cea74900000000000000

it correctly returns from the height I require, however it returns all of the blocks until the latest block instead of the one that I'm after. Am I misunderstanding the point of this API ? I was under the impression it returns block details but instead it just returns missing block hashes. How do I then find out what transactions happened in that block?

It looks like you have your block hashes in the wrong byte order. You have them in the display byte order, but the network actually handles block hashes in the reverse byte order, the zeroes are at the end.

I think the blocks that you are getting in response are going to be the first 500 blocks of the blockchain as well.

So what's happening is that a node sees your start hash, does not find it in your blockchain so it starts with the genesis block. It keeps going for each block and finds that it does not find the stop hash. This would be both because the stop hash is in the wrong byte order, and because it is starting from genesis and not your start hash.

So the response you get is the maximum of 500 blocks starting from the genesis block - the most recent common ancestor between your start hash and it's current tip.

  Am I misunderstanding the point of this API ? I was under the impression it returns block details but instead it just returns missing block hashes. How do I then find out what transactions happened in that block?

getblocks gets the block hashes. To get actual block itself, you need to use getdata with the hashes you've received.


How to create Ethereum brain address? I have used bitaddress.org to create a brain wallet for my Bitcoin.
Now I would like to create a brain wallet for my Ethereum using Bitcoin Improvement Proposals (BIP) 32/39/44/49 technologies. Is there any reputable tool (preferably similar to bitaddress.org) or open source command line tools I can use to generate a brain address for Ethereum?

Thank you all

Don't use a sha512 brainwallet generator like bitaddress.org to generate your brainwallet. Many people have lost their money by doing so.

Instead use a more secure salted scrypt like warpwallet.

For Ethereum, I made a warpwallet implementation here, that is available as a web version and as a go executable. For extra security you should generate the addresses offline.


Is possible to destroy the Bitcoin for just $500K? (51% attack) Everytime I read about the 51% attack the answer was something like:
is really expensive to get 51% of power on BTC and nobody will invest so much so to destroy the bitcoin.
But I found this site where you can rent hash power it seems to cost only $500K to get 51% for BTC (and much less for the altcoins):
https://www.crypto51.app/

Does that mean everybody with just a few dollars can destroy almost any altcoin right now?

EDIT
That site was posted by Charlie Lee (creator of LTC): https://twitter.com/SatoshiLite/status/1001341159405273088 but maybe I'm reading it wrong, becuse the last column says NiceHash-able and for BTC is 2%, LTC 7% and bytecoin 211%, maybe those numbers are the clue but I don't know what it means.
Is that table showing that BTC is hard to attack but other coins like bytecoin are really easy and cheap to attack? maybe someone can clarify this?

TL/DR: No.

The long form of the answer:

Online mining is that grey area where you don't invest until you're 100% sure. The aforementioned website is likely to scam you if they are providing such a service in the first place.

To address the question, how much will it take to launch a 51% attack;

Firstly you can check the current compute power (hash rate) and it's $ equivalent.

attack-cost gives you the exact cost for a 51% attack at any given point of time.

If you compare the calculated hashrate against one of the more popular ASICs on the market, the figure stands at about 2.2 billion. However, this assumes that suddenly half of the network right now goes rogue and decides to attack it. If not, you would need more than 2.2 billion dollars since the hashrate needed has to be 51% of the total hashrate (after the attack starts).

Its rather resource consuming and it isn't that big of a problem since none of the government really cares that much to spend their budget on attacking a cryptocurrency. You probably wouldn't profit all that much when you attack; doubt exchanges credits more than 2 billion dollars worth of Bitcoin automatically without raising a red flag.

Also, If you don't have 51% of the whole network (ie. more hashrate than the others), you don't have a 100% chance of executing an attack. The honest/longest chain still has a chance of overtaking you and you have to acknowledge their blocks. The probability of success decreases with the number of blocks.

Assuming the attacker decides to do 51% attack by purchase lots of ASIC/GPU, but it's not a really accurate number because:

There's no way you could get thousands (maybe millions in the coming future) of ASIC/GPU units easily
Even if they could, it's obvious that the price of ASIC/GPU will be more expensive due to high demand and low supply (this is already the case with graphics cards, poor gamers!)
Unless you have a connection, it's highly unlikely you could use lots of electricity and big mining location without ringing any alarms

Now, what if the attacker wants to hire a pool instead of investing in purchasing the equipment. In the current state where almost all mining power is concentrated within less than ten pools, that's enough to 'buy' a pool admin(s).

Why would even mining pools agree to "rent" their hashpower? If they actually did that, they would quickly lose their users. I don't really think if there would be many farms interested in this form of attack. Long-term earning is much wiser than trying to cheat and sell as much as possible. The rest of the network would quickly realize that the 51% attack was performed. Just look what is going on with Verge which is/was being attacked. The 51% attack is the reason why there are people who think that banning ASICs and mining only with GPUs is a good way to prevent it from happening.


extract wallet address from private key I am using bitcoin core library in node js.

const privateKey = new bitcore.PrivateKey('testnet');
const address = privateKey.toAddress('testnet);

When i console.log it, it get result as below. How can i extract the address part only? I try to use address.Address but it returns undefined

<Address: mmNeqV9HWKUDRUAVdknRKDPHyKYGpBEDzm, type: pubkeyhash, network: testnet>

it's better to get public key first then convert it to address

var publicKey = privateKey.toPublicKey();
var address = publicKey.toAddress(Networks.livenet);

address is an object, you can use it as a string. if you want to see it in console try

console.log("Address: ", address);


Has anyone gotten rich mining bitcoins? A number of questions on this site ask whether it's possible to make money mining bitcoins and the expected profits.  However, I'd like to know if there are real-life stories of people becoming wealthy solely from mining bitcoins.

It seems like mining bitcoins is, at best, a hobby that cannot make someone wealthy.

I suspect that it is hard to find real life stories because the miners would like to remain anonymous. If you had a few million dollars in largely untraceable BTC, would you want to publicize your story and make it easy for the government to tax you?

But there's some very strong evidence to indicate that "getting rich" was very possible. One story that comes to mind is "allinvain" who posted a reasonable amount of evidence that 25,000 BTC that he had mined was stolen from him. So, even though allinvain didn't "get rich" in this story, it certainly showed that a solo miner in 2011 could be making tens of thousands of BTC, easily worth millions of USD in 2013.

If you look at the blockchain it is easy to find addresses used by miners in 2010 that have thousands of bitcoins in them. Just find a block reward and trace where it went to. Here is one: 1AvLeBnWbiBeCNHwLGtWEK9GSVug3RWWxt It appears to be an address where the miner collected his block rewards over six weeks or so. (I'll substitute a blockchain.info link when it is back up.) Perhaps this private key was lost, so we can't say for sure. But it's reasonably to think that this one account (worth about $400,000) represents only a few weeks of work for this miner. If he kept all of the BTC he mined in 2010, he is likely a millionaire. At least on paper.

In short, since mining was much less difficult several years ago, and the exchange rate has gone up so much in that same time period, it seems very reasonable to assume at least some of the serious miners from those early days have made a considerable amount of profit.


How do I view the "change" addresses in my wallet? listreceivedbyaddress 0 true doesn't work I just sent a test account 5 BTC. I see in the output 1.38BTC was "change" and needs to be sent back to my wallet.

Where can I find the contents of 1F39Qj4E3HnbnyYgan5CZa37spGfHro8eK, and was expecting to find it there, but I typed listreceivedbyaddress 0 true and don't see it

The standard client always sends your Bitcoins back to a new address. If you want to figure out which address it went to, you can use gettransaction to view your transaction details (you got the ID when you issued the transaction), and check its outputs. The output that is not one of the addresses that you sent money to is your change address.


Intrinsically useful proof-of-work using Mersenne or Fermat numbers factorization. Could it be possible? I was reading this question and got myself thinking - why can't a crypto-currency use as proof-of-work a difficult problem that has value outside of the network? I understand the effort to produce all those hashes is not completely "useless", but still it seems like too much electricity consumption just to secure a crypto-currency - a proof-of-work that could produce a valuable by-product would be much appreciated, I think.

So I was thinking, what problems could there be if proof-of-work were, say, the factorization of Mersenne or Fermat numbers? Validating a number's factorization is relatively easy, compared to looking for the factors. And a crypto-currency based on it could give an big bonus to finding a Mersenne prime, and a mega-enormous bonus should a miner find a new Fermat prime (assuming there are some more), for these are intrinsically valuable even though validating the discovery would also be incredibly heavy, computationally speaking...

Appart from the obvious problem of difficulty being uncontrollable and going always up, (might be solved by allowing less profitable blocks be mined using another proof-of-work), I thought of the case where a country gets disconnected from the rest of the Internet: In current bitcoin this means coins mined there during the disconnection are lost after the country's reconnected, and any merchant accepting those locally-mined coins will lose their money.

In a system aiming to have a useful by-product as proof of work, all discovered factorizations should get eventually accepted, even if they were mined in such isolated conditions or were initially included in a blockchain that happened not to be the longest - unless some other miner discovered them independently and included them in a longer blockchain.

But then I realized this system could mean miners could attempt using this proof in more than one blockchain - I guess this would open the door for some types of fraud.

Could it also lower difficulty for double spending attacks? What other problems could arise in a system of this type? Are they intrinsically unsolvable?

The same could be said of using protein-folding, or analyzing SETI@home packages as proof of work...

How would solving these problems secure the network? Miners are rewarded for the proof of work they do because the specific proof of work they do -- hashing block headers -- in fact secures the system. Solving other problems doesn't secure the currency. If you want to pay people for doing work, you certainly can. But don't at all confuse it with the proof-of-work that crypto-currencies use to solve the double spend problem -- that must be the actual proof-of-work that actually solves the double spend problem.

The point is that the block hashes are tied to a specific block and to specific transactions in that block. The proof of work cannot be severed from the block header and the transactions. Thus the proof of work secures that block header and those transaction. Factorization of Mersenne numbers isn't tied to a specific block or set of transactions, so it does not secure the block chain.


Hyperledger consensus protocol I'm soo deep inside the consensus protocols like PoW, PoS, PoA or other variants used on permissioned/private blockchains such as JPMorgan's Quorum (Based on Raft), Istambul etc..

But I've not entered yet on the Hyperledger consensus protocols and it's implementations specifications and differences.

So my questions are:

What is the consensus protocol used on Hyperledger? It's inherited from any of the mentioned above? Which are it's main properties that make the difference from another consensus protocols?
Which are the main differences between it's variants (Fabric, Iroha, Sawtooth, and Indy)?

Please, it'll be fantastic if useful documentation links/articles/lectures were added with the answers.

Thanks.

First, lets get the terminology straight. Hyperledger is composed of 5 different blockchain technologies, each with it's own consensus algorithm.

Here are two supported by Hyperledger Sawtooth blockchains:

PoET Proof of Elapsed Time (optional Nakamoto-style consensus algorithm used for Sawtooth). PoET with SGX has BFT. PoET Simulator has CFT. Not CPU-intensive as with PoW-style algorithms, although it still can fork and have stale blocks . See PoET specification at https://sawtooth.hyperledger.org/docs/core/releases/latest/architecture/poet.html
RAFT Consensus algorithm that elects a leader for a term of arbitrary time. Leader replaced if it times-out. Raft is faster than PoET, but is not BFT (Raft is CFT). Also Raft does not fork.
Hyperledger Sawtooth has the advantage of having Unpluggable Consensus. An algorithm can be changed without reinitializing the blockchain or even restarting the software.

Here are some other consensus algorithms:

PoW Proof of Work. Completing work (CPU-intensive Nakamoto-style consensus algorithm). Usually used in permissionless blockchains
PoS Proof of Stake. Nakamoto-style consensus algorithm based on the most wealth or age (stake)
PBFT Practical Byzantine Fault Tolerance. A "classical" consensus algorithm that uses a state machine. Uses leader and block election. PBFT is a three-phase, network-intensive algorithm (n^2 messages), so is not scalable to large networks


Who created the Bitcoin blockchain? Satoshi Nakamoto wrote the theory about Bitcoin in his paper, but did he (or they) also launch the Bitcoin blockchain?

Like: Peter Higgs founded the Higgs particle in theory, but he didn't find the actual particle...

Satoshi did start the blockchain.  The first block, known as the genesis block, is embedded in the source code of the reference bitcoin client.  The rest of the blockchain is built on top of this block.

The genesis block contains the headline "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" to prove that the genesis block was created on or after Jan 3, 2009, and that Satoshi was not working on mining a longer blockchain in secret prior to this date.


Bitcoin Cash - How to get estimated fee and send transaction Last week I started working with Bitcoins and needed to show the transaction fee. While working with Bitcoins, I used:

https://bitcoinfees.earn.com/api/v1/fees/recommended
https://api.blockcypher.com/v1/btc/main

Now I need to do it with Bitcoin Cash (BCH). I was reading something about it and it is a fork of Bitcoin. Are they using same fees?

I have been searching and found many sites showing average fee, is that the standard on BCH?

Thanks in advance for your help.

The fees for Bitcoin and Bitcoin Cash are not fixed, but are driven by supply (block space) and demand (transaction volume) in their respective markets.  They are independent of each other, so prevailing fees for Bitcoin are not likely to be representative of Bitcoin Cash fees.

I don't know of any sites that track Bitcoin Cash fees in the same way as Bitcoin.  However you can see some historical data at sites like this one.


How is it possible to detect system wide segmentation? In this post, MoonShadow says it's easy to detect system wide segmentation.

  Yet a system wide segmentation is fairly easy to detect, the current client just doesn't do it.  If code implementing my 'watchdog' idea were included, the client could be set to suspend automatic trading on websites or warn the user of a fault on interactive clients.

How would that be accomplished technically speaking?

What happened in the March 2013 fork was that two different versions of the bitcoin client disagreed about what a valid block was. You could look for a block reorg, but that will only show up when the fork is fixed. How could you detect a hard fork as soon as it happens?
Well, you could run 5 different versions of the bitcoin client at once, then figure out when they get out of sync for a few minutes. That's when you know there's a version-specific fork. I should note that this is mainly aimed at getting the client fixed faster, not protecting a merchant.
Detecting being out of sync
You could write a program that polled all of clients looking for their latest block.
Psuedocode:
run on each node
  block number = node.getblockcount()
  latest block = node.getblockbycount(block number)
  latest block hash = latest block['hash']

Oh, by the way, this requires the getblock patch.
Now, if these differ for more than a minute or so (and you're not still in the initial syncing phase) then you might have a hard fork.
Making sure you have a good connection to the network
Let's say that you had a 0.8 client that was only connected to 0.7 clients. Even though it would have accepted the blocks in the March fork, it never even hears about them, meaning we won't detect the fork.
I'm not sure how to solve this. Perhaps upping MAX_OUTBOUND_CONNECTIONS ?
Preventing false alerts
If network conditions were really bad, then it's possible that one client would receive a new block, but the others wouldn't. You should use addnode to make them all talk to each other.


what if a coin is spendable by multiple keys? it seems like the scripting language could allow multiple private keys to spend a coin?

what if i send a coin to someone, but also allow it to be spendable by me. would their wallet still show they received the $?

Depends on the wallet. To recognise the transaction at all, their wallet would have to have the script / multisig address in it too. They'd have to have done that themselves, you can't generally trick someone because their wallet simply wouldn't see the transaction at all.


Where can I see an input that will hash to a solution? So as my understanding goes, there's some input (block header) that needs to be altered (via a nonce or other mechanism) which is run through a SHA256 to generate an output with X amount of leading 0's.

I've tried (manually), just for fun, to find an input that will hash out to even 2 consecutive leading 0's with no luck.

Where can I find an input, so that I can hash it, to a correct output?


Why should I keep my coins in an exchange? If I have 1BTC in a wallet anywhere, which I bought at mtGOX for 20USD, and now that 1BTC is worth 130USD on mtGOX, I can simply send my 1BTC from the wallet to mtGOX and withdraw to a bank as USD and have netted over 500% profit after fees right?

So my question is: why would I keep my BTC in the "live" trading of an exchange rather than just keeping it in a Wallet?  There's no difference to me right?

There is a difference, from a security perspective.

When you deposit your bitcoins to MtGox they credit your website account with what are essentially MtGox-bitcoin-credits. These are not bitcoins. If they chose to operate with a fractional reserve system (find out more here), they may have even spent some of the bitcoins, and you wouldn't know unless there was a run on the exchange (like a run on a bank).

Further, MtGox may or may not be able to reimburse you if they somehow lost all your bitcoins. They probably wouldn't reimburse you if someone managed to obtain your login details and withdraw your balance.

However, storing bitcoins yourself has risks too; they can be stolen if your computer is hacked (through malware or a virus). You can however reduce the risk of that to essentially zero by generating an address from an offline computer, printing the details, destroying all electronic traces of it, and transferring your balance there. Of course, then you need to protect your piece of paper...

There is also a difference when it comes to liquidity. If you have the balance stored with MtGox, you have the ability to trade it immediately (provided the website is online).


Exactly how to add bitcoind params (e.g. "verbose") on command line? Some bitcoind commands have optional params. For example, when doing "bitcoind help", it says the getrawmempool has a "verbose" param.

But no matter what I try, I can't seem to set this param on the command line. I've tried this:

bitcoind -verbose getrawmempool
bitcoind getrawmempool verbose
bitcoind getrawmempool -verbose
bitcoind getrawmempool verbose=1
bitcoind getrawmempool -verbose=1
bitcoind getrawmempool {"verbose":"1"}
bitcoind getrawmempool {"verbose":"true"}
bitcoind getrawmempool {\"verbose\":\"1\"}
bitcoind getrawmempool {\"verbose\":\"true\"}

Especially notice how the last few result in "error: value type is obj, expected bool" whereas the others give "error parsing JSON".

What should I type on the command line exactly in order to execute the 'getrawmempool' with the 'verbose' parameter?

Usually it's fairly descriptive if you know what's going on, for example it looks for a  boolean on the end of that command, so this will do as you wish.

bitcoin-cli getrawmempool true

bitcoin-cli has replaced bitcoind for RPC commands, you'll need to get used to it as the RPC client is being removed from the bitcoind binary fairly soon.


when does a transaction go through? When exactly does the receiving party receives their payment.
When the transaction is validated or when the transaction is added to a block?

When exactly does the receiving party receives their payment.

This is considered to have happened as soon as the transaction is included in a newly mined block and that block starts to propagate through the Bitcoin network.

The recipient may not find out that they have received the money until their particular node (e.g. wallet) receives a copy of that block to add to its copy of the blockchain. If the recipient's node is turned off and cannot receive blocks, that does not mean they have not received the money. They have as far as everyone else is concerned.

The recipient may not consider that receipt safe until their node (or one they trust, like a blockchain explorer) sees that six confirmations have been received - that is 6 new blocks mined on top of the block that contains the transaction.

Remember that Bitcoins are not really things that move around, they are not really sent places and do not really arrive anywhere. All that happens is that everybody builds identical copies of the journal of transactions - a list of transactions called the blockchain. By inspecting that list of transactions everyone can see that a specific Bitcoin-address or script now has control over a specific amount of money that they didn't have control over before. Nothing else matters.

Since data takes time to bubble and percolate from node to node to node to node through the network, different nodes will have slightly different dates or times on which they became aware of a specific transaction. No one of these is any more correct than any other.

Blocks that fail validation might as well be considered to have never existed. The network does not keep or propagate unvalidated transactions. By design, no-one trusts anyone else, therefore every node does its own validations. Even though it knows the sending node will have already validated the block.


Possible to run a Lightning node on same computer as Bitcoin Core node? I have a Windows 10 laptop that is running a full Bitcoin node using Bitcoin Core. Is it possible to also run a Lightning node on the same laptop simultaneously with the Bitcoin node?

Yes but some lightning implementations are not running on windows. Lightning needs hardly any hardware but requires to talk to a Bitcoin node (local or remote) anyway.