Does the creator of BitCoin hold a 'master' private key?

No one holds a key that gives them special control of the blockchain.

The closest thing to a "master key" was the alerts system, which allowed signed messages to be sent to every client, for example, to tell users to update their client in response to a security issue.  This feature was for alerts only and can in no way affect the blockchain, transactions, or user balances.  This key was possessed by Satoshi, Gavin Andresen, and theymos.

Update: The alerts system was retired in the summer of 2018, due to risk of DOS attack vectors (full nodes could be DOS attacked by carefully crafted alert messages), and increasingly widespread knowledge of the alert keys.


Deterministic keys with one-way operation

If you use a one-way hash function (ie like hashing ECDSA public key with SHA256/RIPEMD160 into a hex public key) then how can you employ hierarchical deterministic functioning?

You can't. The whole point here is that if you lose your private key for a grandchild public key you can get it back again with the parent key. A two-way hashing function obfuscating the data would work but that's basically what's already in place.


Understanding bitcoin-cli commands walletlock and walletpassphrase

No, use encryptwallet to encrypt the wallet, read this document:

Examples:

Encrypt your wallet

  bitcoin-cli encryptwallet "my pass phrase"

Now set the passphrase to use the wallet, such as for signing or sending bitcoin

  bitcoin-cli walletpassphrase "my pass phrase"

Now we can do something like sign

  bitcoin-cli signmessage "address" "test message"

Now lock the wallet again by removing the passphrase

  bitcoin-cli walletlock


If Bitcoin addresses are a single-use token, how several transactions belong to a single address? (Edited)

A Bitcoin address is not necessarily a single-use token. Addresses can absolutely be reused. However, it's good practice to use a new address for each transaction, for reasons of privacy and security.

The privacy element was outlined in the Bitcoin whitepaper (section 10):

  As an additional firewall, a new key pair should be used for each transaction to keep them from   being   linked   to   a   common   owner.

The security benefit is that a Bitcoin address is a hash of a public key or a script, which means that if the elliptic curve cryptography used in Bitcoin is broken (allowing signatures to be generated for known public keys), we still have the hashing algorithms (SHA-256 and RIPEMD-160) helping to obscure the script or public key until a transaction is published. To spend the coins associated with an address, one must publish the original public key or script, but if you use a new address each time, the new address will have a corresponding public key or script that has not been pulished. Thus it would not be vulnerable to such attacks until you go to spend.

I would interpret the statement "A Bitcoin address is a single-use token." to say that a Bitcoin address may be used as a single-use token, and you should not assume that if someone once gave you an address, that will always be the address to pay to them. You should expect that there might be a different address each time.

