How long would it take a large computer to crack a private key?

how long in bytes the private key is

32 bytes, or 256 bits

  then how many combinations of numbers it will contain

There are 2^256 different private keys.  That's a little larger than a 1 followed by 77 zeroes.

  what is the fastest computer or network of supercomputers

At its peak around August 2011, the Bitcoin network was checking 15 trillion sha256 hashes per second.  (See http://bitcoin.sipa.be/)

  how long it would take to crack a private key using that computer

If we assume it takes the same time to run an ECDSA operation as it takes to check an sha256 hash (it takes much longer), and we use an optimisation that allows us to only need 2^128 ECDSA operations, then the time needed can be calculated:

>>> pow(2,128) / (15 * pow(2,40)) / 3600 / 24 / 365.25 / 1e9 / 1e9
0.6537992112229596

It's 0.65 billion billion years.

That's a very conservative estimate for the time taken to break one single Bitcoin address.

Edit: it was pointed out that computers tend to get exponentially faster over time, according to Moore's Law.  Assuming computing speed doubles every year (Moore's law says 2 years, but we'll err on the side of caution), then in 59 years it'll only take 1.13 years. So your coins are safe for the next 60 years without a change to the algorithms used to protect the blockchain. However, I would expect the algorithms to be changed long before it's feasible to break the protection they provide.


Is it possible to trace BTC or cryptocurrencies?

You can't send bitcoins from a newly generated address. To send bitcoins, you use as inputs transactions that were previously sent to one of your addresses as an output. (Your client will use more than one previous transaction output if it needs to add up some transactions to reach the required amount.)

The inputs to a new transaction are directly traceable to the output from a previous transaction. You can send bitcoins to yourself, but that just adds another transaction hop in the sequence. The transaction chain can always be traced back.


What are the benefits of using btcd instead of bitcoind?

EDIT (2014-09-05): I have updated this answer to the most recent information.  The previous answer was outdated in regards to the cons.  It was accurate as of version 0.3.0-alpha, however btcd is now in beta, up to version 0.8.0-beta, and nearly all of the previous cons have since been addressed.  Also, I've updated all references to bitcoind to Bitcoin Core to reflect their name change

I'll try to answer this as unbiased as possible, but, as a disclaimer, I am the lead developer for btcd.

First, a small correction.  The initial release is version 0.3.0-alpha (https://github.com/conformal/btcd/releases).  It is not yet up to version 1.0 as we first want to get a ton of public testing from early adopters before claiming it is production ready.  We fully understand the importance of avoid block chain forks and are making herculean efforts to do everything we can to prevent that from happening.

I'll provide a list of pros and cons that I can think of for btcd relative to Bitcoin Core below, but one thing I'd like point out isn't specifically related to btcd or Bitcoin Core, but rather the Bitcoin ecosystem as a whole.

Diversity is something the Bitcoin ecosystem is in dire need of.  Diverse, inter-operating implementations make the Bitcoin network more robust against several things such as denial-of-service attacks, vulnerabilities, and individual application bugs.  History has shown that for any protocol to thrive and gain wide-spread acceptance, multiple implementations on multiple devices is inevitably required.  One prolific example is TCP/IP.  TCP/IP would not be where it is today if only a single implementation existed.

Pros

btcd offers a unique architecture in that it separates the chain services from the wallet services (see NOTES [a])
btcd is written in Go which has several advantages over C++ (See NOTES [b])
btcd is a clean refactor of the entire Bitcoin protocol rather than one that is monolithic
the btcd codebase strives to provide easy to follow and well-commented code (Bitcoin Core is definitely improving in this area, but there is still a lot of undocumented "magic")
the btcd core packages provide more extensive unit test coverage to help prevent regressions (for example btcwire provides 100% test coverage)
btcd incorporates a package that has been highly optimized specifically for the ECDSA curve parameters used by Bitcoin (secp256k1) making it faster than OpenSSL
btcd is capable of running as a real service on Windows (see NOTES[c])
btcd provides a compatible RPC interface with Bitcoin Core has which makes it relatively straight forward to use it in existing infrastructures
btcd is able to sync the entire block chain from scratch in around 5 hours on an Intel i7 with an SSD

Cons

btcd does not daemonize itself and instead relies on external tools such as daemonize and upstart to perform that function
The uPnP functionality is currently disabled by default and does not appear work with all devices, so it might be necessary to manually open ports on your router and use the --externalip flag

Notes

[a] A full discussion of the advantages of separating the chain and wallet services would require an entire blog post, but a few examples are that it opens a lot of opportunities for lower powered hardware, offers better multi-user support, and results in less waste in small networks which can share the chain services.

[b] Some advantages we believe Go has over C++

Integrated test infrastructure
Platform independent code
Simpler parallelism and excellent support for concurrency
No active memory management which leads to eliminating an entire class of the most common security vulnerabilities like buffer overflows
Built-in profiling and documentation facilities
Significantly faster compilation times

[c] The Windows installer does not provide the option to install or run it as a service, however btcd itself has command line options to do so.  To install it as a service: btcd.exe /s install


Is there any discrepency on Confirmations?

Yes, there are a few different ways this can happen, and in nearly all instances this occurring is of little significance.

First the most common scenario where that happens: When a client receives a block it first will verify the block before relaying it.  A node that performs this slowly (especially if running pre-v0.8 software) may be many seconds behind other nodes.   So while one node might verify a block and increment the number of confirmations for a transaction, another node would still be working on verifying it and would show one fewer confirmations.   Within seconds the count should become equal for the transaction on both nodes.

Another scenario is much more rare -- where the blockchain has forked, and a transaction will show a number of confirmations that varies between the count on one side of the fork versus the number of confirmations on the other side.  This scenario actually happened on March 11th, 2013 where nodes running the v0.8 client would show a transaction as having a certain number of confirmations and at the same time a node running a pre-v0.8 client might show a lower number of confirmations.  When the forks converged, after the pre-v0.8 side attained "longest chain" status, both client versions then displayed the same count.

The possibility of there being a problem exists where there are several confirmations showing for a transaction on one node but no confirmations on another.  This could mean the funds for the transaction could be vulnerable to a double spend attack, or that such an attack had already occurred. But the scenario you describe, with at least one confirmation on both nodes, is likely simply just a propagation delay.


Why aren't early adopters intervening in the market in order to stabilize the BTC price?

I think the idea is to have a system that is not subject to manipulation. Highs and lows may be what I consider growing pains but will eventually diminish provided there is confidence that the system is a true free market system. This means free of manipulation. Let the free market reign and value will be real. Manipulate it and we basically have another ponzie scheme like we have now with the US dollar.


synchronizing takes weeks and more than 120 gb

For the "out of free space" issue you could use pruning mode. For the "no money in my wallet", you'll have to tell us a little more. Is the transaction confirmed?

also see:

Cannot access my bitcoins because my wallet is still synchronising. What can I do to spend them immediately?
How can I run bitcoind in pruning mode?


Does createrawtransaction have the ability to create a transaction with custom scripts?

Yes that is correct.

What you can do is:

listunspent
createrawtransaction with receiver:amount and your change:amount

(make the amount differ to pay the fee)

Take the raw hex transaction and use it with http://brainwallet.org/#tx to be able to edit in JSON format. Don't worry, when your done you can sign the raw transaction in your local client.

About scriptPubKey, that is a little harder, and you should only experiment with this on testnet. You can try to understand this transaction https://en.bitcoin.it/wiki/Script#Transaction_puzzle and also try to understand how the stack works by playing around with jsforth


Will large Bitcoin holders be a threat in the future?

Large Bitcoin holdings are static assets.  The price only climbs if there are active trades.  It would be in the interest of large holders to promote the use, trade and circulation of the currency.

If a large holder were to dump all their coins on the market all at once would cause the price to drop, but that would not be in their own interest, as they would lose their investment.  Then again, they can only get a return on their investment if they sell it.  It would be sensible that if a large investor wanted to liquidate their holdings, they would trickle them out slowly to keep the price high.

Also, the total amount of money wrapped up in Bitcoins and the risk involved is not enough to attract really serious investors.  There are some large investors, such as the Winklevii, but they are attracting attention because they are the exception, not the rule.


Where can new cryptocurrency features be found?

Have a look at the hardfork wishlist for Bitcoin. These are changes that are just to hard too do in Bitcoin as they would require major changes to existing infrastructure, but are generally considered good ideas or at least worth experimenting with.


What are some paid cryptocurrency exchange software?

Yes, ready-made crypto trading software is available. I have been shortlisted some of the crypto trading software provider across the world.

Coinsclone

BitExchange System

Trading Technologies

Draglet

BlockchainAppFactory


Are there any laws that govern the use of crypto currencies in the international law?

Bitcoin was "banned" in Kenya, probably because the central bank realized its growing popularity among the business "creme" and its eventual increase in value to where it is now. Technically, it is not illegal to use it but you can expect some resistance from government.
Since Uganda is a neighbor, and probably thinks and acts along the same lines, my guess is that the crypto-currency will be banned there too if it hasn't already.


I have Blockchain.info wallet which i can't find

1) Blockchain.info was down for a few moments in recent days - please re-check it's availability.

2) Blockchain.info sends an email confirmation with your wallet's "Identifier". This is your login/username. Try searching your email for "blockchain" and see if you have that email.
Subject: Welcome To My Wallet
Body:

  This email contains important information about your new bitcoin
  wallet. Be sure to keep this safe and stored separately from your
  password.

  Login Link:
  https://blockchain.info/wallet/9c......

  Notifications: Notifications Are Disabled Confirmation Code: D9028

  Verification Link:
  https://blockchain.info/wallet/verify-email?data=xxxxxxxxxx

Clicking the first link to your wallet will pre-fill your identifier (login), and just need the password you set when you started. That will get you into your account.


what is wrong with this litecoin transaction? getting "tx rejected: (code -22")

It looks like these are freshly mined Litecoins that have not matured yet, you need to wait until they mature to spend them. Maturity refers to the number of confirmations that newly mined coins need to have. For Litecoin (and Bitcoin) this is 120 blocks.

