A 'full node' refers to a fully validating node on the bitcoin network, meaning the node validates each block and transaction that happens on the network. An example of this is bitcoin-core.

A 'lightning node' refers to a node on the lightning network, which is a network that exists on top of the bitcoin network. The lightning network has it's own protocol for communicating lightning transactions, and the lightning node will follow that protocol in order to interact with the network. An example of this is lnd.

  If a lightning node, that is not a full node, opens a payment channel with another lightning node, how can the first peer check that the other peer does not send a "malicious" closing-channel transaction to the blockhain?

A lightning node will interact with a bitcoin full node in order to watch the chain for such transactions. Since the lightning network operates on top of the bitcoin network, the lightning node will need information from the bitcoin network in order to function properly.


Deriving the Bitcoin address from the raw block script

Surely the address must exist first before the raw block can allocate the mined coins to it?

No. The network has no concept of addresses. When you send money, you're actually sending funds to a public key or public key hash. The Bitcoin address format you're familiar with is just a way of representing public key hashes in a human-readable way.

This is especially true of generation transactions, which typically send money directly to a public key. Bitcoin-Qt normally doesn't calculate or display the address in such cases, though it's still possible to calculate it.

The "coinbase" doesn't contain the address or public key. That's just mostly-arbitrary data. It contains the block height, extraNonce, etc. The address is in "scriptPubKey". In the genesis block's generation transaction, the scriptPubKey is:

04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG

This is a direct-to-public-key transaction, not a normal address transaction. 04678... is the uncompressed ECDSA public key. Follow the instructions on that wiki page to get the address, 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. But again, this transaction doesn't contain this address, or even its base58-decoded (binary) equivalent. The address is just a way of representing the public key.


Solo mining of Bitcoin would honestly require a serious setup, as well any setup would need continuous added infrastructure/hashpower as the difficulty of mining increases over time-- for any returns to be realistically expected within a "reasonable" timeframe. And that would be to find 1 block. Think 100s of TH minimum to even get lucky.

This is why even people who have setup large mining farms, say 50, or 100 miners, still rely on Pools where the combined hashpower of many miners together work towards solving the next block. This provides a more consistent return on investment and allows you to budget accordingly based on overall pool performance.

As far as Altcoins, new alts are relased all the time, solomining in a proof of work scheme becomes more difficult typically with higher network hashrates on that given coin. So its about getting in at the very very start. Usually difficulty jumps into the "pool now required" within minutes, or even faster.  The more miners hashing, the harder it will be to solve a block before someone else does, because the entire network is searching to solve the same hash. The difficulty will adjust automatically in order to maintain the specified block time (different for each coin). So it's a fight basically, between the miners, and the network hash rate adjusts to keep "in time" say, 1 block per 10 minutes, etc.

Yes, you can solo mine alts. But truthfully, unless you are going to run a serious setup; including configuring your own stratum proxy server, mining on a pool and paying the 1 or 2% fee is really the way to go.


How to make a vanity throwaway address? Similar to 1BitcoinEaterAddressDontSendf59kuE

Simple website to create burn address http://gobittest.appspot.com/ProofOfBurn
If you want a script try this https://gist.github.com/CoinWhisperer/6d673f1f3d13da1611cd


Checking the received fund on an address of an HD Wallet

Bitcoin Core clients do not keep track of the balance of addresses that aren't yours.

To make sure that they do keep track of them, import the private keys into your wallet, and restart your Bitcoin client with the -rescan option.

That's what they mean by non-local.


NEED SOLUTION - Validation Error-Mempool-conflict

I found the solution guys.

Possible fixes, broadcast your transaction on localbitcoin blockexplorer (yeah they have one) :
https://localbitcoinschain.com/tx/send

All fine with your coins the problem is in blockchain mempool and to unblock need to send transaction manually to bypass the blockchain mempool.

Solution step by step:

Open chrome inspector in the network tab
Try to create a transaction and get "Validation error"
Open "Headers" of pushtx request and copy content from FormData, field tx: "You need that content"
Enter that transaction in form here https://localbitcoinschain.com/tx/send and click submit
You'll get transaction id and can check it in blockexplorer this transaction belongs to you and you need to wait when it will be confirmed


The magic phrase on that page is in a finite field.  Here the finite field is the integers mod p, where p is the number 2256 - 232 - 29 - 28 - 27 - 26 - 24 - 1 (see here).  So all the arithmetic in your equations isn't ordinary arithmetic of integers or real numbers; it needs to be done mod p.   See http://en.wikipedia.org/wiki/Modular_arithmetic.  For addition, subtraction and multiplication, you can use ordinary integer arithmetic and compute the remainder mod p at the end.  For division, you will need something like the extended Euclidean algorithm.  Of course, you will also need to be using arbitrary precision arithmetic if you are not already, since numbers of this size are much too large for standard C++ types like long int and double.


Uses of computing power by bitcoin miners

YES.
1)They help maintain the reputation of bitcoin by showing how it "works" and demonstrating that you can make money AND THEREFORE
2)They help encourage the developement of more powerful mining rigs and the business sector that makes them AND
3)They encourage more mining activity AND
4)They increase the difficulty.

GO TO 2).

Oh, just forgot one..

5)They help keep the planet nice and warm with all the electricity converted to heat by the mining rigs (I do hate being cold !).

6)AND ALSO (see my previously posted question): The may(or may not) be effectively working for the NSA (or someone) by helping to crack and/or obtain hash results of SHA256 which may (or may not) be useful (for someone to do something) such as constructing a larger look up table for SHA256 (e.g. crack longer length passwords.).

I suppose if you own a nice big mining rig (or otherwise have "control" of someone else's) it might be more cost effective to use it to hack into something rather than mine coins so I think one answer to the question would be "Yes, but not bitcoin mining if you choose to use the rig for something else more profitable and are dishonest/criminally minded".


Run bitcoin-qt at startup of Windows server

when you run bitcoin-d I believe it's with configuration allowing remote calls to query the wallet . as soon as windows restart you will need to have this exe run with the params ,can achieve this with batch file.
and remove the on startup run of the default bitcoin-qt.exe


Bitcoin: error parsing json in bashscript to send BTC using sendmany command

If this is your echo output:

'{"mj2FrDhEomSzyQtRoGY78oVRPcQs5L5o95":0.00001, "mkxnkT3kx9dsFS8V3qYydpL1o5F5MfwCvM":0.00001}'

Then you have too many quotes.  When you run echo, you should see:

{"mj2FrDhEomSzyQtRoGY78oVRPcQs5L5o95":0.00001, "mkxnkT3kx9dsFS8V3qYydpL1o5F5MfwCvM":0.00001}

That's because the shell strips off the outer set of quotes; it does that when you send the JSON to bitcoin-cli too.  Because you have the quotes there in the echo output, it implies that they're there in the bitcoin-cli command, so what you're sending Bitcoin Core looks like a JSON string rather than a JSON object.

This isn't asked in your question, but you might also want to look into the Debian/Ubuntu packages and commands named jshon and jq.  These help you process JSON in shell scripts.  Because they understand JSON, they tend to be a lot more robust the sed and awk.  I don't know if you need them for this script, however.


Can you have a cryptocurrency with a single source of truth?

Is that even legal to do? Can someone create their own centralised cryptocurrency and let people buy/use it?

What is legal/not-legal can change drastically depending on what jurisdiction you live within. If you have legal concerns, you should talk to a lawyer.
Generally though, there is a history of powerful governments shutting down centralized digital-money systems (eg Liberty Reserve), which culminated in the invention of the Bitcoin network (which has no central point of control/authority which can be shut down). This is similar to the evolution of file sharing: tools that were still at least partially centralized were shut down over time (eg Napster), until eventually someone invented a tool that couldn't be shut down (bit torrent).

Everyone who participates in the system agrees to trust this 1 party only, because they find them trustworthy

Even if the operator of the currency is perfectly benevolent and fair (ie, trustworthy), there is still a massive risk inherent to having a centralized point of control: what happens if the control falls into the wrong hands? (eg a rogue employee, hacker, government, etc). This is a massive risk, that only increases as the value secured by the network increases. What happens if the government policy changes? A war breaks out? The centralized entity running the network goes bankrupt? What if a natural disaster takes out their office? There are a lot of ways things could go wrong, and even if the chance of something happening is small, the impact could be massive.
On the other hand, the Bitcoin network has no hierarchy, no admin, no central point of control or authority. On the contrary, the network is governed from the bottom up, making it much more robust against many types of attacks.

Or they can just process transaction on a 1st come 1st serve basis and eliminate the need for blocks, just timestamp each transaction :)

This would basically amount to an .csv file with limited write access, which is rather uninteresting in light of the above.


What does bitcoin do that prevents someone from using your coins by just generating a key pair and saying "you" sent those coins?

When you spend Bitcoin, you are not just using a new randomly generated keypair. You are using a specific keypair generated before. In order for you to have been sent Bitcoin, you have to give the sender a Bitcoin address. This Bitcoin address contains the hash of your public key. When you want to spend those Bitcoin, you put your public key into the transaction and verifiers will check that that public key hashes to the hash specified in the transaction that sent those Bitcoin to you. If you just put a newly generated public key there, it would not match the hash and so the spending transaction would not be valid.


What is the meaning of in-script and out-script in standard bitcoin transaction?

What is meant by the both seems to be answered following the diagram in the pdf: "The transactions where the input script is a signature, and the output script is a verification algorithm are the most common type of transactions" and in context seems to directly refer to Inputs and Outputs used in Bitcoin.

I apologise in advance if you find my answer too simplified.

You can look at Inputs and Outputs like a coin in your pocket: you received it as an input in change while at the store last night, they received it as an input from the bank earlier in the week, and the bank received it as an input from the mint. The exact same coin at the same time was an output from the Mint that went to the bank, an output from the bank to the store, and an output from the store to you. When you give that coin to the gas station tomorrow, it will be your Output, and the gas station's Input.