Edit: Yes, reusing the same address provides a lot of convenience because you don't have to keep track of many different keypairs, and it makes things easier/cleaner if you can send your change back to the same address instead of a new one. (Edit: Note, as chytrik points out, good wallet software will handle key generation and storage for you, so this should not be an actual concern unless you are making your own transactions by hand, writing your own software, etc.) When you use a new address each time, you may accumulate lots of small amounts of bitcoin at different addresses that you can't recombine without associating those addresses. (Edit: I feel that this comment is worth reading and thinking about, BUT as chytrik pointed out, the privacy risk of reusing addresses is much worse than the risk from recombining UTXOs. I sort of intended this to say something like, "You're probably going to be losing some anonymity either way, so take that into consideration along with convenience when threat modeling and choosing a method." But I wasn't very clear about the level of risk in either situation.) It's definitely a convenience factor.

There are also obvious advantages to having a persistent address. It's much easier to use if you aren't specifically requesting payment from someone. For example, if you want to list an address on your website for people to donate to you, it wouldn't be very useful to have that address constantly changing. Some people also generate "vanity addresses" (see e.g., Vanitygen) which may have taken a lot of work to create, and they may not want that work to go to waste by switching to a new address.


What was the goal of creating the feature of immature coins?

Immature coins are coins that were created in a block reward and haven't aged sufficiently, yet. The problem with block rewards is that they could still disappear again, if the generating block ends up being invalidated by a competing block chain.

In order to minimize the confusion and subsequent problems from someone spending coins that end up disappearing later again, block rewards are considered immature until another 100 blocks descend from the generating block. After this approximately 16 hours and 40 minutes, the coins are mature and considered safe to be spent.

On the other hand, regular transactions that were confirmed in a block that got invalidated by a longer competing chain would just be picked up by another block. The difference here is that a regular transaction is based on prior knowledge of the coins, even if it is through a chain of transactions, while newly created coins would not be there to fund a transaction.


In Electrum, is it possible to restore a wallet from seed, from command line?

Yes, you can do

electrum restore <seed>

You can check what commands are available by doing

electrum -h

and specific help for a command by doing

electrum <cmd> -h


If you want to save your keys as a proper wallet.dat file, you would need to comply with its format.

If you want to store your keys for some other purposes, you only need to save the private keys (public ones can be recreated, you can check out my testing suite for that). You can save them in any format, but Wallet Import Format might be the best choice - it is compact and includes a checksum.


connect my wallet to a s9 machine for mining ... is it safe

No. You will lose all your money. He will use your fear of losing your money to trick you into giving him more money (e.g. private-key release fees) and more money and more money until you have nothing left to give. Then he will tell you to borrow more money from your family, from the bank, from loan sharks ...

  if it's scam

It is a scam

  what is the real way to do it

Spend a long time (at least an hour a day for a couple of weeks) researching Bitcoin and mining. Don't proceed until you understand private-keys, public-keys, seed-phrases, recovery, different types of wallet, watch-only wallets, principles of mining and so on.

Read the answers to all these questions to innoculate yourself against scammers

Then buy a hardware wallet or download a good stand-alone wallet.

Buy a small amount of Bitcoin from a well-known exchange

Practice recovery of your wallet as if your hardware-wallet or computer is stolen. Don't proceed until you have proven you can recover full control of your bitcoin only using the recovery phrase without touching your existing wallet hardware or computer or  mobile-phone.

Write down instructions for your family to recover your money if anything happens to you. Make them follow your written instructions without any help from you and see if they really can. If necessary create a new wallet with new keys and transfer all your Bitcoin to the new wallet. Update your saved recovery phrase etc.

Never share your wallet-password, recovery phrase or private-key with anyone (unless they are someone you'd be happy for them to walk away with everything you own tomorrow). Never let anyone else log in or remotely access your computer or your wallet to help you, even if they seem to be the most honest person in the world, especially if they suggest you can secure your wallet afterwards by changing a password.

After becoming comfortable buying and using bitcoin for several months, re-think about mining, if you have a few thousand dollars you can afford to lose totally, you are probably ready to consider whether the process is for you.

  is mining profitable ?

Not unless you already have several thousand dollars to invest in ASIC mining equipment and a good source of cheap electricity in a building with very good air-conditioning and where noise does not matter. This isn't suitable for people new to Bitcoin. You must be prepared to lose that money without hardship.


Withdraw and wallet lock race conditions?

If the wallet unlock is global (that is, it affects a wallet that exists outside the method, which it clearly does), then yes, that is a race condition. Generally, this is handled with mutexes. A mutex provides "mutual exclusion", that is, only one thread of execution can enter an area protected with the mutex.

From a software design point of view, forcing everything that calls the send_to_address method to do so in a mutex is very bad design. It seems you should make a wallet class that encapsulates all the functionality you need to perform on wallets that manages the locking/unlocking of the wallet inside the class.


Bitcoin uses TCP which would put it at layer 7 of that description, but there's nothing particular that requires it. The transport layer for data is orthogonal to the system, it could alternatively use raw frames, carrier pigeons, or have the packets inked onto the heads of slaves. Systems exist which allow for data to be transfered through a TV satellite relay for example, which skips the networking layers entirely.


Is it always necessary to be in the pool with the most miners joining to have the most profitable mining pool?

This isn't correct.  Your reward is reduced (in the long run) by the same amount whenever a new miner joins, regardless of whether they choose your pool or a different one.

If they choose your pool, it's true that your share of the pool decreases, and the pool's share of the total rewards increases, but these changes don't completely cancel out.  The net effect is a decrease in your reward.

Let's try an example with small numbers.  Suppose there are 10 miners in the world, all having equal hash power.  6 of them, including you, belong to Pool A, and the other 4 belong to Pool B.  So Pool A collects 6/10 of all rewards, and you get 1/6 of those, so you are getting 1/10 of all rewards.

Now suppose a new miner joins Pool A.  Pool A will now get 7/11 of all rewards, and you get 1/7 of those, so you are now getting 1/11 of all rewards - less than before.  If you work out the numbers, the pool's fraction of the total got multiplied by 1.06, and your fraction of the pool got divided by 1.16.

If the new miner joins Pool B instead, Pool A now gets 6/11 of all rewards, and you get 1/6 of those, so your share of the total is again 1/11.

As such, ignoring differences in pool administration fees and such, you get rewarded the same whether you are in a large pool or a small one.  The only difference is that in a large pool, your rewards will be paid out more steadily as frequent small payments, while in a small pool, you will tend to see infrequent large payments instead.


Blockchain is losing me money with every transfer

Have you tried looking up your transaction on a blockchain explorer like https://www.blockchain.com/explorer ? How much did you pay in mining fees as a proportion of the entire transaction amount?


Add some nodes to help speed it up if it freezes here are a few.

First open bitcoin.conf with notepad or notepad++

Type "addnode " and the ip

Example addnode=66.228.49.201

You can add as many as you feel you will need save it then restart your client and you should be good to go.


Any data immediately written to the blockchain when opening a lightning channel?

When opening a lightning channel, is there any data immediately written to the blockchain? I mean, the channel is not considered opened until the data is on the blockchain. The data may be the funding transaction, or may be some sort of 2-to-2 multisignature script, I don't know.

The channel has a funding transaction which must be included in the blockchain before the channel is considered to be opened. Of course, you can use it before it is confirmed, but there is no guarantee of anything that happens in the channel.

  If the answer is yes, then... is it possible that an opened channel becomes invalid due to a blockchain fork, i.e., the blockchain where the data reside being replaced by a longer,conflicting blockchain?

Yes, that is possible. However it is extremely unlikely. Like with other transactions, nodes won't consider the funding transaction to actually be complete until it has several confirmations (usually 6). The probability that a fork of length 6 occurs is extremely low. Note that the risk of a fork here is the same as a fork effecting your normal Bitcoin transactions.

  If the answer is further yes, then, is it possible that some sort of double-spending attacks can be launched on the lightning network?

The same double spending attacks and risks that you can do to a normal Bitcoin transaction also effect the Lightning Network funding transactions because it really is just a normal Bitcoin transaction.


Cannot remote to regtest node with curl cmd - Empty reply from server

You are defining RPC port 18443 and attempting to connect to 18444 in your example.
There's no situation where you should attempt to rpcallowip to anything but localhost, don't get used to doing that or making systems which require it. There is no situation in which this is safe to do, even regtest can cause damage to your system.


How much should I spend when I send BitCoin to other people using electrum wallet?

Does this make sense to you?

---------|-------------------

low/slow........high/fast

The further left you move the slider the lower the fee you pay and the longer it'll take to confirm. The further to the right you move the slider the higher the fee and the faster it'll confirm. If you still don't get it go to tools > preferences > fees tab and check edit fees manually. Now on the send tab you'll be able to see the whole calculation including the absolute amount of fees you will pay for a particular transaction.


How long does it take for a SPV to intermittently sync (order of magnitude)?

SPV syncing depends entirely on the SPV servers that you're connected to. They may not have that much bandwidth and you might have a very slow sync, for example.

That said, you only need 80 byte headers per block you haven't seen (about 1000 blocks per week, or 80Kb for every week that your device is offline) and about 500-1000 bytes per UTXO you have (obviously this is highly dependent on how much new UTXOs you've received).

So assuming about 5 tx's per week and 1000 blocks per week, it's less than 100kb download to catch up once a week, which by any measure should be very quick. On most connections it shouldn't take more than 10 seconds.


Is there a Wiki comparing different wallets?

To my knowledge, there is no such list, although many comparisons between a subset of wallets and services are available.

Although one could conceivably build such a list, perhaps on the Bitcoin wiki, there would be limits to its benefits for actual wallets.

Wallets vs. Wallet services vs. Custodians vs. Exchanges

Services such as Robinhood do not qualify as a wallet, since there is no way to send or receive bitcoin. These are simply exchanges, and you usually have no way to verifying that the bitcoin you supposedly own are actually there, or to access them.

You also have custodial services, most of which offer exchange services as well, such as Coinbase, Bitfinex, and other popular exchanges. Via these, you can send, receive, and trade bitcoin. However, you are still not in control of your keys, and are subject to a significant counterparty risk.

You then have wallet services, such as Bitpay and BitGo. These services provide mobile and desktop apps, and also allow you to maintain control of your seed words, which lead to your private keys. Here, you are still implicitly trusting that their apps will not steal your BTC, but are free to move your keys to another application if you wish, or if the service shuts down.

Lastly, you have programs that are not centralized, and allow you to maintain full control of you coins, such as Bitcoin Core and Electrum. Here, there is no single point of failure, the code is open source, verifiable, and can be compiled directly by you. Backend services are also distributed and redundant, and your keys never leave your machine. This is the only stage I would consider to be a true wallet.

At this stage, any wallet would achieve feature parity fairly quickly, since the underlying transaction mechanism of the blockchain is the same for everyone. As such, a comparison would be limited to the code/ease of use/team, and other such factors.

At higher levels where custodian and exchange services are involved, a comparison makes more sense since features diverge a fair bit. However, this is hard to put into a wiki, since it is not often black and white - for instance, some exchanges only offer certain features to residents/citizens of specific jurisdictions for legal reasons.

Moreover, such a list would also be more prone to defamation and spam attacks with competitors/bandwagons trying to artificially make someone look good or bad, which would be hard to moderate quickly and effectively - On a popular list like this, listing a scammy wallet for even a short while could easily cause someone to lose a lot of money.


How do I make my first purchase of cryptocurrency?

Download and install Bitcoin Core: https://bitcoin.org/en/bitcoin-core/
Create a wallet and receiving address there (it's better to use encryption when creating wallet).
Buy bitcoin on any available BTC exchange (Coinbase, Binance, etc.).

I'd like to keep my own wallet and not use a Coinbase type of service.

You can keep your wallet on your own, but to buy BTC, you will need to use service or find a person who wants to sell you ones.


Bitcoin will store a block on disk as soon as it has verified its proof-of-work.

Blocks are stored append-only in the block files, and never deleted or overwritten. You cannot judge from the block files which are considered valid, or which are considered the currently best chain - that information is kept in the block index database.


Has there been a big uptake of merchants accepting Bitcoin Cash?

Looking at the community created webpage: https://acceptbitcoin.cash/

If you are looking at the percentage of merchants who previously accepted Bitcoin, that now also accept Bitcoin Cash, there is a statement that says that 131 out of 1053 websites listed support Bitcoin Cash.


Testnet coins are an interesting thing:

They are useful because they have no value
If they had value, they would be useless

Remember that the testnet is there to test out your code, and ensure that everything runs smoothly before you deploy that code to an environment which is holding actual value. That way, if something goes wrong, you haven't lost anything of value.
So you certainly could sell someone testnet coins, but I'm not sure why anyone would pay you for them.


How to get number of transaction confirmation from bitcoind?

Use bitcoin-cli getrawtransaction "txID" 1

The output will include a "confirmations" field, telling you how many confirmations the transaction currently has.

Note that to get this information for transactions not related to your wallet, you will need to set txindex=1 when syncing your your node, or provide bitcoin-cli with the blockhash of the block the transaction was included in. Here is some more info about this, copied from the output of bitcoin-cli help getrawtransaction, running v0.17.0.1:

NOTE: By default this function only works for mempool transactions. If the -txindex option is
enabled, it also works for blockchain transactions. If the block which contains the transaction
is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is
provided, only that block will be searched and if the transaction is in the mempool or other
blocks, or if this node does not have the given block available, the transaction will not be found.


Is blockchain really secure to store sensitive data?

some developers claim that they are gonna replace email with blockchain technology.

Blockchain is just a popular marketing buzzword. Its use is largely meaningless. You can safely ignore the marketing output of any person or business that are overly liberal with their use of buzzwords.

Wherever you see "blockchain" just substitute any of "nanotech", "quantum", "solid-state", "transistorised" or "aviation-grade" and see if it materially affects what is being said.

  what guarantee they can give us that these data never gonna get decrypted 50 years from now

Generally speaking, you wouldn't choose to store data on the Bitcoin blockchain - that would be too expensive. What you might store is a hash of your data. If done correctly, that proves that your data existed at a point in time. Anyone who subsequently knows the private-keys involved can prove that they currently know the private key that was previously used. I don't think there is anything else that can be reasonably deduced or proven.

This relies on being able to check that a reasonably large number of accessible and diverse copies of the blockchain, which contain the hash, can be fully verified and agree with one another.

In this case there is no possibility† of discovering the original data from the hash. Assuming you choose your hashing algorithm well and assuming that quantum computers have not destroyed all security on the planet and plunged the world into a post-apocalyptic chaos.

† speaking in general terms. That is - the probability is perhaps not too dissimilar to that of your constituent atoms spontaneously rearranging themselves into the form of a bowl of petunias


How to recover private key from 12-word passphrase?

There is no one private key associated with the 12 word mnemonic that you posses. Consider the seed phrase to be like a keychain, that holds multiple keys. You would need to import the 12 word mnemonic you possess into a wallet software in order to generate the private keys. The wallet software will then scan the Bitcoin blockchain in order to see the funds that those keys control. A use of a hardware wallet is most recommended in order to ensure the privacy of these keys.

Care should however, to use the same derivation path for the keys that was used when you generated the addresses to receive the funds. This can be looked up based on what wallet software you used while generating the 12 word mnemonic. There are multiple derivation paths that wallets use. Some use BIP 44 while others use BIP 49 or even BIP 84.


There is no easy way to export those keys but its possible. Here's a detailed How-To. Please note that you need to root your phone to get access to your wallet file.

Edit:
I just found another interessting and easier method here, but I didn't tested this one.

Edit 2:

  I would like to be able to manage my funds using my mobile or my desktop - both looking at the same wallet.

If you dont mind using a new private key you could import a private key from your bitcoin desktop wallet, sending your bitcoins to this address for further usage.


Could you provide an example of a SegWit transaction?

Here is a non-coinbase segwit transaction https://www.smartbit.com.au/tx/c586389e5e4b3acb9d6c8be1c19ae8ab2795397633176f5a6442a261bbdefc3a


Review BIP32:

The fact that they are equivalent is what makes non-hardened keys
useful (one can derive child public keys of a given parent key without
knowing any private key), and also what distinguishes them from
hardened keys. The reason for not always using non-hardened keys
(which are more useful) is security; see further for more information.

That little apostrophe ' means that branch of the key derivation tree is "hardened" -- and THAT means that you must have the private key to derive its child keys.
So if you have the PRIVATE key for m/84'/0'/0' you can generate child keys for example m/84'/0'/0'/0 or m/84'/0'/0'/0' (these are two different keys, one is hardened the other is not).
If you were to derive the non-hardened key at m/84'/0'/0'/0 then you could use an xpub FROM THIS KEY (not any of the parent keys) to derive public child keys, without any private keys. Examples would be m/84'/0'/0'/0/0 and m/84'/0'/0'/0/1


Why doesn't my balance bought on Coinbase show up on Blockchain.info?

Yes this is expected behavior, Coinbase is not a full wallet and that means the funds under addresses it shows you are completely irrelevant. When you withdraw to an address, Coinbase will send the amount specified.


Pycoin: How to sign SegWit transaction via Pycoin?

For compatible segwit transactions, it is basically using p2sh transactions.
For pycoin specifically, you need to provide p2sh_lookup dict when sign the p2sh transaction.
I have a sample for bitcoin offline/paper transaction if you would like to check, the method spend_sh_fund may suit your need.


How does a filterload client that recieves an incoming transaction retrieve the transaction it's spending?

You don't! The SPV client security model depends on miner confirmations for security. From the Thin Client Security page of the Bitcoin Wiki:

  As Satoshi writes, "[the thin client] can't check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it." If we take "X" to be the "number of blocks added after it", then SPV essentially trusts that a transaction X blocks deep will be costly to forge.

So, surprisingly, SPV clients don't even need to run an interpreter for scripts. They just see transactions addressed to them and wait to see if they get confirmed.


This is either a scam or it's not. It's very easy to tell which:

Case 1: There are no actual signals that make a profit. In this case, it's a scam. Case closed.

Case 2: There are actual signals that make a profit. In this case, who cares whether it's a shady exchange or not? You have the signals -- trade larger amounts on a legitimate exchange, never try to withdraw from the shady exchange, and outsmart the scammers. You still make money.

But I'll bet dollars to donuts it's case 1. That means there are no signals that makes a profit. That means there is no profit. That means there's nothing to withdraw. The means you're wasting your time trying to withdraw funds that don't exist.

It's your exchange account, right? That means you can see what trades it's making. You can check on other charts whether those trades will or won't make a profit. Either you have profitable signals or you don't. In the former case, you're going to make money. In the latter, you can't possibly make money. You have everything you need to tell with.

But we all know which one it is. The signals don't exist.


Would it be possible to create a soft-fork for reducing miner reward?

Yes, it is possible. The rule regarding the coinbase reward is that a miner cannot take more than the block subsidy plus the transaction fees in the block. This means that a miner can opt to take less than the full reward that they are entitled to. This has happened before in Bitcoin a few times. The coins that they did not collect are gone forever.

So, you can use this rule to your advantage if you want to decrease the block subsidy via a soft fork. In your soft fork, you simply create a new rule which results in the coinbase reward being less than the current coinbase reward (e.g. the block subsidy is smaller). Because of the rule mentioned earlier, non-upgraded nodes will still accept blocks that have these coinbase transactions with a smaller coinbase reward. Thus this is a soft fork because the new rule is backwards compatible.


I think you can add ' around your JSON, to make :.from('{"address":"..."}') to create a string with your json inside


Derived address different from CLI to NodeJS

bitcoin-cli is generating a P2WPKH address (bc1...), but then on the user side you are generating a P2PKH address (1....).

You may also need to check to ensure the same address derivation path is being used (Bitcoin-core uses hardened derivation).

For more info on address encodings see:

What is P2PK, P2PKH, P2SH, P2WPKH - ELI5

What is the size of different Bitcoin transaction types?


Could the EC2 infrastructure be used to efficiently launch a 51% attack?

An NVIDIA Tesla “Fermi” M2050 is not as fast as an ATI 5870. According to the wiki, the NVIDIA card makes around 70Mh/s and the 5870 makes around 400Mh/s.

If they were similar and if Amazon had that amount of cards available for rent, then it would be possible. Just don't forget that you would be paying $65415 per hour to sustain an attack that will not give you that much power over the network. See this question for an explanation of what the attacker could do.


Do physical bitcoins or altcoins actually carry value?

The place you bought from, ShibeMint.com, sells nothing more than keepsake tokens.  They are made of copper or silver and are worth only what someone else is willing to pay for them.  They will not include a private key that allows you to then spend Dogecoin somewhere else. These are simply mementos and not a crypto currency.

Quote ShibeMint.com, these physical dogecoins are for

  displaying additional shibe pride, starting an exciting conversation, more accurate decision making, extra inspiration, a lovely gift for a dogecoin enthusiast, attracting quality shibemates

There is nothing to stop another website from creating and selling their own version of Dogecoins.  In fact, here's another that does.

You can purchase physical bitcoins or altcoins with or without a private key that would allow you to spend that currency.  Here is a full list of physical crypto coins.  Without the private key, the crypto coin is worth the metal/plastic/material from which it is minted.

That said, it will still carry the value that someone else is willing to purchase it for.


Are decentralized currencies absolutely critical

Even in the case where a centralized body is perfectly benevolent, and always acts in the citizen/user's best interest, the fact remains that mere existence of a position of power is a liability to the network. What happens if a bad actor gets access somehow? It doesn't matter how well-intentioned the admin is, if an unauthorized individual gets access to the controls.

Since the existence of a centralized power is an existential risk to any network, in the real world we see societies create rules and regulations around such institutions (such as the regulations surrounding central banks). In theory, the regulations help ensure that those in power can't just manipulate the system for their own gain: for example some big bank CEOs can't just create a few million dollars in their own bank account's without anyone noticing. We can have a separate debate on the effectiveness of this system, but at minimum this is how it is intended to work.

Bitcoin is an invention that allows for the creation of a financial network that doesn't have a centralized source of power, and thus does not need the same sort of oversight in order to be trusted. Instead the user can simply run the code, and understand that they are connected to the network, that the code's rules will be followed, and that the network's code is very difficult to change. Through this, the user can be sure that the rules that govern their value will not be manipulated, without requiring the oversight of some centralized position. Instead rules changes will only come through the nearly unanimous support of the network's users, a process which helps eliminate situations where individuals can push unwanted or unjust unjust changes on others.

If there is a centralized admin in a system of value, then users should demand some sort of auditing/oversight/regulation to ensure that they are not taken advantage of. Otherwise, the user must place great trust in the admin, and in the security of the admin's powers.


Just shut down the bitcoin app on the old server, copy the wallet.dat file to the new server, then start the bitcoin app on the new server. Don't remove anything from the old installation until you 100% confirm that the new installation works.


Unable to sendcoins using bitgo express apis

sendcoins is an endpoint that is only available on BitGo Express. BitGo Express is a proxy that runs on your own infrastructure, typically on port 3080.

Instead of calling test.bitgo.com, if you're running BitGo Express locally, try calling localhost:3080.


These charts show the approximate network hash rate on the left axis:
  http://bitcoin.sipa.be/

We know the network adjusts for 25 new bitcoins per 10 minutes.

Together this provides enough info to give an approximate answer to your question:

hashes per bitcoin
= (network hash rate) / (25 BTC per 10 minutes)
= (180 * Th / s) / (25 * BTC / (600 * s) )
= 180 * 600 / 25 * Th / s / BTC * s
= 2,700 Th / BTC
= 2,700,000,000,000,000 h/BTC


For a non-technical person, how do I generate a ECDSA key pair easily?

Install OpenSSL. When the executable in your path, enter this command to generate a private key:

openssl ecparam -genkey -name secp256k1 -noout -out myprivatekey.pem

To create the corresponding public key, do this:

openssl ec -in myprivatekey.pem -pubout -out mypubkey.pem

This will give you both keys in PEM format. I'm not sure what format the web page wants, but it shouldn't be difficult to convert. You can use variants of the last command to output other formats. Remove -pubout if you want the private key, leave it if you want the public key. And you can use -outform DER to get DER format. You can use -text to get hexadecimal.

Do not give any form of your private key to anyone else.


Can I replace the fans in a Zeus Hurricane x3?

You're looking for a 120mm x 120mm x 38mm fan which can produce at least 120 CFM of airflow and runs on DC 12V. (Source.)

According to a random guy on the internet, the stock fans produce about 60-70dB of noise.

There are various fans you can buy, but they're all pretty similar in terms of noise.

http://www.newegg.com/Product/Product.aspx?Item=N82E16835213006

You can also buy one that has less airflow, but is much quieter.

http://www.newegg.com/Product/Product.aspx?Item=N82E16835132022

...or, if you've ever looked at your Hurricane and decided you wanted twice as much airflow, you could install this:

http://www.newegg.com/Product/Product.aspx?Item=N82E16835706015

(The product reviews even use the phrase "jet engine.")

This will void your warranty. (Assuming you have one.)


Are there studies about a Bitcoin-like economy with inflation?

The alternative blockchain Freicoin is a solution to the "deflation-causes-hoarding-problem" (assuming that you think this is a genuine problem) using demurrage rather than inflation.

As for your proposal of making the rate of money growth linear and higher than the expected rate of InflationCoin economy growth, that would accomplish the same goal: punish those who put their savings in coin rather than something productive like stocks and bonds.

According to Gresham's Law, Freicoin and InflationCoin should flourish as a medium of exchange and Bitcoin velocity should collapse as people tuck those relatively scarce coins away in wallets like they're bars of gold.

Of course, this isn't in fact happening. Maybe that's because of network effects (who accepts payment in coin of alternative block chains?) Or maybe the deflation theory is wrong.


Can you create a valid p2sh transaction with the redeem script in the scriptsig alone?

No, the BIP16 rules apply. They require that not only you provide a redeemscript whose hash matches that in the output (the address), but also that valid inputs for that script are provided (which will typically require at least valid signatures).


Which precautions should a newbie like me do when exporting keys from an Bitcoin Core wallet to an Electrum wallet

Before you begin any of this, I recommend you backup your .dat files just in case something goes wrong.

Your wallet.dat file is located at %APPDATA%\Bitcoin\wallet.dat. Make a copy somewhere safe until this operation is complete.

You're going to want to export your private keys from Bitcoin QT and sweep your private keys in Electrum and you should be golden!

The process of dumping your private keys require you open a console (Bitcoin QT -> help -> debug window -> console), unlock your wallet (walletpassphrase "your walletpassphrase here" 600), and type the command dumpprivkey [your Bitcoin address here]. You can then lock your wallet with walletlock.

With your private keys saved now, you can sweep them with Electrum by opening the sweep menu (Wallet menu -> Private Keys -> Sweep), entering your private keys while leaving the 'Address' field unchanged, and executing the dialogue.

Enjoy your new light-weight bitcoin client.


who actually amasses or builds the blocks ... and how do they get passed to miners?

Who selects the transactions to go into this block? If not a person, where in the Core is this included

Miner select them. More specifically, node software that miners run select the transactions. Most miners use Bitcoin Core or some variation of it.

  How do they then get bundled as a block?
  How do they get passed on then to the miners?

When the node software selects transactions, it creates a hexadecimal string for each transaction that represents each of the fields. That hex string follows the same format used for serializing transactions for sending over the network, just as the hex representation of the bytes instead of the bytes themselves. This is then packaged together with some other information into a JSON object in the getblocktemplate format and provided over a JSON-RPC interface to mining software.

The mining software then takes the information provided by getblocktemplate, adds their own additional information (e.g. the nonce) and constructs a serialized block. Serialized blocks are byte arrays containing all of the information in a block and are the same format as sent over the network. If the block is valid, the miner sends the serialized block back to the node which then sends it to the rest of the Bitcoin network.

Here is a step by step example of how a miner Alice mines a block.

Alice runs Bitcoin Core which constantly receives, validates, and relays transactions and other blocks.
Alice runs a mining software (such as cgminer) and connects here hashing machines (e.g. an Antminer S9) to that.
Alice also provides to her instance of cgminer the credentials to the JSON-RPC interface for her Bitcoin Core node.
cgminer will use getblocktemplate and send a request for a block template to Bitcoin Core.
Bitcoin Core receives the getblocktemplate request and chooses transactions from its pool of valid and unconfirmed transactions that it has stored in memory. The transactions are typically selected by their fee rates, highest fee rate being selected first.
Bitcoin Core constructs a block template using the selected transactions and adds any additional information required.
Bitcoin Core responds back to cgminer over the JSON-RPC interface with the completed block template.
cgminer receives the block template and uses it to construct a serialized block header in a form that is acceptable to the hashing hardware
cgminer sends whatever data it has serialized to the hashing hardware and the  hardware computes SHA256 hashes on it while incrementing some data in the data.
The hashing hardware (or cgminer) checks whether a hash has a valid proof of work. If it does, skip to step 14.
Once the hardware exhausts all possible combinations it can try using the data given and responds back to cgminer
cgminer, when the hashing hardware can no longer continue with its data, sends another getblocktemplate request to Bitcoin Core for a new set of transactions and block data to try.
Repeat steps 4 through 12 until the hashing hardware finds a hash with a valid proof of work in setp 10.
Once a hash with a valid proof of work has been found, cgminer takes the data that was hashed for that valid proof of work and combines it with the serialized transactions.
The serialized block is converted into a hexadecimal string and sent to Bitcoin Core using the submitblock RPC command.
Bitcoin Core takes the hexadecimal string representing the block, converts it into a byte array, checks that the block is valid, and if it is, sends the block to the nodes that it is connected to.


What is a mechanism of providing Merkle Path?

They may dislike compute to find transaction if they have to sequence search because they are busy to find hash value of block to earn block reward

You are confusing mining with node operation.

It is a full node on the network that will return info about the relevant merkle path to the SPV wallet.

Mining is done separately, by specialized hardware that is built to only be extremely efficient at hashing to find a new block. The mining hardware will be connected to a full node, so that it can obtain the relevant info to build new block templates. But the two computations are done on separate hardware, in parallel.

So even if a miner’s node was the one to serve the merkle path info, it would not take away from their mining time.


Where are P2SH full redeem scripts stored?

Here's a working example that lays the groundwork for answering your question:

Alice wants to pay Bob, so she asks Bob for an address.
Bob wants to receive payment to a P2SH address.
So Bob creates the redeemScript and then uses that to create a redeemScript hash, which is then encoded into a P2SH address.
Bob gives the P2SH address to Alice, and Alice pays it.
Sometime later, Bob wants to spend those bitcoins to Charlie.
Bob creates a transaction with an input whose scriptSig contains the redeemScript he created earlier.

Now for an answer to your question:  Bob needs to know the redeemScript at the time he creates the P2SH address for Alice and when he spends the bitcoins to Charlie.  He can, as you suggest, store the redeemScript in his wallet for that whole time, or he can regenerate it on demand from other data in his wallet, or he can store it externally---however, nobody else stores it for him automatically and it doesn't become part of the blockchain until he uses it in the spend to Charlie.

I believe Bitcoin Core does the simple thing and stores the whole redeemScript in its wallet for addresses created with the addmultsigaddress RPC.

There might be some wallets that use something like BIP45 to regenerate P2SH addresses when necessary from pairs/combinations of HD wallet seeds.

BitPay Cosign might externalize storage of P2SH addresses in some cases, although I'm really not sure about that.


Imagine attacker introduces 100000 rogue nodes in the network and their goal is to send false information about transaction validity ...

That's no possible. Every node validates blocks and transactions for itself. It doesn't matter what another node tries to represent - if the block is invalid, it's ignored by the receiving node.

Proof-of-work is unnecessary for determining block validity.

What proof-of-work does do is makes block generation expensive. Without it, nodes could generate blocks cheaply, rolling back transaction history by publishing replacements for previous blocks willy-nilly.

To rewrite a previous block, a node must not only rewrite the block its self, but all of its descendants. It must re-do all of the work that was previously done.

To re-iterate: nodes validate transactions and blocks for themselves. Proof-of-work doesn't convince nodes of block validity. It convinces them that a certain amount of work must have been performed to produce the block.

A node uses the cumulative proof-of-work when faced with a choice of two or more valid block chains. The one with the most proof-of-work is used to build the global transaction log.


How does the bitcoin transaction fee be calculated? And who guide this?

When creating a transaction the Bitcoin-Qt client will determine the properties of a transaction and if the transaction is likely to need feeds the client will insist that a fee be added.   The rate is 0.0005 BTC per 1K of data consumed by the transaction.  If the transaction size is below 10K though and meets other criteria no fee is required:

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

Other clients may not have any requirement when sending.  For instance, the Blockchain.info/wallet allows "Custom" send in which the fee is entered by the sender.  Zero is a valid fee amount.

It really doesn't matter what the client or the user chooses, what matters are the level of fees the miner's require.   If few miners will accept a transaction because the fee is too low, the transaction will simply just take longer to confirm, eventually.

So there is a competitive market for transactions.  A miner can try to boycott transactions in which the fee is too low however the next miner might be willing to include the transaction and in that instance the boycotting miner is simply passing up the opportunity to earn the fees from that transaction.

So the market consisting of miners looking for revenues from transaction fees guide the rate that is required for a transaction to get mined in a timely manner.

It is likely the amount for the recommended fee in the Bitcoin-Qt client will be decreased at some point if 0.0005 BTC ends up becoming expensive (currently less than three U.S. cents).


Chicken and Egg confusion over Bitcoin generation

A valid Bitcoin block has to include a minimum of one transaction, which is the coinbase transaction that pays out the block reward. Most of the early Bitcoin blocks did not include transactions that sent bitcoins from one party to other, but included only the coinbase transaction that paid out the newly minted bitcoins.

In fact, the first transaction wherein an exchange of coins occurred was in block #170, when Satoshi sent 10 BTC to Hal Finney


What is the "Maintenance" amount referring to on the bitcoin exchange Bitcoinica?

No, it relates to when you have a margin call for your open positions. From their FAQ:

  What's your Margin Call Policy?

  After you've logged in, you can immediately see your real-time account
  Net Value (total assets) and Maintenance (minimum net value). When
  your Net Value falls below twice the amount of Maintenance, we will
  issue a margin call. If you don't take actions before your Net Value
  falls below Maintenance, all your positions will be liquidated
  automatically.


What is the technical difference between BTC and LN wallets?

A Bitcoin wallet mainly maintains your private keys and keeps track of the transactions associated to the corresponding public keys or the addresses. The Bitcoin wallet will also help you broadcast your signed transactions.

A lightning wallet does all the same but additionally it follows the lightning network protocol meaning it helps you set up Revocable sequence maturity contracts which are used to construct a payment channel. They are created by a sequence of signed but not broadcasted transactions and revocation keys. The hashed time lock contracts wish are used for routing are maintained in a similar way. All of this is the so called channel state and stored privately in a database of your computer. This state is needed in addition to your private keys to access your funds.


This is basically correct. Your main challenge is that the current way to do multisig transactions references the public keys rather than just the addresses. Therefore when you generate the paper wallets, you need to take note of the public keys. Then you can input those into the bitcoin-qt console to generate the multisig address (there's a worked example by Gavin).

Note that using the funds in the multisig does not require the two private keys to exist together in the same machine, rather you just need to generate a signature using each (on separate machine).


Differences/similarities of "Bitcoin script" and "Ethereum smart contract"?

As they say, Ethereum is Turing complete, Bitcoin script is intentionally not Turing complete.

Ethereum has a virtual machine with a set of opcodes. Bitcoin script is defined by different opcodes, defined in src/script/script.h. There are good descriptions of the opcodes at https://en.bitcoin.it/wiki/Script.

Differences include:

Ethereum charges for each operation: https://github.com/djrtwo/evm-opcode-gas-costs to account for differences in computation difficulty.
Bitcoin scripts are limited to a certain complexity (e.g. num of sigops) to prevent DoS attacks.

Similarities include:

Contracts live on the blockchain. In an Ethereum-specific binary format (EVM bytecode), and in Bitcoin as Bitcoin Script.

  Does Bitcoin script run on-chain (similar to Ethereum smart contracts)
  or they run off-chain?

Yes. Script can be stored in 3 places in a transaction: witness, scriptSig and scriptPubkey. These transactions are stored in blocks on the blockchain, and are run by nodes validating them.


I lost my computer, inside my hive wallet , I do have my adress and password can I recover my bitcoins?

The address is useless, the password insufficient. You need to have a backup of your wallet, or know the mnemonics for the seed. Otherwise you can't recover your coins.


How to get sending address of MultiSig transaction?

ok, this looks like a multisig activity. Quickly de-analyzing. To sign the previous transaction, this script was used:

TX_IN[0] Script Sig (uchar[])
483045022100DCD533F206756C83757BD0738905799DD0C7F505C22C567641B1B35573A9B24B02204C3773F60752EA67809AA32EB0A07C0F16BCFE073C99E84C8C30A328FA14874C0121031C9BFFF835236F589BA409B364A9D2C392971C053CDFBBAC9CCDD9F30EABB15B

48: OP_DATA_0x48:     push hex 48 (decimal 72) bytes as data
30: OP_SEQUENCE_0x30: type tag indicating SEQUENCE, begin sigscript
45: OP_LENGTH_0x45:   length of R + S
02: OP_INT_0x02:      type tag indicating INTEGER
21: OP_LENGTH_0x21:   this is SIG R
    00DCD533F206756C:83757BD073890579
    9DD0C7F505C22C56:7641B1B35573A9B2
    4B
02: OP_INT_0x02:      type tag indicating INTEGER
20: OP_LENGTH_0x20:   this is SIG S
    4C3773F60752EA67:809AA32EB0A07C0F
    16BCFE073C99E84C:8C30A328FA14874C
01: OP_SIGHASHALL:    this terminates the ECDSA signature (ASN1-DER structure)
#########################################################
### procedure to strictly check DER-encoded signature ###
#########################################################
Minimum and maximum size constraints                        - ok
scriptsig always starts with 0x30                           - ok
length 138 chars is less than actual sig length (142 chars) - ok
       (hex 0x45, decimal 69, 138 chars)
length of R coordinate (66) >= 0                            - ok
length of S coordinate (64) >= 0                            - ok
S-Value is within scriptsig boundaries                      - ok
Make sure the R & S length covers the entire signature      - ok
S-value must be smaller than N/2                            - ok
strictly check DER-encoded signature                        - ok
#########################################################
21: OP_DATA_0x21:     type tag indicating LENGTH
03: OP_INT_0x03
    1C9BFFF835236F58:9BA409B364A9D2C3
    92971C053CDFBBAC:9CCDD9F30EABB15B

This terminates the Public Key (X9.63 COMPRESSED form), and the corresponding bitcoin address seems to be:    19r8BDjwdmMUYecGX73CAnRCwHoynaeSXi
This address starts with a "1", so no multisig address...

and

TX_OUT COUNT, hex=01, decimal=1
TX_OUT[0]
 TX_OUT[0] Value: hex=404B4C0000000000, --> bitcoin=0.05000000
 TX_OUT[0] PK_Script Length hex=47, dec=71
 TX_OUT[0] pk_script (uchar[])
  51210351EFB6E91A31221652105D032A2508275F374CEA63939AD72F1B1E02F477DA7821004F0331742BBC917BA2056A3B8A857EA47EC088DD10475EA311302112C9D24A7152AE
    51: OP_1, OP_TRUE
    21: OP_Data21 (= decimal 33)
        0351EFB6E91A3122:1652105D032A2508
        275F374CEA63939A:D72F1B1E02F477DA
        78
        bitcoin address:   1NdB761LmTmrJixxp93nz7pEiCx5cKPW44
    21: OP_Data21 (= decimal 33)
        004F0331742BBC91:7BA2056A3B8A857E
        A47EC088DD10475E:A311302112C9D24A
        71
    52: OP_Data52 (= decimal 82)
    AE: OP_CHECKMULTISIG

This is normally the redeem script Hex codes:

It is supposed to be a 1 out of 2 multisig tx, and usually you would ripemd160(sha256()) this, and get a "type 3" bitcoin address.
However: the second part after OP_DATA21 does not start with "02" or "03", instead with "004f..." - so no "real address".
Why the blockchin.info doesn't show correctly is due to the fact, that indeed the redeemscript hash is expected.

Looks like a manually assembled tx, with the redeemscript hex codes, instead of it's ripemd(sha256()) hash.

Follow up question: as it is in the blockchain, it has been a valid tx, then where are the funds? :-) I tried to hexdump it, but doesn' make sense... burnt?


I tried to withdraw coins from Binance but they were lost on the blockchain. I need help from an expert

transfer that had an invalid receive address (the address started with a "3", not an "L")

An address starting with 3 is a valid LTC address, so Binance could not have known this is not where you want them sent.

In your particular case, recovery may not be possible without cooperation from Green Address. Green Addresses are 2of2 or 20f3 multisig addresses and require two keys to spend coins from. One key is from your seed words, and the other is held by Green Address, in the case of 2of2.

Unless you are able to convince Green Address to share that key with you, or sign a tx using it that moves your LTC, you will not be able to access the coins.

If you have a 2of3 multisig, you hold 2 of the keys, and should be able to use an Electrum-LTC client to generate the multisig address and use it on the Litecoin chain.


Specifically:

They blamed transaction malleability for a hack, which was clearly a lie - blaming Bitcoin for their own mistakes.
They stopped withdrawals but continued allowing deposits and trading. A leaked strategy document shows that this was an attempt to conceal the size of their losses from the public, ie they didnt' come clean when they should have .  http://www.scribd.com/doc/209050732/MtGox-Situation-Crisis-Strategy-Draft#scribd
Their communication with their customers leading up to the hack was generally awful.


Can a single wallet stir all different crypto currencies

Wallets need to know how to generate new addresses and check for incoming transactions, and should verify that transactions (and also if possible blocks) are valid, so they will need to know some important information about each coin. Some coins which are simple forks of each other don't require much extra info, just the difference in magic bytes, port numbers, chain parameters, etc. While others which have much larger changes like those with different mining algorithms, different transaction structures, different signature algorithms etc would require more in depth implementation as well. So in general no, a wallet can't trivially accept all currencies, each requires implementation.


Where do bitcoins come from and what gives them their value?

Although individual bitcoins enter the Bitcoin economy as miners are rewarded for processing transactions, it's much more helpful to think of all 21 million bitcoins as having been created when Satoshi Nakamoto defined the Bitcoin protocol and launched the Bitcoin network in 2009.

The reason for this is that the Bitcoin protocol specifically defines and controls when and how a limited total number of coins are rewarded to miners for the job of securing the Bitcoin network.  These "bitcoins" are really just mathematical tokens which are very carefully controlled by the network protocol to prevent counterfeiting, theft, etc.

By agreeing to use these mathematical tokens as money, the larger Bitcoin community is essentially "backing" their value and turning them into a currency in the same way traditional African and Asian societies used the money cowry despite the absence of any central bank.  Unlike the money cowry:

there will never be more bitcoins
they are impossible to counterfeit
they can be divided into as small of pieces as you want
and they can be transferred instantly across great distances via a digital
connection such as the internet.

Presumably, the members of the Bitcoin community who choose to accept them as money consider these features to be worth something, and value the bitcoin accordingly based on supply and demand on open currency exchanges.

Because bitcoins are given their value by the community, they don't need to be accepted by anyone else or backed by any authority to succeed.  They are like a local currency except much, much more effective and local to the whole world.

So to sum up, bitcoins come from the Bitcoin community's agreement to follow a set protocol, and are backed by everyone who uses them as money.


Bitcoin Core - server uptime, privacy and security questions

security... TOR

It is important to note that TOR does not provide added security. In fact, it could decrease security because you are funneling your traffic through exit nodes which could try to manipulate or log that traffic.

TOR does however help with privacy because it helps hide your actual IP address and therefore location / identity.

Running a full node alone will improve your privacy a bit over other types of "light" wallets (like Multibit) and if you follow the advice of
@makevoid above, you can improve security by moving your wallet.dat file to an offline computer. There are many other options for improving security and are easier to manage - look into hardware wallets and BIP38 encrypted paper wallet created offline.

  how secure I am from other apartment dwellers

Anything running on Windows should be considered insecure.  If you are using Mac or Linux, you chances of being hacked are much lower.  Running a firewall makes sense as does using physical ethernet cable (rather than WiFi).  The three options above (offline signing, secure paper wallet and hardware wallet) will all protect your private keys if done correctly.

  I can leave it running only 6 hours a day

Running a full node will not help others on the Bitcoin network if you are only running it for 6 hours a day.  If that was not your goal, then no harm done.  The "6 hours" is arbitrary, you will just want to run it enough to keep it up-to-date (in-sync with the network) as new blocks are created every 10 minutes.  Depending on your hardware and internet connection, this might require bitcoin-core to sync for just 15 minutes per day like my Macbook Air.


Recommended resources or tuts for Bitcoin/Bitcoin Exchange clone using Ruby/Rails?

The biggest Ruby-related Bitcoin project is Toshi by Coinbase.

You can obviously read through the source code. And read through the documentation in the github repo.

There's also bitcoin-ruby which should get you started on how to program bitcoin stuff using Ruby.


The previous account system has been deprecated and removed. Current versions of Bitcoin expect you to either manage address<=>account links in your own software, or use different wallets for things you previously used accounts for.

If you are managing it in your own software, it is a simple matter of making an off chain transfer from one account to another in your own database.

If you are using multiple wallets, you will have to make an on chain transaction to send Bitcoin to an address in the destination wallet.


Proving the margin of error of a block timestamp

Block timestamps are whatever time the miner wants to put in there, within some loose bounds, so there isn't a real guarantee.

For more info on what those bounds are, check out this answer:

https://bitcoin.stackexchange.com/a/917/18196


51% attack + ignore blocks not mined by yourself

Yes. The owner of 51% can get 100%. This is attack-51 itself.

  Is there some measure that would stop this?

no


Electrum is perfectly happy running through either standard HTTP ports (443 and 80) or through a SOCKS proxy like Tor. Both options are viewable under the server settings in the main panel, and both will help you break through a restrictive firewall.


How can I convert bitcoin to any other new launched coins?

I have a bitcoin wallet and need to convert all user wallet balance into new launched coin.

Well, if you want to convert your Bitcoin balance in your wallet to a newly launched coin, you can do the following:

Find a compatible wallet for the currency you want to get. Then, register a wallet on there.
Find a trusted exchange for Bitcoin to altcoin, some are:

https://.kucoin.com/altcoin/exchange

https://www.binance.com/

Create a account onto the exchange, and finally, exchange your Bitcoin to a Altcoin.

I hope this helped!


Multisig refund transaction flaw in Lightning Network talk

Yes, you are correct. Joseph Poon and Tadje Dryja in their Lightning Network whitepaper proposed the SIGHASH_NOINPUT flag to prevent transaction malleability flaw hampering the creation of commitment transaction prior to funding transaction. However, with the deployment of SegWit in 2017, NOINPUT was not longer needed as signatures are not part of the txid construction in a SegWit transaction. Since signatures did not form the part of the txid calculation, it solved the ECDSA signature malleability issue that NOINPUT was trying to solve. Thus SegWit deployment allowed us to create the commitment transaction even before signing the funding transaction.

Lightning Network specs have gone a sea change since that paper was published way back in early 2016. I have tried to highlight below how the parties communicate the signing of the transactions as is today and proposals of the future when opening up a channel with each other.

In the current specs (BOLT 1.0), only one party is allowed to contribute bitcoins to the channel. This simplifies the process of exchanging signatures and creating the commitment transaction prior to the funding transaction. Let us say Alice and Bob wants to open a channel. Alice will broadcast the funding transaction only when she has received Bob's signature for the commitment transaction that she holds. Since Alice is the sole funder over here, she has all ammunition to create the funding transaction after Bob exchanges his funding pub key. She creates and signs the transaction, calculates the txid and then shares it with Bob along with her commitment transaction signature that Bob is holding.

Currently there is a proposal (BOLT 1.1) for allowing both parties to contribute funds to the channel. Both parties help each other to build the funding transaction by sharing the inputs and outputs of the funding transaction with each other that they plan to use to fund the channel. It is important to note that they share all information apart from the signatures for those inputs. Once both of them have shared all the inputs and outputs, the parties have enough information to calculate the funding txid. This is because SegWit transactions signatures are not included in calculation of the txid (as mentioned before). This allows us to build the first commitment transaction even before the funding transaction has been created.

Note: Currently, as is, Lightning Network implementation does not require the NOINPUT flag. But to implement the Eltoo payment construction there is a proposal to introduce SIGHASH_NOINPUT. In a nutshell, Eltoo allows us to get rid of the penalty transactions and reduce a lot of overhead on maintaining the channel states. If you are interested you can read the discussion of this proposal on the Lightning mailing list.


(Mastering Bitcoin) When sending a raw transaction, why is the receiver included in the details hash as a "send" transaction?

Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?

In the actual Bitcoin blockchain that transaction has one input and two outputs. One of the outputs appears to be change being returned to the input address. This is normal.

In an early version of the book, the same information (1 in, 2 out) is shown and the author says on page 52:

  That looks correct! Our new transaction “consumes” the unspent output from our confirmed transaction and then spends it in two outputs, one for 25 millibits to our new address and one for 24.5 millibits as change back to the original address.

The output you show is from page 55 and looks like an editing error to me. If the author has not issued an errata, you could report this to the author or to the publisher.

The example in the question is from Chapter 3 of Mastering Bitcoin. It exists in the previous edition but that chapter has been completely revised in chapter 3 of  the latest edition


Who currently pays the miners for processing transactions?

According to the list of available charts, that chart is showing "miners revenue divided by the number of transactions".  That is, it's the average amount a miner earns for each transaction they process.  "Bitcoin mining cost per transaction" isn't a very good title for the chart.

So far, the vast majority of miners' earnings comes from the 50 BTC per block rewards, with a tiny fraction coming from the transaction fees paid by the people creating transactions.

So to answer your question, nobody pays the vast majority of the cost; it is created out of thin air as the reward for mining a block.  You could see it that each new block generated inflates the money supply and so devalues all existing Bitcoins, in which case you could argue that everyone holding Bitcoin is paying via inflation.  But the inflation is predictable, and so already priced in.


How to BIP38 existing private keys offline

The Bitcoin-Explorer (bx) v3.0 implementation described below has had FULL BIP 38 functionality for over a year, and has extended BIP 38 to numerous altcoins.

See 5) Extended AES256Encrypt and AES256Decrypt BIP 38 CLI Example Set, and use -v 0 for Bitcoin instead of -v 76 for Dash. See the 4th column of BIP44 Altcoin Version Mapping Table for version mappings for various coins.

Use wif-to-ec to convert your WIF-encoded keys to hexadecimal.  Use ec-to-wif to go the opposite direction as needed.

The full round robin example below is for Bitcoin, not Dash, but contrast:

% bx wif-to-ec L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny
f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-ek -v 0 "Hello it is me" f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269
6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a

% bx ek-to-ec "Hello it is me" 6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a
f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-wif -v 128 f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269
L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny

The ec-to-wif command needs to use integer values for the 3rd column of BIP44 Altcoin Version Mapping Table corresponding to the crypto-coin being used. If version integers are dropped, bx assumes the operations are for Bitcoin.

Be forewarned that BIP 38 isn't standardized for altcoins with Bitcoin heritage yet. Many wallet tools claiming to provide BIP 38 functionality use the prefix 6P for altcoins. The prefix 6P should be different for altcoins to minimize confusion.  This sample mapping shows -v 0 maps to a 6P prefix for Bitcoin, while -v 76 maps to a 7f prefix for Dash, (76 base 10 == 4c base 16).


While you have bitcoind or bitcoin-qt running with the -server option, you can then use bitcoin-cli to run commands.

It's part of the bitcoind package.

If you have your conf file in a custom directory you'll have to specify that to bitcoin-cli as well, otherwise it should just work.


How do I query a remote bitcoin node like RPC?

Excellent question, and welcome to the community!
Short Answer
Maybe.
Long answer
Yes, you can send queries to other nodes on the Bitcoin network. Note that these aren't RPC calls, but Bitcoin's underlying communication protocol. That means that all of the calls will be a little different, and some of them won't exist.
Examples:

There's no equivalent to getblockcount in the underlying protocol. Instead, you can connect to a node and listen for its version message, and look at the start_height field.

Instead of getrawmempool, you use mempool.

Instead of getpeerinfo, you use getaddr.

There's no equivalent to stop, because that would be stupid.

Also, if you're trying to query other nodes on the network, one of these libraries will be very helpful:

Python: http://protocoin.readthedocs.org/en/v0.1/index.html
(Use protocoin.clients.BitcoinClient)
Java: https://bitcoinj.github.io/
(Use Peer.sendMessge)
Go: https://github.com/btcsuite/btcd/blob/master/wire/README.md

(If you're not using one of these languages, leave a comment.)


Can you generate a url from a payment request?

You can. If you make a Bitcoin URI with the r parameter, it will interpret that as a url to fetch the PaymentRequest from.

Documentation on this feature is frustratingly sparse, so I'm having trouble figuring out how to implement all of the details, though.


Not only is it safe to encrypt wallets with money in them, it is unsafe not to do so. Think of your wallet as a computer file serving as your safe, in which you put your savings. Would you leave your safe open? Probably not. You'd set a complex combination.

This is even more important in Bitcoin. Since your wallet is just a file on your hard disk, it can not only get physically stolen, but also digitally stolen over the Internet by viruses and other malware. Having your wallet setup to not require a password is asking for trouble. You could lose everything in an instant.

The only real risk of encryption is forgetting the password. Unlike a safe, encryption can't be bypassed by a locksmith. Lose the password, lose the money. If physical theft is not a problem for you, you may want to write down the password and put it in a safe deposit box. Viruses don't read paper. Regardless of encryption, you also want to make a backup of your wallet file onto external storage, in case your hard drive goes kaput. This should also be in a safe place.


The goal of mining is essentially to (i) create new coins out of thin-air and (ii) to secure the network from double-spending attacks.

So no, the act of mining does not create new transactions to be mined, and it does not create work for itself. It validates transactions and keeps the nodes of the network on the same state.


What is the command for primecoind and bitcoind to see my address?

With bitcoind up and running, you can use this command to check your addresses:

bitcoind listreceivedbyaddress 0 true

if you want to add a new address, you can use:

bitcoind getnewaddress

I don't have primecoind or datacoind installed, so I can't confirm if these commands work for them as well, but the source for both appears to be forked from bitcoind so it should work. The documentation for datacoind and primecoind seems a bit sparse on the net, but you can also try running

primecoind help

or

datacoind help

to check what options are available for them.


Startum protocol extranonce2 - where the extraNonce2 comes from

Extranonce2 is generated by the miner performing the work. When a miner runs out of nonces in the block header, they can increment Extranonce2 in the coinbase transaction to be able to give themselves a much larger search space for a valid PoW for the difficulty that they are mining at.

The pool has to provide the size of Extranonce2 because Extranonce2 is not an actual field in the coinbase but rather part of the variable length arbitrary data that a miner can include in the coinbase transaction. So the pool specifies the size so that the miner knows how much space they have to work with for Extranonce2.


Is -blocknotify triggered during catch-up?

Yes, this is by design.

The notify action is run in the function BlockNotifyCallback (init.cpp), and you can see:

static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)
{
    if (initialSync || !pBlockIndex)
        return;
    // ...
}

The initialSync argument comes from the return value of IsInitialBlockDownload() (in validate.cpp).  It checks several things to determine if the initial block download is ongoing.  Probably the operative one here is a check whether the most recent known block has a timestamp that is more than 24 hours earlier than the current system time.

So it appears you will start getting notifications when you are 24 hours behind or less.


If Two Cryptocurrencies use different curves, Can They be in the same HD Wallet?

You can only do that if you are deriving hardened keys. For non-hardenend keys, you still need to know the curve as a public key is calculated for non-hardened derivation in order to derive the next private key.

Note that hardened derivation means that you will not be able to derive public keys from a master public key.


I'm sorry to say this is a scam.  Put it in dollar terms.  Someone is telling you that you've won a surprise $20,000 (not very believable in the first place).  But to get it, you have to send $600 for "verification" -- what possible reason could there be for this except to enrich the scammer?  They'll never send the $20,000, and you'll be out the $600.   (If you send the $600, they may try to  finagle more money from you until you eventually give up on ever getting the non-existent "prize  money".)


Sent .10 from my Electrum to my trezor

Yes you did:

blockexplorer.com/tx/f5e5e6f4de4298a1d74ac3f3ba3116e0b80e97b2373da987766a2d5c27541da6

But then you sent it somewhere else afterwards:

blockexplorer.com/tx/2e4d4cf6f0a6bca1ec9489cc39bf6c6a6036a19ef10db66e42fd2052f37f466f

If you follow it forward, you'll see that the majority currently unspent (0.09373173 BTC) was last sent to address:
1CMoma2Qq5SdaynYaU4yJrLdhQ7mFFsREN

Edit: It was later moved, so I suppose you have control of funds again: blockexplorer.com/tx/1133a9f13708649c0f7aa431013c75a87a0e87efc92ee0b293f10107f7d3c3b8


Is it possible to sign a transaction (to spend) from a multisig address using only one private key?

If the bitcoin is locked with three private keys using a simple script that involves signing by all three private keys (3 of 3), then there is no way to spend it without providing all three private keys for the signature.

However, bitcoin being a programmable money, it allows you to create a locking script that is decided by time. By that I mean, you can include conditions within your script such that, after x amount of days, you need only 2 keys and after y amount of days you need just one key to spend the bitcoin. Thus, within the broad spectrum of your question, yes the bitcoin can be spent by only one private key that generally requires three private keys, only if the necessary condition is justified in the locking script. Below is the locking script that you will follow to meet the above condition.

IF
    IF
        3
    ELSE
        <x days> CHECKSEQUENCEVERIFY DROP
        2
    ENDIF
    <Pub key 1><Pub Key 2><Pub Key 3> 3 CHECKMULTISIG
ELSE
    <y days> CHECKSEQUENCEVERIFY DROP
    1 <Pub key 1><Pub Key 2><Pub Key 3> 3 CHECKMULTISIG
ENDIF

The unlocking script for evaluation of

3 of 3 will be < Sig 1>< Sig 2>< Sig 3> 1 1. The 1 and 1 at the end indicates evaluating both the first and second IF
2 of 3 will be < Sig 1>< Sig 2> 1 0. 1 will trigger the first IF and then the ELSE in the second loop
1 of 3 will be < Sig 1> 0 0. It will trigger the first loop ELSE


Have you set a proxy?

From my experience slow shutdown seems to have to do with slow proxies (for example, Tor).
There is an issue for this: https://github.com/bitcoin/bitcoin/issues/2954

If it is not the network thread that hangs, but database synchronization, then killing with -9 can be dangerous.

I'd suggest debugging this by running in gdb, Ctrl-Cing when it hangs, and then getting backtraces for every still-running thread.


Is mining faster with 2 GPUs in crossfire or with 2 PCs with one GPU each?

They do indeed perform exactly the same

Crossfire is not encouraged as it gives no advantage and may impact your overall performance. The computation is done in parallel on each card so there is no need for them to communicate among each other.


Trying to understand how bitcore-node stores the data in the DB

Bitpay's bitcore-node project uses the same datadirectory as Bitcoin Core. You can see this in their sample configuration in their README:

var configuration = {
    datadir: '~/.bitcoin',
    network: 'testnet'
};

As such, the you can see: What are the keys used in the blockchain levelDB (ie what are the key:value pairs)? for information on what is in this database. However, bitcore-node does provide another interface for storing extra data about addresses and their balances. This is defined in this file. You have to enable this in your configuration and re-index the blockchain to enable this module, as their README details.

As these lines show, for each output, key-value pairs are added to the leveldb database in this format:

key:   [AddressModule.PREFIXES.OUTPUTS, address, timestamp, txid, outputIndex].join('-'),
value: [output.satoshis, script, height].join(':')

And, similarly for inputs, this is the format of the key-value pairs:

key: [AddressModule.PREFIXES.SPENTS, input.prevTxId, input.outputIndex].join('-'),
value: [txid, j].join(':')


Lightning close-channel transaction example?

The actual script implemented on Lightning Network is a little bit different from what you quoted. This is the script below and the specification is here

OP_IF
    # Penalty transaction
    <revocationpubkey>
OP_ELSE
    `to_self_delay`
    OP_CSV
    OP_DROP
    <local_delayedpubkey>
OP_ENDIF
OP_CHECKSIG

I've created that transaction on Testnet as the following,

Txid:
4f8d776c85b1fc15c1125e7043a9aee70e33f0793b472823e3946a8de075bec4

Rawdata:

6321026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc767029000b27521029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a68ac

Decoded by here

{
    "result": {
        "asm": "OP_IF 026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc7 OP_ELSE 144 OP_CHECKSEQUENCEVERIFY OP_DROP 029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a OP_ENDIF OP_CHECKSIG",
        "type": "nonstandard",
        "p2sh": "35M7MGVGd3ajyiTMvriUiyUM3H2cT5sgb4"
    },
    "error": null,
    "id": null
}


Yes you can rebalance your channels by creating circular onions. That will also cost you routing fees which are currently low.
However in order to get onchain funds you would have to close a channel (or open a channel if you want more liquidity). This means you cannot really swap on chain with off chain funds to provide yourself with inbound liquidity - wich is what loop / submarine swaps are for.
If you use c Lightning you can use the rebalce plugin https://github.com/lightningd/plugins/tree/master/rebalance or the drain plugin: https://github.com/lightningd/plugins/tree/master/drain depending on what exactly you want to do you might have to fork these plugins


To find out numer of transactions per day:
http://blockchain.info/charts/n-transactions

To find out unique addresses used each day:
http://blockchain.info/charts/n-unique-addresses

Now here is where the magic happens. You have to bring in your own calculation base for what the above means in terms of unique users.


Where can I learn how to create my own blockchain with a new transaction scheme?

The reason why you are not finding many detailed resources about blockchain is because it is a new innovation and not widely understood. Most resources are scattered across blogs and code repositories. A few developer and programming guides are listed lower down.

The most valuable and primary resource is the Bitcoin Core client implementation - also called the Satoshi reference client.

It is possible to design and build a blockchain client from first principles. The design will require several components, and here are the basics:

P2P networking - manage connections & send/receive messages and data
a Messaging protocol - message and data format
Database - store & retrieve block headers, blocks, transactions and previous spends (UTXOs)
client Behavior logic - handle messages, protocol rules, coinbase rules, etc
Consensus logic - gather, process and apply peer consensus about the validity of transactions, blocks and the unfolding chain
Coin generation code - mining and proof-of-work (if any)
general household code - logging, error handling, state maintenance, etc

That may seem daunting at first glance, but it is a worthwhile and achievable project.

Notice, that cryptography is not listed. This is because a private blockchain does not require secrets or obfuscation. However, if it is of interest, one can implement Bitcoin's Eliptic Curve library and address schema.

Before creating a blockchain client and protocol from first principles, it will be necessary to do some research about how the Bitcoin protocol works. Mastering Bitcoin by Andreas Antonopoulos provides good insight. Other resources of interest:

https://bitcoin.org/en/developer-documentation
This question has useful discussion and several pointers to learning resources.

Study how the reference client behaves, and read the reference client code, especially the file main.cpp - (linked to Core v0.13, since that file's code has been rationalized into separate files from v0.14 onwards)

Also, there are several open source libraries that allow you to run barebones blockchain nodes and exchange protocol messages. Some libraries are better than others:

pychain - basic blockchain prototype
PyCoin - a Python Bitcoin clone
Zen System - encrypt everything blockchain featuring communications, transactions and a DAO.


How does one node connect to other nodes

There is no centralised server required.

1.
If you start a node the first time, it will try to load a bunch of other nodes IPs via the build in list of available DNS seeds (there are ~5 seeds available).

2.
If those DNS seeds are not available, the Bitcoin-Core client uses its fallback IP list (a regularly updated list of IPs)

3.
Once a node could connect to one of those IPs (retrieved via DNS seeder or static list) it will ask for more IPs from known nodes (p2p address relay)


It's been reported that ltc wallet is DOWN and people have been scammed. Unfortunately there isn't a reputable online ltc wallet at the moment that I'd trust with a 10 foot pole. The ones that have come are just as quickly gone run by fly by night scammers. You're best off encrypting your wallet with a very secure password and making multiple copies of your wallet file that you store in remote, secure locations if you want to protect yourself from loss should your drive ever die on you.

The other option would be to start an account at an exchange that trades in litecoin and use it as your online wallet. Just be sure to use a well established exchange, of which I'm only aware of btc-e.com


How can I get Electrum running under Debian with a restrictive firewall?

The solution was to use Tor: under network options set the proxy to SOCKS5 localhost 9050.


Why does this coinbase transaction have two op_return outputs?

Coinbase transactions have some special rules not shared by other transactions:

only one per block
must be the first transaction in the block
must have OP_RETURN output with witness commitment if block includes segwit transactions
must have only one input
the input must have the "coinbase" field instead of a scriptSig

The "coinbase" field is where miners put the extranonce, commit to a specific blockheight (see BIP-34), and mark blocks to be found by them. Although, miners often collect the block reward in a single output, beside the rules for the witness commitment, the Coinbase transaction has no special restrictions on other outputs. In fact, some mining pools used to pay out mining rewards directly from the Coinbase, see e.g. the Coinbase of 133,471 mined by Eligius creating 919 outputs. As such, the second OP_RETURN output could be anything the miner wants.


How do I import private keys en mass from a text file?

Not sure on this, but you might be able to use the importprivkey RPC call. What I would try is importing one of them with rescan=false and then import another with rescan=true. The rescan=true causes it to go through the whole blockchain and look for any places that the associated address to that private key. After importing two private keys, the first without a rescan and the second with a rescan, then look to see if rescanning on the second private key got you all the transactions for the first private key that you entered.

Then if that works, you could write a command line script to execute that RPC call with each line of the file as the private key.

That's a high level description of what I would try. If you need more help on the importprivkey, open the Bitcoin-QT GUI, go to Help >> Debug Window >> Console and type "help importprivkey". If you need help writing that script, you'll probably have to do some googling around to learn about your OS-dependent scripting language.


lightning-cli listnodes is empty. Am I missing something?

In order for list nodes to provide some output you need to first connect to at least one peer on the network. Because the peer is giving you all the information from the gossip protocol about announced nodes and announced channels.

So do lightning-cli connect 03efccf2c383d7bf340da9a3f02e2c23104a0e4fe8ac1a880c8e2dc92fbdacd9df@144.76.235.20:9735 to peer with my node.

In case I change my node in the future you can try any node from a node explorer or find the address of my node at https://ln.rene-pickhardt.de

Also keep in mind that syncing the network over gossip takes some time (currently a couple of seconds) after you connected so you should not call list nodes right away.


How to convert PSBT transaction (base64) to raw/serialized (hex) transaction?

Yes, once the PSBT is finalized you can extract a fully-signed raw transaction from it (using the finalizepsbt RPC). As your PSBT does not have signatures yet, there is no point in constructing an actual transaction from it yet.


How to automate bitcoin wallet to send return payments to website subscribers?

How can a bitcoin wallet even be programmed to automatically respond to incoming payments with a return payment?

What is a bitcoin wallet, exactly? It can be just about anything that is programmed to create keys, check UTXOs and build/sign transactions... A bitcoin wallet can be programmed to do just about anything.
Your question is broad... You need to program it yourself. Build a database to keep track of addresses and payment codes and whatever else then build your site to interact with your database and your wallet, or build your own wallet.


How to block certain IP address from bitcoind or using ufw

You can use the rpcallowip feature in your bitcoin.conf to whitelist IP addresses.
https://bitcoin.org/en/release/v0.10.0#rpc-access-control-changes


How to decode transaction inputs from raw data using bitcoinjs-lib?

You will, by default, only see the values of the outputs and not the inputs. To gather all values for inputs, you will need to loop through your inputs and use an API to gather the transactions where the inputs were once outputs.

I used the BitPay insight API and left some notes in the code below:

var Bitcoin = require('bitcoinjs-lib');
var request = require('request');

function getRawBlock(blockHash) {
  return new Promise((resolve, reject) => {
    request('https://insight.bitpay.com/api/rawblock/' + blockHash, // hitting an insight API to get the full block
      (error, response, body) => {
        try {
          var block = JSON.parse(body); // result is in JSON
          resolve(block.rawblock)
        } catch(error) {
          reject(error)
        }
      })
  })
}

function getTransaction(transactionId) {
  return new Promise((resolve, reject) => {
    request('https://insight.bitpay.com/api/tx/' + transactionId, // hitting an insight API to get the full transaction
      (error, response, body) => {
        try {
          var transaction = JSON.parse(body); // result is in JSON
          resolve(transaction);
        } catch(e) {
          reject(e)
        }
      });
  })
}

getRawBlock('000000000000000000aabc9831a830ab8542137c68998368b86f9127432767d5')
  .then((rawBlock) => {

    var block = Bitcoin.Block.fromHex(rawBlock); // use bitcoinjs-lib to convert the raw block to usable data
    var transactions = block.transactions; // transactions reside here
    var transaction = transactions[1]; // using second transaction as an example since the first one is miner reward
    // you can loop the transactions the way you like

    var inputs = transaction.ins; // will need to use the API to get the outputs that each input once was
    var outputs = transaction.outs; // no need to hit API for outputs, value is in outputs[i].value

    var inputsWork = inputs.map((i) => { // map the inputs to an array of promises which we can run later
      return new Promise((resolve, reject) => {
        var transactionId = Buffer.from(i.hash).reverse().toString('hex'); // derive the transaction id this way
        var outputIndex = i.index; // output index is also needed
        getTransaction(transactionId)
          .then((transaction) => { //this transaction belongs to the looped input (i)
            var outputs = transaction.vout; // get outputs of transaction
            var output = outputs.find((i) => (i.n === outputIndex)); // match the input/output indexes
            resolve(output.value); // resolve with our output value
          })
      })
    });

    Promise.all(inputsWork)
      .then((inputValues) => { // execute array of promises for inputs

        var totalInputs = inputValues.reduce((a,b) => (a+b)); // add up the input amounts
        var totalOutputs = outputs.reduce((a,b) => (a.value+b.value)); // add up the output amounts
        totalOutputs = totalOutputs / 100000000; // outputs in satoshis

        var feesIncurred = totalInputs - totalOutputs; // fees of a transaction is input amount - output amount
        console.log(feesIncurred); // log the fees to your console
      })

  })

Cheers!


How do the miners earn money after 2140 on no-transaction-block?

Simple: they don't.

It's not in the best interest of the network for miners to mine zero-transaction blocks.  It means that the transactions in the mempool will have to wait for the next block to be solved before being included.  This phenomenon of blocks with no transactions is a product of the block reward still being so relatively high.  As it decreases, miners will rely more on transaction fees for their incomes, and we will see fewer and fewer zero-transaction blocks.


Preventing transaction fee collusion between large miners

In theory, preventing this problem is why miners exist in the first place. The sort of collusion you're describing can more generally be described as censorship: miners jointly deciding to delay certain transaction unreasonably long (up to indefinitely).

Ideally - and I'm well aware that reality is quite different now - the mining ecosystem is reasonably easy to enter for anyone, including people who feel they are being censored.

This is the difference - and the only difference - between using Proof-of-Work as a consensus mechanism and using a traditional (centralized) distributed consensus mechanism: anyone can enter, without asking anyone for permission (even anonymously). If we were fine with the set of existing mining pools to never change, we could replace it with a permissioned system.


It looks like the error message for receiving a legacy transaction on a Bitcoin ABC node: https://github.com/Bitcoin-ABC/bitcoin-abc/blob/174846aaaf564e64b6bd06d679996b52ba86ad53/src/validation.cpp#L1445

Speculation:
It seems plausible that Bitcoin ABC would create regular transactions before reaching the fork in order to retain compatibility with the Bitcoin network, but then recognizes them as being invalid to the upgraded network. (This is unverified speculation.)


Litecoin mining 10 times slower than a couple of days ago

I have found the cause:

I had GUIMiner to start on startup, and even though I was stopping it before I'd try to use CGMiner or Reaper, it did something to the drivers and would prevent LTC mining from starting correctly.

If you have a similar problem to this, try to disable GUIMiner on startup.


Are Bisq offer ids picked or partially picked by humans?

Bisq Offer IDs are randomly generated and consist of 3 parts separated by "-":

Prefix: between 5 to 8 characters in length
Randomly generated UUID: 5 sections of 4, 2, 2, 2, & 6 hex values separated by "-"
Bisq Version: "." separators removed

In your first example, emzlols-7639fae0-cd4d-48cf-acc5-abc97dab89db-124, emzlols is the Prefix, 7639fae0-cd4d-48cf-acc5-abc97dab89db is the Randomly generated UUID, and 124 indicates a Bisq Version of 1.2.4

The IDs are created in a method called getRandomOfferId() in the bisq.core.offer.CreateOfferService class as of Bisq v1.2.4.

The Short ID for an offer is its Prefix.


Generate bitcoin address from public key file

Which kind of address do you want?

Assuming that you have compressed public key(compressed_public_key.txt), to generate P2PKH you can use these commands (hash160 and encoding with base58)

  ADDR_RIPEMD160=$(printf $(cat compressed_public_key.txt | xxd -r -p | openssl sha256| sed 's/^.* //') |xxd -r -p | openssl ripemd160 | sed 's/^.* //')
  ADDR=`printf $VERSION_PREFIX_ADDRESS$ADDR_RIPEMD160 | xxd -p -r | base58 -c`
  echo $ADDR

Where $VERSION_PREFIX_ADDRESS for P2PKH addresss are 0x00 for mainnet or 0x6F for testnet (https://en.bitcoin.it/wiki/List_of_address_prefixes)


What needs to be written down for a paper wallet?

The design/structure of a paper wallet is not something is set in stone, but the main idea is writing public and private key pairs on a piece of paper.
The universal flow for generating an address is:

A public key is derived from private key
A bitcoin address is derived from public key

The common flow (Mnemonic) for generating an address is:

Master private key is derived from mnemonic phrases
A private key is derived from master private key
A public key is derived from private key
A bitcoin address is derived from public key

As you can see 3rd and 4th steps of Mnemonic key-generation flow are the same as universal key-generation flow. You can unlock your Bitcoin with plain private key without mnemonic phrases. Mnemonic phrases are just used to derive private key, so you can simply write down public key(65-byte or 33-byte) and private key(32-byte) onto a piece of paper regardless how you generated your key-pairs.


Balance between minimum transaction fee and time using Electrum 3

It's all about bitcoin, the Electrum wallet is just a wallet, it doesn't minning block nor building block.

  Why did the transaction went so fast if the fee was for 25 blocks?

You can't predict in which block exactly your transaction will be added.
The block is filled with arbitrary transactions. *

 * While larger fees improve the chance to be included in the block there is still have a chance to be added to the next block.

  As it was a non-urgent transaction, couldn't I have selected a smaller
  fee in any way?

You can select any fees what you want(and 0 fees also), but there are no warranties what that transaction will be added to the block. Transactions that pay more fee take precedence.

  I couldn't find a way to pay smaller fee in Electrum 3 --I could have
  waited for 24h with no problem to avoid this high fee.

You can set commision manually in the Electrum settings.

  Does this means that I paid much more for the fee than I could have
  paid, given the non-urgent requisition of my transfer?

Transactions (with a small or zero fee) which stay unconfirmed for a longer time usually don't get priorized over transactions with a high fee.
Every miner is free to chose which transactions he is going to confirm in his mined block. Its all about how the node is coded to fill the block with TX's.
Since miners mine because they want to gain profit, they will always priorize transactions with a higher sat/B fee.

From me:

  What happens with transaction with zero or low fees?

Generally, after a few days, the transaction will be removed from the mempool and your wallet shows your balance again, which makes your coins
spendable again via wallet.


One of the network rules is that a coinbase's outputs cannot be larger than the current block reward plus the transaction fees of the transactions in the block.

So, a miner claims the transaction fees by increasing the amount of the block reward. This is true even after 2140, when there will be no block reward. (Network rules require that the first transaction be a coinbase, even if there is nothing to claim.)


Does Blockchain.info track IP addresses?

yes it does, see under Account - Settings - Logging

I guess that disabling logging only disables the DISPLAY of logging info on your side.

see https://blockchain.info/privacy:

  What we collect

  We may collect the following information:

Contact information including email address, skype or google talk username
iPhone or mobile device identifier
ip address
Yubikey or other two factor authentication toke

  My name and identifying information is never connected with my bitcoin, is it anonymous?

Not really...  See the Bitcoin.org FAQ
Generally speaking, I'd say it MAINLY depends on how you get / spend bitcoins.
If you pay for something with TC, and give your shipping address, that's your anonimity compromised!
Avoiding address re-use gives more anonimity...

  How can I keep my bitcoin wallets and usage anonymous?

It all depends on how anonymous you really want to be.
For example, do you use Google authenticator?
That add to security but certainly decreases anonimity

See also: https://blockchain.info/wallet/anonymity

  Will Blockchain.info give up my IP address if "requested" by TPTB?

Sure!

  We will not sell, distribute or lease your personal information to
  third parties unless we are required by law to do so.

(always from their "privacy" page)

  Should I be using TOR for all of this?

If you want more protection, yes.
But depending on the usage you do of your bitcoin, it might be useless, as you anonimity is already compromised in other ways.