Is there a signature format, or cryptography has *only one* possible S value?

The solution is the same regardless of curve or signature algorithm -- reject non-canonical signatures. This is precisely what Bitcoin has decided to do.


When you create a multisig address from existing addresses, do the funds move there?

wil it have a balance of 3 btc

no

  or do you have to send the bitcoin from each address to it for the balance to be 3 btc?

yes


Using ZeroMQ of bitcoind to monitor addresses?

Actually, it's pretty much possible!

You will have to listen for rawtx topic of ZeroMQ in order to retrieve binary representation of the transaction descriptor.

Then you should parse the transaction body and extract Bitcoin addresses from it's output scripts. You could either do this manually, or use some third-party library. No need to make RPC calls!

References:

Bitcoin Transaction Format
Bitcoin Script Format


NBitcoin, how to implement wallet restoration? How does it work?

With public key am I able to track all transactions associated with this key?

A public key has two corresponding addresses: Uncompressed and compressed. I suggest only generating compressed public keys for simplicity. The relevant methods are Compress and Decompress here.

So, yes.

  Even if I used multiple adresses?

Multiple addresses: Yes, you should track all of them.

  Do I have to iterate throughout whole blockchain and check the signatures?

You should use SPV: Download a block, verify it, keep the headers, skip to the next block. Also you should keep the transactions that are incoming/outgoing. Writing the current block height to the wallet file is a good idea, as after you launch the wallet for the second time, you'll only need to download blocks and scan for relevant transactions after that block height.


How can coinbase transactions be created?

The current bitcoin system does not allow to create a block with two coinbase transactions.
The rules are described here.
So a player against the system would need to craft such a block manually, which would get rejected, and eventually the node would get banned.

Hint: as his is a basic question of how bitcoin works, I recommend to read the technical articles on bitcoin.org, as well as the article on protocol specification in the link. And on top Andreas‘ book „Mastering Bitcoin“ gives a deep insight into the bitcoin world. It is also online available, in many languages. Highly recommended!


Are BIP39 mnemonics generated with a French list compatible with software that expects English words?

Given that the mnemonic sentence itself is fed through the PBKDF2 function, rather than first looking up the indices of the words in the dictionary, I guess that the answer is no, and a French list can't be easily converted into an English list. Is this correct?

That is correct. You can not convert a mnemonic generated using one wordlist to another since the mnemonic decodes to different byte arrays. For example the third English word is 3 bytes (able) while the third French word is 8 bytes (abdiquer). And consequently the seed (that you use in BIP32 functions) is going to be different.

  Doesn't this drastically reduce the interoperability of wallets using different word lists?

Usually when wallets implement BIP39 they implement all of it including all the wordlists that are linked in the protocol improvement. So they can remain compatible

  Specifically, how can I ensure that the word list I have for a wallet can be used in another software than the one it was generated with?

You have to check those wallets individually to see what they have done, either by checking their source code on GitHub or their website, or asking the community about for help. Lack of compatibility doesn't stop there.
Usually there is a page explaining it clearly. For instance Electrum uses an entirely different scheme although it still supports BIP39, or LND and wallets based on it use unique scheme called aezeed


Did you include the transaction fee? If you don't, most miners won't accept it. The same thing happened to me.

Also, you need to wait until it syncs. You can check if it's been included by going to blockchain.info/address/*the address to which you sent it*. If it worked, the transaction should be listed there.


Why doesn't the Bitcoin core team develop official Bitcoin mining software?

Bitcoin Core does have mining components in it. In fact most available mining software actually rely on Core (or something abstracting Core's services) in order to get the block built before it attempts to mine it. Bitcoin Core has the capability to serve the information to other software so that they can mine blocks. Furthermore, Bitcoin Core does have the logic necessary to mine blocks. However it only does this via CPU mining, and because CPU mining is no longer viable, this has been disabled on the main Bitcoin network. It is still there in order to mine blocks on testnet and in the regtest networks.

Having a fully fledged mining software (i.e. one that supports all of the various ASIC miners and can connect to mining pools) is outside of the scope of the project. This would enable functionality that the vast majority of Bitcoin Core users never even use and thus would be a waste of time to develop.

Lastly, there is no official node software. There is no official anything in Bitcoin; it is decentralized, official would mean that there is some central authority dictating what is "official" and not.


In simple terms, what are the major differences between P2WPKH and P2WSH bech32 addresses?

P2WPKH - This stands for "Pay To Witness Public Key Hash" and the scriptPubkey is OP_0 0x14 {20-byte-hash}, where OP_0 is the version, byte 0x14 is the size of the data, and the {20-byte-hash} is a HASH160(PubKey).
P2WSH - This stands for "Pay To Witness Script Hash"  and the scriptPubkey is OP_0 0x20 {32-byte-hash}, where OP_0 is the version, byte 0x20 is the size of the data, and the {32-byte-hash} is a SHA256(script).

This data is taken from: http://bcoin.io/guides/segwit.html

Examples:

For the P2WPKH address: "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"

OP_0 , 0x14 , HASH160(PubKey) -- looks like (in hex):

00 14 751e76e8199196d454941c45d1b3a323f1433bd6

For the P2WSH address: "bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3"

OP_0 , 0x20 , SHA256(script) -- looks like (in hex):

00 20 1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262

Examples taken from http://bitcoin.sipa.be/bech32/demo/demo.html and https://github.com/sipa/bech32/blob/master/ref/c%2B%2B/tests.cpp


There is no "consensus algorithm" that starts and stops as you are asking. There isn't a timer and there isn't anything that nodes communicate other than blocks.

The process of updating the blockchain (i.e. the consensus algorithm) is always running and "wakes up" whenever a new block is received. It is run by nodes by themselves as there is no need to communicate with other nodes except to receive new blocks. Updating the blockchain only works on complete and valid blocks.

The process of every node receiving a new block and updating their own view of the blockchain is the  consensus algorithm.

  Due to latency and other issues, every miner is probably building a different block, at a different speed.

They are building different bllocks because they are different miners. Each miner is working on their own  unique block. They probably are not working on blocks at different heights.

  1) When the consensus algorithm will start? There is like a timer? (For example: "every 10 minutes the consensus algorithm starts, with the purpose of putting a new block in the blockchain")

It "starts" within a node when it receives a new block. There is no timer, and it is  not a networkwide algorithm.

  2) Can a miner create more than one block before the consensus algorithm start ? For example, it finishes a block and before this block goes under the consensus algorithm, it creates another one.

Sure. When a node receives a new block before it has validated previous ones, the new block is partially validated (the parts that don't rely on previous blocks are checked) and then it goes into a queue.

  2) When the consensus algorithm start do it consider the blocks builded by all the miners ? And if some miner haven't finished building one's?

Then those miners lose the race and get nothing. Consensus only cares about complete and valid blocks. Whatever other miners are doing does not matter unless they too broadcast a valid block for that height.

  3) Is the order of transaction in a block important ? Must the transactions in the blocks respect the chronological order of the correnspondent "real" transaction (A sends 9 bitcoins to B) ?

Yes, kind of. The order for two independent transactions does not matter. If transaction A came first and transaction B (which has no relation to transaction A) is second, a block can have B then A and that does not matter. The point of blocks is to establish the chronological order anyways.

But if transaction B relies on A (so it spends an output of A), then yes, the order matters. In that case, B must come after A. Otherwise the block is invalid and nodes will reject it.


Noob Question: Trading Fluctuating Currencies

You have one BTC which worth $17,000 so you have $17,000. Now you can sell this BTC for $17,000 and buy whatever you want.


Is it possible to forward signed transaction using bitcoind prune mode?

Is it possible to perform createrawtranscation , signrawtransaction and sendrawtransaction rpc call using bitcoin in prune mode?

Yes
I did the transactions in below link using pruned node:
https://bitcoin.stackexchange.com/a/99679/103136
rescanblockchain might be required if you are using any imported addresses in the transactions and it will work only for blocks saved on disk
I had to use rescanblockchain in this example: https://bitcoin.stackexchange.com/a/99112/103136


"comment" and "to" of malleated transactions

No, it would not because the malleated transaction is technically a different transaction. Transactions are identified by their hashes, not the inputs or the outputs of the transaction. Since malleating a transaction means that you are changing part of the transaction, its hash will also change. This means that the malleated transaction is actually a different transaction and will be treated as such. So no local information from the original transaction will be added to the malleated transaction unless you explicitly add it.


Those are called "pump and dump" schemes. First you own a large amount of coins, then you make your coins public and try to convince everyone to use your coin, so its value will rise and you'll be rich.

  ... sort of like a scam to me

Well, a rumor that says Satoshi owns 1M Bitcoins (Source)

  ... how is this possible?

Bitcoin Gold will change the PoW to a GPU algorithm. Thus, the difficulty will start at "one" or so. Hence generating coins will be easy until the difficulty adjustment happens.

  How do coins get premined on future blocks before being released

Again, first they'll mine, then they'll make it public.


I've been asked to share wallet credentials to participate in mining. Is that a scam?

Its an obvious attempt of a scam. Don't ever do that. What the scammers will do is as follows:
they will make a copy of your key, then you will lock them out to access your key. It won't help because they would have already made a copy.

