How do I compile Bitcoin Core to be more portable?

By default, the binaries that you build are dynamically linked. This means that they use libraries installed in standard search paths on your computer. What you want is a statically linked binary where those libraries are packaged together with the binary.

Bitcoin Core achieves this by using the "depends" system. Documentation for this can be found here and in the windows cross compilation docs.

Basically, you cd into the depends directory, run make in there, then back in the root directory, you configure and point to the configuration stuff produced by the depends system, and when you compile with make, it will use the libraries build in the depends system and be statically linked.

For example, you might do these commands:

cd depends
make HOST=x86_64-pc-linux-gnu
cd ..
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/
make

x86_64-pc-linux-gnu is the platform that you want to build binaries for. The depends system will create a directory in depends/ with that name. That directory contains the depend system's build results.

The resulting binaries should be portable.


Why is there an addrlocal field in the output of the RPC call getPeerInfo, and how SPVs handle it?

Why is this output there?

Because it is part of the version P2P message. getpeerinfo largely outputs the information provided by the version message.

  Is it used anywhere? Does it have a use case?

Currently, no. However it may have been included in the version message because Bitcoin was originally designed for things to go directly to IP addresses. There used to be a Pay-to-IP thing where this could have been useful.

  Furthermore, they commented that "Most SPV nodes set this to 127.0.0.1:8333", why would an SPV node do that?

Because it is easier to implement and no one actually uses it.


bitcoin-cli failed with error: incorrect rpcuser or rpcpassword

re-compiled on an Ubuntu system, fresh from github.com:

$ uname -a
Linux ubuntu-ae 4.10.0-19-generic

$ bitcoind -version
Bitcoin Core Daemon version v0.15.99.0-g96ac26e5662

$ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getaccountaddress "myaccount"
n2r1aQiA37LLgy4qWjuLHXqA9ZhtcX4KG6

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance
0.00000000

and with wrong password:

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance
error: incorrect rpcuser or rpcpassword (authorization failed)

so s.th. is wrong with the sources? Or with Ubuntu setup. What kernel do you have (uname -a) ?


c-lightning & Lightweight nodes (no local bitcoind)

One lightweight alternative that I use quite often when setting up a Lightning node is spruned. The following will get you up and running:

Install some dependencies:

apt-get install -y git python3 \
                       libleveldb-dev \
                       python3-dev \
                       git \
                       gcc \
                       g++ \
                       python3-pip

Get spruned and its dependencies:

git clone https://github.com/gdassori/spruned.git spruned
cd spruned
git checkout 43e197693278fd551b165c6cfa5de78f853ef554
pip install -r requirements.txt

The third line is currently needed since the master commit is currently broken.

Next you can start the lightweight node with the following:

python3 spruned.py --network bitcoin.mainnet --datadir data --debug --rpcuser=rpcuser --rpcpassword=rpcpassword

Once the node is running you can start c-lightning like this:

lightningd --log-level=debug --network=bitcoin \
           --bitcoin-rpcuser=rpcuser \
           --bitcoin-rpcpassword=rpcpassword


How to transfer hash power from one pool to another

If you want to move all your computational power (hash power) suppose you could just disconnect from your current pool and connect to the other one

If you want to divide between different pool I suppose you could just connect to them then use a tactic of process priority to choose how much power you want to devote to each pool depending on its process, for Ubuntu you could have a look at a thread like this one: https://askubuntu.com/questions/656771/process-niceness-vs-priority but it depend on your operating system


What precisely are vSeeds "seednodes", how to they work, how to create one for a new network?

Couple of points covering what it is and how it works:

The description might be out of date.  You'd need to follow the code to see how seeding is done.  E.g. IRC seeding is not used any more (but that is noted).
Those addresses are DNS seeds.  They run a DNS name server which is usually used to translate website names (like www.google.com) to IP addresses (eg 123.123.123.321).  They've made the code such that those DNS server instead of returning IP addresses of servers return the IP addresses of bitcoin nodes.
DNS operates on port UDP port 53 (and TCP) so you would not expect anything when browsing to those DNS seeds.
This is done by running special software that aims to find nodes on the network.  It keeps track of nodes that are consistently available and serves those randomly in response to DNS requests.
When a new node comes on line it will not have a history of peers it previously connected to and will contact these DNS seeds to obtain addresses of random nodes to connect to.
The next time a node starts up it will connect to peers it previously connected to (rather than DNS seeds).  If it can't connect to any it will retry the DNS seeds.
Nodes that are connected to existing nodes also share details of nodes they are connected to.
A seed node is typically a last resort.  It's a hard coded node IP that is running the node software that uses the standard (or near standard) bitcoin protocol to talk to nodes connecting to it.  This is not using DNS. This may be a last resort node to connect to if other options fail.

To implement your own for your altcoin you'd need to replicate this infrastructure.  You could just start with a fixed IP node(s) on your network but to enable decentralisation a couple of independently run DNS seeds are probably a good idea.

The crawler / DNS seed software would need to be adapted to understand the communication protocol of your coin to find all nodes in your network.


Does the client broadcast it's version? Is it possible to determine which version of client are in use?

When you connect to the other Bitcoin client, the first message you send is "version", which states your protocol version. Moreover, it states both your IP address, and the addres you are connecting to. You can capture this data like any other TCP/IP data.


What Is the difference between the testnet and the mainnet?

The testnet (test network) is an alternative Bitcoin blockchain, to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain.

Mainnet: The original and main network for Bitcoin transactions, where satoshis have real economic value.

We're using the testnet alot for developing purposes, assume you are building a new feature and its require you to send and receive bitcoins and you don't have any real bitcoins or you don't want to waste with mistakes, here we use test network (testnet).

Testnet addresses and private keys have a different prefix

Testnet BIP32 private key   tprv    tprv8ZgxMBicQKsPcsbCVeqqF1KVdH7gwDJbxbzpCxDUsoXHdb6SnTPY

Testnet BIP32 pubkey    tpub    tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD9

Testnet pubkey hash (m or n)    mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn


When building consensus how much traffic and their equivalent of orphan blocks are accumulated?

Once a consensus round starts, the amount of information that needs to be distributed is fixed, since new transactions cannot be introduced. If there's no reason a transaction shouldn't be included, then almost all honest nodes will ask that it be included. If there's any reason a transaction shouldn't be included, then the avalanche algorithm quickly excludes it.

  Is communication throttled at all?

Each validator rate-limits how often it changes its position. There is no reason to send a position that is already obsolete due to the decisions made by other validators.

  Is the candidate set processed by the network or the founders?

Once each validator determines that a particular candidate set has a super-majority, it applies the transactions in that candidate set and signs the resulting ledger. If a super-majority of validators sign that ledger, then we have a new "last fully-validated ledger".

Any transactions that could have gotten into that candidate set but didn't are then recovered using a deterministic process.

  how much time does the average round consume?

The network bases each round's timing on the previous rounds, trying to make the round a little bit faster if it can, but making it slower if it must.

There are a few minimum timings to ensure network stability. A ledger must be open for at least two seconds in order to ensure nodes have a chance to finish processing the previous ledger. A consensus cannot be declared for at least two seconds after the ledger closes to ensure nodes have a chance to take an initial position before other nodes conclude there is a consensus. (These are absolute minimums. If needed, they will rise.)

This makes a typical consensus round take about 5 seconds, plus 1 second for each additional avalanche needed to reach consensus. The number of rounds tends to grow logarithmically with the number of nodes and linearly with the network diameter (time it takes for a flooded message to reach the majority of nodes). We don't expect the timing to get over 10 seconds, even with a large network, so long as the network is confined to Earth.

Underperforming nodes will "bow out" of the consensus process to prevent the network from becoming as slow as the slowest node. Overperforming nodes will slow down to prevent the network from becoming as fast as the fastest nodes (as this would reduce decentralization). The algorithm is designed to self-regulate to keep the fastest subset of sufficient size operating.


Relation between Network Hash-Rate & bitcoin value?

You can find graphs charting this relationship at http://bitcoinx.com/charts/. (scroll down)

Network hash rate and exchange rate are certainly correlated, but the relationship is very complex, I think it would be inaccurate to say that one depends on the other. In general, if price increases due to an outside factor (eg. new adopters buying Bitcoins) hash rate will go up, as you can see in the chart at the above link around July 2011, when price spiked and hash rate followed.

Impact of hash rate changes due to outside factors on price is harder to predict. Hash rate increases can lead to increased investor confidence in the currency (which would increase price), but they can also drive miners on the edge of profitability out of mining and potentially even Bitcoin, decreasing the price. (less participants in a market generally leads to price decreases, though not always)


Weird. If you don't mind, could you add a transaction I'd and your bitcoin wallet address?

I'm guessing you withdrew into your bitcoin wallet from circle, but it didn't appear in your bitcoin wallet. You could however see it on the blockchain?

I have a couple of ideas:

Malware

You may have malware installed on your computer that swaps out your bitcoin address that you have copied down to the hacker's bitcoin address. Please verify that the recieving address in the blockchain is the same one as the one in your wallet.

Wallet not synced

If you're using a wallet like bitcoin core/qt, you will have to wait for your wallet to sync. It will show at the bottom of the client.


Recurring Bitcoin or Altcoin Payments as a Service?

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


Conveniently, the file is called validation.cpp.  You probably want to look at the function CheckBlock.


Accidentally transferred Bitcoin to Bittrex Bitcoin Cash account

I realise the question is a few months old, and no response from OP, so maybe resolved.