(See a discussion related to this here: https://github.com/litecoin-project/litecoin/issues/26)

So you won't be able to spend these coins until those blocks get mined. But at the rate that Litecoin blocks get solved that would be around 4 hours, which means that same transaction might work now.


Where do I check if a 1 satoshi / byte fee will go through for a 3xxx address segwit transaction?

You don't know whether a transaction will confirm in advance.

You can look at fee estimation built-in to wallet software, or analysis sites, but ultimately it is up to miners to include your transaction in a block. There is no guarantee whether they will - just be prepared to re-issue or replace the transaction if it doesn't.


What is the exact moment when a miner gets rewarded?

A coinbase transaction it not spendable until it is 100 blocks deep in the blockchain. Since a block is produced every 10 minutes, it will typically take 1,000 minutes (just under 17 hours) before a miner can spend the reward.

  1). Does the miner get rewarded once 51% nodes accept the block? If so, how is that acceptance information propagated to his/her own node - is it done as and when each node in the network accepts it?

It's 51% of mining power, not nodes. Once 51% of mining power is mining on top of the block, it will continue to get longer at a faster rate than any other blockchain, ensuring it is eventually 100 blocks deep. (This is not really 100% guaranteed, but it works this way the vast majority of the time.)

  2). Or does the miner get rewarded the moment he/she creates a block and broadcasts to peers? If so, how is the reward reverted if the block is found to be invalid?

The reward is reverted if the block is found to be invalid because the reward was in that block. So any node that doesn't consider that block valid won't consider a transaction to spend the reward valid. In order for a transaction that spends the reward to be considered valid, the reward itself must be considered valid and the block in which the reward was rewarded must be 100 blocks (or more) deep.


How do I calculate the miners fee for my transaction using BitGo.com API?

You can get up-to-date Bitcoin transaction fees from bitcoinfees.21.co.

They also have an API.

If you are a coder, you can use the API to provide a dropdown list allowing your members/users to select the priority they want to use when making a transaction.


Where is the lightning history persisted?

We like to say that Bitcoin is decentralized, and it is, but all the data can be viewed as having a centralized "source of truth": the blockchain.  All transactions that have ever occurred are a part of this source of truth.  The management and upkeep of this source of truth, however, is decentralized.  Nobody is in charge of it, yet everybody agrees on a single set of data.

The lightning network, however, is even more decentralized.  It doesn't just manage and update itself without central authority, but there is no agreed upon "truth" of the network.  The activity that occurs between two participants in a channel is only the business of the participants, and nobody else ever needs to see it.  Therefore it is not shared, and unless the participants want to, it is not stored.  Once a channel closes, the participants have completely settled all transactions between each other with a single transaction to the main Bitcoin blockchain.  They may very well persist the activity data for their own purposes, but it is in no way required for them to continue to participate.


What percentage of nodes currently support segwit?

According to Luke-Jr's statistics, 96.15% of nodes are advertising the Segwit P2P protocol service bit, which implies that they support segwit.


How is locktime enforced in the standard client?

It's checked in the IsFinal() method of CTransaction. A non-final transaction cannot be included in blocks.

A transaction is final if either:

The lock time is in the past.
All of the inputs have sequence numbers equal to UINT_MAX.

The second one is probably what confused you.


How does a Doge public key is created from a private key?

Dogecoin uses the same public key cryptography ECC with curve secp256k1, so public key generation is the same.

  When I enter a Doge private key to the input the output is still a
  Bitcoin public key (Starts with 1 for example instead of D).

You are confusing addresses with public keys. The 1 or the D is just a prefix to an address, depending on the type of address, see https://en.bitcoin.it/wiki/List_of_address_prefixes

After you generate the public key, you have to do the following in order to get an address:

BASE58CHECK(<address-prefix> HASH160(<pubKey>))

Dogecoin uses different prefixes for the different types of addresses, see https://github.com/dogecoin/dogecoin/blob/master/src/chainparams.cpp (note these are for mainnet only):

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,30);  // 0x1e
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,22);  // 0x16
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,158); // 0x9e

Changing the address prefixes should yield compatible addresses.


Is it possible to do a digital charge on delivery (COD)?

Here is one possible idea that I believe is almost what you want and quite likely (or so I hope!) both good enough and actually particularly good by incentizing all involved parties to collaborate to that goal. The basic idea is to incentize the recipient to sign for reception in a way that prevents him from lying just to collect the incentive.

Use multisig Bitcoin transactions, where the sender sends bitcoin into a multisig address requiring four distinct signatures, one from each party and a special throw-away one. The sender also performs his signature, authorizing a payment to the other two parties (say worth 9 dollar to the courier and 1 dollar to the sender) in a way that not only all other parties have to sign it, but beyond that yet another signature by the sender is required (using a fresh bitcoin address the sender generated only for this message). Instead of keeping the private key, the sender uses the public key of the recipient to encrypt the private key into a cyphertext that only the receiver can decrypt. This is possible with the ECC keys underlying bitcoin, although they are used in bitcoin in a different way, to generate signatures (but alternatively any other asymmetric crypto can be used, e.g. PGP/OpenSSL).

This way, only by completing the delivery can the payment proceed, and the sender cannot withdraw from his commitment anymore. It falls slightly short of what you desired (all payment going to the courier) because without an incentive to bother decrypting and finalizing the payment, it is likely that the recipient simply will not bother, creating significant risk to the courier of not getting paid. But with an incentive, and no means to change the split fraction, we can expect the recipient to usually (and with sufficient incentive, almost always) collaborate, which reassures the courier to go along with the scheme.

The obvious drawback of this scheme is that it requires off-blockchain communication, because (unless I am mistaken), partially signed multsig transactions do not get propagated across the network, and because of the encryption involved in transfering the private key to the fourth bitcoin address. Also, if you were not talking about a physical courier service, this solution does not apply, because having an encrypted communication channel to a sufficiently authenticated recipient (such that the sender already trusts sending to that person) implies that you can already pass any message without a courier as intermediary.

A maybe less obvious drawback is that the cypthertext attached to the message to be delivered must not be easily separated from the two, or your courier (or the wild west bandit robbing him) could just do that, and have only the ciphertext, not your message delivered in the hope that the recipient will collaborate in hiding the nondelivery by signing for collecting the incentive anyways. With digital messages, this can be achieved (e.g. xor the ciphertext with a hash of the message), but then again, for purely data-based messages, you do not need the courier if you have everything necessary for this scheme.


How can't a malicious attacker generate bitcoins on his private network?

The blockchain will only accept blocks which are based on previously accepted blocks and have a hash value that satisfies the current difficulty requirements. A malicious attacker is in the same position as any other miner, so any block that he mines must satisfy the same conditions regarding validity. In fact, the bitcoin protocol is designed to be trustless, which means that even miners with malicious intentions are not able to destroy its integrity unless they manage to control a majority of the mining power.


How to get xpriv and xpub from keyPair with bitcoinjs-lib

The short answer is: you probably shouldn't.

That is not a typical way to generate an xpriv/xpub. You are trying to convert a key pair to an extended key pair. The difference is the extended keys include the following (See BIP32 - Serialization Format):

4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private; testnet: 0x043587CF public, 0x04358394 private)
1 byte: depth: 0x00 for master nodes, 0x01 for level-1 derived keys, ....
4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
4 bytes: child number. This is ser32(i) for i in xi = xpar/i, with xi the key being serialized. (0x00000000 if master key)
32 bytes: the chain code
33 bytes: the public key or private key data (serP(K) for public keys, 0x00 || ser256(k) for private keys)

BIP32 standard Master Key generation goes like this:

Generate a seed byte sequence S of a chosen length (between 128 and 512 bits; 256 bits is advised) from a (P)RNG.
Calculate I = HMAC-SHA512(Key = "Bitcoin seed", Data = S)
Split I into two 32-byte sequences, IL and IR.
Use parse256(IL) as master secret key, and IR as master chain code.

With bitcoinjs-lib, a more standard approach would be:

const mnemonic = 'praise you muffin lion enable neck grocery crumble super myself license ghost'
const seed = bip39.mnemonicToSeed(mnemonic)
const node = bip32.fromSeed(seed)
console.log(node.toBase58())

'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkTcaMEcjq1vG7XmEEW22S2UiSPbrzTkUeXfcwo7PzRZ4aDiRQu'

If you absolutely had to do it, technically you could (not recommended) replace the private key property of the node object with a buffer of your own private key, i.e. __d:

> const bip32 = require('bip32')
undefined
> let node = bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi')
undefined
> node
BIP32 {
  __d: <Buffer e8 f3 2e 72 3d ec f4 05 1a ef ac 8e 2c 93 c9 c5 b2 14 31 38 17 cd b0 1a 14 94 b9 17 c8 43 6b 35>,
  __Q: null,
  chainCode: <Buffer 87 3d ff 81 c0 2f 52 56 23 fd 1f e5 16 7e ac 3a 55 a0 49 de 3d 31 4b b4 2e e2 27 ff ed 37 d5 08>,
  depth: 0,
  index: 0,
  network: { wif: 128, bip32: { public: 76067358, private: 76066276 } },
  parentFingerprint: 0 }