Changing your password prevents anyone from using that password to access your wallet and keys. It doesn't prevent anyone who already knows your secrets from just creating another wallet with the same secrets.


Why can't someone create a valid digital signature without knowing your private key?

Bitcoin uses something called the Elliptic Curve Digital Signature Algorithm (ECDSA) for signing and verifying transactions. Read the linked Wikipedia article for exact process of how ECDSA works. If you understand how the modulo operator works, it should make sense as to why you can't make a signature without the private key.

It's kind of hard for me to explain this as it does rely on some complex mathematics, but I will try.

To produce a valid ECDSA signature, you need the private key, which is a large integer. It is explicitly used in the signature creation algorithm, but the public key is not. Furthermore, the public key is not an integer like the private key; rather it is a point on an elliptic curve. So even if you know the public key, you can't create a signature with it because it is not the private key and you can't recover the private key from the public key.

The private key cannot be recovered from the public key because of a problem called the Elliptic Curve Discrete Logarithm Problem. From Wikipedia:

  it is assumed that finding the discrete logarithm of a random elliptic curve element with respect to a publicly known base point is infeasible: this is the "elliptic curve discrete logarithm problem" (ECDLP).

The private key is the discrete logarithm. Although this is an assumption, it has been shown in practice that ECDLP is a hard problem, i.e. it is hard to find the discrete log given a base point and public key point. So you can't get the private key that is required in ECDSA to produce the signature.


How much does an online store that sells in multiple currencies need to know about exchange rates?

But what is an online store, that quotes goods both in Bitcoin and, say Ripple (but insert any alternative crypto currency here), to do in this situation? It has to have a fast and reliable access to some exchange current bid and ask and constantly update the prices of goods.

First off, would that really be so bad? I could write a program that polled exchanges, took the median of the exchange rates, and use that to price my goods.

Second, having prices that are slightly different because of changing exchange rates isn't necessarily a bad thing, because it can end up functioning as price discrimination. Price sensitive customers will look up the exchange rates and use the one that is less expensive. Price insensitive customers will use whatever is close at hand.

Because of this, how much you need to know about exchange rates is closely tied to how much your average customer knows.


How many Bitcoins existed when block 209,999 was mined?

I suppose this is the culprit. If we add the duplicate 50BTC that is missing and the first reward from block 21,000,000, we would have 10,500,000BTC in total.

However, my calculations would be: 21000000 blocks (ranging from Genesis Block 0, to block 20,999,999) multiplied by 50 BTC, that would give us 10,500,000
With the duplicate transaction, that would be 10,499,950 BTC total.


Your wallet seems to have wildly inaccurate fee estimation.
Currently, for next block mining, you should be paying around 1/8th of that fee - 1/10th or less for next 2-4 blocks.
Unfortunately, that transaction cannot really be cancelled - you could attempt to double spend it, but the fee is so high that you'd end up spending even more to potentially get a double spend mined, which defeats the purpose.


Security trade-offs between centralized wallet system and a SPV wallet?

Well "wallet" as storage of keys should always be under your control. There are online wallets for higher convenience, but as the old saying goes "not your keys, not your bitcoin". It's probably a bad term, but I'd rather say "local (SPV) node" instead of "wallet".

When you are sending there is no problem with malicious peers as the transaction is (usually) cryptographically signed, so the most they can do is not relay your data to the rest of the network (DoS). Like a regular bitcoin node you can
basically just send the tx out to multiple peers.