But to answer the question for anyone stumbling across this in future, there's a good chance the coins can be recovered for now, but it depends on the address used.  If it's a "1" address, then the private key can be used by both bitcoin cash and bitcoin.  It's likely a manual task for the support team though, so unlikely they will be too happy about this!

Sending to a "3" address may be different, if it's a plain old multisig it could be recovered (I believe, as that's not been tampered with), but if it's a SegWit address, it may be recoverable - for anyone!  Bitcoin cash has no concept of SegWit, so the coins really are "anyone can spend", and in fact someone did claim them all at one point (not sure on the ethics/legality of that one, but that's another topic).

Immediately after the release of the bitcoin cash fork, all bitcoin addresses were valid on the new chain.  The good news is bitcoin cash is switching to a new address type see this question, so should cut down on the amount of issues this will cause in future.


Can I move my BTC back into an exchange and still collect BTG?

The private key is just a series of 256 ones and zeros. That unique combination identifies your wallet, and the chance of someone else getting that combination is 2^256, which is very very small. Your private key is used to generate public keys, which are bitcoin addresses, and which will hold some amount of bitcoin.

If BTG splits off from BTC, then they will continue with their own chain after the specified split point, say block nr 491,591. Once split, all of the bitcoin addresses which held bitcoin during block nr 491,591 are are treated as bitcoin gold addresses. Meanwhile, the same addresses hold bitcoin for the original chain, which then diverges.

If you hold a private key that holds addresses which in total hold 23 bitcoin, then you also hold 23 bitcoin gold.

To address your question: if you move the coins from the addresses managed by your private key to an exchange, you are effectively moving them to a private key held by the exchange. If the exchange doesn't support BTG, you won't be able to touch the bitcoin gold account, since you don't have the private key to access them (the exchange does). If the exchange does support Bitcoin Gold, then you are probably offered a way to trade with them.

Note that if the exchange poorly implements trading, they could cause you to lose funds because there is no replay protection. If you hold the coins on your private key, you can try to move the bitcoin gold coins to an exchange, but you would most likely have to make sure of the replay protection yourself (which is non-trivial at best).


Though it might not help much with economics, if you run a node then you can also gather information on orphaned blocks, IP addresses, and unconfirmed transactions (some of which may never confirm, if insufficient transaction fee is paid or the transaction size is too big).

Gathering statistics on Bitcoin is tough, as little can be collected reliably about Bitcoin users. Other questions have looked at that issue here and here.

It's generally impossible to even prove that particular bitcoins have not been destroyed (eg the exchange that apparently lost its wallet when Amazon EC2 crashed), though in some cases proof can be given they were destroyed (where bitcoins are sent to a particular address that nobody can realistically have the private key for). I suppose in that regard it's no different to cash.

You might also be able to get some idea of publicity and levels of user interest from activity levels on bitcointalk.org, reddit.com/r/bitcoin and Google search statistics


The 2FA wallet means there are two distinct sets of private keys, one you hold in your wallet, and one held by a third party. Normally you are authorizing the third party to sign transactions with their private keys on your behalf by giving them a valid 2FA code. In the case of Electrum, the third party is a company named TrustedCoin.

Their terms of service explicitly state that there is no recovery service for lost 2FA tokens.

3. Integration with 3rd-Party Wallets

If you forget your one-time password generator, we offer no way to recreate it.  You will need to use your second key to move your funds to a new address.

From the information presented you will need to find your Electrum seed to restore both halves of your wallet, or find a backup of your phone that contains the 2FA token files. iOS for example will  back these up into iTunes, it is likely that Android devices have similar backups that will contain them as well.


Bitcoin inflation in 9/12 doesn't seem to have been corrected. Why not and will it be fixed?

A short term increase in the gradient on the graph can be caused by a large and fast relative increase in hashing speed of the total network. Within a short time, the difficulty adjusts and prevents it having a substantial long term impact. The steep gradient on this difficulty graph between 13GH/s and around 20GH/s is an increase of around 50% in hashpower in a very short time.
It won't be fixed, because it's not broken; it's working as originally intended. It does mean that the date the reward adjustment is halved comes slightly earlier than if the network hash rate remained constant. It also means that as the value of bitcoins grows higher, more hardware will be purchased and added to the network, and blocks will be produced slightly faster than the 10 minute average.
The final date of "new bitcoin mining" is of little consequence. Well before that date, miners will be earning more from transaction fees than from the block reward.
We can expect more of this when ASIC mining hardware comes online.


You can but you have to use American wallet provider Coinbase but than you have to register and login into their website.

For clarification, your bitcoins are not stored locally on your machine, they are stored on the Bitcoin network which means they are also on my computer and on every other peer's computer. The difference is, you have the access to your bitcoins (you own the private key) and I don't.


How are transactions in forks verified efficiently?

Transactions in forks are not verified completely until the node attempts to switch to that fork. Before that, only those checks are performed that don't depend on previous transactions. In the source code, there is a function CheckBlock, which does only some of the checks, and ConnectBlock, which checks everything. The latter function is called only when the block is about to be accepted into the longest chain, so the hash table of unspent outputs is available.


Pruned nodes forget blocks after a while after processing. However, this is independent from whether those blocks have a witness.