> node.__d = Buffer.from('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'hex')
<Buffer e3 b0 c4 42 98 fc 1c 14 9a fb f4 c8 99 6f b9 24 27 ae 41 e4 64 9b 93 4c a4 95 99 1b 78 52 b8 55>
> node
BIP32 {
  __d: <Buffer e3 b0 c4 42 98 fc 1c 14 9a fb f4 c8 99 6f b9 24 27 ae 41 e4 64 9b 93 4c a4 95 99 1b 78 52 b8 55>,
  __Q: null,
  chainCode: <Buffer 87 3d ff 81 c0 2f 52 56 23 fd 1f e5 16 7e ac 3a 55 a0 49 de 3d 31 4b b4 2e e2 27 ff ed 37 d5 08>,
  depth: 0,
  index: 0,
  network: { wif: 128, bip32: { public: 76067358, private: 76066276 } },
  parentFingerprint: 0 }


Error validating a transaction with blockcypher

It seems that there is no sighash type at the end of the signature data in witness.


Why are Transactions sending out randomly?

Because it doesn't re-broadcast any non confirmed transaction, it re-broadcast only your own non-confirmed transactions. So you will be the only node on the entire network who is doing the re-broadcast every exact 30 minutes and based on this anyone can get what IP is originating that transaction.

A few lines below your code example you find this:

BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
{
...
}

This will loop on the transactions of your own wallet (mapWallet), not all the network transactions.


Soft forks are changes in blockchain rules that add restrictions on which blocks are valid. Soft forks require a certain portion of miners to show that they have upgraded their software in the blocks that they mine before the rules go into effect. This is done so that miners stay in sync about which blocks are valid and which blocks are invalid. What you're seeing in that data is basically a progress report of how many miners have upgraded their software to show support for each of the soft forks.

Let's look at BIP34:

    {
    "id" : "bip34",
    "version" : 2,
    "enforce" : {
        "status" : true,
        "found" : 1000,
        "required" : 750,
        "window" : 1000
    },
    "reject" : {
        "status" : true,
        "found" : 1000,
        "required" : 950,
        "window" : 1000
    }
}

This shows that BIP44 applies to all blocks with nVersion number greater than or equal to 2. It becomes enforced (the soft fork rules actually go into effect on blocks with version >= 2) when 750 (required) of the last 1000 (window) blocks have a version greater than or equal to 2. To date, 1000 (found) of the most recent 1000 blocks on the network have signaled support for BIP34 by using a version number greater than or equal to 2 in their block. Thus, since it is over 750, the "status" is true and it is being enforced.

The reject portion shows similar info, but it's describing when the network will no longer accept blocks with version below the BIP34 version. So, when 950 (required) of the last 1000 (window) blocks on the network have nVersion >= 2, blocks with version < 2 will no longer be accepted by the network. Currently, 1000 (found) blocks have had version >= 2, so the reject status is also true, meaning blocks with version < 2 are rejected by the network.


I've read that addresses alone are a "confusing" way to think about "where" bitcoins "are".

Yep, addresses are only an encoded description of how the coins are locked, not when(*) they are.

e.g. back in 2018 getaccountaddress would list 1 address, getaddressesbyaccount would list that plus a 2nd address, getaddressesbylabel would list those same two addresses, getwalletinfo would show a 0.0003 balance, and listaddressgroupings would also show that balance.

The listreceivedbyaddress command is probably the most similar one : it lists coins locked to each address, if an address has been reused then you'll see multiple txids.  The balance will be updated accordingly.
Given your first sentence, you might be interested in checking listunspent which will give you a less abstract representations of the coins you received.

Now in 2020, that online explorer still shows that 0.0003 BTC balance, as it did in 2018, but due to deprecated cli commands, how can I confirm that with bitcoin-cli?

So, you can use :

getbalance for your total balance
listreceivedbyaddress for the representation by address
listunspent for the representation by unspent transaction

Finally, check the Wallet section of bitcoin-cli help for more commands. For more details about a command, use bitcoin-cli help <command>.
(*) You used "where" in your question, but I think since we are talking about blocks, it makes more sense to reason chronologically.


How are wallets listed on bitcoin.org chosen?

The wallet listing is maintained based on best practices, as such wallets which are unsafe aren't listed. A discussion on Github removed blockchain.info from this listing, pending them making promised security upgrades. Specifically, the concerns raised by the maintainer included:

Bugs and losses: BC.i has suffered from concerning issues during the past year (e.g. iOS denomination bug, weak key stretching, sizeable number of users losing funds, and more issues I haven't verified yet)
Backup/Password Security: BC.i hasn't adopted security features which are slowly becoming standard in other wallets (e.g. BIP32, random passphrases, backup on setup, rotating addresses, 2FA by default).
Transparency: Source code of the app has been reset or not updated repeatedly, making bitcoin.org often relay the false claim that the app is open-source.

Some of these are no longer the case, their new wallet does use BIP32 for example. The full discussion, where these points came from, along with detailed conversation with the developer are available for review on github.


The code you're citing does not actually deal with difficulty. It deals with targets. The target is the maximum 256-bit value than the block hash is allowed to have.

The difficulty is defined as 2^208 * 65535 / target.

As for the book, that looks wrong indeed.


What would it take to create my own Bitcoin exchange?

Setting up and operating an exchange can be quite involved.

A few tiers to start thinking about:  legal, banking, tech+security, and volume.

Legal

The first question is whether you want to operate globally (e.g. Bitfinex or BitStamp) or focus on a national market (e.g. FlowBTC, meXBT).  The next step is to seek legal counsel to help decide where you want to locate and how to incorporate/structure your business.
You want to think about how you can limit your liability and exposure to litigation, as well as what regulatory/compliance requirements are in your jurisdiction, and what they are likely to be in ther near term.
Merkle Tree offers a useful high-level global map of the regulatory landscape.

Banking

What sorts of banking relationships do I need and how can I secure them?
Note that banks can be heistant to provide services to digital currency exchanges.

Tech + Security

You or a partner need to build and maintain complex architecture that pairs orders, executes transactions, and manages deposits and withdrawals.  Major componets are:

Matching engine
Risk management system
Accounting/audit system
Wallet management
Payment gateways

Security is understandably paramount.  Some things to consider:

Sound internal security procedures among your team  - see, e.g.  CryptoCurrency Security Standard (CCSS) (incredibly important, and often overlooked)
Network and hardware security (secure data center, etc.)
KYC (Know Your Customer) + AML (Anti-Money Laundering) solutions
Two-Factor Authentication for users

Volume

Without lots of live volume, all the above is for naught.  It is well worth your time to actively consider all of the below:

Channeling liquidity from large exchanges like Bitfinex to your exchange
Messaging, media presence, brand creation and maintenance, ads and retargeting
User definition (is this a retail exchange, for advanced users?, etc.), and using this to inform UI design and to prioritize features for product differentiation

Hope this is helpful for getting started!

Disclosure - I work at a firm called AlphaPoint (http://alphapoint.com) - we provide white label tech to many of the largest Bitcoin exchanges in the marketplace, including full stack tech and hosting, as well as order routing for day-one liquidity.


how to get address from transaction with empty ScriptSig?

why does address start with bc1q... ? Is it some standard?

Yes, it's a Bech32 address, specified in BIP173.

  How can I derive this value from witness?

In general, you can't.

The address defines under what conditions an output is spendable. The scriptSig or script witness gives the proof that those conditions are satisfied. If you know that a particular output is a V0 witness, then you can determine what that output was based on the input spending it (the last witness stack element is the public key). However, without knowing exactly what type of output was being spent you can't generally do so.


Is price volatility necessarily a bad thing?

Volatility has two sides of course, an upside (commodity or currency increasing in purchasing power) and a downside (decreasing).

When you invest in something as a store of value, you're always going to appreciate when it gains value as you hold it and dislike when it loses value.

Before you invest (EG, you have another money you're about to use to purchase it) you like when the price comes down so that you can get more of it (with the expectation of going back up again once you have it) and you dislike when the price shoots up prior to your purchase.

It is always a bad idea to price loans and contracts in a volatile currency, however. Since each party would be in a position to hope for an opposite swing direction, one party would always be inconvenienced by a change in value. Since loans and contracts are designed to offer joint utility, you don't want one party suffering or resenting the other party for their perceived unjust lucky gains: people would just avoid such contracts instead.

Today it is common to price items in USD then allow for spot payment in Bitcoin, for example, or to loan out money or establish contracts denominated in USD with sides paid by Bitcoin spot value. EG, I borrow $100usd from you today when Bitcoin is, say $100usd/BTC so you give me 1BTC. I pay you back later $110usd (principal + interest) but Bitcoin is in a dip when the contract matures so at $90usd/BTC I have to pay you back 1.222BTC.

And finally, while it is nice that Bitcoin appears to be on a long term up-trend, it's shorter-term volatility makes investments and contracts that can't hold out for the duration required to "get to the moon" much riskier and more difficult. Most Bitcoin-related business (including merchants, arbitrage, obtaining BTC and then holding to pay off payroll or suppliers and avoid paying multiple interchange fees) require maintaining balances in BTC over time and those balances may ebb or flow. Again, if you receive BTC on a rise (customer pays you; hey they get to choose the timing!) and have to pay it during a dip (regular payroll, running lower on parts than you can afford to wait for an upswing) then you are experiencing a significant capitol loss.


Is it possible to buy or sell Bitcoin options?

It is possible, there various sites that provide option (or option like) trading. Each have their pros and cons. Of the ones I know of theses seemed the best. However YMMV and caveat emptor.

At time of writing here are some simple ones:

btc oracle <-- Looks like a very elegant (bitcoin) solution. Just send some bitcoins to the addresses and if (in 15min, 3hr, 1day, 1week respectively later) you are in the money you are sent back X a Multiplier.
btc Levels <-- Similar to btc oracle in concept. Except you have to login to place your (high low positions) bets. Plus you can only place positions for up to the next 24 hr.

However neither of those let you buy/sell an option that is in the money(or out of), you have to wait until the option expires. And neither of them let you write options.

Some others:

icbit.se <-- Futures contract
mpex.co <--  Has a large buy in.
coinbr.com <-- They act as a broker to mpex.co (So has a much lower buy in)
1broker.com <-- CFD  for btc/USD
campbx.com <-- Options coming soon. (so is xmas though :P )


Convert back from BTC into a local currency, efficiently

How about localbitcoins.com?
231 countries support,  can meet
people face to face from this website in country where you go and exchange your bitcoins for cash in local fiat currency.


Automated FIAT Transfer to bank from Exchange

This would vary widely by exchange. The BTC transfer and trade can almost definitely be automated through most large exchange's APIs. Fiat withdrawals might be possible, but I don't recall seeing any APIs for that recently. Your best bet would be to contact the exchanges and ask about it, as I suspect it is a feature that is available "on-demand" for larger clients, and they might be willing to support you on it.


Does sending the "max amount" with given feerate require crafting the transaction twice?

No, you shouldn't need to sign the transaction until it's completely crafted. Bitcoin core can handle this for you!
An easier flow when creating a transaction is

Create raw transaction. Don't add any inputs yet.
Fund raw transaction. This will select inputs for you. Add subtractFeeFromOutputs of the output you want to subtract the final fee from. The docs on subtractFeeFromOutputs is a bit confusing, but it wants you to specify which output(vout) the fee should be deducted from. If you specify multiple outputs, the fee is spread equally across the outputs. Bitcoin core will amend the amount in the output(s) you specified.
Sign your raw transcation. Voila, you're done!


The best JavaScript libraries supporting Bitcoin Core?

I highly recommend bcoin:
https://bcoin.io/
https://github.com/bcoin-org/bcoin
It is a nodejs library that can also run a fully validating node, SPV node, and BIP44 wallet. It's used in production by many long-standing bitcoin companies such as Purse.io
You can even use the bcoin client to make RPC calls to bitcoin core, and of course you do not need to run the bcoin full node to take advantage of the library for TX construction and wallet functions.


Is there ANY way i can get my coins back?

No because you

don't have a backup
don't know the private key
don't have any recovery phrase (if applicable)
overwrote the disk
(though there was still a tiny chance of recovering a wallet.dat)

  And if not where are thay?

They are in the blockchain but can never be used.


What defines the standard Bitcoin transaction size?

What is a "maximum standard weight"?

It is a property that nodes follow to prevent processing large transactions with number of rules and signatures. It is standardness not consensus. If a node receives a transaction greater than 400,000 WU, it will discard the transaction and not relay it further. I can however, definitely create a transaction greater than 400,000 WU and contact a miner to mine it in a block. The nodes then will be forced to accept that transaction in the block as it is allowed by the consensus rules. So standardness is a subset of validity that nodes use to prevent large processing and DoS attacks.

Now, if I have to close the channel unilaterally and the channel had a bunch of HTLCs, I can't be expected to go looking for a miner every time my transaction size is greater than 400,000 WU. The other alternative will be to run another software other than Bitcoin-Core that accepts such transactions, but that would have to also mean the miners also run this software. If miners run only Bitcoin-Core they will never receive the transactions and Bitcoin-Core nodes in between will not relay it. The best thing is to conform the Bitcoin-Core standardness as it is in the interest of all.

  Where does the number 400000 come from?

Before the activation of SegWit transactions were limited to 100,000 bytes (since a long time). This was merely extended to 400,000 WU.


First you must configure your bitcoin.conf file for JSON-RPC

rpcallowip=127.0.0.1
rpcuser=yourusername
rpcpassword=reallystrongpasswordthatsnothis
rpcport=7788
walletnotify=/home/scripts/transaction.sh %s

Where transaction.sh is some bash program. One approach is to have it make an http request to some process to notify you of the deposit. An example:

#!/bin/sh
curl -d "txid=$1" http://127.0.0.1/some/route

walletnotify will execute transaction.sh every time you either

receive bitcoin
send bitcoin
when a bitcoin gets its first confirmation

%s is the transaction ID or txid which gets passed to transaction.sh.


Electrum wallet giving dust error even for larger amount

Please try switching servers using the Network option or the green dot button in the bottom-right. Try making the same payment from a different server.


How can I transfer my BitCoins to my PayPal?

If you have them in an exchange like coinbase.com: (1) sell them into your bank account, (2) connect your bank account to PayPal, (3) transfer them from your bank account to PayPal.

If you have them on your hard-drive, step (0) is to open an account on an exchange like coinbase.com and send them to your coinbase.com account. Then go to steps (1), (2) and (3).


Tendermint consensus: Are validators "known" and "pre-selected"?

Yes they are known. They are selected via a round-robin fashion. The Tendermint team intend to add a VRF to randomly select validators:

https://github.com/tendermint/tendermint/issues/763


Why do we need revocation in both the offered/received HTLC outputs and HTLC timeout/success outputs?

HTLCs have a different timeout (cltv_expiry) than the regular timeout that we use for penalty transactions (to_self_delay). That is the reason why we use a separate transaction stage (HTLC success/HTLC timeout) to allow our counterparty sufficient time to exercise their right to get the entire balance of the channel in case we broadcast the previous state of the channel.

To elaborate further, when your counterparty tells you to add a HTLC, your version of the commitment transaction will have 3 outputs:

Paying to your counterparty immediately
Paying to self, guarded by the revocation key for to_self_delay time
Received HTLC output like below

# To remote node with revocation key
OP_DUP OP_HASH160 <RIPEMD160(SHA256(revocationpubkey))> OP_EQUAL
OP_IF
    OP_CHECKSIG
OP_ELSE
    <remote_htlcpubkey> OP_SWAP OP_SIZE 32 OP_EQUAL
    OP_IF
        # To local node via HTLC-success transaction.
        OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
        2 OP_SWAP <local_htlcpubkey> 2 OP_CHECKMULTISIG
    OP_ELSE
        # To remote node after timeout.
        OP_DROP <cltv_expiry> OP_CHECKLOCKTIMEVERIFY OP_DROP
        OP_CHECKSIG
    OP_ENDIF
OP_ENDIF

When you supply the HTLC pre-image to your counterparty the transaction gets resolved. However, even after successful resolution of the HTLC with your counterparty, let us say you decide to cheat them by force closing the earlier state of the commitment transaction containing the HTLC. As soon as you publish this commitment transaction, you publish the HTLC success transaction that consumes the OP_IF part inside the OP_ELSE. Since the HTLC success transaction is consuming an output that is not timelocked, you are not providing enough time for your counterparty to use their right of the revocation key which is in the received HTLC output. That is the reason there is a second stage, where your spending from the offered HTLC output to yourself is locked until to_self_delay which allows your counterparty to use the revocation secret.

Now you might wonder, why the revocation exists in the commitment transaction received HTLC output if it is provided in the HTLC success/timeout transactions. Let us take the above case to explain it. You added the HTLC and signed the commitment transaction. That HTLC was settled by you providing the pre-image to your counterparty and the commitment transaction containing that HTLC was revoked. Despite that, assume you try to broadcast the previous commitment transaction containing the HTLC and refrains from publishing the HTLC success transaction. If revocation did not exist in the commitment transaction, the counterparty might not be able to get their funds back until the cltv_expiry which might extend to hundreds of blocks (couple of days) if there are a number of hops. This is cumbersome since that HTLC was already settled (especially if there are number of previously satisfied HTLCs), and the provision of revocation in the commitment transaction allows the counterparty to settle them immediately.

The revocation part is designed so that your counterparty never suffers because of the actions you decide to take to cheat them. The presence of revocation in commitment transaction and the HTLC success/HTLC timeout transaction help protect the Lightning Network participants from frauds committed their peers.


What is the difference between PoW and PoS regarding computations when determining a new block?

I think you pretty much got it. It's hard to give more than a rough explanation, because there is no standard PoS model. But my understanding is that given the most recent block the only thing that will increase your chance of mining the next block is time passing. If something like timestamps is the only thing to check, the number of possibilities worth any one miner computing is limited.

PoS does not have a difficulty target max, but there is a range of possible answers, say 0-N. The last block is used to compute some new target(not a max, but an actual target), say T. A PoS algorithm will define a stake holder's chances differently, but there will be some function that gives them a range on the spectrum proportional to their stake(M...M+S). As time passes either that range grows, or is recomputed given each new timestamp. When a miner's range includes the target, it is there turn to mine the block, at which point a new target is determined.

00:00 > 0___M...M+S____T_______________N

00:01 > 0______________T___M...M+S_____N

00:02 > 0____________M.T.M+S___________N < Chance to mine a block

A miner could get better chances by acquiring more stake, but that would require new blocks to be mined for stake to actually transfer. More to your question, a miner could also increase the number of computations they have to do by breaking stake up into multiple accounts, but that would not increase their actual odds. It would just increase the number of accounts they have to check.


Where can I safely sell a Casascius version 1 physical bitcoin (with hologram error) for cash?

There is a fairly robust market for these on ebay.  One sells every few days.  I have bought several from ebay with no problems (except for my underperforming post office).

PayPal is a little frustrating but you get used to it.

Be sure to post a good quality photo of the hologram and clearly describe the that it is a V1 error coin.


I can't connect to RPC from python. JSONRPCException: -342

Indeed to use bitcoinrpc, you need to set the username and password in bitcoin.conf by:
rpcauth=user:salt$hash of password

which you can generate using https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py. Simply shutdown bitcoind, add this to bitcoin.conf, restart, and you'll immediately be able to run commands in python like
print(rpc_connection.getinfo())


What is the block verification procedure, and will it ever become too expensive?

I) See https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages for the full list of checks that must be done on a new block.

II) Only an index of "unspent transaction outputs" need to be kept to check new transactions / blocks, and that index is a few hundred megabytes currently and very comfortably fits in memory. It will get bigger as more people hold bitcoins, but it will not grow without bound and we've implemented incentives to encourage software to make the UTXO set smaller instead of bigger.

III) Verifying every transaction in every old block isn't necessary, and the reference implementation skips the expensive (ECDSA signature) transaction checks up to a compiled-in checkpoint.


walletnotify takes the supplied string and runs it as a command. If you want to make it request a URL, you should pass the URL to a command that can do that.

On linux:

walletnotify=curl 'http://localhost/blocknotify-update-deposit?trxhash='%s

If there's an error while running the command, Bitcoin will append a message to debug.log. It should look like this:

runCommand error: system(curl http://...) returned 3


Can the wallet's balance be deduces from the wallet's address and the blockchain's history? Is this concealable?

Looks like you misunderstood what is the wallet  and the address. Wallet is not an address, wallet is a bunch of addresses.

An address is a single-use token

Addresses are not wallets, and do not carry balances.

  Thus sharing a wallet's address means sharing the whole wallet's data.

Addresses in this particular wallet doesn't related each other, therefore if you know one address you can't calculate the balance of all wallet.


Recovering a Ripple wallet on Ledger Nano

Ledger should recover all your funds including any altcoins like XRP from your 24-word recovery phrase. You may read technical details about the process in BIP44.

I'm not sure whether there is an official Ledger tool for deriving keys for XPR from recovery phrase. You may use Ian Coleman's BIP39 Mnemonic Code Converter. It is possible to launch this site on the offline computer if you worry about keyloggers.

You may also find this discussion on Reddit interesting.


What is the standard protocol for pools/miners?

When there were no pools, all of the first mining clients interfaced directly with Bitcoin. They connected to Bitcoin's JSON-RPC interface and used the getwork RPC method to get the required work. Getting work from a pool is the same as getting work from Bitcoin. The client connects to the pool over HTTP, often using the same HTTP authentication that Bitcoin's JSON-RPC interface uses; the client sends a JSON-RPC getwork message; and the pool sends back a JSON-RPC getwork response.

Many pools nowadays support some extensions to the getwork protocol that Bitcoin does not.

See:
https://en.bitcoin.it/wiki/Getwork


BTC-Wallet from "Airgap.it" asks for Receipient-Adress-Prefix "1ABC". What format is that?

The Prefix "1abc" is part prefix "1" and part wildcard "abc". so it asked for the P2PKH-format all along. there is NO secret third format with a fixed prefix that is always "1abc".

I reported the issue of the QR-code accepting BECH32-format with the developers. using the right address everything works like a charm and is a very nice alternative to a hardware-wallet if you have a old smartphone to spare.


If i pay 0.001 to cloud mining site such az minezone.io or bitbase.club or 99quick.cloud

I wouldn't trust them at all.

Take minezone.io for example, they claim to be a London-based company. The company number they have on their "FAQ" page is for BITEXPLOSION LIMITED whose registration status is "Active — Active proposal to strike off". Being struck off is a bad thing. Their annual confirmation statement is four months overdue. That also is a bad sign.

Bitbase.club's website is an almost exact copy and also gives the same company number (i.e. BITEXPLOSION LIMITED)

The 99Click.cloud domain doesn't seem to exist.


NXT uses transparent forging to detect who will solve the blocks. How can DDOS be prevented?

I am a developer for NXT and am currently programming an automated defense system for the network, aside from this if a forger is DDOS'd my understanding is that the network will skip to the next node and not process the block the attacked node produce(s/d).


How to recover funds from a force-closed Lnd lightning channel?

In c-lightning the per commitment point is derived from the hsm_secret using per_commit_point from:

The node id / public key (can be found with listfunds, until the channel is purged some time after closing)
The channel database id (can be found with cat ~/.lightning/debug.log | grep $node_id), shown as chan #$node_id
The commitment number (0 when opening the channel, increases during fee negotiations and other channel updates, |  grep commit)

We care about the commitment point, not the secret, because the private key we need is derived as follows:

privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)

I created a tool for c-lightning to dump this point (with help from @cdecker): https://github.com/ElementsProject/lightning/pull/3115

Back to Lnd... One easy place to dump a private key is in the lnwallet walletinfo command. Add something like this to commands.go:

basePointSecret, err := keyRing.DerivePrivKey(keychain.KeyDescriptor{
  KeyLocator: keychain.KeyLocator{
    Family: keychain.KeyFamilyPaymentBase,
    Index:  0, // Same commitment index as used in c-lightning
  },
})

// Parse per_commitment_point dumped by c-lightning:
bytes, err := hex.DecodeString(".........")
commitPoint, err := btcec.ParsePubKey(bytes, btcec.S256())

// Obtain SHA256(per_commitment_point || basepoint)
h := sha256.New()
h.Write(commitPoint.SerializeCompressed())
h.Write(basePointSecret.PubKey().SerializeCompressed())
commitTweak := h.Sum(nil)

// Obtain and dump private key
tweakedPrivkey := TweakPrivKey(basePointSecret, commitTweak)
commitmentWif, err := btcutil.NewWIF(tweakedPrivkey, &chaincfg.MainNetParams, true)

fmt.Printf("Dump commitment priv key: %s\n", commitmentWif)

Where TweakPrivKey() is lifted from script_utils.

Import the resulting private key into Bitcoin Core et voila!


Your database is corrupted. This probably means the RPi overheated, or its storage is crappy.

This is not unusual for RPi class hardware.

To recover, you'll need to reindex.


Can I use my mtgox BTC balance on the mtgox checkout button/payment platform while my account is pending verification?

Yes, verification is only for increasing the amount of BTC and other currency you can move

"up to 10x your current daily limit, and up to 5x your current monthly limit"

through their service. It also enables you to use other services with mtgox such as dwolla.


Where can I request ardor ignis testnet coins?

You can request Ardor Testnet coins here: https://nxtforum.org/testnet/some-testnxt-to-test-asset-exchange/


If I remember correctly, the Trezor uses deterministic wallets, as specified in BIP 0032.  That means that the device will give you a sentence that the wallet can be regenerated from, in case it's lost.


How much does it effectively cost to purchase currency at an exchange?

Essentially, you have to factor in 3 fees in a purchase:

1. Deposit fee (if applicable)

This is usually a fee for wire transfers, and from my experience is only relevant if you deposit cash across economic zones, albeit this is slowly reducing to 'anywhere to asia', or outside of the SEPA zone.

Kraken charges 5€ per wire transfer, SEPA transfers are free as of the time of writing this post.

2. Trade fee

This fee depends on 2 factors:

Your current trade volume tier, which you can find at the top right of your account on the Kraken webpage. This is calculated in fiat currency, and based on the traded volume in the past 30 days.
The order type you buy your currency with. A Taker fee is charged, if you buy using 'market' orders - that means you'll get the best available price on the market for the volume of currency you'd like to buy/sell.
If you buy using any other order type, you'll be charged the maker fee. You'll notice that the taker fee is higher than the maker fee - this is because it is assumed that buying via market orders takes away liquidity from the market (there are less offers available), whereas limit and other order types add liquidity to the market (it adds to the offers available on the market).*

*It is worth noting that some exchanges still charge you the taker fee, despite quoting using limit orders - this usually happens if you quote an existing order, causing your order to resolve instantly. Bitstamp is such one example. After checking back with Kraken, this is also the case at Kraken.com.

3. Withdrawal Fee (if applicable)

This fee is charged with any withdrawal you make from your account. On Kraken, this fee is 0.0005 BTC for BitCoin, and 0.02 LTC for LiteCoin withdrawals. Additional fees are charged if you use BitGo, which adds an additional 0.1% cost to your withdrawal. In cases where you may need your BitCoins fast, this may be worth it. You can check on the fees for other currency on their respective withdrawal page on your Kraken Account's website under the Funding tab.

Bringing it all together

This put all together leaves you with the following (slightly unwieldy) formula to calculate your actual cost of purchasing currency at Kraken:

(Deposit Fee) + (Order Volume * Quote Price) + ((Order Volume * Quote Price) * Transaction Fee) + (Withdrawal Fee * Quote Price)

Please keep in mind that your bank and any recipient you send your currency to may also charge you fees; these will have to be factored in as well.

Trade safe!

Example:

You'd like to buy 1 Bitcoin @ 500€, deposit via bankwire, use a market order and transfer it via BitGo Instant. Your Trade Volume Tier is 1.

Deposit Fee = 5€

Order Volume = 1

Quote Price = 500€

Transaction Fee = 0.0026 (or 0.26%)

Withdrawal Fee = (0.0005BTC + (Order Volume * 0.001)) * Quote Price

Gives you this:

(5€) + (500€ * 1) +  ((500€ * 1) * 0.0026) + ((0.0005 + 0.001 * 1)) * 500€) = 507.05 €