So it is with a bitcoin: it starts life magicked into being by a miner who receives it as a reward for mining a block. He sells it for cash to pay his electric bill and so in a transaction on the blockchain, that same bitcoin is transferred as an Output from the transaction that magicked it into life, and an Input to the address of the new owner. Every single bitcoin transaction can thus be looked at as defining who owned that sum immediately beforehand: its in-script, and who may spend that coin next: its out-script. (I'm deliberately not mentioning how transaction fees affect Inputs and Outputs for simplicity.)

I've covered how the In and Out describes the movement of a bitcoin sum, but what about "Script"? In bitcoin (and computing generally) a Script is a very short program describing how data is to be handled. Here, the Out-script is a short program that defines the conditions under which that bitcoin may be transferred: in a standard transaction (I'll come to that shortly) the Out-script program will say something like "this sum may only be transferred by the private key that matches public key X". The In-script program will say something like "My right to receive these funds may be identified by Y". Only when combined and validated will the network at large agree that the transaction happened.

I've not read his entire PDF but I'll take a punt on just the section shown that The Standard Transaction he refers to is a p2pkh transaction. Your easy explanation to the diagram is this: Two sets of bitcoins (v1B and v2B) had ended up unspent in transaction Ty1 and Ty2 (think: you have two unspent coins in front of you, both received in change from different stores.) Now comes transaction Tx which identifies itself as having the right to spend those coins through In-scripts1 and 2; it imposes a condition PIx on whomever would next spend those two coins; and the result is the two are combined in one new, larger value vB. (Think: you pick the coins up and put them in your pocket.)

I do not consider myself an expert here, and am acutely aware the above is likely oversimplified to the point of offensiveness. If so, I apologise and encourage you to read https://en.bitcoin.it/wiki/Transaction for a more serious background to your question.


Which Bitcoin exchanges publish proof of reserves?

Several exchanges have published reports (OKCoim, Kraken) but Bitfinex is the only one I am aware of to offer real time proof of reserves with individual BitGo wallets.

"The era of commingling customer Bitcoin and all of the associated security exposures is over"

http://www.businesswire.com/news/home/20150603005462/en/Bitfinex-BitGo-Partner-Create-World%E2%80%99s-Real-Time-Proof

Implementation plans exist so maybe more exchanges will follow:
https://iwilcox.me.uk/2014/proving-bitcoin-reserves

Proof of Solvency appears to be a similar term used by the industry


Download git and clone it from the repository. you can find instructions here:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md


Why is getdescriptorinfo returning an error "Invalid descriptor (code -5)"

Descriptors in Bitcoin Core can have a suffixed checksum.