SegWit does permit a half-pruned state, where witnesses are removed but the rest of the block is kept. That state is enough to serve lightweight nodes (which don't care about witnesses), but not enough to serve other full nodes. As far as I know, no full node software has implemented that half-pruned state.


How can I get the private key from wallet.dat from 2011 Bitcoin software on WinXP?

The wallet.dat was created with Bitcoin Core (in 2011 it was called "Bitcoin").

You should install the newest version of Bitcoin-Core (0.14.2 by the time of writing). The wallet.dat from 2011 should still run.

Use the GUI.

If you want to export the private key, you don't need to sync (takes a couple of hours / days)

Can also be done on a different machine then your Windows XP box.

Following steps may help:

Start Bitcoin Core
Stop Bitcoin Core
Datadir should be created, open the datadir folder (https://en.bitcoin.it/wiki/Data_directory)
Replace the existing wallet.dat (backup it if you already had Bitcoin Core installed) with your old wallet
Start Bitcoin Core
If you want to export your keys, open the debug console and type dumpwallet <filename>
If you want to use Bitcoin Core, let it sync (takes a couple of hours/days)


How are mutated transactions prevented from getting relayed?

Transaction malleability is prevented by selecting one canonical representation of every transaction and making every other representation nonstandard. That is, of all possible transactions one transaction can be mutated into, exactly one is considered "original", and other representations are not relayed.

Originally, Bitcoin could accept different representations of the same data. For example, it were possible to represent the same number both with and without leading zeros, producing equivalent transactions with different binary representations. Now, a transaction would only be considered standard if those numbers are represented using a specific number of digits, so it is now impossible to write the same number in different ways.

However, this rule is not enforced on transactions that are already in a block (since otherwise it would be a fork), so a powerful adversary can still push a mutated transaction into the network by mining it himself.


Building from Source on MAC OSX 10.9 Error

I encountered the same problem and solved it by appending the following code to ~/.bash_profile file:

export CPATH=/usr/local/include


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

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

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

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

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

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


Consistenly getting Block magic mismatch error?

You have a corrupted block file. You will need to delete that file and all higher number files and then redownload the entire blockchain.

The block file that is corrupted is the 0th file, blk0000.dat. Since this is the first block file that Bitcoin Core creates, the easiest thing for you to do is to just delete the entire blocks and chainstate folders in your Bitcoin Core datadir. Then start Bitcoin Core. It will redownload the entire Bitcoin blockchain.


Either accidentally or intentionally, the Bitcoin Core chainstate database (which is a LevelDB database directory containing the UTXO set at the current tip) used to occasionally trigger anti-virus software. It would recognize certain byte patterns in it, and automatically quarantine and scan the file, resulting in database corruptions.

This was resolved by making the software use an obfuscation scheme for the non-hashed data in it. The scheme is very simple - a randomly chosen (per database) 64-bit value that gets XORed into all values in the database. This is fast, simple, and so far, effective.


In the NXT register alias dialog pop up, what is the DEADLINE text field for?

The deadline field is the amount of time in minutes/blocks (1440, or one day being the default) for the transaction to complete. If it is not completed in that time period you receive a "refund" from the network and the alias will not be registered to you.

A common mistake is to set the deadline to 10, or an even lower number reducing the odds of your transaction going through.


How to calculate bitcoins in fees spent dailly? (Avg)

Yes that look correct.

From https://bitcoinfees.info/, the current average fee rate listed at the bottom of the chart is 24 satoshis/byte. To calculate the total fees in a day you want fee rate * total bytes = total satoshis.

Assuming 2MB block size,

fee rate = 24 satoshis/byte
total bytes = 2MB * 6 * 24 = 288MB

total btc = total satoshis / 1e8
total btc = (24 * 288M) / 1e8 = 69.12 BTC


What is the mechanism by which the 'system' adjusts the difficulty of finding blocks so one is found on average every 10 minutes?

It's enforced by the fact that every miner and every Bitcoin user is running software which implements the adjustment algorithm you described.  So everyone is able to compute, and agree, what the current difficulty is supposed to be.  This is the notion of "consensus" which Bitcoin relies on.

If some miner created a block with a difficulty lower than the "correct" current value, the rest of the network would reject it.  The coins created by that block would not be accepted as payment by anybody else, making them effectively worthless, and the transactions contained in that block would not be considered as confirmed by anyone else (though they could still be added later to another valid block).  Other miners would not use that block as the "previous" for their own blocks, and so it would not be incorporated into the block chain.


How will the new Internet Neutrality Act affect Bitcoin?

The Internet is a vital platform for innovation, economic growth and
  free expression in America. And yet, despite two prior FCC attempts,
  there are no rules on the books to prevent broadband providers from
  limiting Internet openness by blocking content or discriminating
  against consumers and entrepreneurs online.
  —Protecting and Promoting the Open Internet May 15, 2014 fcc.gov

There's a possibility that Internet Service Providers discriminate against bitcoin traffic either by making it more difficult, setting limits, charging a toll, or by blocking it altogether. This could prevent nodes from relaying transactions and relaying blocks, either of which would undermine the network.

The prodigiously talented members of the community would no doubt come up with  workarounds, perhaps ways of obfuscating bitcoin related traffic. This could possibly result in an arms race. It could ultimately drive the bitcoin community to build its own network which some have already proposed.


MtGox websockets vs HTTP - which is more real-time?

You would expect websockets to be more real-time because it is designed as an upgrade to HTTP to enable live streaming and real-time services.


Its ok I found out what was the problem- I had to update my drivers


Are Hardware Wallets (i.e, Ledger Nano X) Safer than Software-Based Cold Storage Wallets?

If the hardware device is lost or stolen (don't forget it's "sleek and small") it would impossible to retrieve the wallet as the PK is only be stored on the device itself? (If it can be stored anywhere else you are no longer resistant to malware attacks)

All current hardware wallets use BIP 39 mnemonics. This is a sequence of 12 or 24 words which you can memorize and/or write down on paper which can be used to re-generate all of the private keys in your wallet. This is allows for your private keys to be stored elsewhere while not exposing them to any malware.

Can't a malicious program siphon funds from the hardware wallet while the device is connected to a computer without ever stealing the PK? Similarly, since every hardware wallet runs some OS, why can't it be infected when it connects to a computer? Perhaps the PK can't be stolen but the funds can.

No. The hardware wallet has buttons and screens so that it can show the user what it is going to sign, and allow the user to accept or reject the transaction before signing. Hardware wallets are not just dumb storage devices, they have mini operating systems and will do their own checks of the transaction and ask for user input before private keys are retrieved and used for signing.
The mini OS that they run is not like an OS on your computer. They are highly specific to the device and, in general, can't be infected by malware on your computer. Hardware wallets have a limited communication protocol with the computer. While there could be a vulnerability in the firmware that does allow it to run malware, the attack surface is very small and far more easily auditable than the software that runs on a laptop.

If a laptop is always in offline mode (not connected to the internet) won't this prevent it from being infected in the first place?

Airgapped devices can still get malware through USB drives and other devices you plug into. Famously, the Stuxnet virus successfully jumped an airgap in this way. Furthermore a laptop could be accidentally connected to a network. You cannot assume there won't be any human error.

Also it seems that a device that is specifically designed to store cryptocurrency is the perfect candidate to be tampered with during manufacturing and/or delivery. After all, it's pretty clear what the device is going to be used for (unlike regular laptops which have other use cases)

That is possible, and different hardware wallet manufacturers address this in different ways. Trezors are shipped in boxes that have tamper evident seals. Coldcards are shipped in sealed, tamper evident bags. The Coldcard, Ledger Nano S and X can be visually inspected to see if any of the hardware is not what it should be. Coldcard and Ledger have high quality images of the device's circuit boards online and you can look at your devices circuit board and compare them to the pictures.
Additionally, most hardware wallets have open source firmware so you can compile the firmware yourself and run that on your device instead of trusting the firmware that it shipped with.
Of course there is still the element of trust. You still have to trust the hardware wallet manufacturer and their factories. But it is reduced with these methods.


What information is available from the blockchains of privacy currencies?

Unlike many users might think, Bitcoin blockchain is completely transparent linking all your transaction history and those who you are transacting with. Everyone who has ever transacted with you or will be in future is able to see what amount you have received from or sent to which address, forever. Some (centralised) mixer/tumbling services try to mitigate this fact changing your BTC into some completely other ones, but they still have their history and you don't know what it is.

Privacy focussed coins try to solve this at protocol level, I'll try to summarise:

Dash (and Pivx fork) offer you an option to use a sort of CoinJoin which is performed by their Master Nodes and can have several rounds. This is pretty similar to tumbling services but you are not at risk to loose your funds. However, you still have to wait for mixing partners in every round you make and this can take minutes up to several hours for every single round. Since the amount of mixing partners is very limited, an attacker could simply offer high supply to mix with and be able to track your mixed funds anyway.
Verge is a joke. It's basically Dogecoin over TOR hiding your IP but having a completely transparent blockchain. Their Wraith protocol just uses some other notation for receivers addresses, but they are stored in plain on the blockchain.
In Zcash, Zcoin you have an option to use ZK-Snarks and send your transparent funds to a shielded z-address. Unfortunately ZK-Snarks are very computation heavy and need several minutes on modern hardware computers for each transaction to be generated, they are not available for mobile devices yet at all. They are fully shielded hiding sender, receiver and amount of a transaction. However, they are barely used and no exchange or payment service is accepting them to date, so you have to claim them back on their completely transparent t-address blockchain before being able to spend them.
Monero (beside some small forks of it) is the only coin with mandatory privacy enabled for every single transaction. Ring signatures obfuscate the real sender, stealth addresses hide the receiver and (ring) confidential transactions hide the amount of the transaction by default. Unlike all the optional private coins you cannot tell how many Monero wallets are in existence nor how much has been transacted. An external observer cannot say who send how much money to whom. Even as receiver you still don't know the sender's address, you can only determine it by your sub-address or payment id used.


How to store private key in MySQL database?

Storing private keys in an online server is not best practices (even if you quickly transfer to an offline wallet). Generally, you should not store private keys on an online device

Instead, if you use a BIP32 HD wallet architecture, you can just store an extended public key on your online server. This will allow you to generate receiving addresses on the fly, while generating (and securely storing) the private keys on an offline machine.


Securely erase a previously used address from bitcoin-core

No, and in fact, deleting a file is not destructive enough.
File deletion typically does not actually delete the file. Filesystems will just mark a file as deleted and allow it to be overwritten. If the file does not end up overwritten, it can be recovered from the drive using some forensic tools.
Furthermore, the way that the hard drive itself writes data physically often leads to data being left behind and just marked to be overwritten. So there could actually be multiple copies and fragments of your wallet.dat file left on the hard drive. Forensic analysis tools can then recover those fragments even after the file has been deleted, and some portions overwritten.
A better guarantee that no one can recover the data is to wipe the hard drive and overwrite every part of it with random data. However there is the potential for bad sectors or other issues with the drive which prevents an overwrite from actually overwriting some portions of the drive.
To be absolutely sure that data cannot be recovered, you have to do what companies like Google do to ensure that data cannot be recovered from their used drives: completely destroy the physical drive. Physical destruction is actually the only way to ensure that no data can be recovered from a drive.


Can a raspberry pi zero run bitcoin core 0.16.1 and sync up without downloading the entire blockchain?

You can't avoid downloading the block chain with Bitcoin Core  or any other full node.  That is inherent to their functioning.

You don't have to store it, however, if you enable pruning.  This would reduce your storage needs to 1 GB or less.

If all you want is to make transactions, and you're satisfied with having to trust other servers a bit more, you could use a wallet that uses SPV or gets transaction data from a centralized server.  See https://bitcoin.org/en/choose-your-wallet and look for those listing "simplified validation" or "centralized validation" as a feature.


How long does it take for an unconfirmed transaction to reverse?

There is no estimated time, and in fact this transaction can potentially get confirmed at any moment, though the less likely the lower the transaction fee was.

To fully revoke it, create another transaction that overrides it, and put a higher transaction fee to make it more likely that it will get confirmed before the other one.


How Does Bitcoin network prevent from the same transaction being included multiple time in a block

First of all let's discuss what would happen if a block indeed contains a transaction that was already included in the chain:
All full nodes validate all blocks, and will not accept a block with any invalid transaction in it. If a transaction is repeated, it means its inputs are already spent by the first instance. The second one will thus be considered a double spend, and regarded as invalid, which by extension means the entire block in which it was included the second time is invalid. Thus, the entire block will simply be ignores by the network.
This means miners have a very strong incentive to not do this. It doesn't really matter how they do this, but if they risk including a transaction twice, they'd lose the entire reward (subsidy + fee) from that block if they'd win it.
Turns out, it doesn't need much to prevent it, and arguably with existing software it is much harder to do include duplicates than not. Recall that every block needs to contain the hash of its parent block. This means the miner needs to be informed of that parent block first, and gets to see it. A new block tenplate (with transaction selection) can't be constructed before the previous block is known. Since building on top of an invalid block is also invalid, software will also validate that new parent when it comes in. As a side effect, it knows about its transactions, and thus knows what a successor block is allowed to contain (which excludes duplicates of course, but also other forms of double spending).
There is sort of a shortcut that is sometimes taken in practice. When a new block is found, miners may learn about its existence faster than that its validation nodes have learned and processed the full block. In this case, a miner may instruct its hashers to temporarily switch to mining on top of an empty block (which is certainly valid). When the new parent is fully procsssed, hashers get an upgraded template with actual transactions. This can be dangerous, and has caused a significant fork of empty blocks building on top of an invalid block, around the time BIP66 activated.


I wouldn't use Dropbox. Use 2 encrypted USB drives or harddisks and store both on separated locations. Storing it on 2 locations prevents it to be damaged during a fire or any other event or robbery.

The precautions to take depends on the value of your wallet ofcourse. A high value means higher precautions.

For example, you'd store $30 cash in your wallet and $1.000.000 or gold bricks in a safe or trusted bank with goverment insurance.

If you have a $xxx or $xxxx amount, store an usb at your home and another one at your work. If the amount is higher, i'd spend some money on a safe.


any limitation to use "bitcoind - zapwallettxes" to reverse unconfirmed transactions?

Run bitcoind and with -zapwallettxes.

bitcoind is the daemon version of the original Bitcoin wallet maintained by Bitcoin Core. bitcoin-qt would be the GUI version.

The option -zapwallettxes is specific for the Bitcoin Core wallet. It 'forgets' spend outputs and allows you to respend them. However this does not imply that other bitcoin nodes on the network accept a new transaction with the same (already spend in your first transaction) outputs.

-zapwallettxes is only affects your local wallet.

Your transaction can not be reversed. Probably the best thing to do is wait. Your transaction will confirm eventually.


How to get balance history of a bitcoin address using BCOIN node

Looking at the docs, you're using the HTTP api incorrectly.

Try this in your terminal. Make sure to define or change the $url variable.

address0='RQKEexR9ZufYP6AKbwhzdv8iuiMFDh4sNZ';
address1='RHpAA3ZmmmWF6FW8qSfaEvh1jR1nUmVYnj';

curl $url/coin/address \
  -H 'Content-Type: application/json' \
  -X POST \
  --data '{ "addresses":[ "'$address0'", "'$address1'" ]}'


Technically, there is no such thing as a bitcoin. There is only a ledger (the blockchain) that contains transactions. A transaction refers to outputs from previous transactions, and specifies new spendable outputs.

A transaction output consists of a Bitcoin address, and an amount. And for practical purposes we pretend as if these amounts represent actual "bitcoins".

So if I send a transaction to your address for the amount of 3, we say "I sent you 3 bitcoins". But all it does is adding a transactions to the ledger that says 3 from my address to your address, signed with the private key that corresponds to my address.

Just like you say, it's just a number in the transaction.

Now regarding if bitcoins have IDs: no. Say I have 10 different addresses with 1 bitcoin each. I can now spend all these 10 together, in one single transasction, to one new address. This will create one new spendable output of 10 bitcoins. At this point it's impossible to distinguish the previous 10 separate coins. The new spendable output for 10 bitcoins is "atomic", I can only spend that 10 in its entirety. If I want to spend only 0.5 of that 10, I would send 0.5 to the recipient and 9.5 back to an address of my own.

Similarly, I can also have 1 bitcoin and divide that into 20 parts of 0.05 BTC each, all on different addresses, in one single transaction. I can then mix up one or more of these 0.05 BTC parts with other fractions of other bitcoins, merge them, et cetera.

So no unless a (fraction of a) bitcoin has moved completely separately from any other bitcoins, you can typically not track bitcoins to their origin, or associate them with some ID.

P.S. this model of a transaction is actually a gross simplification, more complex constructs are possible, but for sake of simplicity and clarity this basic interpretation should do.


That is what Andreas is trying to convey. He is saying that the traditional way of generating random private keys for each transaction in order to prevent address reuse is a poor choice of wallet principle. That is because every time you generate a new random private key, you would have to make sure to keep a backup of it so that you can recover bitcoins tied to that private key in case your wallet software becomes inaccessible. If you are transacting multiple transactions a day, generating a new address every time, you might find it tedious to back up your private key every time. The other way you get around this would be people using the same address so as to prevent the hassle of backing up the keys.


how does bitcoind functions in bitcoin exchange model?

A wallet is not the same as an address. A wallet is a collection of addresses. Wallets usually also contain the private keys for the addresses and any relevant transactions.

You can get as many addresses from bitcoind as you want with getnewaddress and they will all be part of the same wallet. Any coins sent to those addresses will be part of your wallet.

Also, Bitcoin Core is an HD wallet, but there is no need for you to have an HD wallet to do what you want. HD wallets are only relevant for backups.


IIRC WannaCry requires you to contact the malware authors (via their built in chat system thing) and then tell them the address that you used to send the payment. Then they will manually decrypt your files for you. Otherwise there is no way for them to track who sent what payment. This of course is fraught with issues and is very unreliable. I have heard some people say that their files were decrypted even without paying, and others say that they have paid but their files were not decrypted.


Is something gained by double spending myself on a 51% attack?

Double spending is not about doubling, but about using the same UTXO twice. So, you won't gain anything by double spending coins to yourself.

Let me explain you, with a simple example, how double-spending works:

Lets Alice be an attacker trying to double spend some coins. Alice goes to Bob's store to buy some goods. In order to pay for the goods, she create a transaction, TX1, that spends from an UTXO from a previous transaction, TX0, and pays to Bob. Later on, Alice generates a second transaction, TX2, that also spends from TX0 but this time pays back all the money to herself. Down bellow you can see the scenario depicted.

Now, Alice has multiples ways of double-spending the transaction, depending on her hash power and on whether TX1 has been included in the blockchain or not. Since you assumed you have a 51% of the network hash power, we can assume that Alice can mine a block with a greater probability than anyone else, so we will take it for granted, an analyze only the other factor, what happens with TX1.

TX1 not confirmed

If we assume that TX1 is still not confirmed, but it has been broadcast and the nodes are aware of it, Alice can double spend TX1 with TX2 by just including TX2 in the next block she mines. If Bob has accepted the zero-confirmation transaction as a payment and has delivered the good to Alice before the inclusion of TX1 in the blockchain, Alice will obtain both the goods and the double-spent amount.

TX1 confirmed

If TX1 gets confirmed, either because, against the odds, another miner has mined a block in which the transaction was included before Alice mined hers, since Alice has the greater hash rate she can overcome the previous block by continue mining on the top of the previous block. This will create a blockchain fork, and eventually Alice branch will be longer than the other, since her hash rate is bigger. Notice that if Alice does that frequently lots of forks will occur, in which double-spending transaction could be identified, what will undermine the trust on the currency.

Last, being Alice the most powerful miner, she could just include double-spending transaction without forking the chain, by including a TX2 in the same branch than TX1 was included. Notice that this violates the blockchain inclusion rules, since two transactions can not spend from the same source. Therefore, the rest of the network will not accept this block as valid. However, since Alice has the greater hash power she can just keep going and mine over that block. In this case two things can happen, either the trust in the currency is lost since more of the 51% of the hash power is devoted to cheating, or the branch that includes both transactions is just ignored by the rest of the network.

In conclusion, no good comes from someone controlling such amount of hash power.


How and When are lightning channels disabled?

This is a tricky question as it tackles the difference between what the protocol supports and what implementations provider as an API.

On a protocol level channels are enabled / disabled via an update message on the gossip Protocol. Nodes SHOULD set the disabled flag and send such a message if they are shutting down or turning (shortly) off for maintenance. Similarly they SHOULD enable the channel if the node is going online again. Now gossip messages are rate limited to prevent spam. Thus it could mean that the node is online but the update message is not sent / propagated yet. Your node would refuse to even try to send out a package over a channel which is known to be disabled to the payer node.

You are correct: lightning nodes do not provide a command line api to change the activation state of a channel.


You just have to wait. Eventually, another miner will produce a block and it will be on top of one or the other of the two blocks found at about the same time. The probability of again having two miners find blocks at about the same time is very low. The truly paranoid can wait for six blocks to be mined before relying on a transaction.

Persistent splits should be unlikely because the longer the chain you mine on top of, the higher the probability of you getting to keep the mining reward. If you mine on top of a chain that is one block shorter, you only tie the existing chain that other people are already mining on top of.


Why are transactions taking so much longer in the last few days (2017-10-29)

So what has happened to the block chain

Some miners moved their hashpower to Bictoin Cash blockchain because it was more profitable for a while. https://cash.coin.dance/blocks

This resulted less hash power on bitcoin main chain and larger intervals between blocks.


JSON-RPC call to bitcoind error, 403 failed to open stream

I just read through the code that handles rpcallowip, and I can tell you that rpcallowip=0.0.0.0 won't work.

If you want to allow from all addresses, you should use

rpcallowip=0.0.0.0/0

(Weirdly, I can't find any code that handles wildcards. I'm going to open an issue on github about it. It looks like either the documentation or the code is wrong.)

Edit: It turns out that wildcard support has been removed.


How a block is defined (size, number of transactions)?

A block must satisfy the following conditions for it to be valid:

The total size of the block must be 1MB or less.
At least 1 transaction called the coinbase transaction must exist.
Block must satisfy proof-of-work.
Block must reference a valid block as the previous block.

There are some miscellaneous restrictions, but these are the main ones. What you called "solved by mining" is what's called satisfying the proof-of-work. What you called having at least one transaction is the restriction that the coinbase transaction must be present. I encourage you to read the specification to find out more.


Do you need to run own server when using a full node wallet?

What other full node wallet apps are available to select from for bitcoin?

See https://bitcoin.org/en/choose-your-wallet for a reasonable list

  Is it mandatory to have an own server when using a full node wallet

Not really. Some wallets have an API that allows other software to interact with the wallet but the wallets are generally usable directly for straightforward use.

  What pros/cons are there in terms of wallet security

Security is a complicated subject. On the one hand you want to keep things simple to minimise the exposed attack surface. On the other hand you may want to support coin mixing or other strategies to improve privacy. Unless you have some specific security requirements, the general advice is to keep the private keys under your exclusive control on a computer that is well protected. Use a hardware wallet for larger amounts or infrequently accessed Bitcoin.


Is it safe to store user's secure pass-code in database with encrypted form while creating bitcoin wallet?

Best practise is to only store a hash of a password, not the password itself. You should also include a random salt before hashing. You should be aware of which well-known hashing algorithms are no longer considered safe for this use.

Encrypting the password before storing it is not a good strategy because you end up with one encryption key, stored somewhere as plain-text, that can unlock all user's passwords. This is a gift to hackers.

You need to take care of how you hold the password in memory for use when encrypting and decrypting other data (keys etc). For example, you need to be sure other processes and plugins can't see into your processes' memory space and that before being released, any allocated memory is cleared. This should be automatic with most modern systems but it is your responsibility to be certain of this.

Yes, amateur attempting to write security code is probably a good way to destroy your business, destroy your reputation and put yourself in the way of civil or criminal proceedings for negligence.

To be honest this question might be better asked on somewhere like Security.stackexchange. There's nothing Bitcoin-specific about this.


How Many Clients Could Not Send to Bech32 Addresses?

As an answer didn't appear to be forthcoming, I did my own research in order to address this question.
Based on the information provided by the Bitcoin Wiki on Bech32 adoption, I surmised the following information.

All mainstream software wallets support sending to Bech32.
All mainstream hardware wallets support sending to Bech32 (either directly or via Electrum).
All major web wallets support sending to Bech32.
Most exchanges support sending to Bech32 (although notably Bitrex and LBC don't).

Note that I have specified sending because a lot of these do not support receiving funds via a Bech32 address as of yet.  However, for my particular requirement that is unimportant as it is about sending only.
With the above facts confirmed, the answer I actually gave to my client was:
Nearly all wallets can send to bech32 including most commercial wallet providers so you don't need to worry.
When he asked what percentage, I was unable to answer it.  I would need to know what percentage of daily volume went through the exchanges that didn't support Bech32.  However, given then pretty much every wallet does support it I felt that this was less relevant.


Do bitcoin addresses reveal my identity?

The blockchain doesn't know your total possession.  You know that addresses A and B belong to you, but the rest of the world doesn't know they belong to the same person.

However, Bitcoin transactions are allowed to have multiple inputs.  So you can create a transaction with two inputs, one from each of your two previous transactions.  This transaction will include two signatures, one for A and one for B, thus proving to the world that the respective owners of A and B (whether the same person or different people) have authorized their coins to be spent in this way.

Your wallet client software will take care of this for you automatically.  So from your perspective, all you have to think about is that you own 2 BTC.  You don't really have to pay attention to which addresses they live in; when you want to spend coins, your client software will choose appropriate inputs from among all your addresses.

It's not really correct to think of a Bitcoin address like an email address that identifies a particular person.  It's a token that's associated with a particular private key, such that coins sent to the address can only be spent by whoever holds the private key.  But there doesn't have to be a one-to-one correspondence between addresses and people.


Does bitcoin have enough resolution to replace all other currency?

The question is good (and has been asked before) but contains a misconception
No one buys rice a grain at a time

The granularity problem gets even worse since prices for mass produced items (like small electronics components) are often specified in units as small as 1/100 of a penny.

Sure, but you will never order just one 120 ohm 0402 SMD resistor from Mouser. You always have to respect the minimum order quantity. You never ask your bank teller to hand over a coin worth $0.00001 so that you can pay Mouser. Your credit card company or bank never has to track account balances to hundredths of a cent. The monetary system you use today also doesn't have currency units as small as that. It isn't a real-world problem. People can and do buy those 0402 SMD resistors using a currency system whose smallest unit isn't small enough to buy just one.
So this issue has no practical effect on the lowest denomination coin available in the currency. A one cent coin is a smaller amount than you'll ever need for any real-world transaction.

Satoshis may be too big?

If there are 7 billion people in the world then there are only 300,000 satoshis per person.

This is indisputable. However there are solutions.
MCCCS pointed out that the Lightning network can already be used for transactions smaller than a Satoshi.
The general view seems to be that the Bitcoin protocols, or related payment systems, can be adjusted in a timely manner to provide for higher resolution in advance of any requirement for it.


How would I be able to show 24 open, high & low on my site made with php

A lot of the code you are sharing is unnecessary and unrelated to working with APIs in PHP.

It's 3 basic steps. Define the URL of the API endpoint you want, fetch that URL in PHP, return the values to your page.

Here's a simple example:

<?php
//define API endpoint
$url = "https://api.gdax.com/products/BTC-USD/stats";

//fetch the url and convert the JSON into an associative array
$fgc = json_decode(file_get_contents($url), true);

//assign values to variables
$open = $fgc["open"];
$high = $fgc["high"];
$low = $fgc["low"];
$close = $fgc["close"];
?>

My Website

Bitcoin 24 HR stats

Open: $<?php echo $open; ?>

High: $<?php echo $high; ?>

Low: $<?php echo $low; ?>

Close: $<?php echo $close; ?>


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

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

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

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

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

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


Alternatives to OP_RETURN to store data in Bitcoin blockchain

For a proof of existence, you do not actually need to store the data in the blockchain. Merely commiting to it, by using its hash in way that is later provably used, is enough.

One such way is using a mechanism originally described as pay-to-contract.

Warning: elliptic curve math follows.

You start with any public key X (yours or someone elses). Then construct the modified key X' = (X + H(X || C)*G) [with H a hash function, || concatenation, and G the secp256k1 generator point], and send a transaction (possibly as part of an actual need to send money to X) to the address corresponding to X'. The receiver (which can be yourself if you do this for a change output) will need to add the value H(X || C) to his private key corresponding to X, to be able to spend the coins.

However, revealing X and C, plus the transaction in the blockchain you used to send to X', is a proof that C was actually known at the time of the transaction.

This scheme has the advantage of not requiring any data in the chain more than the transaction would already consume, and additionally that it is indistinguishable from a normal transaction, making it harder to censor or be subject to changing policy of nodes on the network.

An alternative possibly exists which works without modified addresses of transaction, but is not well studied yet.


Where is a comprehensive list of websites for getting free bitcoins?

Constantly updated list: https://bitcointalk.org/index.php?topic=90718.0

  Free Bitcoin sites:

The Bitcoin faucet.
One time payout per Google account. Explanation available at the site.

Daily Bitcoins.
Can be used once an hour now, and not just once a day.

CoinAd.com.
Can be used once an hour with registration.

Bitcoin Addict

Bitcoiner

Bunny Run.
See here for more info.

Free bitcoins - netlookup.se

Nakabot's Bitcoin Faucet
(Tor hidden service) NakaBot pays out a portion of its winnings in 0.001 increments.

Free BitCoin Daily Scratchcard

kickme.to/goxkeygen
MtGox account needed to redeem the code one receives.

bitcoinpixels.com
0.01 BTC free when signing up to betfair. See here for more info.

memorydealers
Learn how here.

Omnicoins
Learn how here.

cointicket.org

BitCrate *

bitcoins.so *
Roll dice : same numbers - win 0.01

Paperco.in faucet *
Scan a QR code to reveal a MtGox code for 0.0007 BTC.

Gambling sites that give out free bitcoins ( freerolls etc. ) after you join

Dragon's Tale
A casino site, but gives out small amounts for free that you can use to gamble with or withdraw to your own Bitcoin wallet.

Seals with Clubs
Seals has a free poker tournament every hour with a .05BTC prize. There are larger free tournaments from time to time.
See here for more info.

Strike Sapphire
See here for more info.

Not exactly Free but popular "earn" Bitcoin sites

BitVisitor
Earn Bitcoins for visiting websites

CoinTube.TV
Earn Bitcoins for watching TV


How is the distributed transaction log stored in P2P network?

Your client gets it from another client that has already received it. You then relay it to other clients that connect to you, and the cycle repeats.


Problems generating addresses using bip32

addrgen author here!

Addrgen was created before Electrum was BIP-0032 compatible and thus it used different master public keys and derivation method.

Please check the following PHP implementation which supports BIP-0032:

https://github.com/Bit-Wasp/bitcoin-lib-php

For python there are couple of implementations available, e.g.

https://pypi.python.org/pypi/bip32utils
https://pypi.python.org/pypi/pycoin/
https://pypi.python.org/pypi/bitcoin/


getblockstats

  "txs" : n,                   (numeric) The number of transactions (including coinbase)

Example
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockcount
627251

C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockstats 627251 | findstr /C:"\"txs\":"
  "txs": 2103,

The full output contains lots of other information
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockstats 627251
{
  "avgfee": 8359,
  "avgfeerate": 17,
  "avgtxsize": 571,
  "blockhash": "000000000000000000070ab39c953fd599b27da2c171476d2b2e8533484130bd",
  "feerate_percentiles": [
    7,
    7,
    8,
    25,
    30
  ],
  "height": 627251,
  "ins": 6108,
  "maxfee": 1598037,
  "maxfeerate": 387,
  "maxtxsize": 99011,
  "medianfee": 4007,
  "mediantime": 1587620811,
  "mediantxsize": 249,
  "minfee": 162,
  "minfeerate": 1,
  "mintxsize": 188,
  "outs": 4844,
  "subsidy": 1250000000,
  "swtotal_size": 550012,
  "swtotal_weight": 1383607,
  "swtxs": 893,
  "time": 1587623122,
  "total_out": 403374241843,
  "total_size": 1202103,
  "total_weight": 3991971,
  "totalfee": 17572435,
  "txs": 2103,
  "utxo_increase": -1264,
  "utxo_size_inc": -94315
}


Saved .bitcoin directory full ~9 GB block data, won't work when copied to another system

Two things come to mind as possible reasons.

The most probable reason is that you've switched client versions. There was a switch between 0.7 and 0.8 in how the block index (not the block data itself) was stored; it was changed from BerkeleyDB to LevelDB. If you remove the blkindex.dat (and really want to keep an index around, which is unlikely) you can restart the client with -rescan and -txindex. It will take a while (an hour?) to complete the indexing.

The other reason that I can think of is that it's genuinely corrupt, but that's unlikely.


How to derive BTC m44 addresses from xpub?

The following key:
xpub6C5oXscLYZwgq2DB42TFC32QcoPa1MeCWUNPZSjydunniCM77TRcBfFnjScJeToVXS5RBDr53Ls5RXvDHujmFSL4Fqc9kkpsMjU1vg68xv7

Corresponds to a level 3 public key w/index of 0x00000080 which is 0h/0'. In the context you've described it probably corresponds to "m/?/?/0'". This key's parent's fingerprint is 0x3ab9169c, so you'd need to provide the parent's full fingerprint to confirm the original derivation path.
Although m44 & m84 have the same master/root key, they have completely different level 1 keys, which would change all lower nodes. In short you can only derive m/... full paths from root keys, not child keys, which you've provided.
Edit: The key you've provided is probably meant for deriving receive & change addresses of a certain address type.


generating master public key from address

It's not possible.
An address is created though a hash160 (RIPEMD160) which is a one-way function.

Creating a xpub key (bip32 extended public key) requires the according pubkey and the chaincode.
Alternatively you can calculate an xpub from an xpriv (extended private key).


Do Coinbase, Coinbase Pro, Robinhood, Gemini, GBTC count as Web Wallet?

Does that mean when you buy bitcoins on Robinhood, Coinbase, Coinbase Pro, Gemini, or even the trust GBTC, they are all Web Wallets?

You can call them exchanges or web wallets but in both cases you don't hold the private keys and just looking at numbers based on the database used by website/app until you withdraw bitcoin to an address for which you own the private key.
GBTC is completely different from others but still you don't own any bitcoin private keys and you can read more about it here: https://grayscale.co/faq/

So should we consider Robinhood, Coinbase, Coinbase Pro, Gemini, or GBTC Web Wallets and avoid using them for too long but should transfer the private keys into our own wallets?

Keep only the funds that you need for trading on exchanges or willing to risk in case exchange gets hacked, shutdown etc. Withdraw everything else to your address for which you own the private keys.


"state channel" v.s "micro-payment channel" : are they the same?

Payment channels are a specific form of state channels used for forwarding payments (as in the Lightning network). State channels are a more abstract idea: In theory you could use the ideas of cryptographically securing a state between two or more participants (the balance in payment channels) backed by a blockchain for something else than payments (like games). But, just as with blockchains, it is highly doubtful if this actually makes sense economically for anything else than money itself.


Conditional scripting: how does OP_NOTIF (and OP_IF) operation(s) affect the stack?

So your inputs are:

<sig> <pubkey> <a>

And you want to verify that Hash160(a) == Hash1 or Hash2, and that sig is a valid signature by pubkey? Based on your original script, it looks like you also want to verify that pubkey matches a hash in the script.

So, the best way to do this is like this:

OP_HASH160 OP_DUP <Hash1> OP_EQUAL
// stack now has <sig> <pubkey> <Hash160(a)> <Hash160(a)==Hash1>
OP_SWAP
// stack now has <sig> <pubkey> <Hash160(a)==Hash1> <Hash160(a)>
<Hash2> OP_EQUAL
// stack now has <sig> <pubkey> <Hash160(a)==Hash1> <Hash160(a)==Hash2>
OP_BOOLOR
// stack now has <sig> <pubkey> <Hash160(a)==Hash1 OR Hash160(a)==Hash2>
OP_VERIFY
// stack now contains <sig> <pubkey>, and if <a> didn't pass the test the transaction has already failed
// now just do a norma pay-to-pubkey-hash for the rest of it
OP_DUP OP_HASH160 <Hash160(pubkey)> OP_EQUALVERIFY OP_CHECKSIGVERIFY

(I realize this is an old question, but I didn't see that until I'd already written up the script for it, so I'm posting anyway...)


How long does it take to update all nodes that have the blockchain so that they are identical?

The Blockchain is never changed only extended.

As I understand it, nodes do not explicitly check or care whether other nodes have identical copies. They just verify what they receive against what they already have in their copy of the Blockchain.

Synchronisation isn't exactly the right word to describe what happens but it effectively occurs as a consequence of nodes applying the same "consensus" rules. Nodes follow the longest chain, the one with most proof of work.


What were some discussed and current potential issues with pre-forked Bitcoin coins from August 2017 that have never moved since then?

No, there is no such problem. When BCH developers thought about introduction replay protection, they first agreed on the OP_RETURN-based one. Then they changed their minds and decided to use the better SIGHASH_FORKID-based one (see details about BCH replay protection).
Their first replay protection wasn't removed. It expired with block 530,000. After that block, unless you had moved your coins, it would have been impossible to separate your coins using that method.
That didn't matter to anyone then, since the second replay protection method introduced was made mandatory and worked perfectly. It was actually good enough to be exemplary (Bitcoin Gold copied it).

If you have pre-2017 coins, then you have BTC, BCH, BCHA, and BCHSV. To split those, send your bitcoins and BCHs to Coinex and they'll split it for you. (It is suggested to check that your transactions don't have nLockTime.)


Does a miner (or mining pool) who has 10x as much hashing power have 10x the odds of mining a block?

Each hash you do has a certain chance to successfully mine a block. Do twice as many hashes, and you have twice as many chances to mine a block.


gcminer with ATIRADEON HD3600 on ubuntu 12.04 64bit headless won't detect GPU

OpenCL is not supported on 3xxx series cards.  Although it's not completely impossible to mine on a card that old it will be very difficult.  Also, a card that old will produce less than 1 MH/s which will only be fractions of bitcoins.  I wouldn't waste my time fighting the Radeon 3600.

If you are serious about mining check out the 5xxx and 7xxx series cards.  Or better yet, look into ASICs.


What are the steps to overcome a state in which miners couldn't mine blocks?

A hash that can satisfy the PoW can always be found, the only determinant is time. This is identical to coin flipping - you can always flip a head, you just have to keep flipping until you do.

On average it takes ten minutes to find a hash, but let's consider something very dramatic has happened: let's say the Chinese have cut all links to the outside world, the Americans have successfully banned all Bitcoin activity, and the Europeans have a topsekrit piece of code that successfully intercepts and scrambles anything uploaded from one of their miners. Let's say that all of that happened inside the time it takes to mine one block, and let's say that for whatever reason there is now one single, solitary, functional miner anywhere on the planet, it's a Raspberry Pi, and it'll take Eleventy years to mine the next block. And a hundredteen times longer to reach the next difficulty adjustment. I think you'll agree that this is a state in which miners couldn't mine blocks. What then?

The most obvious step is a hard fork that resets the difficulty for that one miner. The miner will obviously agree; those using the blockchain would rather have that fork than wait in hope too.


Property based tests have been added to Bitcoin Core. What are they and could they replace some of the unit tests in Bitcoin Core?

I think this is a fair summary. I would hesitate to phase out unit tests, rather supplement them with property based tests. In a library I maintain called bitcoin-s we use them in tandem.

Concepts

There are two primary concepts in property based testing systems.

The first one is a Generator. The point of a generator is to generate values you want to run through your tests. Think of a generator as specify the boundaries of what random values you want to be generated for your test.

The second concept is the test itself. In english, property based tests say that

"Given a generator X, i want to generate random values from X and run them through my test case. My assertion should always hold true for the value generated from my generator".

An example

I'm going to pull an example from this PR i've had open for a long time now. If you want to see some more extensive tests I recommend taking a lookg at it.

The "property" we are going to assert is that

"If we generate two random private keys in bitcoin, they should NOT be the same"

If this property fails, we have an indicatin that something is probably wrong with our pseudo random number generator.

Here is what that test case looks like in C++ with bitcoin core:

/** Check CKey uniqueness */
RC_BOOST_PROP(key_uniqueness, (const CKey& key1, const CKey& key2))
{
    RC_ASSERT(!(key1 == key2));
}

That test case can be run N number of times (by default 10 in the rapidcheck library.

The next logical question would be "where do key1 and key2 come from"? The answer: They come from the generator! The beauty of property based testing is leverage the framework to do the generation of values for you.

Here is what the generator for CKey looks like:

/** Generator for a new CKey */
template <>
struct Arbitrary<CKey> {
    static Gen<CKey> arbitrary()
    {
        return rc::gen::map<int>([](int x) {
            CKey key;
            key.MakeNewKey(true);
            return key;
        });
    };
};

This gives rapidcheck the ability to generate arbitrary valid CKeys to pass in as a parameter to the properties that we are asserting holds true.

You can see more complex generators and assertions related to Script in that PR too if you want to see non trivial generators/assertions.

Summary

It's really useful to have multiple runs of a test case with newly generated values every time. Typically in software testing, you write a unit test asserting that your code works as expected for one or two values. This is a really limited approach to testing as you want your code to work for a range of values. With generators, you can get the computer to generate a range of valid values that your property should assert true on.

I think this is particularly useful for consensus systems like bitcoin where we need to reason about a wide range of values being fed as input into the consensus system. Property based testing is a great tool to use to offload some of that cognitive load when reasoning about corner cases.


Do I need to move bitcoins stored in a paper wallet?

Uh. No.. leave them be. Unless you need  to spend them.


In BitcoinJ, what is the purpose of Peer?

When should I use which construct?

Use PeerGroup, unless you want to connect to a specific Bitcoin node.

  From the code, it seems that we should only be interested in PeerGroup and not Peer.

PeerGroup will construct Peer objects. It's necessary, even if you don't use it directly.


How can extended public keys generate child public keys without generating the child private key in HD wallets?

Upon a bit more searching, I found the derivation for getting the child public key without the private key here:

child_private_key == (parent_private_key + lefthand_hash_output) % G
child_public_key == point( (parent_private_key + lefthand_hash_output) % G )
child_public_key == point(child_private_key) == parent_public_key + point(lefthand_hash_output)

In terms of K, k and G where prime denotes the child and h denotes the left-hand hash output:

k' = (k + h) % G
K' = point ( (k + h) % G)
K' = point (k')
K' = K + point(h)

Here are the exact implementation details from the BIP 32 documentation


Bootstrap.dat on Mac OSX 10.9 - Difficulty

In the Finder, click the 'Go' menu and choose 'Go to folder' (or just cmd-shift-G)
type

~/Library/Application Support/Bitcoin/

in the field that appears, click go and viola. If you've never previously run bitcoin the directory won't be there but you can go to

~/Library/Application Support/

and create it.

the problem you were having trying to find it if you were using the Terminal to do so may have been that spaces have to be escaped in file paths, so the command to change to that directory would be

cd ~/Library/Application\ Support/Bitcoin

note the backslash before the space. As I've noted you know, you can also drag files or folders in to the Terminal and it will automatically enter the path to that file/folder.


It means that for each cloud instance you own, you will get exactly 1 GHS or exactly 1 MHS, depending which type of cloud instance you own (sha256 or scrypt).


A Bitcoin transaction to an address has to be spent using the specific private key that corresponds to the public key whose hash is the address.  In this case, that's the child private key.

Of course, if you have the master private key, you can compute the child private key from it.  Your Bitcoin wallet client might even do that for you.  But at the last step, it's the child private key that is used.


Address creation in standard client - random library?

In addition to microsecond time, Bitcoin seeds the random number generator with GUI events, /dev/urandom on Unix, and HKEY_PERFORMANCE_DATA on Windows (very random, constantly-changing data).


How 1 address can create 14 inputs in output transaction to 1 direct address?

When funds are sent to an address, the funds are locked into a UTXO (Unspent Transaction Output). When you want to spend funds, you create an input that references a specific UTXO and satisfies the corresponding locking script. It doesn't matter whether the UTXOs were sent to the same or to different addresses. Every UTXO has to be spent explicitly and separately. There is no efficiency gain to spending multiple UTXOs received to the same address in one transaction, each still needs its own input to be spent.


Make sure to build the dependency:

cd ./depends/
make

And then tell bitcoin where to find the dependency:

cd ../
./configure --prefix=`pwd`/depends/x86_whatever_your_current_arch_is

Further information:

https://github.com/bitcoin/bitcoin/blob/master/depends/README.md#usage


How can I recover last word of BIP-32/39 mnemonic copay second signature multisig wallet

last word only have 128 possibilities
you can calculated by the first 11 words


blockchain.info seems to source transaction money from an address not in my wallet

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

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


Is it profitable to use Amazon EC2 to mine litecoins?

Yes it can be worth it, but generally what happens is if it ever is worth it then a huge number of people start doing it until the prices of EC2 are driven up and it is no longer profitable. Here is a good blog post about the subject:

http://da-data.blogspot.com/2013/12/briefly-profitable-alt-coin-mining-on.html


How can I force estimatesmartfee to return estimates on regtest?

You need to fill up the mempool of your regtest nodes and mine blocks (this means creating transactions --eg by using sendtoaddress-- and generating blocks --with generatoaddress).
For reference here is how it's done to test estimatesmartfee.


Because not everyone's nodes' clocks are in sync with each other and because of network latency, there needs to be some buffer of time that a block's timestamp can be in so that nodes will still accept blocks.

Having a larger buffer allows for miners to change the timestamp too in addition to the nonce in order to have more possible blocks given the same list of transactions.


HD / Deterministic Wallets and public key

Clients that use an HD wallet generate a fairly large number of the keys in advance (e.g. Armory does 100 by default). When it scans the blockchain for relevant transactions, it checks for transactions to all of the keys that it's generated so far.

Typically, you do transactions off the next address in the list (there's a certain order to it, and it's easier to just generate the next one than 100 next ones). Let's say your client has generated the first 100 keys, and someone sends money to the 150th address in your list. You'd have to wait for the client to decide to generate the 150th key (probably because you hit your 50th key used and it pregenerated out to 150), or tell your client to generate out to the 150th key, and then rescan the blockchain, in order to know that you received money there.

  It seems like there must be a way to determine if an address is spendable by the master key pair.

Not necessarily: you can generate a very long series of addresses (2^32, if I'm reading BIP 0032 right) from a master key pair, but doing so would take a substantial amount of time. I'm not sure if there's a theoretical way to do what you're asking (without actually calculating all of them), but in practice it's clear that you just generate the set of addresses you think will be useful in the near future, and go from there.


Where can I find a wallet for a blind or visually impaired user?

I don't know of any wallet specifically developed with blind users in mind, but I think there is a solution nonetheless: using the daemon (bitcoind) that is a part of bitcoin-core, through a CLI text-to-speech program. Being a command line tool, the daemon is entirely text-based, so it should be usable in this way.
You can use the daemon to synchronize with the bitcoin network, create receiving addresses, and craft outgoing transactions. It is a very full-featured wallet, despite having a clunkier user experience than some other options.
I am not extremely familiar with the options available for text-to-speech accessibility programs, but bear in mind that there are likely some security considerations when choosing which accessibility program you will be using. Ideally, you would use bitcoin-core and this accessibility program on an offline computer (ie, one that never, ever connects to the internet), to ensure that there are no potential data leaks (does the accessibility program communicate on-screen data with a cloud server? etc).
The good news is that if used correctly, you won't have to sacrifice privacy, security, or sovereignty in using this sort of solution, but the bad news is that the solution isn't easy to use. To quote the user Steve Ellis in the question linked in Murch's comment above:

The short of it is Bitcoin already has a subpar reputation for user experience, and it doesn't get better as you dig into accessibility


C secp256k1: What is the purpose of the idiom '(void)data;'?

Without (void) data;, gcc will complain about data being an unused variable. This is used throughout the codebase, especially for context objects, to deal with parameters which are required for API/consistency reasons but not actually needed.


Is it possible to recreate a multisig wallet with just 2 out of 3 private keys?

It is possible to move funds with only two private keys, however, you must still know the missing private key's public key.

The public keys are required to produce the redeem script, which is require to complete a transaction.

If you already know the redeem script (for example, it may be recorded in an old wallet file, or available on the blockchain if the same multisig address has been used to send out coins in the past), then you can spend any remaining coins with just two keys (in a 2 0f 3 multisig).


Where change the size of the window in Bitcoin code?

Open one of the .ui files from /src/qt/forms in Qt Designer

Press CTRL+O or click on [Form] -> [Break Layout]

Resize the form and different objects accordingly

Compile and run bitcoin-qt

I changed width and height in minimumSize property and same in geometry. Also made few changes in rpcconsole.cpp because I removed some objects, its not related to resizing the forms.


What prevent someone to not use the receiver address of one transaction as the sender in another one?

what process do prevent Bob from not using Alice address as the sender in another transaction

Bob doesn't know Alice's private key.

A transaction requires that a kind of digital signature be included with the amounts being spent (e.g. From Alice's address)  All other Bitcoin users (wallets, miners, etc) check the signature.
the signature is just a complex mathematical process that proves someone knows a private key without ever disclosing the private key. The private key is just a large number that is kept secret by the user (e.g. Alice).

Further reading:

Is it true that all the bitcoins in existence are on the blockchain (the ledge), but it just depends on who the owner (address) is?

Some other things worth remembering:

Bitcoin has rules but no rulers.
Bitcoin is electronic cash
There are no accounts in the Bitcoin network
Wallets don't contain money.
Addresses don't identify people, businesses or places.
Bitcoin isn't sent to, or from, addresses.
Bitcoin is never really in transit.
Bitcoins don't survive transactions.
Bitcoins don't exist as entities.
The blockchain is not a ledger (it's a transaction journal)
Miners don't have any special privileges (they exercise a role that has two special rewards).

The above are intended to guide readers away from misconceptions, not as a self-evident explanation of the points made.


In theory could we skip the proposed Taproot soft fork, activate Simplicity instead and use Simplicity to write the equivalent of Taproot scripts?

I think that's both very premature, and misses the point.
Simplicity is a completely different approach to scripting, with significant advantages, but it's being designed from the ground up. There is lots of progress, but it will require more than just the base layer.
You can't just write scripts in Simplicity, and if you have one, you can't just sign for it. There is work on improving that, by building something Miniscript-like for Simplicity, but it's all a long way from being usable & integratable.
And even ignoring all that, if Simplicity was completely ready and usable and reviewed and everything... it would be strongly preferable to integrate it as a leaf version under Taproot. Doing it otherwise would remove some of the incentives for hiding policies that Taproot offers.

This question was answered by Pieter Wuille on Twitter.


Does flattr complement or compete with bitcoin?

Flattr is a social micropayments system. Bitcoin is a currency.

There is no reason the two could not be integrated together, pay with bitcoins and then share the bitcoins out using the same method as flattr.

In fact, I would go as far as saying this would be an excellent idea due to lack of transaction fees and friction for small amounts.

Flattr is the service, Bitcoin is the currency. They don't compete; they could certainly complement each other though, in my opinion.


Copay is a mobile wallet which supports Bitcoin Cash testnet.

Desktop wallets based on Bitcoin Core should also support testnet; e.g. Bitcoin ABC and Bitcoin Unlimited.


Can a full node understand the transactions it downloads from the Bitcoin network?

Can a full node read and understand these downloaded transactions, ...

Yes.

or just it's just keeping a copy of encoded information?

You write "encoded" but the context makes it seem you may have meant "encrypted"
The Bitcoin network does not encrypt any data. None of the data in the blockchain is encrypted. It is all publicly readable information in plain sight.
The answer you are reading right now is encoded. The encoding used is UTF-8.


Has any illegal data been saved in the Block Chain?

While working on my master thesis I used the AACS encryption key (09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0), considered an illegal number, as a basis for creating a fake Bitcoin address - 1ujTAfEQh2obwdt72GrmXonakx2RxvYpX. A 1 Satoshi transaction was sent to that address from address 17TQLZvXjKTrUyRnV9DuQs4RVDgNjUPeXQ. The transaction was encoded in block 177653.


What pressure prevents alternate currencies from completely diluting bitcoin?

That pressure is purely market opinion of each currency as it comes into the public view.

F.A. Hayek argues that competition among currencies is beneficial for the economy and a useful means for fighting inflation of currencies. See Choice in Currencies.

Bitcoin by the very definition of its protocol is, in the long term, a deflationary currency. This is a fundamental quality that the introduction and rise of competing currencies - many of which will be modeled after Bitcoin - cannot change. Bitcoin cannot be diluted, because bitcoins cannot be arbitrarily added to circulation on a whim. Those who may have this power are under tremendous public scrutiny and would have a gargantuan task of persuasion ahead of them, should they choose to attempt to sway Bitcoin users' opinion.

Competition among the various alternative cryptocurrencies remains a topic of considerable debate, but the market cap chart to which you linked in your question comment indicates that someone finds value in these alternative currencies based on their merits.


How is an address beginning with a 3 valid?

According to the List of address prefixes, an address beginning with 3 is Bitcoin script hash. This means that transactions sent to this address are handled differently than normal transactions.


How to send user input data(Bitcoin address) from iPhone to server and then send Bitcoin back to user's Bitcoin address?

How do I send a Bitcoin address from an iPhone to my server?

Basic Python client socket example:

  Server side:

import socket

serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('localhost', 8089))
serversocket.listen(5) # become a server socket, maximum 5 connections

while True:
    connection, address = serversocket.accept()
    buf = connection.recv(64)
    if len(buf) > 0:
        print buf
        break

  Client Side:

import socket

clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect(('localhost', 8089))
clientsocket.send('hello')

How do I make a Bitcoin transaction using Python from my server?

How to make a simple payment with the python-bitcoinlib?

  (Rewritten for brevity)

  Run
  bitcoind,
  install python-bitcoinlib, then run this code:

from bitcoin.core import COIN, b2lx
from bitcoin.base58 import CBitcoinAddress
import bitcoin.wallet
import bitcoin.rpc

rpc = bitcoin.rpc.Proxy()
addr = CBitcoinAddress('1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T')

txid = rpc.sendtoaddress(addr, 0.001 * COIN)
print(b2lx(txid))


Why is it important that miners mine at the end of the longest branch?

Lets imagine that a fork is created during the propagation of a block in a certain height h. Two valid blocks are created and spread along the Bitcoin network. The majority of the miners start mining on block hA, while the miner m you mentioned (or actually a mining pool since a single user with such mining power is quite unlikely to exist) starts mining on the top of block hB.

The odds of mining a block on the top of hb before the rest of the network mines on the top of hA are lower that the other way around, but since the mining power m and the rest of the network are not that far from each other, it can happen (actually, it will happen, sooner or later).

Moreover, the hashing power of the network is split, and a huge part of it is wasted (either m's or the rest of the network), so the elapsed time between blocks will grow, until a recalculation of the difficulty is performed (some point between 1-2015, since it is recalculated each 2016 blocks).

Other papers has talked about similar things in the past (selfish mining techniques) concluding that with even less mining power similar attacks can be achieved.

By using selfish mining techniques a malicious pool can benefit from mining in a "secret branch" and reveal blocks just when they are ahead of the public branch by 2+ blocks, earning all the mining reward and making other miners waste their time, or when a block is propagated by other sources, trying to get their block picked up by a majority instead of the other.


What is miner supposed to do when waiting for longpoll

If you run out of work while waiting for longpoll to finish, then what you should do is submit another getwork request.

Note that just because you find a share in a particular piece of work, doesn't mean that you're done with that piece of work. There still might be shares or even a block solution in there somewhere.


You should sign up for a pool service and configure minerd to send shares to that service.  Right now it is attempting to connect to a local instance of a scrypt coin (litecoind I would presume) on port 9332 for solo mining.  If that is what you intended then verify that you have a server running and listening on that port.  It is also not recommended to run minerd as root in case theres is a remote buffer overflow vulnerability in the application.  You can check by executing the following command:

netstat -anp | grep 9332

This will tell you what application had that port open if any does.


How can I programmatically use several different (isolated) wallets?

Currently bitcoind is designed to only run one wallet at a time.  You would have to run multiple daemons on different ports and connect to each separately.

That said, it looks like multiple wallet support is being actively developed and will be available possibly in 0.9, based on this pull request.


There is nothing in the official documentation about this sort of thing. In the examples no-one is doing anything with deposits or withdrawals either. A quick google doesn't give any results, so I think you're stuck.

However, when I log in and want to deposit, one of the rules is the following:

  Address can be used for further deposits.

Isn't that working? Just use the same address over and over again? You will have to manually generate an address for the first time. (I know this is violating your first statement, but I used the same address at least twice for a deposit)


How come the bitcoin blockchain is only 285gb only?

Any factor limiting the size of a block is a maximum, there’s no minimum requirement.


Can you create Bitcoin transactions from one address to the same address?

Yes, this is possible.

As far as bitcoin is concerned there is no such thing as an address, only locking scripts. As long as the input's lock script is satisfied, the output can be sent anywhere, including to an identical script.

This technique is often used by exchanges to consolidate the smaller outputs that build up as they process withdrawals into more usable chunks when fees are low.


Is it profitable to mine any Altcoin in the Cloud? Amazon aws has servers with GPU.

If it were profitable, everyone would be doing it, increasing the difficulty, and making it no longer profitable. Mining is only profitable for you if you have some advantage over other miners.


How does the tx fee in sendmany method get calculated?

Does that mean that Bitcoin Core implicitly calculates and sets a smart fee for a given block target?

Yes that's how fee estimation work (basically statistics are made out of the transactions you relay given their feerate and how many blocks it takes for them to be confirmed).

  If so what is the priorities if I:

  Set TX fee explicitly before
  Set conf_target == 1
  Set estimate_mode == UNSET

Assuming you mean calling settxfee by "Set TX fee explicitly before".

The command parameters take precedence over globally-defined parameter, so the conf_target parameter will be used for fee calculation.

Setting estimate_mode to UNSET will make the decision of using conservative estimates depending on either you signal for RBF (use ECONOMICAL) or not (use CONSERVATIVE).


Scripting multiple cgminer processes / running on a router

That's an interesting approach. It's probably cheaper than a Raspberry Pi.

Put your startup script in a file:

./cgminer -o pool:port -u username.worker -p password --usb :$1

Save to start_single.sh, then

$ chmod u+x start_single.sh

Make the final script:

NUM_MINERS = 7
cd "$(dirname "$0")"
parallel -j $NUM_MINERS -- ./start_single.sh $(seq 1 $NUM_MINERS)

Save as start_all.sh, then

$ chmod u+x start_all.sh

Run ./start_all.sh to mine.

If you want to start the script on startup, google 'TomatoUSB start program on startup'


Testing the blockchain for ECDSA signature random collision

It can easily be done, and has been done. See https://bitcointalk.org/index.php?topic=581411.0 for example.


Is the minimum fee considered when a full P2P node validates a Tx?

A bitcoin network fork occur when a block generated by one node is not accepted by a percentage of nodes, those nodes will split and continue working on its own.

This change will not cause a fork, it will cause that some transactions will be discarded by some nodes, older nodes will never include it on a block but newer nodes will and older nodes will accept a block with transactions different transaction fees as those are not checked for block validity.

This has already happened, pools can discard transactions without fees or ask for higher fees than usual for example and the block will be valid and included in the blockchain without problems.


What is the best way to differentiate users' balances in a shared wallet?

Creating individualized addresses for each user is the best course of action, it is what the vast majority of services do. Using a BIP 32/44/49/84 HD wallet, you can derive individualized deposit addresses for each user, in a way that is easy to manage through your backend.

Making a single deposit address not only makes it difficult to differentiate between user deposits, it is also bad for the privacy of your users, and your service. Why allow every user that learns your deposit address to know how many coins your service has received over time?

If you are storing user funds you should also be diligent with your backend coin management (ie, you should use proper cold storage methods, to reduce the risk of user funds being stolen). This means you’ll need a system of hot/cold wallets to manage not only deposits, but withdrawals as well. So just using one monolithic address will not be sufficient in this sense either, and this is perhaps even further reason to not build a system with just one deposit address.

If you really need to create just one deposit address, then you could have users sign a message using the private key of the address(es) they sent BTC into the wallet from. This would prove ownership of the deposit ina cryptographically secure way. However, the vast majority of user-friendly wallets do not provide a message-signing functionality, so it would significantly hurt UX and usability of your platform to require this. My guess is that many BTC users will likely not have any idea how to sign a message like this in the first place.