To prevent Bitcoin loss, would a merchant need to keep every address (and associated private key) forever?

Yes.

  Doesn't that become burdensome?

Not really. First of all, private keys and addresses are fairly small, so they don't take up that much space. Putting them into a database can make access very quick and easy so that's not much of a problem. Furthermore, merchants already have to keep the private keys around in order to spend the coins from those addresses later. It is uneconomical for them to immediately forward the funds to some other storage address as they will incur transaction fees for doing so.


C secp256k1 : what is the purpose of secp256k1_context_randomize?

I just merged a PR by Rusty Russell that aims to explain its purpose. From the text that was added:

  While secp256k1 code is written to be constant-time no matter what secret values are, it's possible that a future compiler may output code which isn't, and also that the CPU may not emit the same radio frequencies or draw the same amount power for all values.

  This function provides a seed which is combined into the blinding value: that blinding value is added before each multiplication (and removed afterwards) so that it does not affect function results, but shields against attacks which rely on any input-dependent behaviour.

  You should call this after secp256k1_context_create or secp256k1_context_clone, and may call this repeatedly afterwards.


Do some Bitcoin wallets fail to support sending to multi-signature addresses?

Sending to P2SH addresses (addresses starting with '3') seems to be directly supported by only Bitcoin-Qt/bitcoind and Electrum at the moment. EWallets using those clients might allow sending to P2SH addresses. It's not directly supported by BitcoinJ, so BitcoinJ-based clients like MultiBit and Bitcoin Wallet for Android probably won't support it until BitcoinJ does. It's also not directly supported by blockchain.info or Armory. Some clients allow you to create raw transactions, which could be used to send to P2SH addresses manually.