sh(multi(2,
[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,
[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,
[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))
#3qpdv9la

You pass the checksum 3qpdv9la. However if I call getdescriptorinfo without the checksum (see below) a checksum of 539k404m is calculated for that descriptor.

bitcoin-cli getdescriptorinfo "sh(multi(2,[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))"
{
  "descriptor": "sh(multi(2,[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))#539k404m",
  "isrange": false,
  "issolvable": true,
  "hasprivatekeys": false
}

Invalid descriptor (code -5) is returned, because your descriptor doesn't match the checksum you provide.

Did you enter the descriptor by hand (i.e. not copy pasting)? Where did you get the descriptor from?


Can bitcoins be moved from the origin address to the origin address?

Yes. There are no restrictions. (In fact there is no "addresses" in bitcoin protocol)

  it seems more efficient to send change to the original address

Why do you think that it can be more efficient? In fact it is not.

  Does the cryptography not allow this?

This is not related to cryptography at all.


Why were OP_RESERVED, OP_RESERVED1, and OP_RESERVED2 originally reserved?

Since the earliest public release of Bitcoin, OP_RESERVED, OP_RESERVED1, and OP_RESERVED2 have been defined at 0x50 (80), 0x89 (137), and 0x8a (138), respectively.

I doubt there's any known reason for them to exist. The script engine in Bitcoin obviously underwent a lot of changes during development and in the year following; a good portion of all the opcodes were completely rewritten, the behaviour of OP_FALSE was inverted, OP_CODESEPERATOR was effectively removed by execution changes, and so forth. There's many remnants of those changes and removals, and many of the opcodes have non-obvious quirks about how they are handled as a result.
It's worth remembering that the original releases of Bitcoin had > 8 bit opcodes at least partially implemented, and they were removed in the following year, so some of the space was reserved for the byte indicating their extension.

Is there some other instruction set which reserves them (or where reserving them makes the "Bitcoin instruction set" consistent with that instruction set)?

Bitcoin script's instruction set seems to be influenced by a research paper from the early 2000s that describes "security forth", but the copies of this online seem to be well and truly rotted. Notably, the order of the operators is the same and it has matching oddities such as OP_2OVER and OP_3DUP, but these is shared by a number of other similar languages from the time as well.


If I backup my wallet.dat once, am I forever safe?

TL;DR: If you have a frequent recurring backup you are safe, otherwise use a deterministic wallet.

No, you are not safe in that scenario.
Let me rephrase that, you are not safe if you really want to use your the coins from your addresses.

Wallet.dat file stores all public and private keys of your current addresses but standard client generates a new address every time you generate some change spending your money and those addresses will not be saved in your distributed copies.
Also if you generate a new address manually it will not be in your backups.
So if you recover the file from a backup those "change" addresses will be lost and you will not be able to use that coins.

Well that is not really true :D indeed to leverage this kind of problems with recent backups standard client (and probably doge client) pre-generates a bunch of addresses (100) in a qeue and when it needs a new one (used for change or when you ask for it) it just take the first one and add one to the end of the qeue.

So while it is not really safe to store a backup forever if you backup frequently you will have no problem recovering all your coins when you recover a backup.

Another option is using a deterministic wallet, it is a system that given a unique passphrase, file, code or whatever will generate always the same addresses with their private keys, so as long as you save or memorize the seed you can recover everything.
bitcoin-qt (and dogecoin-qt) does not support this but clients like Armory and other online wallets do.


Is centralization in the Lightning network inevitable? Why (not)?

“Centralization” is now a word constantly repeated but is one that, generally speaking,
   no one tries to define accurately.  ---Alexis de Tocqueville, Democracy in America, Vol.1, Part 1, ch.5.

Lightning Network channels will naturally tend to form along the paths of economic
activity.  If you assume (as I do) that most economic activity in
Bitcoin today is from individuals to large Bitcoin businesses (mostly
exchanges), then you should further assume that most channels will be
between users and those very same large businesses.

You can call the centralization if you wish---but it is not a
centralization of Lightning's making; it is a centralization that already
exists for Bitcoin users.

Moreover, even though Bitcoin commerce and trading is dominated by large
businesses, there are quite a few of those large business.  I haven't
looked up figures, but I would suspect that Bitcoin commerce has a much
less centralized distribution than mining at the present time---and with
new businesses offering Bitcoin-payable services all the time, Bitcoin
commerce would seem to be in a steady of progressively becoming more
decentralized.


Could any standard fee transaction be double spent by using a higher fee?

The original design assumes a common behavior of processing the incoming transaction on FIFO basis. That means the first transaction received by a miner wins and all conflicting transactions received after it will be ignored (no matter if the first one is already confirmed or not).

While this standard behavior is beneficial for the Network as a whole, some "smart" miners might employ a bit different approach: when building a block, always take the transaction with the highest fee, no matter the order in which it was received.

It might seem this is just a marginal misuse of the protocol and there won't be enough rogue miners doing this, so it doesn't matter. Well, unfortunately, there already is (at least) one mining pool that tries to build its business exploiting this idea. Should it prevail, services accepting zero-confirmation transactions will need to reconsider their policy.


Is it possible to check if a bitcoin address "belongs to" a master public key from a deterministic wallet?

No, except by exhaustively iterating the whole derivation tree below the master.


How Do I use the prune option on bitcoin core?

Like so:

prune=550

in your bitcoin.conf in your data directory.

This will not make blockchain sync faster. It will make it take less space, though, which can be helpful.

(I have only 40 gigabytes of storage on my system, so this helps me a lot.)


How does the mining process support the currency?

Mining is not just a way to ensure the initial distribution of bitcoins. It happens that coins have been distributed through mining, because it was easy and useful to do it this way, so this might be a bit misleading, but mining will remain essential even after all the bitcoins (~21MBTC) have been distributed.

Mining has not been designed to distribute coins. It's exactly the opposite: coins are distributed to attract miners. The network needs them.

Mining is the core mechanism that makes Bitcoin possible.
The bitcoin block chain (i.e. transaction history) needs to be updated continuously. In effect, one block is added to the chain about every 10 minutes. Mining is the little miracle that allows trust in the network as a whole, without trusting any single participant¹. The idea is to add some artificial difficulty to block creation, so that only a few blocks are presented to the network for consideration (and for validity checking). This way, the network can choose which block will be accepted as the next reference, while nobody has full control on block creation.

The hard work of miners that build those blocks must be compensated (hardware equipment and electricity are not cheap). A reward has therefore been included in newly created blocks. For now, the reward is constituted mostly by newly minted coins. But given that the mining process is essential to the bitcoin ecosystem, that reward must (and “hopefully” will) be replaced by fees, paid by transactors, when coin creation is going stop completely, in about 130 years.

—

1. Assuming no one has access to more than 50% of the total computation power of the network.


You don't have to manually verify Bitcoins you receive - the according transaction is verified automatically by your Bitcoin client. If you see a green checkmark left to the transaction you received (in the Transactions view) then it means that the rest of the Bitcoin network has confirmed the payment as well and you can safely consider the coins yours.

The "Sign Message" feature is an advanced functionality of the Bitcoin client which allows you to sign arbitrary messages to prove to somebody that you are (were) in control of the funds of some Bitcoin address. For a usage example see this answer. You normally don't need this feature for day-to-day use of Bitcoin.


Can Ripple gateways operate as fully transparent fractional reserve banks?

For currency in the form of Ripple IOUs, yes. Anyone can tell at any time the total outstanding value of all IOUs in a given currency for a given issuer. So a gateway could, if it wished to, provide provable reserves relative to its outstanding IOUs.

However, gateways typically also hold fiat that's not in the form of IOUs. Gateways currently use a two-step deposit scheme -- you deposit currency in your gateway account and then you tell them to "withdraw" these funds as Ripple IOUs. The funds in the gateway account that haven't been withdrawn as IOUs are not visible. So there's no way to know what obligations a gateway has that aren't in the form of IOUs.

A gateway that wanted to operate in this form would probably wind up supporting only a one-step deposit and withdraw system. With this scheme, you specify the Ripple account the IOUs are to go to before you give them any currency and they issue IOUs as soon as the deposit clears. And for withdrawals, you specify where the currency is to go prior to returning the IOUs to the gateway.

I don't believe these one-step mechanisms are supported by any gateways yet.


Read the manual for gui-miner and make sure have the connection parameters configured correctly. Mining is super competitive these days so unless you have a high-end computer which can output high hash-rates you will very likely wait a long time for coins. In the meantime you are burning electricity which you or someone else need to pay for.


If it wasn't you, it was very likely that you were hacked. There are many possibilities, a virus, a phishing site, etc.
You could check the transactions and their destination addresses, so you can see where the funds have moved


How does the protocol prevent miners from building off of a fraudulent blockchain?

A miner could create a block with an incorrect transaction, but this wouldn't be accepted by the honest nodes in the network. The honest nodes would attempt to validate the transaction, fail and then not propagate the block to other nodes.


Do Bitcoins still need users to trust each other to feel confident?

I will add Lohoris's comment as an answer, because it really is the answer to the question. Bitcoin does not directly try to address the issue of trust in a transaction.

Therefore, yes, some trust is needed because one party still has to be the first to hand over goods and/or cash. I just read a post on the bitcoin subreddit that relayed a story of getting ripped off after handing over BTC.

Now, Bitcoin does make some aspects that make fraud harder, most specifically a transaction log. If the recipient address is either well known, displayed on an invoice, or recorded in an email, it is trivial to prove that you sent BTC to that address. (Of course if you obfuscate the transaction through a mixer, that removes this benefit.) But, even then, that is just providing tools to law enforcement/court or some other sort of after-transaction dispute process. And, given law enforcement's lack of experience with Bitcoin, and the irreversibility of Bitcoin transactions, if you don't trust the party you are trading with then you may have to engage some sort of escrow service.

Update: Per request, this is the reddit post I mentioned.


What would be the effect on the number of leading zeros hash generation if bitcoin increase its nonce size from 32 to 60 or 100 bits?

Increasing the nonce size would not increase or decrease the expected block time.

The block time is maintained via the difficulty adjustment algorithm, which adjusts the network difficulty according to the apparent time it took for the last 2016 blocks to be found. How quickly blocks are found can thus be used to estimate how many hashes/second the network's miners are collectively performing. The limitation for how many hashes/second a miner can perform is hardware-based (ie. "I own an ASIC miner that can do some amount of hashes per second"), not nonce-based (ie. "I'm running out of possible input values").

This is because if the nonce-space is exhausted, then the timestamp can be incremented, and the nonce-space can be searched through again. A miner can alter the transaction content of the block, or even just the coinbase transaction, and then the nonce-space can be searched through again. So while the nonce-space for a specific block template may be exhausted more quickly with a smaller nonce size, we can effectively 'increase the nonce' infinitely, by adjusting other input variables and then incrementing through the nonce-space again.

Since mining utilizes the SHA256 hash function, the number of input bytes that you can arbitrarily alter (ie increment as a nonce) will not affect your ability to generate a desirable output (ie, a valid block hash). So as long as you can alter some parts of the input arbitrarily, so as to not run out of possible input values, it seems to me that the bottleneck to finding a valid hash will be hardware-based, not algorithmic-based.


No.  A "multisig address" is really a hash of a redeem script encoded as a P2SH address.  Redeem scripts can't be nested, which means you can't include one redeem script inside another redeem script, so it is impossible to implement the feature you describe under current Bitcoin consensus rules.


How many peers it MultiBit connected to? Can not send bitcoins

You can hover over the "Online" indicator to see the number of peers.

It should only take a few seconds to find more peers. This is dependent on the Bitcoin network though. You can force MultiBit to attempt to connect to a whole new set of peers by restarting it.


Ripple: How is an UNL (unique node list) constructed?

Most servers aren't validators and so cannot appear on anyone else's UNL.


The main reason to run Bitcoin-Qt is to help the bitcoin network by relaying transactions and blocks as well as verifying the blockchain.  Bitcoin is a distributed protocol and relies on its users for validation.  You can download an initial blockchain so that your client doesn't need to get it from a peer node (your download will be limited by the upload bandwidth of the peer node).  Once synchronized, the network load is around 144 MBytes/day depending on the number of connections and the needs of your peer nodes (your upload bandwidth can be saturated for hours if another node needs to download the blockchain from you).

That said, if you just want to use bitcoins without participating in the network, you should use a light client such as Multibit, Electrum, or Armory.  Check here for more information.


This is a failed decryption

Unfortunately, openssl can sometimes respond with a zero even when the result is a failed decrypt due to padding and it appears that this is what has happened here.

I have more passwords to try...

I'd suggest modifying the script to avoid the break; after success. This will ensure that every one is tried. You can then go over the output and try the alternatives manually until you see an output that matches the # KEEP YOUR PRIVATE KEYS SAFE ! line which is the true representation of a successful decryption.

None of them worked...

If you are unable to unlock the wallet with the password then there are two possibilities:

You have the wrong password - more common that you'd think even when people swear blind that they're typing it correctly
The wallet/key file has become corrupted - very rare but exposes the fragility of encrypted files containing random private keys

Data does not exist unless it is in two places - ideally a local backup and a remote one. Even then files get corrupted just through hardware issues.

It was for the above reasons, and others, that the MultiBit development team strongly urged people for years to upgrade to MultiBit HD and the associated seed phrase which mitigates this situation entirely. Further, when creating keys and writing them out, MultiBit Classic checks that the data can be successfully read back in using the offered password.

What has happened?

In general when a file is AES encrypted there is a header section containing encryption specific data (key, salt, initialisation vector etc) then comes the main body of data. A corruption in the header section is a very serious problem as it renders decryption of the entire body almost impossible. A corruption in the body section allows for the wallet to be decrypted successfully but it could contain erroneous data.

What can I do?

Your first response should be to use reputable file recovery software. This will hopefully uncover early versions of wallet/key file backups and may undo the corruption through repair operations.

The quickest way to check the recovered files is to use OpenSSL as follows:

openssl enc -d -p -aes-256-cbc -a -in <ciphertext file> -out <plaintext file> -pass pass:<password>

The plaintext file should contain the text # KEEP YOUR PRIVATE KEYS SAFE ! if it has decrypted correctly (as shown in the question).

Next, find a wallet/exchange that accepts private keys and sweep the recovered bitcoins into a hardware wallet protected by a seed phrase - such as Trezor.

That didn't work

If all you have is a damaged file your last hope is to try to work out how the file has been corrupted. If it is in the header section where the key, initialisation vector, salt etc are stored then that's bad news. It's going to take a lot of work to rebuild those.

If it is later then you could get a partial decrypt but have incomplete private keys. Bitcoin does have reasonable checksums so you could use a key recovery script to try various combinations until one gives a working checksum. You can then look up the associated address of the public key and check for your funds.

In either of the above cases of corruption you will need to be a very accomplished coder to successfully rebuild the files. You might want to consider sending it to a specialist service.


How would you give away free bitcoins by letting the user just scan a qr code?

You would have to do this in a couple of steps, the first of which doesn't involve Bitcoin at all.

User scans QR code using an app you provide.
Your provided app sends a request to your server. This request contains something that identifies the user (say, the user's Bitcoin address).
Your server sends Bitcoin to the user's address.

Having said that, if you already have the user's Bitcoin address, then you should consider skipping the QR code entirely and proceed directly to step 3.


Start and end parameters in historical price data request are ignored

The coinbase API docs say:

  If data points are readily available, your response may contain as
  many as 300 candles and some of those candles may precede your
  declared start value.

So it looks like you need to parse and remove the extra data if you don't need it.


What are the differences between Bitcoin and other crypto-currencies?

Until a careful analysis is performed, I think most crypto currencies are very similar in all properties except one - adoption.

Bitcoin has the largest hash rate, participating nodes, accepting sites, and people going over the code and protocol.

While alternative currencies can gain more hash rate, especially if effective forms of merged mining are developed and adopted, it remains to be seen if they gain the same adoption (sites accepting them), and developer base (strong developer community).

(See this post about merged Namecoin/Bitcoin mining)

Edit - One notable exception to this is Namecoin, which does offer unique features making it suitable to use as a DNS or general name registrar.


How to get a history of incoming and outgoing transactions for a certain address?

To get the history of incoming and outgoing transactions all you need to do is send "listreceivedbyaddress" command to the bitcoind rpc interface. For more detail see here.
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

To see where the address first appeared is more intense, you will need to run a search query on a block chain and analyze each block up until you find an appearance.


Is there a multi Sig Explorer or Stats provider?

Are you looking for 'bare multisig' transactions by BIP-11?

Have a look here: https://webbtc.com/stats and here: https://webbtc.com/scripts/multisig

Or may be you are interested in BIP-16 mostly used for multisig?

Take this link: http://p2sh.info


How to Connect already running bitcoind in AWS to Insight API in different AWS Server

Follow the instructions on this README. It should install bitcore (the bitcoin full node implementation by Bitpay), insight-api, and insight-ui. The instructions are:

npm install -g bitcore@latest
bitcore create mynode
cd mynode
bitcore install insight-api
bitcore install insight-ui
bitcore start

If that doesn't sync with the bitcoin network and start showing blocks, then please share some logs/errors and we can help you further.


How often do miners recalculate the merkle root they're working on?

There are indeed many new transactions every second. The way miners deal with it is two-fold:

If an appropriate proof-of-work is found on any merkle root, simply publish that block and any transactions that did not make it into the block go into the next block (assuming sufficient fees)
Otherwise, calculate a new merkle root every so often (varies per miner, but let's say for the sake of argument that it's 5 seconds) and try to calculate the proof-of-work with the transactions included.

The reason why miners don't accept just 2 or 3 transactions is that it's just as much work to find the nonce for the proof-of-work whether there's 1 transaction or 1000 transactions. The probabilities remain the same. The nice thing about including more transactions as a miner is that you get more mining fees out of them.


What happens to .blk files on disk when the Bitcoin daemon switches to a longer chain?

The second is correct. The blk*.dat files are append only. Once a block is downloaded and written to disk, it is never deleted (except when pruning). A block index (database) is maintained in blocks/index to keep track of block locations on disk and statuses (valid, invalid, etc.).


How are difficulty level and block reward determined and stored in decentralized fashion in Bitcoin?

Each node independently computes it on its own, following the formula:

At every block n with n beingg a multiple of 2016, look at the time stamps of the past 2015 blocks, and change the difficulty for what follows to old_difficulty*(2 weeks)/(time the past 2015 blocks took)

Each node does that calculation to make sure that any new block it finds will have sufficient difficulty in order to get accepted by other nodes on that network. This is all about how Bitcoin is kind of self-organized. A node can find a block with too little difficulty, but that will be next to useless as this block won't get accepted into the chain.


Why does my Antminer S7 power down right after startup?

I'm guessing that the PSU kicked off from the overload circuit protection.  I don't have this miner nor do I use 250V setup.  However from observation your equipment setup appears correct.  Could you try just the psu by itself?  Leave it on for maybe 5 minutes - nothing should happen and the cord should remain cool.  Was the cord itself really hot or was the adaptor on the wall hot too?  The miner should be okay (if it's not defective) I don't recall having antminer equipment that shut off, but if your wiring is really hot then consider buying lower gage wire (thicker) - though at this point I would also consider putting the surge protector between the pc and see if that seems to continue to work (though if all those things seem to pass then consider trying it one last time) It could be built in overload protection on the PSU kicking in as well, if it overloads and turns off on the 2nd round then you should try to get bitmain involved as you never even got the chance to use the device - maybe the surge protection is also a factor here though so perhaps try it without that...I mean that seems unlikely, but try to rule out pieces if you can while testing (unless its dangerous to do so)


listtransactions will list transactions only involved with me?

"listtransactions" will list all the transactions associated with your specific bitcoin wallet.  The "All Accounts" business, I believe, has to do with the various addresses someone could have withing a single wallet.

For example, I have an address where I receive donations, and a different address where I receive mining payouts.  by default "listtransactions" will list all my transactions from both addresses, however, I could specify one of my addresses and it would list only those transactions.  It's an easy way to get more granularity in the lists and organize your data better.


Yes, they are that high at the moment. You should not send such small amounts of bitcoins nowadays. You could wait until the Lightning Network works. The fees will probably fall then.


Can I lock a transaction from being used until a particular condition is met

Your question indicates some experience with bitcoin, so I am going to be very technical. You may want to look up "smart contracts" as keywords. In the bitcoin world we talk about checklocktimeverify and checksequenceverify, together with some multisig (as escrow service). There are many examples, e.g. here (this is basically what I posted in bitcointalk):
IF
    2 <Alice's pubkey> <Bob's pubkey> <Escrow's pubkey> 3 CHECKMULTISIG
ELSE
    "30d" CHECKSEQUENCEVERIFY DROP
    <Alice's pubkey> CHECKSIG
ENDIF

or something like this:
 if
  <merchant pubkey> checksigverify
 else
  <timestamp> checklocktimeverify drop
 endif
 <customer pubkey> checksig

imho, n-of-m multisig is the easiest form of a contract. Escrow service is the next layer (as in examples above). They can make sure, that BTC is only payed, when a specific condition is met.
And then one can create very specific constructs like:

CHECKSEQUENCEVERIFY: lock some Satoshis until a specific number of
block have passed, before one can use them
CHECKLOCKTIMEVERIFY: lock some Satoshis until a specific number of
block appears (aka my son is 18 years old...), but use a 2-3 multisig
to release the funds in case funds are required earlier

It goes even up to the point where you can create tx spends, where the hash of a condition must be equal to a previously defined value.
I see some limitations when trying to use Oracles (aka data from "outsides"), maybe data from exchanges, or from real live (in case of death).
Some more example in Andreas' book "Mastering Bitcoin" (second edition) in the chapter "Timelocks".
or here:

https://bitcointalk.org/index.php?topic=1300723.0
https://bitcointalk.org/index.php?topic=1558207.0
https://bitcointalk.org/index.php?topic=1952248.0

or here:

https://www.reddit.com/r/Bitcoin/comments/4kit49/is_it_safe_to_use_cltv_for_recurring_payments/
https://www.reddit.com/r/Bitcoin/comments/4p4klg/bitcoin_core_project_the_csv_soft_fork_has/d4i01he/

and here:

https://en.bitcoin.it/wiki/Timelock
https://en.bitcoin.it/wiki/Contracts


What is the difference between Ripple and Stellar?

[Note: This answers the question as written and at the time it was written (and for quite some time afterwords). See a later answer for the current state.]

The Stellar code is a straight fork of Ripple with mostly trivial changes. It does have certain controversial features omitted (I assume on purpose) such as freezing. From a server and protocol perspective it has the exact same strengths (and weaknesses!) as Ripple does.

The client appears to have have had much functionality hidden/removed. For example it's currently impossible to set up trust lines.

The internal "currency" (transaction tokens) has been renamed from XRP (ripples) to STR (stellars). Sadly, "STR" doesn't even attempt to be ISO 4217 compatible.
The STR distribution model differs from the XRP distribution model including an "inflation" feature whereby new STR is issued (and for the foreseeable future, goes to the "Steller Development Foundation").


Should there be a minimum transaction limit to prevent dust spam?

There already is a limit of 5460 satoshi. It's unlikely any transaction smaller than this will be ever relayed or included in a block without colluding with a miner.

https://github.com/bitcoin/bitcoin/blob/b78d1cdf82fb12cc0c8eb9049074b359b9589b7c/src/core.h#L153


Is the alert system still in the main client's code? Will it be removed?

Satoshi didn't remove the alert system; it still exists in the client. However, it cannot trigger RPC safe mode as it could before.

There are no plans to remove all traces of it, as all it does in its current state is display a warning message.


Why does my bitcoin "to US dollar" worth change when the stock market is closed?

To my knowledge, bitcoin is not traded on any stock markets.  It is traded directly on exchanges specialized in cryptocurrencies.  These exchanges don't necessarily close, and therefore trades are always occurring.

Your wallet is reading the price feed from one of these exchanges (you can probably configure which one if you look at the settings), and is therefore getting updates about the going rate on that exchange.  Whether a stock market is open or closed it's irrelevant.


There are several API services that allow bulk address queries.

For example smartbit's API takes up to 1,000 addresses with their v1/blockchain/addresses endpoint which will return details about each address sorting by the highest balance first.

Example GET request:
https://api.smartbit.com.au/v1/blockchain/addresses/1DuMuchPBGNoi5b9JmpreZ2L5EpuMiJdyc,1N75aWck3TFPorTvSgdzLUttY8uddqTAFZ,161UqtBktXJMzcg2zxBGMiHgnVrtH78Amx,19eK34996XoXPgpranrUVSPLmkxzowt8ox

Link to API docs: https://www.smartbit.com.au/api


In what line of what file does the block reward depend on?

main.cpp:

int64_t GetBlockValue(int nHeight, int64_t nFees)
{
    int64_t nSubsidy = 50 * COIN;

    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());

    return nSubsidy + nFees;
}

miner.cpp (within CreateNewBlock):

pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);


Did the action of creating a Blockchain.com/Blockchain.info account mean I have handed over my wallet to the company

Yes.

and lost this BTC?

You are wholly dependent on the continuing good-will and competence of the business and its customer support systems and staff.
When Satoshi Nakamoto invented Bitcoin, his famous white-paper said

What is needed is an electronic payment system based on cryptographic proof instead of trust,
allowing any two willing parties to transact directly with each other without the need for a trusted
third party.

I feel too many people ignore this.


How can I watch an address on Windows and Android?

Just use bitcoind
-walletnotify=    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)

in a script or for more details, access the bitcoind API via RPC  https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


How can I see what is bitcoin tx for pending Lighting channel (lnd)

The output of lncli pendingchannels gives you as much as you need:

"pending_open_channels": [
{
        "channel": {
            "remote_node_pub": <pubkey>,
            "channel_point": <txid:output_index>,
            "capacity": ,
            "local_balance": ,
            "remote_balance":
        },
        "confirmation_height": ,
        "commit_fee": ,
        "commit_weight": ,
        "fee_per_kw":
}]

The channel_point will give you the txid, that you can later lookup at a bitcoin testnet explorer, or directly with btcctl --testnet gettransaction txid


What is the meaning of target-confirmation?

It's pretty much the same thing.  It probably should have been called 'minconf'.


Double spend attack by sending higher fee transaction directly to the pools possible?

If a merchant accepts 0-confirmation transactions, he has to accept that the transaction can be reversed. So he only should do that if he trusts you for more than the amount you transferred to him. You won't get any bragging rights for doing that, since Bitcoin never promised to be secure without sufficient confirmations.

That trust may come from different sources. For example he might know your name, and will sue you for lack of payment. Or you put an amount that exceeds the payment into escrow.

Or perhaps he just doesn't care. For example for many digital goods(most software, movies, music,...), you have negligible marginal costs, and you're already relying on the user being honest enough to not download a copy from Pirate Bay without paying you.

Personally I believe those attacks are irrelevant, since Bitcoin isn't well suited for small fast payments in the first place. I expect those to be handled by higher level protocols, with Bitcoin itself being used to handle larger balancing payments and as a secure value store.


How are fees determined in the Lightning Network?

Fees are determined by the node operators. It's a free market, you can set whatever fee you want. Of course there's lots of competition, so if you want people to route payments through you, you should set a low or no fee.

  If there aren't fees in the Lightning Network, what is the economic incentive to operate a node?

Even without fees, there is still an incentive to operating a node and using LN. In order to use LN, you must be a node. You will want to use LN to avoid paying higher fees with on chain transactions, and thus you will be operating a LN node.


I'm running a RaspberryPi Bitcoin node. Since I discovered that the node had sometimes crashed due to overload, I put an hourly starting command into crontab:

@hourly <completePath>/bitcoind -daemon -disablewallet

If bitcoind is already running, it fails to start due to not getting a lock on the data directory. Otherwise, the server will be restarted with at most one hour of downtime.

I'm sure there are more elegant solutions, but I didn't explore it much further as this worked for me.


I'm a developer, trying to land a job at an exchange. What type of software would an exchange need? Want to build something to use as a resume

I think there are few values that every exchange is looking for.

ability to work with multiple coins (exchanges = shitcoin casinos)
ability to generate the addresses and manage them securely on-scale within organization
knowledge of API interfaces

Regarding second point (as it's a bitcoin-related board) I'd advise looking at few projects that you can work on yourself, copying the ideas:

Key derivation tool: https://iancoleman.io/bip39/
Bitcoin transaction fee estimate like: https://billfodl.com/pages/bitcoinfees or https://bitcoinfees.earn.com/
Maybe some Lightning Network related project if you know that the exchange you are applying in may be interested

Although it relates to bigger exchanges only, as smaller ones use external order books and usually work only on the frontend.


Accidentally Sent BTC to bitcoin core watch-only wallet with private keys disabled

The Bitcoin would then be whatever addresses your watch only wallet is watching. Bitcoin Core won't just generate a keypair and throw away the private key, that would result in fund loss. In a wallet with private keys disabled, it will only use what has been imported into it in order to create addresses. If nothing has been imported into it, then it won't be able to make new addresses at all.
If the watch only wallet was created by Specter and it imported keys into that wallet, then you should expect to see your Bitcoin in Specter as well.


multiple input and output addresses in bitcoin transactions

why some of transactions have one input and one output?

A bitcoin transaction can have many inputs and many outputs. Bitcoin has a transaction oriented logic, where amounts are transferred from previous transactions. As an example (neglecting the fees): to be able to spend 1 bitcoin, when the  wallet has 2 previous tx with amounts of 0.5 BTC, then a new tx is created with two inputs. Same logic would apply, if 4 previous tx existed, each @0.25 BTC. Then a tx with 4 inputs would be created.
For the outputs: you can create tx with one or more outputs. E.g. faucets pay to many outputs, instead of creating single transactions - this saves on the fees.

  They don't have any change transaction?

If you are not the owner of a wallet, you cannot know, which is the "change". Normally you have an output address, and a return address (for the change, like in the second example of the screen shot). The transactions move from one pubkey to another pubkey address, and there we cannot see, which addresses belongs to the user's wallet, and which might be the change address. With this said, there are some activities to try to link addresses to real users. They create diagrams, and try to see the flow of tx, and derive the information. But when using addresses only once, you wouldn't loose your privacy...

  If any transaction has two output, the second one is change
  transaction?

not necessarily. I can send a transaction with 0.5 BTC to my brother, and 0.5 BTC to my sister. So there would be no change address.

  can we see fee transactions in output address?

hmm, no... Transaction fee is the difference between summary of input values and summary of output values. A usual case: you have one BTC, you send 0.5 to your brother, you send to your change address 0.4995, and the diff is the fees, which go to the miners.

  Are multiple addresses in input part related to each address in wallet
  that has bitcoin?

Not necessarily. The bitcoin network doesn't know about wallets, and its belonging addresses - this is a layer to make it more comfortable for the endusers. The bitcoin network works with transactions, moving funds from address(es) to address(es). No wallet information is included. So multiple input parts can belong to different wallets.

A good overview of transactions is here, and of course in Andreas' book "Mastering Bitcoin", which is also online available.


getreceivedbyaddress without knowing the private key

Bitcoin Core 0.10 was just released with support for watch-only wallets.

You can use the importaddress command to make a wallet consider the address to be belonging to it, and track incoming payments to it. getreceivedbyaddress will work as expected in that case. In fact, Bitcoin Core does not support an "address balance" feature at all.

It does indeed require you to import the address in advance (or go through a lengthy rescanning procedure). The upside is that this approach scales much better (it doesn't require a fully indexed blockchain, and is compatible with future pruning features).


+1 for fun question. Places where you can sell bitcoins are a plenty. You are a bit late though since the exchange rate was much higher earlier this year. Purchasing stuff with bitcoins isn't that widespread. bitcoin.travel lists about 10 travel releated places in the entire world that accepts bitcoins. bitcoin.it also has a list of travelling related vendors accepting bitcoins. All this may change quickly in either direction so watch these sites for updates.


Is it normal to be asked for an advance fee on a withdrawal?

Never pay to receive a withdrawal. If they wanted to send you money, they could deduct the fees from the sum they claim you own in your account.
It's a common scam to be asked for money so that you withdraw your funds. In fact, if you pay, they'll find a different excuse and ask you again to pay them, while you in reality never had any money on their website.
Your account balance might show $10k, $100k, $100m but don't be fooled by their values displayed on their website. Never ever pay to withdraw any bitcoins.
Seek help from your local authorities.


How to accept and detect altcoin payments?

Most (99%) altcoins are just Bitcoin clones, so the same process applies, you just need to use the appropriate daemon (dogecoind, litecoind, etc). If you need extra help, we'd need to know which altcoin. In addition depending on how popular the altcoin is there may be the equivalent of Blockchain.info (has merchant services for Bitcoin), eg. DogeAPI.


Why does transaction activity show on the blockchain for my Bitcoin address at my hosted (shared) E-Wallet service?

You do not have a Bitcoin wallet at LocalBitcoins.  Instead you have only a ledger account with their hosted (shared) Bitcoin E-Wallet.

What this means is that you cannot use the blockchain to track your balance.  You can only use it to determine how many confirmations your transfer (deposit) has received.

The E-Wallet provider simply credits your account when they see a confirmed deposit transaction (e.g., 6 block confirmations) to a Bitcoin address associated with your E-Wallet account.

To know your balance, you will need to login to your E-Wallet account on LocalBitcoins.  That will show you your balance.  The account details will show deposits, withdrawals, purchases and sales.


Who in their right mind would waste their Bitcoin on taxes or buying random stuff?

Can't comment on taxes because it's different in every country and depends on individual how they manage it.
Who would use their bitcoin for payments?

Holds only bitcoin and no fiat
Not interested to see few things in bank/card statement
Merchant accepts only bitcoin or other cryptocurrencies
Want to avoid payments being censored by governments

Also using bitcoin for payments allows you to buy more things over a long period of time especially bull markets:
https://link.medium.com/p8oVGwGWAgb
Normally people manage fiat in bank account, credit card, long term savings, investments etc. If someone wants to buy ice cream, most probably they will use cash/card and not withdraw money invested in markets or long term savings. Similarly, bitcoin can be managed in cold storage (long term savings), hot wallet on-chain (for payments, trading, etc.) and LN wallet(for quick payments with low fees). Don't need to use cold storage for payments.


Transaction flagged as having a non-standard input

I believe it is non-standard because you include an OP code in your input script, specifically, OP_FALSE.  It should not be necessary to include OP codes in input scripts; only literals.  The only way input scripts (scriptSig's) intereact with the output scripts they are spending (scriptPubKey's) is by placing values on the stack.  Therefore, there is never any need to run an operation, since you could simply place the values on the stack.

From the docs for OP_FALSE:

  An empty array of bytes is pushed onto the stack. (This is not a
  no-op: an item is added to the stack.)

Becasue there is an operation and not just a literals in your script, it is non-standard.

That said, I'm not sure how to write an input script that places an empty array of bytes on the stack without using OP_FALSE.  I don't know why such a thing would be necessary for redeeming an output.

EDIT:  I just realized that you are using a standard Multisig input script (which I forgot is an exception to the "no op codes in input scripts" rule) to redeem a standard P2SH output script.  Technically, your redeem script is standard, because it matches one of the standard transactions, but it doesn't match the output script it is spending.  Your redeem script should probably be in the form of <sig> [sig] [sig...] <redeemScript> if it is going to spend an output script that looks like OP_HASH160 <Hash160(redeemScript)> OP_EQUAL.


If everyone decided to switch to Bitcoin tomorrow, how much would a Bitcoin be worth?

What complicates your calculation is the liquidity aspect.
Although there is about 16 million mined bitcoins, the number of bitcoins available for trade is far less than that.

What is interesting to observe is that the fact there is a ~7bn market on bitcoin right now doesn't necessarily mean the sum of the money spent by the bitcoin holders is even near 7bn. Some people bought if for pennies, some for a couple dollars, some mined it. It just means that the holders of bitcoins are not willing to give them away for the price being offered by buyers right now.

The price is determined by supply and demand market forces, and the supply would respond to the increase in price. I maybe would sell one of mine if the price reached $100k per unit.

Other factor is that fiat money may be created out of thin air, so it has sort of an infinite supply. If an unrestricted government decides to purchase bitcoin, this would strongly push the price up.

In the end of the day, what you can try to grasp is what would be the minimum price it would reach, but estimating the actual price would depend on far too many variables.

Note that non-Bitcoin currencies have the same or extremely similar price mechanism. Dollars, specifically, can lose all their value if people stopped liking them. In a way, cryptocurrency is a huge threat to "free floating" currencies like the US Dollar.


Why is there a difference between the candlestick data on coinigy versus the data that binance provides?

Coinigy appears to use data from multiple exchanges, whereas Binance is just one exchange and their data is only for their exchange only.


Transactions with a wait time (using nLockTime)

Solved. You can prepare transactions with a wait time and the standard client will accept them.

You can check some details in:
https://bitcointalk.org/index.php?topic=131443.0

Essentially, I have been able to create a raw transaction https://en.bitcoin.it/wiki/Raw_Transactions using bitcoind. Then, before signing, I could manually replace the bytes for the sequence number and the locktime. I had some hard time with locktime. First you set the UNIX timestamp you want, then convert to hex, reverse the bytes (little endian) and replace the the last bytes of the hex transaction. https://en.bitcoin.it/wiki/Protocol_specification#tx tells you which are the relevant bytes. You can later sign the new transaction and send it.

I've been using the guide in:
https://people.xiph.org/~greg/signdemo.txt

I did all in the testnet. In my first attempts I wasn't careful with my change and ended up spending all my wallet in fees. You should be careful if you try this with real bitcoins.


What files do I need to copy to a new computer to prevent having to sync with the network?

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

This might be of some help.I followed that and successfully moved the files from C:\Users[username]\AppData\Roaming\Bitcoin\ to E:\BitcoinData.

Just cut and paste the whole content of from the Bitcoin folder (C:\Users[username]\AppData\Roaming\Bitcoin) and set the new target as

"C:\Program Files (x86)\Bitcoin\bitcoin-qt.exe" -datadir=d:\BitCoinData and that is assuming you have bitcoin Qt installed in your C: drive.Change the path accordingly.


How to determine if a remote node prunes?

Yes. The client unsets the service bit NODE_NETWORK when pruning.

You could also try to request a block.


How to get Bitcoins without having a bank account?

Read up about chargeback, this is unfortunately a huge problem when you exchange from bitcoins to 'PayPal dollars' and other online currency.

However, you can buy bitcoins with cash: https://localbitcoins.com/


Does bitcoin validate transactions against the mempool?

A transaction that has been included in a block does not need to be in a node's mempool in order for that node to validate the block. Each block contains the transactions, so by downloading and validating a block, the node will have received a copy of all transactions in it (so that it can validate the transactions, as part of validating the block).

As you mentioned, there would otherwise be problems syncing old blocks, because the transactions in those blocks would be invalid if you tried to add them to the mempool today (because their inputs have already been spent!).

Further, a miner can include a transaction in a block, without having ever broadcast that transaction to the network otherwise. So in that case, no other node would ever have included the miner's transaction in their mempool!

Note that compact blocks (BIP 152) is an improvement to the block-relaying process, that allows nodes to compare a new block's transactions to their local mempool, and thus avoid having to re-download transactions they already know about.


What client-side checks does blockchain's android client do?

The quote in the documentation is a remnant from the http://code.google.com/p/bitcoin-wallet/ which the app was forked from.

At present it does not do any blockchain validation. I would like to have it so instead of downloading the full transactions from blockchain.info the client asks for the block hashes that contain transactions of interest. It can then download the full blocks from the p2p network and only the headers for other blocks to verify the proof of work. However this is not currently implemented.


Wallet takes way too much time to keep up to date?

Try Multibit. It's a light-weight client.


How can you find how many keys you wasted in bitcoinj?

Wallets contain a pool of 100 unused keys plus every key ever used. You can never run out of unused keys because the client adds new keys to the unused key pool as you use them.

The reason it maintains a pool of unused keys is so that future transactions that happen after a backup can still be recovered.

You should frequently back your wallet.dat up off-site using non-flash media. You should also backup your wallet.dat after every 50 send transactions (receive transactions do not use up unused keys unless you frequently create new addresses to receive coins with, which would also use the key pool up; in that case, every 50 transactions of any kind).


How do I read a script? How does the processor separate "data" from "commands"?

The script is read left to right and is the concatenation of the output of a preceding Transaction to the input of a consuming Transaction

Basically, though the scripts are not actually concatenated. The scriptSig is run, and then the scriptPubKey is run on the resulting stack. This distinction is occasionally important.

  A script output can have only one corresponding transaction script that consumes it.

There are many possible scriptSigs that could "solve" any scriptPubKey, but each output can only be spent once in a valid block chain.

  but I'm unclear if this means non-standard scripts may never get incorporated into a block

They can get into blocks, though miners using the standard client will never add them to their blocks.

  How does the forth like processor know the difference between data on the stack and commands on the stack?

Data is preceded by bytes 1 through 78, the pushdata ops.


'Deposit account' for repetitive bitcoin payments

As mentioned in a comment to your question, reuse of addresses is discouraged. It's considered good practice to generate a new address for each receive transaction.

This question has a detailed answer that discusses how Electrum generates its initial keypool, and how generating additional addresses should be handled.

As outlined in the Electrum docs you can generate a new address in the Electrum console with:

wallet.create_new_address(False)

Be aware of the gap limit issue (discussed in the same document).

If you would like to automate the process you could write your own script or use one of the many open source utilities available on GitHub to generate a new private key and associated address. Let your web page display this unique address for each new transaction. Later, import this address's private key to a non-seed Electrum wallet. Of course, a seed (HD) wallet will not accept addresses that were not specifically generated by it.

Alternatively, and for greater security and control, you could run an instance of Bitcoin Core. It can provide your web server with a unique address via an RPC call. There would then be no need to manually request a new address or to later import the private key.


How does bitcoin impact the real economy?

I think bitcoin is like a knife, it can be used for both cooking and killing. If you say I use it for cooking, it does not mean that others do not use it to kill.
Terrorist groups, spy agencies and even criminal groups are all abusing Bitcoin.


How are bitcoin transactions and the blockchain transferred over the internet?

The Bitcoin P2P network

The Bitcoin P2P network is a randomly-wired gossip network. This means that all nodes make arbitrary connections to other peers (using various ways to discover new addresses) using a custom TCP protocol, usually using port 8333. Typical nodes create 8 outgoing connections, and if publicly reachable, accept up to a few 100 incoming connections.

It being a gossip network means that nodes send messages to each other of the form "do you have block with hash X" or "do you have transaction with hash X", after which the peer can respond by asking for the full transaction or block. Simplified, this means that eventually every node learns about every block. The protocol is bidirectional - it doesn't matter who connected to whom; both peers will announce if they have something they don't know the other side already has as well.

Not all network nodes are reachable. Some only make outgoing connections. Sometimes setups are used where someone runs a publicly reachable node, and then runs a second private node that only connects out to their own public node, thereby giving some extra privacy and reduced attack surface.

Not all network nodes validate the blocks and transactions they see and pass on. Nodes that do are called full nodes.

Miners (or at least mining pools) run nodes like this, picking up transactions their nodes learn about, assembling them into candidate blocks, hashing to find a nonce, and if they succeed, broadcast the resulting block out to their peers using the same P2P network. Miners in this way are not special - people don't directly submit things to miners.

Since recently, an extension to the protocol is used to relay blocks much more efficiently, called Compact Blocks. It makes use of the fact that most nodes will already have most of the transactions that are added to a new block.

Specialized relay networks

Additional networks exist of groups of nodes that use specialized protocols to very quickly interconnect nodes. One such protocol is FIBRE, which is in fact UDP based and makes heavy use of error correcting codes to avoid roundtrips.

Electrum

Ironically, Electrum in your question is a bad example. Electrum is not a P2P client (not even a light one). Instead, it uses a client-server architecture, and connects to specialized servers (which are themselves Bitcoin P2P nodes however).


No, bitcoin transactions that stop being valid after a certain point in time are not possible


What's partial spending? What does avoidpartialspend do?

Currently, best practices are to receive coins to an address only once - Any reasonably new wallet will generate a new receiving address for you if the previously displayed one has already received coins.

However, there are scenarios where an address might receive coins multiple times, such as being a saved address on an exchange, stored with an automatic payout system (mining pools etc), or just intentionally giving the same address to multiple people who send you coins.

In such cases, an address has multiple utxos, possibly of varying sizes, associated with it.

Additionally, if you also use your wallet normally have have many other addresses with just a single transaction, this one address with many transactions could result in coin selection algorithms spending this address' coins along with coins sent to other, single-use addresses, thereby linking them as belonging to the same wallet.

avoidpartialspend is a configuration option that tells the coinselection system to spend all utxos on a single address before attempting to source utxos from other addresses (which may still be necessary depending on the amount being sent). This ensures that, as much as possible, the utxos selected minimize the number of individual addresses that are linked together for a single transaction. However, this comes at the cost of a higher transaction fee due to potentially larger transaction sizes, and sub optimal utxo selection as opposed to selecting the best input(s) for the amount being sent.

This does improve privacy to some extent. However, as notes, it is not a complete solution, as future utxos to that address may be used in other transactions that link them to more wallet addresses, even after this process.


It's leaderless.

A validator begins a consensus round when it has either at least one unconfirmed transaction it thinks is valid, the idle time has expired, or it sees enough validators it trusts have begun a consensus round. Each participating validator makes an initial proposal listing the transactions it believes should be applied in the current round. The servers avalanche to consensus.

If there are conflicting transactions, all cases are handled. If just one gets in the round, it is applied and the other is forever invalid. If both do, a determinstic algorithm determines which is applied first and the other fails. If neither do, a deterministic algorithm determines which is announced in the next round so there should be an agreement in that round.

Because Byzantine failure is possible, validators build the next ledger at the end of the round and then broadcast a signed validation of that ledger. Seeing a supermajority of trusted validators sign validations for the same ledger assures that an actual consensus was reached. (If there was no real consensus due to Byzantine failure, the network simply tries again.)

The avalanche algorithm is designed so that minimal overlap of trust is required. Essentially, if there's no reason a transaction shouldn't be included, every honest node should agree to include it. If there's any reason a transaction shouldn't be included, there's no harm done in excluding it. (So long as it's included in the next round if it's still valid.)


Yes, that is normal. bitcoind is downloading the blockchain and writing it to disk. When you are syncing, it has to download and write to disk nearly 200 GB of data, so that is going to use a lot of disk I/O.


How small can a payment be while still adding value to your wallet?

You generally would not be able to receive a single satoshi.
The Bitcoin Protocol defines something known as a "dust limit".
The exact value of this limit varies based on the receiving address type, but it is defined as the minimum amount of BTC required to spend an input for a given address type.
It is calculated by using a basic 1 input 1 output transaction consuming an input from that address type at the minimum acceptable fee level, and calculating its fee (minimum fee level * tx size).
This works out to 546 satoshis for traditional p2pkh addresses, and 294 for p2wpkh addresses.
Transactions that create one or more outputs under the dust limit will be rejected by the network and you will not be able to broadcast them (even if other outputs in the transaction are above the dust limit). If you're left with a value under the dust limit as change, most wallets will add it to the fee.


I realize this question was asked a few years ago, but for anyone else with a similar issue: If your wallet isn't working the way you want it to, just create another wallet using a different service. There's no reason you need to get them to fix anything unless you want them to. They aren't stopping you from transferring your funds because they have no control over your funds.

Always make sure you have your private keys or seed saved securely somewhere in case your wallet disappears or breaks in some way. That way, you can set up a new wallet to access the very same funds any time that becomes necessary.


Your wallet is probably old enough that uncompressed public keys are used instead of compressed public keys. Segwit only works with compressed public keys so you cannot currently use segwit with your addresses.

However you can upgrade your wallet to using compressed keys. To do so, first start Bitcoin Core with the -upgradewallet option. That will upgrade your wallet to use compressed keys by default. Then you will need to call getnewaddress ~1000 times in order to get to addresses using compressed public keys keys. I don't believe that there is a way to regenerate the keypool without emptying it by requesting all of the addresses from the keypool.


If it can be less then blocks can be created really quickly.

This is not the case if threshold is referring to the target. In order for a block hash to be valid, it must be less than the target value. The lower the target value, the less possible solutions exist, because the target value (and block hash) are 256 bit numbers, meaning there is a finite number of possibilities.

There is a difference between target and difficulty. The article confuses the terms threshold and difficulty.

Target

The number that the block hash must be less than in order to be valid. This is a 256 bit number e.g. genesis block target:

0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Genesis block hash (notice it is less than the target above):

0x000000000019D6689C085AE165831E934FF763AE46A2A6C172B3F1B60A8CE26F

Difficulty

This describes how difficult, in relation to the genesis block, the target will be to reach. The higher the difficulty, the more hashes (on average) you have to do to find a solution that is less than the target. It is calculated as:
difficulty = genesis_difficulty_target / current_target


You are asking a lot of questions in one post but to answer the question in your title concisely:

A Bitcoin wallet is loosely the equivalent of a physical wallet on the
Bitcoin network. The wallet actually contains your private key(s)
which allow you to spend the bitcoins allocated to it in the block
chain. Each Bitcoin wallet can show you the total balance of all
bitcoins it controls and lets you pay a specific amount to a specific
person, just like a real wallet. This is different to credit cards
where you are charged by the merchant.

From Bitcoin.org.
A wallet contains any number of public/private keys.  You can easily create new wallets or new public/private keys in your existing wallet.
I'd recommend breaking down anything still unanswered into their own specific question.


Is pre-mining of a future block possible?

You seem to be asking if you can mine block X+1 while the network is still working on block X.

The answer is no, you can't mine block X+1 until block X has been solved, as each block requires a hash of the previous block to be valid.


What does it mean ERROR code=-28, message=Activating best chain?

Your node is still starting up, you need to wait until it is finished before using the RPC interface. The RPC message is telling you to call back later, which insight-api doesn't seem to be able to understand, simply waiting until the node is completely active is a suitable workaround. This may take a few minutes depending on your servers hardware, the bitcoin-cli tool supports automatically waiting for the interface to be available with the -rpcwait flag.


Change addresses and key backup on Bitcoin Wallet for Android

Android Bitcoin Wallet does not send change to a new address. You don't need to re-backup your keys unless you explicitly generate a new address.


Is it possible to remove unnecessary addresses?

Many wallets can show you a list of all the receiving addresses they have generated.
Some wallets do allow you to view a list of only those addresses with a non-zero balance.
Wallet developers probably don't want to allow deletion of addresses because of the customer support issues that would be raised if money were subsequently sent to an address that had been deleted from a wallet. They'd have to also provide a way to re-create deleted addresses.
So just providing a list of addresses with non-zero balances probably seems like a more sensible option to many wallet developers?


Keeping my bitcoins safe: any flaws in my strategy?

The segwit accounts in TREZOR Web Wallet are derived using BIP49.

So far, no software wallet I know support this, unfortunately. I have heard that Electrum is working on it.

However, if you already wrote your seed to your PC or phone to some of the wallets - Electrum, Mycelium, Wallet32 - you should consider it compromised and move your coins somewhere else. Seed is good only if you don't rewrite it to your PC or mobile phone.

Note that Wallet32 is no longer maintained; since it is a regular SPV wallet, it's possible it will stop working with Segwit2x fork. Mycelium should work; as should Electrum, or its Android clone.

Also, other hardware wallets support the same seeds as TREZOR - for example, there is Ledger wallet, that uses the same seeds and the same logic for accounts. So you can rewrite your seed there and you will have access to your coins.

Because I am an employee of TREZOR, I will tell you that it's more wasy to use than Ledger, but I am obviously biased :) but if you have the seed, you can also use Ledger with the same seed as TREZOR.


Seller asks me for my BTC address to confirm my payment

It is normal to have a new address for every costumer since a customer's money doesn't necessarily come from a single address. You can see that in this transaction money from 5 addresses was transferred to 2 addresses. It might be that in the case of money coming from several addresses, the seller expects their customers to give them the first addresses of the transaction input or any address of the transaction input but I don't know that.

Most transactions, go from 1 address to 1 or 2 addresses. If there are 2 target addresses, usually one is the address of the recipient and the other one is one of the sender's addresses so they get their change.

The seller probably tries to receive all payments on a single address and wants to link the money received back to the sender's account so the seller knows who paid and who didn't.

It's important that you don't give the seller any address your (probably HD) wallet gives you. From an outside perspective (everyone but you), these addresses are independent of each other. You have to give the seller the address your money came from.

If your wallet doesn't show you which addresses it used to send the money, that's no problem. You can simply go to https://blockchain.info or https://blockexplorer.com, enter your transaction ID, and see which addresses the money came from and which it went to.

Someone knowing your address doesn't mean they can steal your money. In fact, you can just go to https://blockchain.info or https://blockexplorer.com, click on any transaction that's flying by, and see the addresses involved in the money transfer.


If there was an easy way to check for double spends, will consensus algorithms be needed?

Yes, if you assume that the central challenge of a distributed system in an antagonistic environment doesn't exist, hypothetically creating such a distributed system is indeed much easier!

Currently, checking for double spends is very computationally expensive[…]

Detecting doublespends is trivial. You just need to recognize that two transactions are in conflict because they spend the same funds.
The actual challenge of the doublespending problem is to get a network of equal peers to converge on one canonical transaction order. In fact, Bitcoin's most notable achievement is to propose a practical solution to the doublespending problem.

the protocol was changed so it will reject a blockchain that has double spends and it will accept accept a blockchain with no detected double spends, then will there be no need for consensus algorithms?

So, sure, if you assume that there unexplainedly is already consensus on how to solve the principal problem of operating a decentralized currency system, you no longer need to figure out how to achieve consensus. However, that's not a particularly useful starting point.


.indexes & .tesnet3 not located on my Bitcoin dir

but i didnt modify the .conf at all since it should be by default with the latest version...

There is no default bitcoin.conf file nor is txindex enabled by default.

Without enabling txindex in the bitcoin.conf file, the indexes folder will not be created as the txindex is not being created.

There won't be a testnet3 folder if you are not running it in testnet mode.

  Well, tbh im not using it either on testnet nor mainet,

The default is mainnet. Mainnet is not a different special mode. Furthermore, "the blockchain" is tied to a network. It is not a shared blockchain between testnet and mainnet.

If you have not modified the bitcoin.conf file or started bitcoind with special options, you are using mainnet without the transaction index, so neither the testnet3 folder nor the indexes folder will appear.


What would happen to the world if Bitcoin were the only allowed currency?

It's possible, but with the current block size and lack of lightning network or side chains, no. Most likely people would do what they've done throughout history and use other forms of currency for daily use.


To allow compatibility of your wallet.dat file with other bitcoind installations, it's strongly recommended to use bdb 4.8.

Nevertheless, you can disable the db4.8 check by adding --with-incompatible-bdb during configure.

Better would be to manually install berkley db 4.8 in a isolated path and compile bitcoin-core with something similar to:

CPPFLAGS="$CPPFLAGS -I<your-bdb4.8-path>/include"
LIBS="$LIBS -L<your-bdb4.8-path>/lib"

But this would probably require some makefile tweaking.


Which daemon is a lightning node running?

By the lightning network protocol there is no direct means to detect which implementation is used by another node.

However you could use indirect hints for example the standard cltv deltas or channel fees are different for the various implementations. That being said I could obviously run clightning with the default config of lnd.

Even if there was a way (like the user-agent header of http) nodes could easily spoof such a header.

On a side note: just to be clear there is currently a forth implementation that is said to be mainnet ready called Ptarmigan. Also electrum is short of being ready for mainnet.


In a double spend attempt, how is the valid transaction chosen?

When a node receives two conflicting transactions, it will only relay the first one that it received, dropping the other.  If one transaction fully propagates through the network before the other is sent, the first will prevent the second from ever reaching any miner nodes.

If both transactions are sent at roughly the same time, the network will be in disagreement about which one is valid.  This will be resolved once a miner node finds a block and includes whichever transaction it had first heard about.


What would happen if two public keys had the same Base58 hash?

Then both of the people could spend the same coins if they were sent to their Address, rather than public key. If they instead received the money to the public keys, they couldn't spend eachother's coins.

All in all, the most important thing that would happen is that they would show RIPEMD-160 collision, which would most likely be the first one ever. A pretty improbable sight.


Please explain CFeeRate::GetFee(size_t nBytes)

If I pass in say 2000 as the nBytes argument, what will this function return as the fee nFee?

It depends on the fee rate that the CFeeRate object represents. The fee rate is denoted in Bitcoin per Kilobyte. So you pass in the number of bytes into GetFee and and calculates the amount in Bitcoin for the fee to be paid for something of size nBytes_.

If, for example, your CFeeRate object represents 0.00020000 Bitcoin per Kilobyte (or 20 satoshis per byte), giving 2000 as nBytes means that your fee will be 2000 * 0.0002 / 1000 = 0.0004 BTC.

  I don't understand how nSatoshisPerK is defined.

It is defined at the creation of the object. Whatever created the object specifies the fee rate to use.

  Also, curious as to why this is used instead of letting miners determine this fee through selective mining.

This is just an implementation detail, not an actual network thing that specifies the fee rate for everyone to use. CFeeRate is internal to Bitcoin Core and is simply just how fee rates are representing in internal logic. The fee rates themselves are constructed by the fee estimator which calculates fees based upon mined transactions.


Is disclosing an index used for generating BIP32 addresses insecure?

I wouldn't expect stealing to become easier. BIP32 uses low incremental integer numbers, which are easily brute forceable if not predictable.

Same reasoning for linking addresses i guess.

I'll leave a real answer up to someone more knowledgeable though.

One consideration I'm sure you thought about is that you need to make sure the order number is unique (no address reuse). Even over multiple years (unless you use the year as one of the other HD indexes, I guess).

One downside is that if you ever load the private key into another wallet it probably won't find your money as it doesn't know your numbering system. Maybe that's an upside actually as it ads a layer of obfuscation to protect you from theft. Slippery slope though.

(Meant to type this as a comment instead of an answer, but i guess I'll leave it unless a better answer says it actually is dangerous.)


understanding bech32 Addresses / BIP173 question

how to interprete script handling?

What you're missing is that BIP173 is not a way to encode public keys or scripts. It is a way to encode segwit transaction outputs. What those outputs are and mean is currently in BIP141 and BIP143 - but may change over time, without BIP173 changing.

All segwit transaction outputs (current and future) have the following structure:

a single opcode between OP_0 and OP_16 (whose numeric value is what we call the witness version)
a push of a byte array between 2 and 40 bytes (which we call the witness program).

BIP173 simply encodes a witness version number and a witness program. Nothing more and nothing less. It does not care what those things mean.

Currently there are 2 types of native segwit outputs defined:

P2WPKH: pay to witness pubkey hash. The witness version is 0, and the witness program is the 20-byte RIPE160(SHA256(pubkey)).
P2WSH: pay to witness script hash. The witness version is 0, and the witness program is the 32-byte SHA256(script).

Segwit addresses, as defined in BIP173 permit encoding the two types above, but also all potential future witness output types, as they simply encode a version number and program bytes, whatever they are.

Some of the examples in the BIP use real witness versions and programs of those two types, and for clarification the keys and scripts are listed. But BIP173 doesn't really care what they are.

To learn how payments to public keys and multisig scripts are done in segwit, look at BIP141 and BIP143.


How do I obtain exponential moving averages using the MtGox API?

Found an answer almost straight away - the answer is to get the data from the BitcoinCharts.com API, rather than MtGox - http://bitcoincharts.com/about/markets-api/

Further info here: Bitcoin Charts API Data


What are the trade-offs between the different algorithms for deciding which UTXOs to spend?

The challenge for picking a Coin Selection Algorithm is that there are multiple goals to optimize for:
Privacy
The Coin Selection should reveal as little as possible about the user's wallet contents.
Transaction Fee
One wants to minimize the current transaction fee, but also the overall long-term transaction fees.
Non-dust change creation
It would be preferable to create non-dust change.
Reduction of Dust UTXO
Dust UTXO have to be stored on all users' devices and therefore create data volume even on thin clients. It should be a priority to reduce their number.
Unfortunately, these are contradictory to one another, and therefore every solution must find an appropriate balance for itself.

Oldest UTXOs first (FIFO)
Good

Will use up dust UTXO as they come up in your transaction history.

Bad

Gives a date for the oldest UTXO the sender has in his wallet. E.g. reveals how long a user at least has been using Bitcoin (with that wallet), might even be used to guess the amount of bitcoins someone is holding by watching when he spends a known output.
Will not minimize the transaction fee.

Newest UTXOs first (LIFO)
Good

Reveals less information about your wallet than FIFO.
Most of your UTXOs see hardly any action at all (potentially good for privacy).

Bad

Grinds your latest UTXO to dust, until a newer is received or it is used up. Might generate a wallet full of small UTXOs.
At equal or more income than spending, dust will never be consolidated.
Will not minimize transaction fee.
Will link your recent activities by always reusing the newest change output.

UTXOs with the smallest amounts first
Good

Consolidates dust asap.
Continuously keeps number of UTXO at minimum in wallet.

Bad

Reveals lower bound of UTXO value in wallet.
Large input lists (especially as long as dust exists in wallet) cause huge fees and slow confirmation.
Links lots of addresses in your wallet together.
Can be exploited to increase your transaction fee, if people just send you low-value outputs.

UTXOs with the greatest amounts first
Good

Minimal transaction fees.
Likely to create non-dust changes.

Bad

Reveals upper bound of UTXO value in wallet.
Never consolidates dust.
Usually increases number of UTXO in network.

The Knapsack Selection Algorithm used by Bitcoin Core
Good

Often small transaction fees
Random selection of UTXOs seldomly reveals any information about the wallet.
May consolidate dust UTXOs at random.

Bad

Always aims for 10 mBTC change outputs.
With a lot of small UTXOs in your wallet, likely to cause big transaction fees.

(2014:) I have been looking into coming up with a better Coin Selection Algorithm, but haven't found one yet that significantly improves on the Core Client Selection Algorithm.
Here are some ideas to improve it:

When a UTXO is randomly selected, add all other UTXOs associated with the same address as well: less linking of transactions improves privacy, potentially consolidates UTXOs into fewer.
Instead of selecting the smallest change, one could aim to create a change of the same size as the spending target. Assuming that people mostly send useful amounts, this would create new UTXOs of useful value instead of the smallest possible changes as it currently does. It also makes it harder to guess what was the change and what was the payment.
Select UTXO set to minimize transaction fee, instead of minimizing change output.

Update in 2021:

Removed a few allusions to Coin Age Priority as transaction selection policy in block building which was removed in Bitcoin Core 0.12.0 in 2016.
Removed erroneous claim that spending multiple inputs from the same address is cheaper

Note that Bitcoin Core used the Knapsack solver as its only algorithm until 2017, but since then has added an improved algorithm proposed by the author of this answer.


Wallet suddenly shows transactions from someone else

According to this link: https://media.mycelium.com/2020/01/31/mycelium-wallet-to-support-eth/
Mycelium supports few other cryptocurrencies now.

So now I see all my Bitcoin tx, but on top of that the Ethereum part of the wallet (which I never used) shows transactions that someone else must have performed.

Not sure why did this happen.
What can be done to resolve this or use Bitcoin in a better way?

Create an issue in https://github.com/mycelium-com/wallet-android/issues

Use better Bitcoin Wallets. Example: Bitcoin Core, Electrum, Wasabi, Specter, Bluewallet, Samourai etc. How to restore wallet with your backup: https://bitcoin.stackexchange.com/a/61401/

https://www.reddit.com/r/Bitcoin/comments/4jy1yp/myceliumelectrum_seed_technical_question/d3apuka?utm_source=share&utm_medium=web2x&context=3


Having trouble getting poclbm to work on linux, Segmentation fault

This turned out to be a problem with installing two different versions of the nvidia driver on *nix


Problems with Antminer U1 - why doesn't it work?

I had the same error "Bmsc recv golden nonce timeout" after to try Windows10 Install. So I reinstall Zadig drivers, and reconect my U3. So works fine again.
I dont know if is your case, but:

To reinstall your Zadig (http://zadig.akeo.ie/):
1) choose Options | List All Devices
2) Select CP2102 USB..
3) Choose "Replace Driver"


What are the different prefixes of Bitcoin addresses?

According to the glossary
the possible prefixes for bitcoin addresses are 1,3 or 5:

I'm quoting here:

  Address

  Bitcoin address is a Base58Check representation of a Hash160 of a
  public key with a version byte 0x00 which maps to a prefix "1".
  Typically represented as text (ex. 1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG)
  or as a QR code.

  A variant of an address is P2SH address: a hash of a spending script
  with a version byte 0x05 which maps to a prefix "3" (ex.
  3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8).

  Another variant of an address is not a hash, but a raw private key
  representation (e.g.
  5KQntKuhYWSRXNqp2yhdXzjekYAR7US3MT1715Mbv5CyUKV6hVe). It is rarely
  used, only for importing/exporting private keys or printing them on
  paper wallets.