The important part where blockchain comes into play is verifying whether a transaction actually happened (possibly also the one that you've submitted).
In this context "centralized" means you basically just ask another node. Now the node will usually tell you the truth unless it has some incentive to cheat. Like owners want to persuade you they've sent you money in exchange for your goods or services when in fact they didn't. You could ask multiple nodes, but you can't be sure they're not colluding to scam you (same goes for block explorers).

In order to be 100 %, you'd need to download the whole bitcoin blockchain from genesis and check for yourself. Point is that you do it from multiple nodes and due to PoW they can't make up that data from thin air. Downloading the whole chain is however a bit impractical so what "simplified payment verification" does is basically allows you to just download the chain of block headers (that are only 80 bytes each). Then you see that the block containing the transaction is part of the longest chain (and that means that there was consensus on the network that the transaction you are wondering about was indeed valid).


Miners role is not to validate transactions, but to confirm them. Every node validate every transaction every time. A single invalid transaction would invalidate the entire blockchain.

In Bitcoin technology the transaction is collection of bytes. All the information about a transaction is the very transaction itself.


why is BnB coin selection algorithm not enabled by default?

You're misunderstanding the code. That variable tracks whether BnB was used. Not whether we attempt to use it.
BnB does not always yield an acceptable result, as it requires a solution with no change to exist. It is attempted, but if no such solution can be found, Bitcoin Core's coin selection falls back to other algorithms. The bnb_used variable remembers whether that was the case.


See the list of forks on the Ripple wiki. It currently lists four projects.

As to why there are not more, any answer will by necessity be opinion based which tends to be not appropriate on a StackExchange site. But my answer would be that, as you say, producing an identical fork is trivial to do but also useless. The value of system like Ripple comes from network effects that a clone would lack. The only reason rational people would consider a using a fork would be if it had some important new feature (hard, lots of work) or if the existing implementation had some serious actual or perceived flawed that the fork did not (including possibly just the perceived control a specific entity may have on the network). For many issues people appear to have with Ripple, instead of forking it makes much more sense to work towards having a set of validators with a robust set of UNL entries that possibly exclude Ripple Labs and additional non-Ripple Labs contributors to the code base.


Please keep in mind that exposing your node's RPC interface to the entire internet is considered to be unsafe. RPCs are not encrypted so anything that you send to your node will be in cleartext for any man in the middle to see. This includes things such as your RPC username, RPC password, and wallet password. If an attacker were to see any of this information, they can execute commands on your node including ones that move any Bitcoin stored in its wallet. Attackers can also do other things like force your node onto an alternative blockchain or force your node to connect only to malicious peers.

Instead of exposing your node's RPC interface publicly, you should instead setup a VPN which has your VPS and other computers that will access your node's RPC interface and have the RPC interface exposed to the VPN. This is far safer as the RPCs will be encrypted and only computers within your VPN will be able to access your node.

The reason that you see that error is that Bitcoin Core no longer binds to 0.0.0.0/0 when -rpcallowip=0.0.0.0/0 is set. You must explicitly tell it to bind to 0.0.0.0 using -rpcbind=0.0.0.0. This functionality was removed for the reasons stated above. I highly recommend that you do not do this and instead setup a VPN and then bind your node to your IP address within that VPN.


How to delete wallet without deleting blockchain

As Raghav already commented:

Yes, you can delete the wallet.dat file as long as you don't have any private keys in it. Once you restart Bitcoin Core it creates a new and wallet.dat.


Yes, wait for it to finish synchronizing. You will not see your coins until it finishes.

(Note that the time shown is not the estimated time until completion; it represents the age of the old transactions currently being downloaded. Depending on the speed of your computer and internet connection, you can expect it to finish in a few hours to a few days.)

In the meantime, you can enter your address in a "block explorer" site like http://blockchain.info to check whether the seller made the transaction as agreed. (This is safe; your address alone cannot be used to steal your coins.)

If you don't want to download the entire block chain, you can use a different client such as Multibit, but you will have to import your wallet.dat from Bitcoin Core into your new client software. Its documentation should explain how to do that.


Import Multibit multibit.key into Electrum

I had the same problem with one of my customers and found out that Multibit had generated an invalid key due to a bug in the software. This key cannot be used because it is out-of-range of the bitcoin EC specs. Check if your key is working with any other software. We are currently working on a solution - you can PM me.


So, In my case most easy way out was - make a payment from my adress on my adress of all balance with economical fee, which was small enough, and transaction took an hour and half. Then payment for external adress gone with reasonable enough fees.


Is an exchange a good substitute for a mixing service?

Well, "mixing" can be seen as different things. At it simplest, every transaction mixes up your coins a little, especially when you split or combine them. However, what makes a "mixing service" is somehow more specialised.

So, there are several differences with exchanges:

Mixing services usually have a static pile of coins, distributed over a big web of addresses. When you want to mix your coins, the mixing service can do it instantly by distributing your coins into his web transferring them to both new and existing addresses and meanwhile transfer an equal amount of coins to a new address for you by combining small parts from his web. The difference here is that you do not rely on another 3th party that also wants to mix/trade, as you do with an exchange.
Most mixing services have a fixed fee that you pay in Bitcoin. Exchanges may as well have fixed trading fees, there is another cost to consider. You will have to both make a sell order and a buy order to "mix" your coins using an exchange. Even if you make both orders instantly after each other, you will probably lose more than twice the trading fee. This is because there is always a price difference between the lowest buying price and the highest selling price. Furthermore, if you make the trades while the price is raising, it will probably cost you even more.
As Stephen Gornick already mentioned, exchanges keep logs. They usually also require you to verify your identity and this information will be bound to the logs, making the mix all but anonymous. Most mixing services do not require you to have an account at all, they just give you a sending address and ask for a receiving address to which you want your funds back.

As a final note, I want to add that with a good implemented mixing service, the user base of the mixers does not really matter. A good mixer will always have a static web that can be used for each new mix by adding your coins into it and at the same time, picking some random others to combine to an equal output. As long as this static web is big enough, the mixing will be very hard to trace.

There is one thing that could make you vulnerable for trackers. If the mixing service works instantly, the trackers could search for a new address receiving just the same amount as the amount you just spent. This is not hard to do. So, another feature that would make a good mixer, would be the option to give multiple receiving addresses and not executing mixes instantly, but taking a few minutes between funding the different addresses. Note that this can be in favor of an exchange, by which the actual mix is not logged in the block chain, so trackers need to have access to the logs of the exchange to track you.


It depends on the pool, because the miner (here: the pool) decides. Getting the fees and the block reward just means that you get to include a transaction spending those bitcoins. Typically, this transaction will transfer everything to a Bitcoin address owned by the pool, and the miners get individually paid by the pool.

There are different allocation schemes that pools use for this, but they all tend to be based on paying for not-quite finding blocks (solving a share), which occasionally but rarely will also happen to solve a block. Essentially, the pool is a bit of a risk insurance, taking in the infrequent but large rewards for hitting the jackpot of finding a new block, and dispensing smaller rewards for, typically, not-quite getting there by their individual miners.

So whether the pool pays a percentage (say 98%) of all it gets per block, including fees, or else excludes fees and keeps those entirely for itself, or uses some more complicated formula is entirely up to the pool to decide (and the individual miners to agree to by choosing that pool).


What are some good solutions for analyzing Bitcoin script patterns?

It seems that bitcoin-iterate implements your second suggestion:

  This is some fast code to iterate over bitcoind's block files to extract blockchain data from the main blockchain.

But as far as I know it doesn't allow your to filter by script. That would be a nice addition to the project, I think. Or you could write something similar that did that.


You would need to use a client node that has a different architecture, from the satoshi's client.
Specifically, the client must be able to quickly browse through all the unspent outputs.

You may want to check this table for clients that support Multi-wallet.
Among them, there is a new client Gocoin. It is currently in a testing phase, and you need to build it yourself from sources, but if you have a PC powerful enough to run it, it needs less than a second to give you an unspent balance of any standard bitcoin address.


I found the answer seconds after I posted my questions. I was not writing the code right, here it is

openssl enc -d -aes-256-cbc -md md5 -a -in /Users/adriangonzalez/Desktop/bitcoin-wallet-backup-2019-06-26-22-20 -out ~/Desktop/file.txt

https://github.com/bitcoin-wallet/bitcoin-wallet/blob/master/wallet/README.recover.md


What are the consequences if I spoof an IP address in the node_announcment message?

I don't see the attack here. You cannot claim you are a different node, because you cannot sign for that. All you can do is give a false IP address FOR YOUR OWN NODE. Which probably just leads to people not being able to reach you.

I guess the only interesting case is where the IP you give is already known as another node. Maybe the spec should spell out what an implementation should do then. But I guess not doing anything is probably fine, since you could still reach the known node under its IP adress (node lookup being per ID, I guess), and whenever you try to reach the spoofing node under the fake address, it just won't respond.


Will ASIC miners hold the network "hostage" and demand a fee for their services?

The 'race to the bottom' is still continuing in the mining market and hopefully will continue. If any of the miners tweaks transcation inclusion like you suggest that would make them less competitive in this market.

The miners have pretty much no power to enforce transcation fees while the market is functioning as intended, so your question is somewhat moot.
If the miners do hold the network hostage that would be a sign that a cartel has formed and the mining/fee market has broken down.

If that happens it may well be that the users and developers will augment the protocol such that the miners are once more 'held hostage' by market forces.

The difficulty evolution is often described as 'difficulty follows price', this does not model the cheapening of the hardware but otherwise describes the market forces pretty well (by assuming that block rewards and fees won't change rapidly).


Do legacy nodes receive the witness fields of a Segwit transactions?

Legacy nodes (that is, nodes before segwit) do not receive witness data.

Witness data is a separate data structure. It is only relayed if a node asks for it.

Older nodes don't know it exists, so they don't ask for it, and thus don't receive it.

Since segwit data does not contribute to the txid, old nodes can receive the regular block and still validate it as normal. They just interpret the segwit inputs as "anyone-can-spend" equivalents.


Can two parties accidentally pay the same lightning network invoice simultaneously?

As far as I know It can and did happen.

On a protocol level 2 seperate nodes (or the same node) can construct two different (or the same) onions and initiate the routing process.

On a protocol level I am not aware of any mechanics to prevent two htlcs on the same channel with the same payment hash and on different channels this is obviously not encoded to the protocol. In particular while there might be a rule that the recipient SHOULD NOT release the preimage more than once I don't see any way to detect or prevent such a behavior without drastic protocol changes.

The situation becomes worse, once we implement base AMP in which a recipient node expect several htlcs anyway and overpayment is also part of the expected protocol behavior.

A little off topic: AMP also allows a denial of service attack vector by just denying the second onion with the same payment hash to be forwarded.


One seed phrase created two wallets with two script types

How can I proceed to put all in one wallet together?

Decide which wallet you want the coins to end up in
Open that wallet, copy a receiving address from it
Open the other wallet, send all funds from it to the address you copied above (be sure to double check that the address you paste matches!)
Wait for transaction confirmation. Once confirmed, all your funds will be in available in that one wallet

It is not technically impossible to have a wallet handle addresses that are different script types, but I'm not sure I know of any wallets that include this functionality.


Backup of a bitcoind wallet using the extended private masterkey only

1) If I only backup that extended private masterkey, would I be able to recreate the wallet entirely in case my application crashes? Or do I really need to backup the wallet file itself? (Let's say I do not import addresses that were not generated by bitcoind itself.)

No. Bitcoin Core does not allow your to create a wallet from the master private key. There is no way to import it into a newly created wallet or to create a new wallet with a master extended private key.

  2) I heard that changing the passphrase of a wallet would change the extended private masterkey... Is that true?

Only setting the password will change it. Subsequent password changes will not change any of the private keys in your wallet.

An important thing to note here is that Bitcoin Core does not use an extended private key. Rather it uses a HD seed (as defined in BIP 32). When keys are being generated, that seed is hashed to get the extended master private key, and from there the child keys are derived. That extended master private key is never stored in the wallet file itself.

Instead of backing up the master private key, you could instead backup the HD seed. This can also be found in the dumpwallet output and it will be listed as hdseed=1. It will look like a normal private key and be presented in Wallet Import Format.

Once you have the seed, you can create a new wallet and set it to use your backed up seed using the sethdseed command.


What happens when bitcoin loans start to appear?

Given how quickly intrest on top of intrest grows, won't the bankers get to 21 million BTC quite quickly?

Sure, but is that really meaningful? Let's say that I loan you 1 BTC, with the terms that I get 10% interest per day. Before the year is out, you owe me more bitcoins that actually exist. The face value is the amount that the loan is supposed to be worth, if everybody keeps their word.

However, the real value is much lower - you're a random stranger on the internet, and you're unlikely to come up with quadrillions of dollars.

Bitcoin can't save you from untrustworthy borrowers.


If everybody stops paying transactions fees

So why miners can't be satisfied with just the coinbase earnings? no fees for users = more adoption = BTC value goes up.

First of all, transaction fees is used as a mechanism in bitcoin to deter spam. If transactions can be made without paying transaction fees, then there is no cost to the user to create spam transactions that will eventually overwhelm the network. So, the inclusion of transaction fees is a necessity for network health.

Secondly, it is not necessarily true that "no fees for users = more adoption = BTC value goes up". Paypal incurs zero fees for friend to friend transactions, does everyone own a Paypal account? Would onboarding many users that do not pay transaction fees cause Paypal shares to rise? Probably not.

Finally, a fee market for bitcoin transactions is a good thing as miners need to be compensated for the work they contribute to generate blocks. As block subsidy tends to zero, the proportion of mining revenue derived from transaction fees must rise or at least reach an equilibrium where the mining revenue is equal to the security cost of securing the bitcoin blockchain.


You need the private key from the wallet that had BTC in it on both forks. Sending the funds to a new wallet is the right thing to do, now only step you need to do is import the private key into BCH BTG wallets, and if you had BTC on 28 dec on the B2X fork you can also import your key into the b2x wallet.


If bitcoin fails as a currency, how will blockchain tech still be secure for other applications?

I understand it exactly the same way as you .. the currency needs to be worth the time and effort of the miners or at least the have to believe it is in the long run.


Could decentralised proof of time in BCHSV solve for high PoW power consumption?

Mining is the timestamp in Bitcoin, it allows for a decentralized system to achieve synchronized ordering of transactions with high probability. If a system for doing decentralized time sync existed there would be no need for mining blocks at all, you'd simply timestamp transactions as they arrived and call it a day.

No system for this exists, hence we use Proof of Work to achieve an approximation.


Download the entire blockchain on Bitcoin cash in order to get your bitcoin cash coins?

Technically no, you only need to know your UTXOs so you can make a new transaction and sign that yourself. But if you want to use a Qt GUI or similar, then yes, it will attempt to download the entire blockchain again I would imagine.


Where can I find a roadmap of the main bitcoin client?

You can read the Roadmap and the status before v0.4 release

They discuss the development at
http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development


Is there a mechanism to handle stale bitcoins?

If coins are lost, they are gone forever. This only hurts the person who lost the coins... and in fact it makes the rest of the coins more scarce and thus more valuable long term.

Because Bitcoins are divisible down to eight (or more) decimal places, it really means there are 21,000,000 x 1,000,000 = 210,000,000,000,000 units (and this can be divided even further with changes to the code. In practice, this means that one can always have a "small enough" unit of Bitcoin to buy tiny items.

So if X number of Bitcoins are lost, the rest simply become more valuable, and unless a coffee costs less than .000000000000001 BTC or something, there will not even be a need to alter any code. If we were using those tiny units, a convenient name would be given to them and life would be fine and dandy.


MULTIBIT: How to restore wallet with following information?

The MultiBit HD wallet can be restored with just the seed words. Click "Restore" on the unlock screen and follow the instructions.


what is the lowest amount i can transfer using bitcoin ? can i send 0 satoshis?

This is unexpected (but valid) behavoiur of mining pool software. btw, i am creator of this tx


What would happen to people's money if the Bitcoin project was discontinued?

Bitcoin exists on a few levels. One is the protocol which evolves through a proposal process. Second is the Bitcoin client and bitcoind project which is an implementation of the protocol. Third is the currency managed by what's referred to as the Satoshi-blockchain. All of the above are available under free software licenses or are, at the very least, public information (in the case of the blockchain and protocol). It is therefore unlikely for any part of Bitcoin to be meaningfully discontinued.

Should everyone in the world stop using Bitcoin, the transactions and private keys to spend again would still exist so you could say the money will stay right where it is. The exchange rate wouldn't fare well but the Bitcoins would all just be there in deep freeze until someone started mining again. Once you know more, you'll see how unlikely any kind of discontinuation would be.


What are the specific interactions between a Wallet client/node and a Miner?

A wallet is used by a client to store Bitcoin Addresses. The standard client can be ran in a server mode, which will allow it to take HTTP JSON RPC commands. One of them is "getwork" - a standard command used by miners to get data to hash. The standard client creates new blocks crediting one of the addresses in its wallet with the block reward. A miner can submit finished work to the client to help it solve it.

This solution is not ideal for most miners, as the use of pools as an intermediary between a client and a miner allow the block reward to be split between them.


Sweep all functionality for a Bitcoin Lightning private key using mobile, desktop, or cli wallet?

There are currently no specifications for interoperable text/file formats between lightning network node implementations. The lightning BOLT specifications deal with standardization of the network protocols so that different lightning implementations can talk to one another, but all other details which are not part of this protocol are left up to the individual client implementers to choose.

It will probably be useful to have a standardized import/export format for lightning node information and channels in future, so that you can migrate your node information to an alternative implementation. I'm not aware of anybody working on such formats to date.

Channels in the Lightning Network are tightly coupled to a specific node with a specific public key. It is not really possible to migrate channels to a node with a different public key, and attempting to do so will likely get both nodes blacklisted, as the specification indicates that blacklisting should occur if any duplicate channel is broadcast with a node id which does not match the one previously known.


Are they truly 100% random (generated by hardware) or is it pseudo-random (generated by software)?

Pedantic answer: No, they're not random, because the first twenty digits or so will always be zero.

Serious answer: The Bitcoin client does not use any hardware randomness, as far as I know. However, if even a single transaction in the block was generated using hardware randomness, the block hash will incorporate hardware randomness.

Also, I don't think you could predict the hash of a block that hasn't been found yet.

  Can I rely on it or any other blockchain data to make a 100% trustable raffle?

As Greg said, a miner can withhold blocks if releasing them would make the miner lose the raffle. Of course, the cost of withholding a block and not broadcasting it to the network is about $9000, so this attack might not be useful.

  How do I make a trustable raffle

Your method would probably work. This answer discusses how to exchange a secret between two parties that can't trust one another. You could use something based on that.


Bitcoin - Read transaction details from LevelDB

The two strings are the same, but with the bytes (hex digit pairs) in reversed order (with an extra c at the beginning).  The first string starts with 24 6c 5a ... and the second string ends with ... 5a 6c 24.
It looks like an endianness flip to me (network order is big-endian, but  your machine is presumably using little-endian order).  I don't know what the meaning of the extra c is.


How to handle return address Output field using bitcoin bip 70?

I managed it with Petrer Todds python-bitcoinlib.

Link to payments_pb2 proto file here.

import bitcoin

## Uncomment for testnet
#bitcoin.SelectParams('testnet')

import payments_pb2

from bitcoin.wallet import CBitcoinAddress
from bitcoin.core.script import CScript

def protoresponse(httprequest):

    ## Object
    o = payments_pb2

    ## PaymentACK object
    pao = o.PaymentACK()
    pao.payment.ParseFromString(httprequest.body)

    refund_address = CBitcoinAddress.from_scriptPubKey(CScript(pao.payment.refund_to[0].script))

    return httpresponse


How can I tell if my Bitcoin wallet is working?

breadwallet is a standalone bitcoin client for mobile devices. There is no server which can get hacked or go offline, so you can always access the funds stored on your phone.

Using SPV mode, breadwallet connects directly to the bitcoin network with the fast performance you need on a mobile device.

Since the wallet itself has no indicator for connections and does not synchronize the blockchain, I would suggest that you use a very tiny amount of Bitcoin and send it in a micro transaction to your breadwallet to test if you are set up and connected.

By the way, did you backup your wallet yet?


Someon offered me btc mine trough his mining device

Yes, it's a scam. Don't send them anything.


Bitcoin cross trading from Bitstamp to Bitfinex

Nobody knows whether Bitfinex is insolvent or not. As a result, dollars at Bitfinex are worth less than dollars at other exchanges. This accounts for the price difference you see. To exploit this difference, you would have to send dollars to Bitfinex and command them to make what appear to be fraudulent transfers on your behalf.
See this article for more details. Some excerpts:

Bitfinex has imposed a haircut on all of their depositors.
For those whose deposits were not held in segregated accounts, there is no question that the deposits constituted general obligations, payable on demand, on the part of Bitfinex. To justify making anything less than a full payment on a general obligation that is payable on demand, a company would have to be insolvent or illiquid.
By definition, if you don't have sufficient assets to make the payments you are obligated to make, you are insolvent. There's no reason to think Bitfinex has assets that are not liquid. They imposed a haircut because they don't have assets to cover the funds their depositors have every right to demand from them. They are insolvent.
When you deposit funds at Bitfinex, they have your funds. You have a promise that they will repay you the funds you deposited. But you're just another creditor on their list of creditors. You get funds if they have them and not if they don't. Your deposit is another general obligation of Bitfinex, a company that is insolvent.

An insolvent company cannot make full payment to a junior creditor without court approval (or consent of all their creditors) -- such a transfer would be fraudulent. We know Bitfinex has not gone to court as they would have to have given notice. When you deposit money at Bitfinex, you become a junior creditor. When you command a trade or withdrawal, you are commanding full repayment of yourself, that is, you are ordering them to make a fraudulent transfer on your behalf.
Fraudulent transfers are subject to clawback. That is, if you trade at Bitfinex, you may eventually get a letter from a trustee or receiver demanding you repay the money you made or even the full value of the assets you withdrew.


What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?

When the nonce range is exhausted, miners change the extraNonce field of the generation transaction. This changes the Merkle root in the header and allows a new range of nonces to be attempted.

Since the Merkle root is 256 bits, this can be repeated indefinitely.


How to transfer bitcoins to my Indian bank or PayPal account?

Bitcoins cannot be "transferred" to any fiat currency or any bank account. If you need to liquidify your bitcoins and you want to get fiat currency in exchange, you can sell your bitcoins in Bitcoin exchanges. Alternative is that you directly spend bitcoins on bought products and services.

If you just want to store your bitcoins you can create your own local Bitcoin wallet independent of online bitcoin services.

No financial institution will touch bitcoins. In fact, most banks and PayPal are openly hostile towards anything having word "bitcoin" on it.

Good options to sell your bitcoins in India is LocalBitcoins where you can sell bitcoins online, or on the street with cash. Be aware that there are some risks, and those risks are especially  when selling bitcoins on PayPal. Unless you are professional you should not be doing Bitcoin sells on PayPal.

What I would do is that I would transfer my bitcoins to LocalBitcoins trade wallet, pick a trader with high reputation (so him/her can be trusted) from LocalBitcoins "Sell bitcoins online" list and make an offer to sell my bitcoins using Indian bank transfer.


Can I have one wallet for all types of coins?

Hierarchical Deterministic (HD) wallet technology is very powerful. HD wallets can be implemented as either software applications or dedicated embedded hardware devices that connect to computers or Android devices using USB interfaces. Trezor, Ledger, and Keepkey are three examples of hardware wallets that support the BIP 32, 39, and 44 standards.

BIP 32 is the foundation for HD wallet technology.

BIP 39 makes it easy to backup, restore or port all of your private keys typically represented by 12, 18, or 24 words supported in multiple languages.  BIP 39 also supports hidden wallets with the application of as many extra passwords you so desire to provide plausible deniability services. The three hardware wallets mentioned above support passwords, albeit the Keepkey password support is still in beta testing. BIP 39 also prevents vendor wallet lock-in.

BIP 44 technology enables HD wallets to supports multiple cryptocurrencies within one software application or hardware device.  Here is a complete listing of registered BIP 44 cryptos.  Hardware wallets, tending to be the safest for holding large sums, support a subset of cryptocurrencies on this list. Software-based multi-currency wallets (e.g., Jaxx, Coinomi) tend to support more currencies. The last time I checked, these software-based wallets did not support BIP 39 passwords.

It is recommended to have your BIP 39 seed words loaded into multiple hardware wallets from different vendors.  At times, backend servers associated with one H/W vendor might be down or transactions don't complete successfully, and the other manufacturer product will work fine. This is analogous to having multiple email addresses in case one server goes down.


Looking to start mining litecoin/altcoin

I recommend you try mining with your current hardware first for Litecoin and a less popular altcoin like Yacoin, then look to invest in hardware.  Litecoin is popular enough that it will take you multiple weeks before you earn enough in a Litecoin pool to withdraw.

You can compare Litecoin hardware output here:
https://litecoin.info/Mining_hardware_comparison

Yacoin is up and coming but is still low in difficulty enough that you can earn enough in a day or two and while using your CPU.

http://www.yacoin.org/

For an example to put it in perspective, on one of my machines, I mine for Litecoin using my GPU and I also mine for Yacoin using my CPU.  I am getting close to 5 Litecoins mined but I have already mined over 700 Yacoins.


The synchronization process has two parts: Downloading the data and verifying it's validity. You already took care of the downloading part by acquiring the boostrap file. Now your Bitcoin Core is building the transaction database by verifying the network's whole transaction history.

The value you are asking about doesn't give you a time estimate, but shows you how much of the data in the blockchain still has to be verified.

You are just at the very beginning, so your client still has to verify the transactions of 4 years and 17 weeks. Since you have downloaded all the data already (it's in the bootstrap file), your downloading speed doesn't matter.

Depending on the speed of your computer, the verification process can take a few hours to a few days.

If you don't want to run a full node and don't want to wait that long, you might want to look into thin clients, such as MultiBit.

Also see:
Why is downloading blocks taking longer and longer?


The current signature scheme that bitcoin is using (ECDSA) doesn't support signature aggregation, so you will have to sign each input and provide one signature per input (assuming it requires only one signature) and your transaction size will grow accordingly.

  sell 5000 pcs coffee every day for $1 each

Then you might want to look into Lightning Network. It works on top of bitcoin as a second layer and for micro and frequent payments it is the better choice:
https://lightning.network
How does the Lightning network work in simple terms?


Is the idea of fraud proofs possible in reality?

The whitepaper said that SPV clients would avoid accepting a rules violating block by being altered to the violation, downloading the block, and checking for themselves. This is not realistically possible in the protocol as it exists today because the commitment structure means that for many rules the smallest amount of data you must download to tell if a block is actually invalid is the entire chain-- even if you have a peer that knows where the invalidity is. For example: if a transaction spends a vin txid that never existed in the chain currently the smallest amount of data you need to verify a claim that it didn't exist is the whole chain.

Back in 2012/2013 I proposed an additional set of commitments that would make what the whitepaper described possible by allowing the alerting peer to point you to the invalidity (thus calling it "fraud proofs"). For the above invalid-vin example fraud is proven by having every block commit to where in the chain their inputs came from and simply showing those commitments to the querying lite client. Unfortunately, even that isn't that sufficient: a miner producing an invalid block could decide to only serve SPV requests and keep the invalid part hidden from every full node that could alert others to the invalidity.

In 2014/2015 I proposed that clients sample from a locally decodable error correcting code to make it difficult for a malicious block to serve parts of the block without indirectly serving the entire block.  Unfortunately, the result has high overhead to only achieve a relatively low level of security against falsely accepting an invalid block and as a result no one in the Bitcoin space currently seems all that interested in exploring that sub-idea further at this time.


Sending from same address multiple times VS receiving to the same address multiple times

This is a weird question because you have to send from the address you receive from.  If you receive all your bitcoin to the same address, you will inevitably be spending from that same address as well.

When you receive to the same address, it ties together the addresses that are paying you.  If you are running a business, this could allow chain analysis to figure out who your customers are.  This might be bad for your business, and it might be bad for your customers.  Giving customers a fresh address for each transaction will give you and your customers the most privacy.

When you send from the same address, chain analysis can determine how you spend your money.  Also, consider addresses used for "change" outputs.  If you re-use the spending address as a change address, it makes it very easy to detect which output is the amount being spent, and which one is your change in the transaction.  This now makes your purchasing habits even more obvious to anyone who is watching.

For best practice, always use a new address for receiving bitcoin, and always use a new change address each time you spend it.


Why there are no OP_CODEs for querying the blockchain and retrieving data to the stack?

There are several reasons why I think having those would be a terrible idea.

Scalability. If scripts can access arbitrary pieces of the blockchain, fully validating nodes would require (fast!) access to the entire chain. This is currently not the case - fully validating nodes do not need the full chain, but only a small database of unspent transaction outputs (which is less than 3 GiB, and grows much slower).
Mempool management. If script validity can depend on the state of the blockchain, unconfirmed transactions can be invalidated by new blocks. It is possible to construct these hypothetical blockchain inspection opcodes so that new blocks never invalidate things (e.g. only have opcodes that fetch from a block, and if that block is not found, cause immediate script failure). However, even in that case validity may be affected by reorganizations. That would effectively mean that the entire mempool would need to be revalidated after every reorganization.
Fungibility. Related to the previous point, it is even the case that deeper-than-1 reorganizations may affect the  validity of already confirmed transactions. This means wallet software would need to be extra careful about accepting payments with transactions whose validity depends on blockchain state, as reorganizations have an increased chance of wiping them out, even when the sender is completely honest. This is not true for transactions right now - transactions removed during a reorg can always be re-accepted in new blocks in the new branch.


Why doesn't Butterfly Labs use their ASIC machines for their own mining process?

They are choosing a less risky option.  By selling now, they get the price of the machine no matter what happens to the BitCoin economy.   They are defining their core competency as being in the hardware business not the cryptocurrency business.

The same could be said for people selling pickaxes during the Gold Rush.  Why not use the pickaxes to mine gold?  They got the money for the pickaxes up front, then they were out of the picture.  They didn't have to choose a place to prospect and worry about how long the gold would last. They chose to be in the pickaxe business not the mining business.  Incidentally, during the Gold Rush it was these peripheral entrepreneurs that made much more than your typical gold miner.


You can run bitcoind on one machine, and communicate with another over your LAN using bitcoind's JSON-RPC API.

Once bitcoind is running just hit your host machine's local network IP on port 8332 with your API calls. You can find out your local network IP of your host machine by typing ipconfig in your command prompt.

You didn't mention how you were trying to communicate so let's say for example if you're using Python-BitcoinRPC

from bitcoinrpc.authproxy import AuthServiceProxy

access = ServiceProxy("http://USERNAME:PASSWORD@192.168.2.1:8332")
access.getinfo()

Make sure you update the ServicProxy() function with the host's local IP, and your username and password from your bitcoin.conf.


Is it true that Paypal banned Bitcoins, while Google Checkout did not (yet)?

I can't speak for why Google Checkout seems to have no problem, it may simply be that they are unaware of Bitcoin as of yet. Edit: A Google Checkout employee has replied that they explicitly allow virtual currencies - at least for the time being. PayPal, on the other hand explicitly bans "the sale of traveler’s checks or money orders, currency exchanges or check cashing" in section 3(f) their acceptable use policy.


How can Blackcoin get 1st confirmation in 10 seconds?

Blackcoin is a fork of Novacoin which is a fork of Peercoin which is a fork of Bitcoin.
In your own answer on how PoS mining functions is the answer to this question:

For Peercoin specifically, PoW and PoS blocks are independent. Just as you're betting your consumed electricity and CPU-time vs. the possible PoW-blok's reward, in the PoS blocks you're betting your coin-age: the amount oF PPC you own multiplied by the number of days they've sitted idly at your wallet. It must be a minimum of 30 and a maximum of 90 days for your coins to start generating tickets for the PoS raffle.
Should your ticket win, you earn 1% interest and lose all your coin-age, so your coins are, from the network POV, as though you had just received them. I.e. you'll need to wait another 30 days for them to be able to pay you interest again. Over time, though, you're just supposed to earn about 1% annually.

Honest nodes will only attempt to generate blocks if their stake is below the limit.  This cuts down on traffic immensely.  Looking out for violators cuts down on DoS as well which has only strangely been recently implemented in some coins.
I could find no major deviations from NovaCoin except for a decreased block spacing which may or may not apply to the PoS portion, faster coin maturity, and a few additions to net.cpp communications.
I have found no posts complaining about orphan blocks or any remarking that there are few except for this question.
I have found a few posts claiming that PoS will create extra traffic but nothing to substantiate it.
In short, BlackCoin appears to be the PoS Fastcoin, and throttled PoS will produce no more bandwidth consumption than PoW.
Throttling mechanisms
NXT
NXT is much more controlled than the other PoS coins:

What does this transparency mean? It means that anyone can predict (with very high probability) who and when will generate next block(s). And this gives us superior advantages:

Transactions can be sent directly to the miner who will mine the next block (if he decides to reveal his location on the Internet), thus saving traffic and coming much closer to VISA/MasterCard processing volumes.
Blocks can be generated in advance and sent to most of the miners before they become valid (timestamp validation), thus greatly reducing rate of orphaned blocks.
Due to ability to predict timestamps of future blocks (rate of blocks) it becomes possible to set appropriate fees to assure quick confirmations for important transactions (without paying too much for inclusion into a block).

NovaCoin
This will seem more familiar:

Novacoin uses the mixed Coin-Age/CoinDayWeight approach to provide proofs of the stake. The proof-of-stake difficulty is adjusted so as to limit the rate at which new blocks can be generated by the network to 10 minutes target spacing rate. Due to the very low probability of successful proof generation, this makes it unpredictable which computer in the network will be able to generate the next solution.
It's performed through scanning all available inputs in order to find lucky one that satisfies following condition:
SHA256(SHA256(KERNEL)) < CoinDayWeight *  NetworkTarget
Miner has to find a SHA256 hash that is under the target value.

In NovaCoin's case, it's still a little PoWish, but traffic is cut down because those who cannot mine because of insufficient stake either don't or are blacklisted for violating the rules.
Once a node has a conforming block, it stops working on that block index and moves to the next.  Eventually, no one is left working on the wrong chain.
BlackCoin
Based upon the above inspection of the code which is a fork of NovaCoin, BlackCoin works in an almost identical way except the spacing is tuned way down, and there are a few network enhancements to make the network a little stricter.
As a side note, based upon bitinfocharts's calculations, the 10 second advertisement is never met on average and is more like a lower bound; however, the intended spacing is one minute, so either the spacing formula is wrong, or PoS is actually so performant that it has busted the formula.
Ophan management
NXT is the extreme case.  My guess is that it rarely has any orphan blocks because the subsequent miner is selected, so an orphan is generated from a network malfunction rather than by design.
NovaCoin's first line of defense is PoS which limits the number of potential miners.  Since the longest conforming chain is accepted just as with PoW, hashpower dedicated to a losing chain is reduced for each now block index.


Why API of bitcoin exchanges use HMAC over HTTPS/SSL?

This is part of strategy known as "Defense in Depth."  Each layer does not presume that the layers before or after it are certain to be secure, and takes measures to ensure security and verify security.  HMAC signatures are one of those measures.

A HMAC signature preserves the integrity of the query so that a 0.1BTC purchase doesn't get changed to a 1.0BTC regardless of the security of the HTTPS transport.

The protections granted by SSL/HTTPS/TLS are not absolute and do have some clever attacks. In addition to some non-clever attacks such as the private key of the other side of the transaction being known to some third party (either by malice, hackers, or force of law).  The same goes for other parameters needed for the integrity of the communication.  There have been experimental Man in the Middle attacks where SSL transactions have been altered.  The math wasn't broken, but other clever configuration changes were done. So the weak link there is people.


activate Electrum command line interface (mac)

It might be in a subdirectory, so run:
find . -name electrum

Or if it is in ., it might not have execute permissions:
chmod +x electrum

Or it might be named something else:
find . -perm -100

Or you might not have . in your PATH: ./electrum help


For the block to be valid there must be a coinbase transaction but it is only checked that it spends at much the reward and the fees generated in the transactions included in the block.
So it is possible to generate a valid block with a coinbase transaction spending less than the available coin and thus destroying coins forever.

But you can always send the reward to a random address in the hope that no one will ever be able to find it's private key and that it does not belongs to anyone.


How do I find out what the latest protocol version is?

As of october 2013, the protocol version is 70001. It's not linked anymore to client versions (so it doesn't correspond to version 0.7.0.1 in particular; 70001 was introduced in 0.8.0), and is intended to go up in increments of one, as changes specified in BIPs are implemented.


How do you stake / forge in nxt / ardor using a public node without having to login publicly?

You should lease the balance of your main account to a second account which has only a small balance. Submit this leasing transaction on your local workstation.
See: https://nxtwiki.org/wiki/Account_Leasing

Now setup a public node and start forging using your second account.

By doing so, you never have to expose the passphrase of your main account to the public node, only the passphrase of your second account which has a small balance is exposed.


Effect of media coverage on the exchange rate?

There is no way to attribute Bitcoin price changes to news coverage with precision. Because you can never know the exact reason people are buying or selling.

The situation in Cyprus coincided with Bitcoin price skyrocketing to $245. There were lost of news covering both subjects at the same time but we don't know for sure.

It is logical though, to think that Bitcoin related news does have an impact on Bitcoin price. Especially high profile news and articles on high profile media. But, the content and the tone of the news/article will make a huge difference.

NYT article might push the prices up if it has a positive or even informative tone. It might also cause a drop in prices if it has a negative tone.

The larger the economy the harder it will be to manipulate the price.


Which wallet applications implement BIP38 - Private Key password encryption

The paper wallet generator from Bitaddress lets you encrypt with BIP38.


Is there a way to chain calls in Bitcoin core console?

You can use the $() syntax to execute another command and have it return its results:

validateaddress $(getaccountaddress "")

Here's the docs: http://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html#Command-Substitution


When running bitcoind from a systemd service, as in https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service, what is the role of the -daemon flag?

-daemon starts bitcoind in the background as a daemon. So if you run bitcoind -daemon in the terminal, the program will exit immediately but bitcoind is still running in the background. Without -daemon, you will see that bitcoind appears to hang in the terminal, but that just means it is running. If you stop the command, then bitcoind will stop as well.

  If one sets daemon=1 in bitcoin.conf, is it redundant to also use the -daemon flag when starting

Yes. This applies for all command line options.


Can an onlooker even learn anything interesting by de-anonymizing a transaction?

Knowing what you bought isn't the only information that you can get from a transaction. For example, you could possibly discern:

The transaction creator's salary. (If the inputs in a transaction came from your salary payment.) At the very least, you put a minimum on how much money they have.
The transaction creator's location. Many websites track where payments come from, geographically.
Where you buy things. If an onlooker has access to address information from one party, say Overstock for example, then they can see if you transact with them. And sometimes where you buy things is a strong indication of what you're buying.

So, knowing exactly what item you bought is not the only information that a user may be trying to keep private.


Reusing bitcoin hw wallet infrastructure as a PGP replacement?

While I'm not sure how far the development of hardware wallet support for Lightning is, there is an E2EE messaging protocol called "Sphinx chat" based on the Lightning Network. Some HWW also function as smart cards for PGP and general password manager. I'm not aware of a project that aims to provide an email encryption system.


Where is debug.log file in Bitcoin source code?

On Unix systems the debug.log file, as well as all other files created by the client (blockchain data, databases, etc) are placed by default in ~/.bitcoin; that is, a subdirectory of your home directory named .bitcoin.  If you have used -datadir to set a different data directory, debug.log will be placed there instead.

Note that the ls command normally will not show files or directories that start with ., so you won't see this if you just ls your home directory.  But you can still cd there, or use ls -a to see it.


The counter-parties are different.

In Ripple chain: BTC has an issuer, it can be Bitstamp, Snapswap, Gatehub or any other gateway. So if you send your BTC to Bitstamp, they will give you BTC (issued by Bitstamp), if you send BTC to GateHub, you will get BTC (issued by Gatehub).

If you have BTC (SnapSwap) and you want to withdraw BTC from your Bitstamp account, BTC must be exchanged from BTC Snapswap to BTC Bitstamp. Though it can be done automatically (path can be found)


Monitor a bunch of addresses for deposits

We use a third party service for this - i’d recommend https://blockchainwebhooks.com - You can set a webhook for each address, and when a new transaction enters a block with this address as an input or output the webhooks will trigger and send you the transaction details. Hope this helps!


How to safely spend from a compressed key offline?

Creating a manual offline transaction isn't super difficult, you just need to be careful and think about what you're doing.

Make sure you have the public bitcoin address and the private key before continuing.

Here's what I do (This assumes you are sending some BTC to one address, some back to yourself as change and some as a transaction fee)

Create a bootable Live linux CD
Download https://github.com/brainwallet/brainwallet.github.com/archive/master.zip and save it to a USB memory stick.
Open https://blockchain.info/unspent?address=1publicbitcoinaddress and pasted it into a text editor
This (from 3) is a list of all the unspent transactions for the bitcoin address, I like to manually pick the transactions I want to use as inputs.  eg. if I want to send 1 bitcoin, I might reference a 0.5 and an 0.6 BTC transaction rather than a 5BTC transaction.
Remember that the transactions are in 1/100,000,000ths of a bitcoin.
Remove the transactions you don't want to use as inputs, to do this, delete the transaction from the text editor including the "{" and the "},"
If you removed the last transaction in the list, check that there isn't a comma after the last transaction.
Save the contents of this text file to the USB stick with the brainwallet code.
Shut Down, disconnect your computer from the network, disconnect the hard drive(s) and boot into the live linux CD.
Open the brainwallet code in an internet browser
If your private key starts with a 5 (uncompressed) or an L (compressed), skip onto step 15.
You need to convert your private key to a format which starts with a 5 or an L.
If it's a 64 character hex code, type it into the "secret exponent" section of the generator tab and copy the private key.
If it's a brainwallet (passphrase), type your passphrase into the "passphrase" section of the generator tab and copy the private key
Go to the transactions tab
Type in the private key, click Cancel when asked to download the transaction history (it won't work as you're air gapped anyway).
Verify that the "Source address" is your bitcoin address
Click "Edit Inputs" and paste in the test of the unspent transactions.
The BTC box next to source address will update to show the value of the transactions you've selected - This is the number of bitcoins you will loose if you mess up transaction fees, so be careful.
Take the number of bitcoins from 19 and subtract your transaction fee (eg: 0.0003) - The result is the number of BTC you need to spend (including change).
Edit the Destination address to be the address you want to pay and set the amount.
Click the [+] button to add another destination address and enter your bitcoin address (for change) and set the amount to be the result from 20 minus the payment to your destination.
Now, on a calculator, add up the two payment amounts and add in your transaction fee.  This should perfectly match the amount in the reference transactions from step 19.
Scroll to the bottom and click Re-sign.  This signs the transaction.
Copy the contents of "Raw Transaction" to a text editor and save it to a USB stick
Shut down, reconnect hard drives, networks and boot up.

You now have a signed transaction which is not yet on the bitcoin network.  You now need to push it onto the bitcoin network.

We will do a final test of the transaction.

Visit https://blockchain.info/decode-tx (title should be Decode Raw Transaction)
Paste in the raw transaction and click "Submit Transaction"
Scroll to the bottom of the result and check the following:
vout_sz is the number of destination addresses (it does not include transaction fees)
hash is the transaction hash which will be searchable on blockchain.info, etc (once submitted)
vin_sz is the number of input transactions you referenced
out contains sections (per destination address), so check the "address" values are what you expected to pay coins to.
Also add up the "value" sections and divide them by 100,000,000 to get the total bitcoins to be sent (the difference between this and all the referenced inputs will be paid as mining fees)

If you are completely happy with the above checks, you can now broadcast the transaction.

Go to https://blockchain.info/pushtx (Title is Broadcast Transaction)
Paste in the raw transaction and click Submit.
It should say "Transaction accepted" if all was good.


What's the formula giving the % of succesfully maliciously messing the blockchain?

The formula is directly from the original paper by Satoshi Nakamoto. Check pages 6-8. The paper has C code to easily compute the values, and that page you linked to is just that C code converted to javascript.


Buying and selling Bitcoin on a hardware wallet and not sending to an exchange

Both are quite easily done. Selling and buying bitcoin, straight from a hardware wallet, can be done at the so called 'fiatgateways' such as www.satos.nl (dutch), I believe Changelly deals with the same strategy. You simply open an sellorder and simply send the amount you have set to sell to the walletadres (straight from your ledger) given by the fiatgateway. Buying is exactly the same at these fiatgateways, not an exchange which comes in between your coins. Your keys, your coins! :)


Do OP_RETURN messages persist on the blockchain?

Yes, the OP_RETURN output is part of the blockchain forever.

This is easy to show: the OP_RETURN and the message that follows is part of the transaction's output set, therefore changing the message changes the transaction ID, which in turn will change the hash of the block. If the message were to be deleted after a certain time, then new nodes on the network would fail to sync as they would not be able to validate that block. Therefore all full nodes will retain your message forever (as you mentioned, not in RAM, but buried deep in a file on your hard drive).

As for actually accessing the data, apart from the Blockchain.info API, I guess you could run a Toshi node locally (on your own hardware). Since it uses PostgreSQL, you can just query the blockchain as you would any database. This way, you don't depend on any external API that could turn evil or shut down. The hard drive requirements, however, are enormous (even worse than a Bitcoin Core full node).


Perhaps it's just an issue with the code block, but I only see one double quote. I assume that the other is before the entire code block, and is used to pass the program name.

The only other possible issues I can think of are to

make sure the directory specified in the datadir argument exists and is writable
make sure that the USB drive is mounted on H:\ on any other computers you use. Maybe it would be smarter to use a relative path instead.

Regarding portable Litecoin etc.
Any program is portable, as long as all of its dependencies can be met in a portable environment. Therefore, if you copy the entire C:\Program Files\Litecoin folder, you should, in theory, have a portable program, provided you copy your data directory also, or don't mind re-downloading the blockchain and don't mind losing all your Litecoins.


That would not work because the way the system is designed, accounts do not have a pile of coins to spend. Spendable coins exist in the form of transaction outputs that have not yet been used as the input of a subsequent transaction. To form a valid transaction, you must pull in coins from specific transaction outputs, not from specific accounts.

One could imagine a Bitcoin-like system where accounts have balances. In such a system, you could simply report the new balance of an account in any block that modified that account's balance. Then a transaction could pull in from accounts rather than specific transaction outputs. But that system would not be Bitcoin.

Essentially, Bitcoin was not designed around accounts. Accounts are just a convenient way for human beings using Bitcoin to think about the set of transaction outputs that can be claimed with the same key. (Or to form transactions that we know can only be claimed by a particular person.)


What are the drawbacks (if any) of encrypting your wallet with Bitcoin-Qt?

The benefits far outweigh the drawbacks here, but it's a worthy discussion nevertheless!

Starting with encryption in general: Encrypting the wallet.dat file (and backups etc) with a third-party encryption tool like truecrypt can be time-consuming and requires a lot of hoops to jump through every time you start the client.  But this might be more secure and allow you to put the whole client on an encrypted bootable usb stick for portability.

Using the qt's built-in encryption is a lot easier and other than what you mentioned the drawbacks are:
The possibility of losing the password.
The need to type the password upon starting the client.
Waiting for the wallet to encrypt/decrypt itself upon starting/stopping the client. The pain level here is pretty much entirely dependent on how fast your computer can get the job done.

Theoretical possibility of some bug in the encryption algorithm (or something simply goes very wrong during the process that corrupts it) that might render your wallet unusable if it's unable to be decrypted. I don't know if this has ever actually happened--just thinking out loud here.
But I suppose creating backups helps safeguard against such a problem. Although then you need to be sure to secure the backups -- which again creates a new series of todos and requires more time and care to maintain.  All of this stuff can be automated, however.

Don't seem to be any other potential drawbacks I can think of. Like I said, none of those issues are likely worth arguing against encryption.


Does mining activity only exist if there are bitcoin transactions?

This is not correct.  There is no requirement that a block contain any transactions at all (other than the single transaction indicating what address should be credited with the block reward, currently 25 BTC).  Miners can mine whether or not there are any transactions on the network for them to include.

See also What is the smallest block ever mined?


OP_RETURN custom message in testnet transaction

If you are developing in java using the bitcoinj library, they have a mechanism in place to do it without downloading the full block chain. They just download the header lightweight simplified payment verification (SPV) mode. Maybe you can try that.This is the link.

    SendRequest req;
    Transaction transaction = null;

   transaction = new Transaction(networkParameters);

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


gettransaction cannot get address where it send from

What you're looking at is a byproduct of the now-deprecated account system. The send/receive labels are applied according to the addresses that are part of your wallet.

If you want the sender/recipient details as a whole, pass the raw tx hex to decoderawtransaction. This will give you the inputs and outputs as they appear in the transaction, without the accounting filters on it.


It's definitely possible and you've done the nesting correctly.
Also, aside from being "useless and meaningless", it's more expensive since the scriptSig for redeeming outputs sent to this address will have to contain the 26 bytes of the redeemScript (the p2pkh script itself) and the push operation of it, along with the public key and signature.


Can you generate bitcoin addresses without storing a private key?

Yes

I love how all the upvoted answers talk about multisig or electrum but the one answer that mentions HD wallets is at -1.

HD wallets allow you to do this.

TL;DR Derivations per level on an HD wallet use 3 portions in 2 different hashes. 1 hash requires the parent public key and parent chain code (summed together creating the parent extended public key) and the other hash requires the parent private key and the left half of the output of the 1st hash.

Confused? The diagram at the bottom oughta help. At the end of the day, the private keys used to sign are derived from the chain of private keys all the way from the ECDSA key. If you only derive from the extended public key (public key + chain code) then you can derive as many addresses as your heart desires without giving up the private key. Minus the chain code and you're unable to generate many addresses (chain code gives up privacy AKA ability to derive many valid addresses)


What's the easiest way to gather/collect statistics on the bitcoin network?

BitcoinCharts doesn't show much from the bitcoin network.  The market data comes from the exchanges.

Bitcoin Charts shares freely their markets and trade history data:

http://bitcoincharts.com/about/markets-api/

The original source for the data is accessed from the exchanges themselves.  Most exchanges do share their data but the API methods are not standard nor consistent between exchanges.

As far as statistics on the blockchain data, the method will vary on which statistic you are trying to get at as some are stored (confirmed transactions), and others are not (e.g., memory pool contents, double spend transaction attempts, etc.)

If you like python, then Armory provides access to the blockchain.  See the Sample Armory code in the extras::

https://github.com/etotheipi/BitcoinArmory/tree/master/extras


Transacting bitcoins while there are no Accept rules in iptables

Telnet says 'Connection failed' which means others will not be able to connect to you. Your iptables is working as it should.

You may be mistaken thinking that bitcoin is working without ACCEPT rule because you are seeing outgoing connections. Probably 8.

Your netstat shows bitcoin is LISTENing but if iptables doesn't ACCEPT then it will never see any incoming connections.

Try netstat -na | grep 8333 and you will see only outgoing connections (source address: you).

To make your bitcoin node reachable to the outside world simply add a rule to accept 8333.

Note do NOT open 9333 ! It's meant for local use only and you might lose your bitcoins if people get access to it (in fact you're better off disabling it if you're not using it).


Why are median transaction fees so much higher now (in october 2017) than a year ago?

The relation between average transaction size and average transaction fee is not linear.

  Are people still falling for bad fee prediction algorithms?

There are no good prediction algorithms here. Think about 110 people waiting for  a bus, but the bus has only 100 seats.

  Is there an increased demand for quickly-confirming transactions?

I don't think so. Most of users do not care at all about transaction fees while their capital grows.


What is the point of "Bitcoin Lightning" and "Bitcoin Liquid"?

The lightning-network (LN) is an instant payment system built on top of Bitcoin. Its relationship to Bitcoin is akin to that of Visa card payments and the US banking system. The LN is a convenient and efficient way to pay directly from one user to another, especially for smaller amounts. Under the hood, the Lightning Network works by spanning payment channels between users and providing cryptographic guarantees to prevent abuse. Compared to on-chain payments, the LN trades off different privacy properties, lower transactions fees, and manifold increased transaction throughput with different security assumptions and the opportunity-cost of staging funds in payment channels.
The liquid sidechain is an alternative blockchain protocol whose native currency is "Liquid Bitcoin" (L-BTC). Users may convert Bitcoin to L-BTC 1:1 by paying into the custody of the federated peg or withdraw BTC by returning L-BTC back to the peg on Liquid. The Liquid sidechain operates with different consensus rules that give it better privacy (via confidential-transactions), greater throughput, and the ability to issue other assets. This comes at the cost of trusting that the majority of the Federation remains honest. Being closely related to Bitcoin, Liquid has its own Lightning Network.
LN and Liquid are sufficiently separate from Bitcoin's protocol development that they are not covered by the Bitcoin Improvement Proposal process even though LN is widely considered to be part of Bitcoin, while Liquid is more distinct. LN and Liquid solve different problems and are optional.


How to split fee between more than one miners?

A coinbase transaction is allowed to have as many outputs as the miner wishes so long as the total amount in those outputs does not exceed the block subsidy + transaction fees for that block.
Thus a miner could create a coinbase transaction which has more than one output which pays to himself and someone else. It doesn't matter who the recipients of the outputs are. In fact, it doesn't matter if the outputs have invalid scripts. There are no rules on what the output scripts must be.
The amounts of each output are decided by the miner creating the coinbase transaction. They can choose to set the amounts as they wish. The only rule is that the sum of all of the output amounts cannot be larger than the reward (subsidy + fees) for that block.

While each block ostensibly has one miner, miners will typically team up in mining pools. This is effectively multiple miners mining one block. In reality, it is a single miner in that pool who gets lucky and finds the valid block, but the pool as a whole shares the block reward.
Some pools will pay out all of their miners with the coinbase transaction by creating multiple outputs that pay each miner in the pool. The amounts are determined by whatever the pool operator and miners have agreed for the distribution of the block reward.


What would you call bitcoin wallet that give access to private keys unlike coinbase.com for example?

A Bitcoin Wallet is what I would call it. A wallet on a central service with no access to the private keys I would call a “custodial” wallet.


bitcoind and figuring out if it's still downloading blocks

There are several ways to estimate the number of blocks left to download. The easiest is likely that the client takes a look around at what its peers are saying their longest chain currently looks like. So if you connect to 8 peers in the network it is very unlikely that all of them are still catching up with the rest of the network and therefore it will tell you what the current state, or something close to it is.

Another way of estimating the number of blocks is by looking at the timestamp included in the block that you just downloaded. In expectation a block should arrive every 10 minutes. The timestamp in the block is not allowed to deviate from the actual time it was mined by more than a fixed number of minutes (otherwise it would be rejected when it is first seen). So if you subtract the time of the last block you downloaded from the current time and then divide by 10 minute intervals you get an estimate of the total number of blocks in the network.

Notice that the second method may not be incredibly precise, especially in times the commputational power in the network grows quickly, like it is currently doing, or is reduced quickly.

As for you checking how many blocks are left, it's a simple matter of going to a trusted block explorer and comparing your blockchain height with the height they display.


With the right technology, could the entire blockchain be rewritten?

In theory yes but the alien super computer would have to have hash power at an incredibly large multiple of the hash power pointed towards the Bitcoin blockchain today. According to blockchain.com today's network hash rate is around 130 million terahashes per second. If the alien super computer had more than this it could likely produce the next block with greater than 50 percent chance. However, to generate a new chain from genesis (over 10 years ago) it would need to create 10 years of blocks rather than just one. There are checkpoints in Bitcoin Core at historical intervals for when you are doing an initial block download but my understanding of these is that they don't overrule a new chain with a heavier accumulated proof of work even if it goes all the way back to genesis.


How do wallet-sites generate large numbers of Bitcoin addresses?

At Justcoin.com, we've used a few different methods over the years:

Generate addresses using bitcoind, now called bitcoin core, when we need them. To avoid key loss in the case of storage failure, we use a large key pool. The command is simply getnewaddress.
Hierarchical deterministic wallets are much better and we use these for an increasing number of things. When using these for hot wallets, we import new private keys into our hot wallet before its ever used. That way we can still spend its inputs from bitcoind.


Is there any way to "revoke" a bitcoin address?

Unfortunately, there is no way to do any such thing. Your only option is to manually inform any business partners that the address has fallen out of use.

As the only way to proof indubitably that you were the owner of said address would be to sign a message with the respective private key, I don't see how anyone could justifiably shut down an address.


From the Wiki on P2Pool:

  Each share contains a generation transaction that pays out to the previous n shares, where n is the number of shares whose total work is equal to 3 times the average work required to solve a block, or 17280, whichever is smaller. Payouts are weighted based on the amount of work each share took to solve - proportional to the p2pool difficulty at that time.

So it works like a PPLNS pool, which is not vulnerable to pool hopping.


Without changing hardware, GPU mining is almost certainly the "best" option. For BitCoin ASIC is the fastest, anything else is a waste of electricity at this point. For LiteCoin GPU is the fastest, and CPUs are around breakeven (electricity usage vs LiteCoin value).

Keep in mind that LiteCoin is inherently about 1000x slower than BitCoin mining. Getting 32kh/s out of a laptop GPU is doing reasonably well (my work laptop does the same). That same GPU can get almost 30Mhps mining BitCoin.


How do I import a private key into Bitcoin-Core?

Run Bitcoin-Core
Select Help (to the right of Settings)
Select Debug Window
Select Console
If you encrypted your wallet, unlock it by entering walletpassphrase "YourLongPassphrase" 600 next to the > input box
Next to the > input box type importprivkey <bitcoinprivkey> (Note that the private key must not have spaces, remove them if they are included in your backup)

Example: importprivkey 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS


Correlating BTC price changes with recent use in commerce

That's the thing about a pseudonymous digital currency -- there's little information that can be gleamed from the blockchain data.

There are some metrics reported in aggregate by the payment processors and others.  For instance, last month BitPay shared during a discussion that they had surpassed 10,000 transactions since their launch over a year earlier.  They didn't provide the number of bitcoins as well or give the average amount per-transaction.  They are probably the largest payment processor but even that amount is pretty insignificant.

This data will probably be most accurately obtained through user surveys and from there extrapolate.


Congratulations! Safely exit the software, create a safe backup copy (check that everything is copied correctly) and upgrade to the newest official version for your operating system. You will need approximately 150GB of storage in total for the full blockchain once it finishes catching up, including what you have already, or you can set -prune= mode.


What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations?

Rusty Russell discussed lnprototest (repo link) during the August 2020 Sydney Socratic Seminar.
What is lnprototest exactly?

It is a pure Python3 test system and some packages to interface with
the spec that currently live in the c-lightning repository. You run
lnprototest and it has these scripts that go “I will send this” and
you will send back this. It can keep state and does some quite
sophisticated things. It has a whole heap of scaffolding to understand
commitment transactions, anchor outputs and a whole heap of other
things. Then you write these scripts that say “If I send this it
should send this” or “If I send this instead…”. You create this DAG, a
graph of possible things that could happen and it runs through all of
them and checks that happens.

Can it be used to test an individual Lightning implementation or just interoperability between implementations?

It is really good for protocol development too not just testing
existing stuff. When you want to modify the spec you can write that
half and run it against your own node.

In addition there is an open PR at the time of writing in the c-lightning repo from Lisa Neigut to run lnprototest with every c-lightning CI build.
What does an implementation need to do to use lnprototest?

They need their own runner. Take the c-lightning one, it fires up a
bitcoind in regtest mode and fires up a c-lightning node. It is kind
of dumb. You have to have c-lightning run in developer mode because it
uses some weird hacks. We are slowly pulling those out. Ideally you’d
be able to run it in any off the shelf implementation. You have to get
your hands dirty a bit and write some Python for your implementation,
that is true.


new Bitcoin Core (0.13.2) as Cold Storage Wallet?

Bitcoin Core does not officially support cold storage. That doesn't mean it can't be used for it, but if you don't know what you're doing you are likely to shoot yourself in the foot.