How do wallets receive the amount of Bitcoins

You don't have to parse the whole blockchain for every transaction, this is why database indexes exist.

You parse the blockchain once and create a unspent-transaction-output set (UTXO) which is a mapping between all unspent outputs and their balance. This is around 2.5GB in size and much-much faster to process.


Where can I find historical exchange rate data for Dash (ex DarkCoin)/USD?

CoinMarketCap provide charts since February 2014 and IIRC, the name was Darkcoin back then. It include the price in both Satoshi & USD.


How to send my 2X coins to an exchange from a private BTC wallet I had during the fork?

The 2x fork did not activate (there was a fatal bug in the code, perhaps more than one), so there is no 2x network on which to send coins.

On some exchanges, people are trading financial contracts issued by the exchange, which are related to the expected outcome of the 2x hard fork situation. This is different from an actual 2x coin (which does not exist).


In which circumstances is the identity of a miner known?

No, it's not necessary to disclose the identity. As Pieter commented below, "foundBy is a feature of blockchain.info, a privately operated website, which gives a guess about the creator of a block. It is by no means something that's part of the protocol".

If you look at the receiving address of the block's coinbase, you'll see that BitFury sends all their block rewards to that address, so that's probably how blockchain.info arrived at their conclusion.


Ledger Nano S - Do you use the same key to send & receive Bitcoin?

The string of characters you sent your btc to is called a bitcoin address. You should use a new one every time you receive funds.
This is important for your privacy, and the privacy of those you transact with. The blockchains is a public database, if you just used one address repeatedly, then every person that paid you would be effectively able to see your entire financial history. Obviously this is not ideal, but using a new address for each transaction can help a lot with this issue.
There are some small security considerations as well, but they are more theoretical in nature. Privacy is the main reason.
For more info see: https://en.bitcoin.it/wiki/Address_reuse


Getting error when starting bitcoind in regtest mode

Since paytxfee is not passed as an argument you need to alter the value of paytxfee in your bitcoin.conf.


Do we Need Pay Tax for Mining for US Govt

Do you need to pay Taxes for US Govt for doing Bitcion Mining.?

You are not liable for income tax because:

You are not a US citizen and
You are not working in the USA.

Someone in the USA who is selling you a service might be required to charge sales-tax (though that sort of tax is often not applied to foreign sales).

  Does Univted States TAx Revenue Board send the TAX Invioce on my Name

As far as I know, there is no USA government branch named "United States Tax Revenue Board".

The USA Internal Revenue Service (IRS) would not charge you personally for sales tax. So far as I know, US sales taxes are a state tax not a federal tax

Scams

When buying "mining services" be aware that, unless you have a really good understanding of how bitcoin mining works, you are likely to be the victim of a fraudster.

One of the things fraudsters do is repeatedly invent superficially plausible (but actually false) reasons for you to send them money.


Uncaught exception 'Coinbase_ApiException' with message 'Status code 401'

HTTP status 401 is "Unauthorized", you likely have your credentials or keys configured incorrectly.


Is there a reference, authoritative resource or book on Bitcoin programming?

I was asked by Hasan Hasan, a junior developer, which of the following three books I'd recommend. Personally I think all three books are fantastic (I would recommend them all) but they do approach the topic from very different angles.
Mastering Bitcoin (2nd edition, Andreas Antonopoulos) was the first technical Bitcoin book to be published. The 2nd edition was published in 2017 so there may be some outdated details but the vast majority should still be accurate today. It does have some chapters on concepts but not as comprehensively as Grokking Bitcoin (see later). It will provide instructions for configuring a Bitcoin Core build from the command line and contains a lot of Python code examples. It is especially strong at explaining Bitcoin scripting. For an example of Antonopoulos teaching Bitcoin Script see his 2017 presentation at SF Bitcoin Devs (video, transcript).
Programming Bitcoin (Jimmy Song) is also a technical Bitcoin book but covers different topics in depth than Mastering Bitcoin. Mastering Bitcoin mostly avoids cryptography but Programming Bitcoin has three detailed chapters on finite fields, elliptic curves and elliptic curve cryptography. If you like math or want to understand how public keys and signatures are generated in detail this is the book for you. There are also more Python code examples in Programming Bitcoin than Mastering Bitcoin. There are some conceptual explanations but generally I would say it assumes you understand most concepts covered in Mastering Bitcoin and Grokking Bitcoin (or that you best learn those concepts through code rather than written explanations.) For an example of Jimmy Song teaching ECDSA and transactions see this presentation at Bitcoin Edge Dev++ in 2017 (video).
Grokking Bitcoin (Kalle Rosenbaum) contains minimal code, instead it focuses on the various challenging concepts that you need to understand to get to grips with Bitcoin. For example, Kalle Rosenbaum presented  how SegWit works at London Bitcoin Devs in 2020 using the content from Grokking Bitcoin (video, transcript). If you are having trouble understanding a concept I'd recommend that book as some of the diagrams, explanations and exercises are really useful. It is easy to discount this book as being the less technical of the three but if you are already a junior developer you may have more trouble with concepts than command line and code. It is a technical yet accessible book.
They are all open source so you can try before you buy. Mastering Bitcoin is here, Programming Bitcoin is here and Grokking Bitcoin is here with a special build of the book including diagrams here.
If you like them and can afford to buy them I encourage you to support the authors and publishers by purchasing them. Whether the authors publish future editions of the book or continue to produce these kind of educational resources depends on how successful the books are. In Grokking Bitcoin's case you can buy directly from the Manning publisher here but all are available from Amazon or your usual book seller.


online tool to play around with ECDSA public keys, message signature verification?

Here are a few I'd recommend:

https://bitcore.io/playground/#/address (private key - public key)
https://brainwalletx.github.io/#generator (signing and verifying but bitcoin specific)

Or play with pybitcointools at the command line (not online):

$ git clone https://github.com/vbuterin/pybitcointools.git
$ cd pybitcointools
$ python
>>> from bitcoin import *
>>> sk = random_key()  # Generate a private key
>>> vk = privtopub(sk) # Generate a public key
>>> msg = 'hello world' # Create a simple message
>>> sig = ecdsa_sign(msg, sk) # Sign the message using your private key
>>> print sig
GxXGAt...2L/eJk=
>>> print ecdsa_verify(msg, sig, vk) # Use sig and public key to verify
True
>>> msg = 'hello mars' # Change the message
>>> print ecdsa_verify(msg, sig, vk) # Changing the msg invalidates sig
False

http://showterm.io/203b168061b0156c4d1dd

HD Wallet stuff:

https://iancoleman.github.io/bip39/
http://bip32.org/

If you're looking to learn more about ECDSA suggest checking out: https://jeremykun.com/2014/02/08/introducing-elliptic-curves/


What is the maximum transaction throughput of the Bitcoin network?

The smallest transaction that would commonly occur in the wild is a P2PKH transaction with one input and two outputs (send amount and change output). A P2PKH input has 148 bytes, a P2PKH output has 34 bytes and the transaction overhead is 10 bytes, 148 bytes + 2*34 bytes + 10 bytes = 226 bytes, in the case when no change output is required, this could actually be 192 bytes.

The blocksize limit is a megabyte, not a mebibyte, so it's 1,000,000 bytes.

If all transactions were only P2PKH with one input and two outputs, the throughput would be 1,000,000 / 226 / 600 = 7.37 tps. However, the mix is very different with a lot more transactions on the network making use of multisignature inputs or sending to boatloads of different addresses at the same time, and the current average transaction size is around 520 bytes, making the 3 tps figure much more accurate.

I don't know why the authors would have only rounded the upper bound.


How do miners select which transactions to include in a block?

A bitcoin node's (bitcoin's standard client acts as one) first function is to relay transactions on a best effort basis, it only relays valid transaction. The miner which also is a node will try to solve a block on the transaction it received, but in the end the miner has last word he can decide to arbitrarily discard some transaction (like one with no miner's fee)


See the wiki. Basically you have to extract the 20 byte pubKeyHash (shown as bytes to push) from the scriptPubKey and convert it to Base58 (which is also described in the wiki.  There is no need to be online to perform this operation.


Transaction cancelled but bitcoin was not return back to my wallet

While your transaction may have been cancelled by whatever system you used, you have to wait for it to cancel out everywhere else too.

Since you only provided a destination wallet and not the actual transaction ID, it's hard to provide much info. I do, however, see transactions going to the wallet you specified above without issue. It does look like your fee (8.93 sat/B on a 224byte trans) was well below a reasonable fee to be processed in a decent amount of time on the transactions that show up though..

I suggest leveraging https://bitcoinfees.21.co/ to ensure your transactions process in a decent amount of time in the future. Relying on a cancellation is unreliable.

To see your transaction ids, check the following links

https://blockchain.info/address/39j2nuZWr4F2hZ5wYDwQwZWzsTJC4H6ujn
https://blockexplorer.com/address/39j2nuZWr4F2hZ5wYDwQwZWzsTJC4H6ujn

you will notice the transaction IDs under the heading "transactions"


Is there any rational economic reason to purchase XRP early?

1) OpenCoin has been clear on how many XRP they are going to distribute, they have been secretive only about how they are going to do that. And that's fine, since otherwise people might try to game the system before their distribution starts.

2) You might buy a few XRP if you need them, or you can buy a lot of XRP if you want to speculate (i.e. you think their value will rise)


How to calculate conversion exchange fees?

The formula to calculate that is:
100% x (1-√(BTC x fiat))

where BTC and fiat are the two values highlighted in gray above.
Using the values given in the quesiton, it is 5.1%.
(Assuming that the conversion fees in both ways are calculated as a percentage, with the multiplier)


Reindexing after initial download of bitcoin core

Well, I figured this one out. Running a full node on my other computer with internal hard drive is much quicker.

Believe the original problem that I had was that I downloaded the application on my internal hard drive but saved the blockchain itself on an wireless external drive. Having the external drive disconnected even once I think would cause some issue.

Given the size of the blockchain, not sure what the plan is once it reaches 1TB?


If you plan to using any API extensively I suggest installing bitcoin core and using RPC provided.


Base58Check encoding: Using for Version 4 UUID?

Nothing is preventing any sort of data from using Base58Check encoding, but I'm not sure why you would want to. There's already a multitude of 'altcoins' using a variety of address prefixes though, so you might run into issues should one of them become a real-world success.

In reality, I'd just avoid having users typing a UUID-type string at all, then you don't need to worry about having the typing friendly characters and checksum.


It sounds to me like your antivirus program may be interfering. Check if neo has been moved to your virus chest, and if so, add it to your antivirus exclusions list


How can I sign an Ardor transaction using an offline computer?

On the offline computer use the sign.bat / sign.sh script:

Usage: SignTransactionJSON <unsigned transaction json file> <signed transaction json file>


Do cryptocurrency exchange sites work and operate like a regular bank?

Main laws that they do have to comply with are Money Laundering and Terrorist Financing and "Know Your Customer" type rules.

This is why when you open an account you have to send ID etc.. These they are forced to comply with as the banks that serve them (remember you have to wire them the USD EUR etc.. somehow - and that is through a bank with whom they have an account) force them.

What they DO NOT have to comply with are all the other regulations that an exchange/bank would normally have to comply with - hence the reason they go bust so often!

E.g. they are not required to segregate client funds, they do not have to retain capital to protect clients, nor do they have the same requirements for auditors, segregation of duties (making sure the developer is not supporting the site too!), being fair to clients etc..


Does every transaction have the same signature?

Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA). While people in the physical world use their unique signature to authenticate when accepting documents or contracts, digital signatures are cryptographic commitments by the owner of a private key corresponding to one specific message (which in this case is the Bitcoin transaction).
As the inputs to the signature generation algorithm are the message and the private key, different messages produce different signatures.


What services let you trace the history of Bitcoins?

WalletExplorer.com can associate addresses and Txs with ~100 services, including:

LocalBitcoins
Silk Road, Agora, other DNMs
Defunct services like Vaultofsatoshi, Bitcoinica, Inputs.io, Mt. Gox etc
Strongcoin, other wallet providers
Lending platforms like BTCJam
BTC-E, Coinbase, Bitstamp and other popular exchanges
Gambling sites like Just-Dice, SealsWithClubs Poker
Mixers/tumblers like BTCFog

I'm extremely curious how this is done, to be honest. I suppose it's just tracking UTXOs of known addresses and identifying associated Txs, but it's quite fascinating how accurate the data is.

The service doesn't identify newer addresses, of course, since fresh addresses need x blocks / UTXOs to deduce the associated account/marketplace/exchange.


yes, it is. For each input you create a raw transaction with the pubkey script in the scriptsig "slot". Then this raw tx gets seigned. Each input has a different "source" (previous input tx and previous input "outpoint"), since they are hashed before signing, it creates a different result. A sample how to do this for two inputs is shown here:

  How to sign a transaction with multiple inputs?


GetBlockChecked always returning genesis block?

Ok, so the code is just fine as Andrew assumed.
It was odd to me that first several blocks are the same. They all have one transaction and the same output value of 50BTC, but according to site https://blockstream.info/testnet/, where you just type a block height in search bar and you can see all transactions inside of resulting block, this is correct.


RPC Command to send from multiple accounts to one account (default - "") in same wallet

NOTE: Account features are deprecated and will be removed in Bitcoin Core v0.18.0, it is recommended to switch to the label API in v0.17.0 and later, see Release notes 14023.

Depending on what you are trying to do, you can either move them using the move RPC:

move "fromaccount" "toaccount" amount ( minconf "comment" )

DEPRECATED. Move a specified amount from one account in your wallet to another.

Arguments:
1. "fromaccount"   (string, required) The name of the account to move funds from. May be the default account using "".
2. "toaccount"     (string, required) The name of the account to move funds to. May be the default account using "".
3. amount            (numeric) Quantity of BTC to move between accounts.
4. (dummy)           (numeric, optional) Ignored. Remains for backward compatibility.
5. "comment"       (string, optional) An optional comment, stored in the wallet only.

Result: true|false           (boolean) true if successful.

Examples:

Move 0.01 BTC from the default account to the account named tabby
> bitcoin-cli move "" "tabby" 0.01

Move 0.01 BTC timotei to akiko with a comment and funds have 6 confirmations
> bitcoin-cli move "timotei" "akiko" 0.01 6 "happy birthday!"

As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko",
0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

Or you can get the address of the default account using the getaccountaddress RPC:

$ bitcoin-cli getaccountaddress ""

and then send it to that address using the sendfrom RPC:

$ bitcoin-cli sendfrom <account-name> <to-address> <amount>


Do checkpoints in the block chain help to avoid a 51% attack that rewrites the entire blockchain?

Checkpoints are features of certain clients, not inherent to the blockchain itself. So, if an attacker did re-write the chain all the way back to a popular checkpoint, he could maybe get the network to disagree. Some would go with the 'chain with most work wins' approach, and some would go with the 'chain that meets my checkpoints with the most work' rule.

Checkpoints do not inherently help prevent a 51% attack though. In fact, their usefulness is predicated on the assumption that a 51% attack all the way back to a checkpoint will never happen. For example, some clients skip ECDSA verification for anything older than a certain checkpoint, so it's useful to have these checkpoints because initial-block-download syncing will be faster.


Alex, Monero is listed on all of the major exchanges (bittrex, poloniex, kraken, binance, etc.). The non-exchange options like shapeshift or changelly make it possible without doing this, as mentioned above. It's none of my business, of course, but do some research before buying into a new coin (I wouldn't take advice from CNBC although I like Monero and own a few coins). There are a lot of privacy-focused coins out there now that have a variety of pros/cons. Here is a non-exhaustive list of coins that have varying degrees of privacy built in... https://drive.google.com/open?id=1PVSBXpjHaqkJv8mLY5AEPk-6AP7BA1BgW7IOPG-h0mc


What's the use of not relaying non-standard transactions if anyone can still use them using P2SH?

As you say, there are two separate concerns here:

There are some scripts that might cause harm to the network.
There are some scripts that might make future upgrades harder.

For the case of harm to the network, the non-standard transaction check was first implemented by Nakamoto before P2SH existed, so it couldn't be so easily circumvented.  This gave developers time to better analyze the script language and fix problems with the remaining opcodes (e.g. see cases like this where it was possible to create transactions that would take a very long time to verify).

However, even if the scripting language is perfectly safe, each script has to be stored by every full node until it is spent as part of the Unspent Transaction Output (UTXO) database.  Since scriptPubKeys are limited to 10,000 bytes, this means that an attacker can add up to 10KB to the UTXO set for every output he creates, potentially quickly adding enough data to degrade performance enough that the rate of stale blocks (orphan blocks) mined increases, which would reduce miner profits and encourage them to centralize further to recover that lost revenue.

That'd be bad.  Happily, there's an easy solution: if we use P2SH or segwit P2WSH, we only see the full script at the point when the output is being spent---when we can remove the output from the UTXO set.  This is somewhat inferior with P2SH due to it limiting scripts to 520 bytes, but P2WSH fixes that problem and restores the earlier limit of 10,000 bytes.  So that's the security reason why we require complex scripts today use P2SH.

For the upgrade case, there are some opcodes we don't want people using.  Most notably these are opcodes that might be redefined in the future, e.g. the OP_NOPx opcodes that have been used for soft forks in the past (OP_NOP1 became OP_CHECKLOCKTIMEVERIFY and OP_NOP2 became OP_CHECKSEQUENCEVERIFY).  Lately, Bitcoin Core 0.16.1 has stopped relay of OP_CODESEPARATOR in non-segwit in preparation for another potential soft fork that will reduce some lingering problems with expensive verification.

In those cases, standard transactions forbid both the scriptPubKey and the redeemScript (P2SH) versions (and, when applicable, the segwit P2WSH version), so the easy circumvention isn't possible in that case.


Moved Bitcoin-Qt wallet to blockchain - can see my funds but can't send them?

i have blockchain.info "My Wallet" wallet on iphone. i didn't pay any attention to it for about a month until a couple of days ago. when i opened the app it showed a balance of 0.00 BTC. A momentary shock. Then i noticed that the "identifier" i.e., the string of letters and numbers in the top field. This is your public key for that block. For some reason in its wisdom blockchain created a new identifier that now by default fills the identifier field, whereas my old correct identifier used to show in that field, and a positive BTC balance associated with that idedentifier showed as well. Now when I hand enter the old correct identifier, it shows my correct BTC balance.

I do not appreciate having the functionality of the app change like that without notice to me first.
Contacting support from blockchain is impossible if there is any support from blockchain.

To answer your question: hand enter your original identifier and your correct account will show. I have no idea why they change one's identifier.


Has anyone attempted to rewrite the bitcoin software and protocol?

I believe that is what the NXT project is attempting to do.

It is a from scratch implementation of the ideas introduced by Bitcoin et al. They use Proof-of-Stake and claim to provide "built-in support for robust features such as a decentralized peer-to-peer exchange, voting system, messaging/chat, decentralized DNS, and options for instant transactions".


Create an arbitrary script with two locktimes and p2sh

There are a lot of possibilities to write such script. This is the simpliest, but not the shortest one

OP_IF
  lock2 OP_CLTV OP_DROP pubAlice OP_CHECKSIG
OP_ELSE
  OP_IF
    OP_3 pubAlice pubBob pubCarol OP_3
  OP_ELSE
    lock1 OP_CLTV OP_DROP OP_2 pubAlice pubCarol OP_2
  OP_ENDIF
  OP_CHECKMULTISIG
OP_ENDIF


Ttransaction validation in the bitcoin blockchain

Transactions are validated by nodes before they are broadcasted to the Bitcoin network, and also after they are submitted as blocks.

Here are the basic steps for transaction validation:

Transaction is submitted to a node
The node does some checks to see if it is valid and standard
It enters that node's memory pool and gets broadcasted to other nodes
Miners determine if the fee rate is profitable, and if so, they begin to mine it in the next block
Block is submitted when a single miner solves the proof of work
Miner submits the block to a node
Node checks entire block including transactions
If its valid, it broadcasts it to other nodes.
Every additional block adds another confirmation to the transaction

6 confirmations is common for wallet software to consider a transaction final. That might be where you got the "6 miners" from.

Note that usually miners get and submit the block to the pool software instead of the node directly.


I sent my bitcoin to my own email adress instead of to my wallet, Now what?

The bitcoin protocol does not support sending Bitcoins to an email address, so I am assuming that Coinbase offers a Paypal-like service that allows sending Bitcoin to family and friends' accounts with their email address. Check the inbox of the email address that you put on there for instructions on how to redeem those Bitcoins at Coinbase, otherwise, contact their support.


How to get the private keys out of old wallet.dat without syncing blockchain

From bitcoin-qt, click Help->Debug and open the Console tab. Type in dumpwallet <outputFileName>, making sure that of course, the output filename isn't wallet.dat or it may overwrite your wallet.

This command creates a plain text version of your wallet with all private/public key pairs in WIF format.

You may need to configure your clients to point to the correct directory containing your wallet.dat with the -datadir command line option, or if you have a custom config file use -conf.

You can also use the dumpwallet command with bitcoin-cli if you have a bitcoind running.


Is there a way to tell which *coin is most profitable to mine?

This site allows you to compare the mining profitability of the various coins:
http://dustcoin.com/mining


Nothing is stopping miners from not including transactions in their blocks, in fact it has happened before.

  hashing smaller data will result in greater hashes/s (yes?)

No, the hashes are always the same size, and adding transactions to the block does not make any difference to the difficulty in finding the nounce that validates the block (the speed of hashing remains the same, and the probablity of finding the bock also remains unchanged), hence it makes financial sense for miners to add as many as they can since they earn more transaction fees.

Edit: for more details on the mining process, this thread provides a good summary:

  Simplified mining process 1) Miners select tx from the memory
  pool for inclusion in a new block (the number, method, and criteria is
  up to the miner) 2) Miners construct a merkle tree from the tx in
  step #1 3) Miners create a block header with the merkle tree,
  prior block hash, version, timestamp, and nonce 4) Miner will
  hash the blockheader.  If it is a solution go to step 5. 4a)
  Miner will increment nonce and go to step 4.  If nonce range is
  exhausted go to step 4b 4b) Miner will modify another element in
  blockheader, reset nonce range back to 0 and go to step 4 5)
  Miner has found a block.  They broadcast it to peers.  So
  once a miner finds a block they are done.  All the work for deciding
  tx comes BEFORE solving a block.

So the number and size of transactions has no real impact on the repetitive step #4.

Having said that, it has been claimed that some miners do choose smaller blocks in order to minimise network propagation delays, and hence reduce the chance of their block becoming an orphan.


There is no credit in Bitcoin. Therefore, you cannot send any bitcoins until you have either purchased or earned some.


How to set exact bitcoins to receive in blockchain api?

No, not the way you think.
The recipient has no say in whether a transaction to him gets made. The sender signs over money to the recipient, the recipient is not being asked. Any (simple) transaction that just sends money from one party to another is the sole prerogative of the sender.


How does a non-upgraded node read a SegWit transaction?

Segwit node will convert transactions and blocks "on-the-fly" while sending them to your non-upgraded node. You will see anyone-can-spend outputs and redeems from such outputs. You will not see any additional flags, witness data and any other segwit stuff.


Open source ASIC design plans in Hardware Description Language (HDL) format?

No. ASIC designs are all proprietary. This is controlled to the point where gaining information about the use for packaged chips is subject to a highly restrictive NDA. Some optimizations in use are non-public, and at any rate nobody is going to give away millions or tens of millions of dollars worth of NRE cost to their competitors. It seems unlikely that any of the older manufacturers will make their designs open source, as most have collapsed since selling their devices. The public manufacturers like BFL, HashFast, CoinTerra, ASICminer have all struggled to even exist after selling their devices due to the large NRE cost and difficult market for the devices.

There are however some ancient FPGA miner designs written in VHDL which are open source.

https://github.com/fpgaminer/Open-Source-FPGA-Bitcoin-Miner

They aren't very much use to anyone for practical use but may give some idea of how hardware miners function. ASIC miners are significantly more efficient than FPGA miners even on the same process, especially now that some are moving to regulator-less supply rail chaining designs, so there is no realistic chance of this information being profitable for anybody at this point in time.


How do I convert Bitcoin to cash at my bank via Mt. Gox?

The factors that matter for any cash-out decision are:

Where are you located (country)?
How much are you looking to trade?
What type of cash are you looking to receive?
How soon do you need access to the proceeds?
Is privacy important?

You are specifically asking about Mt. Gox but there are numerous methods for transferring value from bitcoins to your bank.  In some instances, Mt. Gox will be a good choice or the best choice, and in other instances it may not be.

In the U.S., for instance, Mt. Gox does not directly provide ACH withdrawal.  ACH transfers are a method for inexpensive bank transfers.  They do support withdrawing of funds to Dwolla and Dwolla can be connected (via ACH) to your bank account.

Here's the article for Mt. Gox on the Bitcoin Wiki:

http://en.bitcoin.it/wiki/Mtgox#Direct_Deposit_2

And here's the article for describing most of the various cash-out / withdrawal methods:

http://en.bitcoin.it/wiki/Selling_bitcoins


Can anyone assign btc address with wallet?

Yes it's possible if you don't take care.

Let's imagine you have 1BTC on each of your five BTC addresses.

Now you want to spend 4.5BTC, your transaction will look as following

input:
Addr A (1BTC)
Addr B (1BTC)
Addr C (1BTC)
Addr D (1BTC)
Addr E (1BTC)
output:
Addr X (4.5BTC)
Addr Y (0.5BTC) // the change

By seeing such a transaction you can easily deduce that the Addresses A,B,C,D,E belongs to the same person.

Note that this is not a 100% evidence because several people can put their coins together in one transaction for example for an Assurance contract.

Note that when you use TOR it creates a static route from your computer to an exit node. If you don't click on the 'Use a new identity' button your transactions will be broadcasted through the same TOR exit node. So click on 'Use a new identity' between each transactions.


So I think you're missing some things. Since the Lightning node has bitcoins in the channel and can be used as a conduit for B to send or receive money, node A must have an automated way to sign bitcoin transactions and participate in lightning transactions. An attacker could theoretically use this ability to send bitcoins from the channel through the lightning network to themselves, in the case that the attacker compromises the machine in such a way as to have the ability to instruct the Lightning node to do those things. The private keys would still be in memory at very least, and so could potentially be accessible to kernel viruses.


What would be the consequences to lower the difficulty such that a block is generated every 5 minutes?

The most important consequence:

It would increase the orphan rate, which gives big miners more chance to mine (because they run their own ISP, while a miner with 0.1% hashrate of the network probably doesn't), and this leads to centralization.


Am I seriously going to have to keep this clunky old infernal machine running for weeks upon weeks to sync the blockchain?

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

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

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


How Bitcoin wallets avoid address re-usability?

Is wallet generates an address from index 1 and scan blockchain whether an address is used or not, until wallet finds an unspent address?

No. The wallet software generates a seed (pseudo-random). With that seed, it generates private keys. With those private keys, it generates public keys and with those public keys, it generates addresses. And this address is (almost) always unused.

  and checks whether the index is used or not until it reaches address that has not been used.
  ---- and ----
  If the wallet is stateless, then determining unused address by generating the address from very first and looking up blockchain for the unused address is expensive?

That's not how it works. The probability to hit an address that is already used (by the method seed->SK->PK->address) is almost 0 because you don't know the seed of other people. You don't need to check that because it's almost impossible (unless you have a lot of computer power and want to waste electricity).

  Is the wallet keeps state of unused address?

The wallet simply check the funds of all your addresses, recognizes that your first address is used (has funds on it) and provides you a new one (also created by the same seed (seed->SK->PK->address).


Does the official Bitcoin version 0.8. client still download the whole blockchain?

0.8 doesn't actually use the bloom filter feature, but it enables support for letting other nodes use it.

0.8 does download the entire chain.


Now, if I discover a block, won't both my localhost GBT "pool" and the remote pool claim it as theirs?

No. That isn't possible. Changing the coinbase transaction (what controls where a block reward goes) invalidates the block. All that happens is that the block propagates slightly faster.

Cheating on pooled mining

  This appears to be known as the "selfish mining attack."

Actually, that's something else.

Luca Matteis explains:

  You're missing the main point: when a selfish miner finds a new block,
  he keeps it private, does not broadcast it to the network, and starts
  mining on top of that privately.

  The rest of the network is still mining on a block that was actually
  already found, but not broadcast.

  When the rest of the network finally finds this block, the selfish
  miner broadcasts his version, in an attempt to replace it.

  By invalidating blocks this way a selfish miner is effectively wasting
  other people's cycles, and has a head start for winning the next
  block, because he started mining on it before the others.


What happens if I don't "pick up" bitcoins with a Bitcoin client?

Everything is already stored in the blockchain, and there is nothing to "pick up".

The blockchain stores: "A generate a block (25 btc now)" and "A sends 2 btc to B".

When you want to send bitcoins, you proof that you are "B" and sign a message saying "I own these coins (A->B) and want to send all of them (2 btc) to C".

Now "C" owns 2 bitcoins.

(This of ofc simplified alot, e.g. I am missing confirms/etc but you really need to understand the basics before you start learning the advanced)


I bought a bunch of 2009 Bitcoins the actual coin. How can i cash the coin in?

It seems that you have what many people would call physical bitcoins. There are several kinds, but I am not aware of any from before 2011 that actually take the shape of a coin. The probably best known type is made by Casascius. Is there any additional information you could provide? Maybe a photo?

Anyways, if this is what you have, then be aware that none of them are in any way official. They are merely someone's personal invention. To link them to bitcoin, they usually contain the private key, with some more or less effective tamper-protection (e.g. hidden behind a self-voiding seal or the like). If printed, this private key is a long string of alphanumerical characters starting with 5. With this private key you can, using a bitcoin client, take possession of the actual bitcoin(s) associated with the coin. Look out if anyone has done that before you! The coin should also display a bitcoin address, without being hidden behind a seal or the like, which you can use to check if there actually are real bitcoins associated with it using web services such as blockexplorer.com or blockchain.info. You recognize the bitcoin address by starting with 1 if given as a string of alphanumeric characters. Sometimes bitcoin addresses and private keys are additionally shown as QR codes for easy scanning by bitcoin apps for smartphones.

As Jannes pointed out in an earlier answer, do check if your coin has collector's value. Particularly if it is true that you got a physical bitcoin manufactured by someone as early as 2009, it may really be special.

For instance, this post on Bitcoin Forum list the different types of known physical criptcoins, with some info about their mintage and sales history. The Series-1 1BTC Casascius Coin is the one with seems to attract the highest collector interest, since it was the first physical criptocoin ever to be released to the world. In the Bitcoin Forum, some of those coins were reportedly sold for 8 BTC, even though they are only loaded with 1BTC.


Explanation of probability of forks in the Bitcoin blockchain

I haven't read the paper, and I think the expression is only an approximation, but the basic idea is that this is an inhomogeneous Poisson process.

In order for a fork to occur, some unaware node needs to find a block. This is 1 minus the probability that no unaware node will ever find a block. Which itself means that no unaware node finds a block in 1st second, no unaware node find a block in 2nd second, etc. This probability is the product of the probabilities of the individual seconds (since they are all independent).

Each individual probability is roughly (1-P_b)^(1-f(t)) (if f(t)=0 then all nodes are unaware and the probability is the same as no block being found at all a block at all, if f(t)=1 then all nodes are aware and certainly no block will be found by an unaware node, and in between it interpolates. If it's not clear why the interpolation is via a power, keep in mind that for small P_b, the power is irrelevant since the expression is roughly 1-P_b*(1-f(t)).

The combined probability, as mentioned, is the product of probabilities, which is like (1-P_b) to the power of a sum of (1-f(t)), which is like (1-P_b) to the power of an integral.

If it was up to me I would have written the expression differently, but these are the general ideas.