text:
Allowing Incoming Connection on Bitcoin Core
Good Evening,
I recently installed Bitcoin Core v0.12.1 on my home server (running Windows 7) and wanted to allow it to accept incoming connections and used the guide found here: https://bitcoin.org/en/full-node#windows-7 to ensure I did everything that was needed.  Unfortunately, it hasn't been showing any incoming connection and when I used the connection tool recommended in the guide (https://bitnodes.21.co/#join-the-network), it says my server is unreachable.
I have already setup port forwarding for port 8333 to both my server's IP address, 192.168.1.105 (wireless) & 192.168.1.129 (ethernet).  I ran a port scan on the following websites and they all indicate that Port 8333 is open:

Ping.eu Port Check
WhatMyIP Port Scanner
T1 Shopper Port Scanner

(I would provide links for the above scanners, but I cannot post more than 2 links)
I also created two rules in Windows Firewall (under Inbound Rules) with the following properties:

Local Port - 8333
Remote Port - All Ports
Scope - Local & Remote IP address set to Any IP Address
Domain, Public, and Private all checked
All programs that meet the specified conditions checked
Set to allow the connection
Rule is enabled

There are two rules with the above settings, one for TCP and one for UPD.  Even with all the above setup, the "Join the Network" tool on Bitnodes website (second link from the top) still says my node is unreachable and the debug window inside the program shows 0 incoming connections and 8 outgoing connections.
I'm not sure what else needs to be setup since I completed everything in the guide and port 8333 is definitely open.  Any help or information with this issue would be greatly appreciated.  Thank you in advance.
Dominick

Why do you have two port forwarding rules set up? Why not just set a rule to forward to your ethernet interface?

Originally I did, but when it wasn't helping the connection I decided to add the second rule just to see if it would help, which it hasn't.  Right now my total connections is down to 5 outbound and still no inbound.

Wait for whole chain. Without it your PC will never be full node...

I had the same problem. The port was open, but the test at bitnodes.21.co would fail. However after my Bitcoin client downloaded the entire BlockChain everything worked. I used about 144 hours to download the entire chain with a 150Mbps fiber line.
Before the entire chain was downloaded the test at https://bitnodes.21.co/#join-the-network would give an "Unreachable" error. After it downloaded it changed to Green saying it's reachable.
So you just have to be patient :)

I had the same problem after following all of the usual steps. I waited and it still didn't work. I had to change my computer's firewall (in the Inbound Rules) for the Bitcoin Core (highlighted one below) to have a Private Profile. It was "Private, Public" at first.

You can see if you have both directions working from this icon. Both parts of the U's to the left of the check mark below should be bold. If one of the directions isn't working, it won't be a bold line.

Also you can change the maximum number of connections here:
Bitcoin Core - Wallet > Settings > Options > Open Configuration File
I think mine was only set to max=3 at first.

If all else fails you may try "Port Triggering" whereby your router will open specified ports for incoming traffic based on triggers.  I'm using the Motorola Surfboad / Arris router.  I had to enable this option even though I had set Port Forwarding as required.  Good Luck.  Rob.

On the inbound rule that you have created on your Windows Firewall, go to the Advanced tab and set the 'Edge Traversal' setting to Allow Edge Traversal, by default its on Block Edge Traversal.
I faced a similar problem at first but after changing the above setting, i started getting incoming connections.
Thanks

Try using a blank bitcoin.conf. Then see if you have incoming connections.
If so (it worked for me) then add back your info one by one checking each time by closing bitcoin core and reopening.
I ended up not adding rpcport and it worked !

i need to add that i also couldn't use rpcbind so it could be either the rpcport or rpcbind that screwed it up for me


text:
Will hashing bytes from /dev/urandom yield a secure private key?
From what I've read, a Bitcoin private key is a 32 byte long integer. I take this to mean that to have a valid private key, all I need is 32 random bytes and that, by extension, running
dd if=/dev/urandom bs=1 count=128 | sha256sum

will give me a perfectly secure private key.
Is this correct or have I missed something important?

Due to the internals of SHA256, the resulting key would be slightly stronger if you used count=119. Having count be a multiple of 64 is the worst you can do in terms of entropy of the final output. The optimal values for the input length is 55 plus a multiple of 64, so 55, 119, 183 are good values. But of course what is much more important than the count you specify is the security of the computer you use to generate and store the key.

@kasperd I responded to your comment in my answer.

Short answer: If you are using /dev/urandom as your source of entropy, there is no need to run sha256sum to hash the data. Instead you can use the random data directly to form your key:
dd if=/dev/urandom of=/home/jsmith/private.key bs=1 count=32

Long answer:
The reasoning behind this recommendation is that /dev/urandom is already designed to produce high quality, unpredictable, unbiased random data. Indeed, the most common way to implement such an RNG is to feed raw entropy sources into a cryptographically secure random number generator (CSRNG) algorithm or a cryptographically secure hash function (like SHA-256).
What you are doing by sending urandom's data into sha256sum is almost entirely pointless. If urandom is working correctly, your procedure does not buy you any extra security. If urandom is compromised (e.g. outputting only a few possible sequences), then sha256sum cannot rescue you either, because the hash of a few different sequences is only a few different hashes. However if urandom were unpredictable but badly biased (say it generates 90% zeros and 10% ones), then sha256sum-ing this crappy entropy would help - but this situation is unimaginable for a proper RNG implementation.

To respond to kasperd's comment:

Due to the internals of SHA256, the resulting key would be slightly stronger if you used count=119. Having count be a multiple of 64 is the worst you can do in terms of entropy of the final output. The optimal values for the input length is 55 plus a multiple of 64, so 55, 119, 183 are good values. But of course what is much more important than the count you specify is the security of the computer you use to generate and store the key.

This assertion is false, but the reason is not entirely obvious. How the SHA-256 algorithm works is that takes an input message, pads it to a block boundary with some specific numbers, then combines the hash state with each block in sequence.
Suppose S0 is the initial state, Bi is the ith message block after padding, and H(S, B) is the hash algorithm's compression function. Then we calculate, S1 = H(S0, B0), next S2 = H(S1, B1), etc. until all blocks are processed.
The non-obvious fact, however, is that H is an invertible function when B is known. In other words, we can calculate S0 = H−1(S1, B0). Hence we can say that H takes a 512-bit block B and uses it to permute a 256-bit state vector S into another 256-bit state vector Sʹ.
Because of this fact, it doesn't matter if the last block being hashed is highly predictable. If the previous blocks are unpredictable, then the state S will be effectively scrambled by hashing these blocks. Because the block compression function H is invertible, it can't "collapse" multiple states into one state, thus hashing a predictable block will not undo the state scrambling from previous blocks.

The compression function is supposed to be collision-resistant. If it could be inverted the way you say it could, then that would be considered a vulnerability in the hash function. The part of the compression function which could not be inverted is the final step which adds the result of processing the message block with the initial state from before processing this block.

@kasperd I want to understand what you're saying, but don't know what you are referring to when you talk about the "part of the compression function which could not be inverted". Can you elaborate on that in a comment or send me an email?

The assertion I made about the compression function H being invertible is provably true. In fact it is used by the SHACAL-2 cipher, which I have implemented and tested. Note that the permutation to the state is invertible. I never said anything about being able to derive the block from the state.

I don't know SHACAL-2. You could turn the compression function into a block cipher, if you removed the final addition step. Whether it would be secure is a question I will not even try to address. But if the compression function in SHA-2 really suffered from a vulnerability like the one you describe, it would reduce the trust in SHA-2 enough that people would try to move from SHA-2 to something more secure, and I don't see that happening.

I'm struggling a bit with your answer. If the RNG is compromised (and by looking at the output I can't know that), I think one would gain a lot if one were to use expensive key extension. If /dev/random puts out hash(someSecret, username, milliseconds), the manufacturer would know but the user had no chance of knowing but if I used an expensive key extension to get from seed to mnemonic, similar as mnemonic to masterseed is expensive, an attacker would have a hard time using his backdoor.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
What is the maximum idle time for a node to be considered active?
Maybe I'm wrong but I remember I read somewhere that a node will be considered active for a certain period even if it is not responding for a certain time (something in the order of minutes).
Does anyone know if this is true?
If this is the case, how long is the maximum idle time for a node?

If there is no traffic on a connection, nodes will periodically send a message to maintain the connection. If a node has not communicated on a connection for more than 90 minutes, it is assumed to be disconnected and a new peer will be found.
A more detailed explanation is given in the book Mastering Bitcoin by O'Reilly Chimera. The specific explanation is given here

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Testnet peers list (with IP addresses)
There are some services to get the list of current known peers,
like those offered by 21.co or Blockchain.info
but I can't find anything similar for the Testnet network.
Does anybody know a Testnet peer list?
Actually, it is also very hard to find any IP testnet address.
Is there a reason for that?

Just use a testnet dns seeder.
Type this into your terminal:
dig A testnet-seed.bitcoin.jonasschnelli.ch

or
dig A seed.tbtc.petertodd.org

for IPv6
dig AAAA testnet-seed.bitcoin.jonasschnelli.ch


text:
How to implement multiple wallet folders located out of the bitcoin blockchain folder?
After substantial research I could not find any solution for this seemingly simple implementation of the Bitcoin-Core app.
Here is what I am trying to achieve:
Running a full node on one computer require up do 400GB of drive storage. It appear, after all my research, that if one wants to access more than one wallet from the same computer, it would be required that each wallet be run from a different folder altogether, otherwise the Bitcoin-Core will act strangely, refuse to launch, or ask the user to create a new wallet altogether. Add to that, would also be required that each wallet be launched with a different shortcut, which is well acceptable.
I am running a Windows 7 computer that can hold 1TB on a secondary data hard drive. The first drive is an SSD and is strictly utilized for the OS and software installation. Holding the whole bitcoin blockchain is OK but holding 2 copies or 3 is out of the question, besides would be kind of ridiculous since X times 400GB of the same data makes no sense.
What I am trying to do is be able to launch a different wallet via its own shortcut. After several experimentation the only way I found to do this would be that every time I want to run a wallet I have to replace a whole bunch of files related to that wallet into the \bitcoin folder. This is a tedious task and a relatively unsafe way to do things. Such practice is prone to errors and could potentially be risky to lose some bitcoins.
I’ve experimented with the shortcut option

–walletdir=D:\AllWallets\MyWalletA\

but this doesn’t work for some reason. The parameter is completely ignore without generating any error. The only way I found that could work would be to maintain the whole blockchain 3X into 3 different folders and launch any of them with the appropriate shortcut. An option that require 1.2TB and makes no practical sense since it is utilizing so much hard drive memory storage.
So here is the question:
How can I store a specific wallet located in FolderA that is completely different then D:\Bitcoin\
(were D:\Bitcoin\ would be the complete blockchain location) ?
If I could do that then I could also create any number of FolderB, FolderC, FolderD that would hold my different wallets and that I could launch any of those wallets ( not simultaneously ) when I need to do a transaction. All these folders could store the wallet files but not the whole blockchain.
Thanks for your help

@Prayank, that suggestion does not resolve the problem. I did experiment with " -datadir=D:\SomeFolder " and it does work fine. The problem remains that the wallet.dat file Must reside in D:\SomeFolder for the Bitcoin-Core to open properly. If the wallet in not there Bitcoin-Core will force you to create a new one. I'm sure there is a workaround for this. Still searching. Thanks

You can have multiple wallets loaded at the same time.

One work around the limitation of wallet location is that into the \bitcoin folder there could be a subfolder named, as an example, \AllWallets. Into this subfolder there could be many subfolders containing the files for each wallet desired. These files are the Wallet.dat, .walletlock , and db.log
When bitcoin-qt.exe is launch with NO wallet it will alert the user to either create a new wallet or to utilize the menu “File > Open Wallet” and will offer to open any of the subfolder wallet files that are located into each of those subfolder.  For instance there could be 3 subfolders called \JackWallet , \AlfredWallet and \JoeWallet.
The user can open as many wallets as desired ( it seems ). A selector box will appear into the bitcoin-qt GUI on the top right  corner. This selector will offer to work with any one of the currently opened wallets. This way it becomes very convenient for the user to be able to utilize the wallet of his choice for payment or any other operation. The selection change is quick and appear very functional.
More experimentation is necessary to become familiarized with this newly discovered feature. Although this does not solve the limitation about Wallet location being out of the \bitcoin folder, it sure render the GUI more convenient  for the utilization of multiple wallets.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Where is a good source of information for procedural algorithm to program my own Bitcoin QR code generator?
Not trusting those already available QR code generators available, I would want to program my own. The idea is to input a Bitcoin key ( private or public ) and the program would simply generate the corresponding QR code image as the output. Of course, this program would be run from an offline computer has to preserve a maximum security.
I haven't found any useful source of information about the procedure needed for my project. I've got fare experience in programming BASIC VBA C C++. I can probably figure out some Java or Python codes.
Essentially , I am looking for a tutorial showing the main procedure to input a Bitcoin key and construct the actual QR code.

Here is certainly a good start:  https://www.nayuki.io/page/qr-code-generator-library

You're mentioning private keys, which are obviously not supposed to be shared while the purpose of QR code is to share information.
A QR Code is the transformation of a string into a 2D picture. It could be URL or whatever text. There is no specification for Bitcoin about QR Code.
If you'd like to share a public address for payment purposes, you just have to generate the QR Picture using the public address, some exchange applications support it.
Edit: QR Code generation libraries exists for most of programming languages.

Thanks for your answer. Its absolutely relevant. My view on the question is that the QR code I want  is for my own private utilization and never to be shared. I want this QR code to be printed on paper and then copied onto another material. Hence, the need for a QR code. I would certainly not send my private key over any website offering a QR code.

You can encode a bitcoin public address to a QR code using whatever QR code generator is suitable for your language of choice. There is no reason not to trust existing QR code generators, as these are usually open source and you can study them to make sure that they don't do anything nefarious.
If you want to program your own QR code generator you can do so, but this has nothing to do with Bitcoin. A Bitcoin QR code is simply a QR code of a string that represents a Bitcoin public address.
As for the content of your QR code, if you encode the public string for your address that's usually enough. However, you may want to look at BIP 0021. This proposes a URI standard that allows for other coins as well, and also lets you pass some more optional parameters such as a transfer amount, a label, and a message. Many wallets support this standard.

Yes, that is exactly what I want "If you want to program your own QR code generator you can do so, but this has nothing to do with Bitcoin."     But I haven't had any result so far searching how I can learn how to program it, which was my original question.


text:
What is meant by "Maintenance" of a Crypto Currency Wallet?
I have invested in AltCoin XtraBYte XBY on c-cex.com exchange. My account now as XBY funds frozen because the XtraBYte Wallet status is on "Maintenance".
see https://c-cex.com/?id=ws
Where maintenance is a pretty straightforward word that is clearly understood in English, it remain another thing when we are talking about a cryptocurrency wallet. What exactly do we mean by an account on maintenance? What does it involve? Why a wallet would need to have maintenance? Why would users account be frozen because of a currency under maintenance?
Thanks for your help

Since the initial post of this question, my account as been reset back to normal and I was able to retrieve my cryptos. Thanks to the support people at c-cex.

In order for the exchange to process deposits and withdrawals, they must have an actively running instance of the coin's daemon, which is connected to the primary chain of the altcoin's network (i.e., not on a fork).
Wallet maintenance implies one of several possible things could be happening:

The exchange wallet is not on the correct fork, and needs to be
synced to the proper chain.
The wallet has been updated by the developer and the exchange is in the process of implementing the wallet update.
The wallet daemon on the exchange's server has hung or crashed.

There are likely other possible scenarios, but the general story is always the same: an exchange with a wallet marked as "maintenance" does not have an actively synced, running client of the altcoin available to the customer at that time, and has disabled access to the wallet to prevent customers from placing requests which cannot be completed.
Because the amount of each customers' funds is kept in a database hosted by the exchange, they are able to process trades for a coin despite the wallet being in maintenance.


text:
Asset creation on cryptocurrency/blockchain
I have a question regarding the creation of a blockchain application.
In bitcoin its predetermined before the genesis block is even created, to only release a limit of 21 million bitcoins. Examples such as ripple and ethereum also release the amount of coins they have in their blockchain on creation.
Is the possibility to determine asset on a blockchain only available at the creation?
Lets say for example I want my blockchain to have 1000000 monkeycoins as assets, but 4 years later I want to add another 500000 monkeycoins and maybe 5 years after that another 500000.
Is it a must to say I want 2 million coins in assets on creation or can I add a random amount as long as everyone in the network agrees on the creation of the asset?

That depends on the protocol you are using to create the assets.
For instance, with Colu's Colored Coins protocol (a protocol that works on top of Bitcoin), the issuer of an asset explicitly specifies if the asset is reissuable in the future or not (when he first issues the asset). If the asset is issued as locked, then even the issuer can not reissue more units of the same asset in the future. On the contrary, if the asset is issued as unlocked, then the issuer is able to reissue more units in the future. Note that if the asset is unlocked, then the issuer alone may decide to create new units of the asset (there is no need for the "network" to agree on this).


text:
Is it feasible to derive the root key of an HD wallet from a large sample of child public keys?
I'm considering the following architecture for a bitcoin-related service:

A BIP 32 HD wallet is created that controls all of the account keys for the web service. The private key is kept in cold storage, and the public key is stored on the server and used to assign bitcoin addresses deterministically to new accounts by deriving child public keys from the root public key.
Users can send money to the bitcoin address corresponding to their account in order to pay to use this service.
Money deposited by users is signed to my business account using an offline process that has access to the cold storage containing the private key

It wouldn't be difficult for an attacker to gather a large sample of child public keys (either by looking at the blockchain after I consolidate all of the micro-deposits) or by signing up for a bunch of accounts.
My question is this: Would having a large pool of these child keys make it easier to derive the private root key (since they are computed deterministically), or would there be no statistical advantage over attempting to brute force one of the child private keys (which can then be used to derive the root key)?
Thanks in advance. My understanding is that this is still secure, but I wanted to check with some of the experts here.

According to Mastering Bitcoin chapter 4 Hardened child key derivation, the master key is protected.

As a best practice, the level-1 children of the master keys are always derived through the hardened derivation, to prevent compromise of the master keys.

So special care is made by wallets to protect that key specifically. Knowing the child indices, entropy, and child keys don't expose the master key as long as you keep the master key itself secure.
The chapter goes on to explain the normal child derivation's associated risks, but those are xprv keys.
Edit:
HMAC-SHA512
index   -->|HMAC-  |
master  -->|SHA512 |-->lt 256 bits --> + index + master --> child key
chain   -->|       |-->rt 256 bits -----------------------> chain

This is how I reimagined the diagram from chapter 4:

The parent public key, chain code, and the index number are combined and hashed with the HMAC-SHA512 algorithm to produce a 512-bit hash. The resulting hash is split into two halves. The right-half 256 bits of the hash output become the chain code for the child. The left-half 256 bits of the hash and the index number are added to the parent private key to produce the child private key.

This didn't show the resulting addresses, but the text describes their
behavior as identical to random addresses.
Source Code
https://github.com/btcsuite/btcutil/blob/master/hdkeychain/extendedkey.go
170 starts comments describing how the IsPrivate flag is assigned.
 For a hardended child, it must derive from extended private key.
https://github.com/btcsuite/btcwallet/waddrmgr/wallet.go
2029 shows the BIP0044 HD structure
 being defined by using the 44 + hdkeychain.HardendKeyStart (upper 2^31 range) value
m/44'/<coin type>'/<account>'/<branch>/<address index>

https://github.com/btcsuite/btcwallet/blob/master/waddrmgr/address.go
316 newManagedAddressFromExtKey we know IsPrivate is true and calls newManagedAddress
 on 286 which generates the pub address using the same logic from public key at 301:
ripemd160( sha256( publickey ) )

where the publickey is elliptic-curve paired to prv
I believe the EC property is still what makes the resulting addresses irreversible.
Looking at the identifier notation, you can make guesses about common values:
m/44'/0'/1'/1/1

Assuming this is a very common HD wallet identifier, the other inputs are the root
seed and the pass phrase.
Collecting Significant Pool of Addresses
With the EC property, no amount of addresses collected can be reversed-hashed, then
reversed-EC'd to obtain the private keys.
So then the work could be to iterate through all possible inputs (seed, pass-phrase)
with the common
BIP0044 HD identifiers, and compare results to the collected addresses. Not trivial task.
Another layer of protection I can see, is to fan out at the child of the index:
m/44'/0'/1'/1/1/<here>

Import that public key to the online wallet. At each branch, you are increasing the
possible addresses by 2B. If the online wallet in turn generates a child per user,
that person only ever "collects" addresses for his/her branch; 2B addresses and
still they will not see addresses for a sibling user.
Reversing here only reveals the public key, another deterrent.

This does not seem to answer the question.

The problem with hardened child keys is that their public keys cannot be derived from the public (xpub) root key. I'd therefore need to store the root private key (xprv) on the server, which is quite risky.

Actually, I had questions of my own trying to work out the math earlier; I'll do another attempt and look at the code to see if I can improve this explanation.....


text:
Is it possible to run Bitcoin-Client and Bitcoin-Full-Node on two different computers?
I have my Bitcoin-Full-Node running on a Raspberry Pi4 hard wired on the home network.
Is it possible to install the Bitcoin-Client on another computer connected to the home network, but avoiding to install the full blockchain ? By doing this, my personal wallet would strictly be stored on my PC and I could initiate transactions from that PC.
Because the Pi4 running the Bitcoin-Full-Node would be ON 24/7, it would be the main server for information for the Bitcoin-Client.
I’m I understanding this properly ? I that feasible ?

The Bitcoin Core software only implements a fully-validating node. It has no other mode of operation, so it will always download, verify, and optionally store, all blocks. By running in pruning mode it is possible to only keep the last few 100 blocks on disk, but all earlier ones will still be downloaded and validated fully.
There are many other Bitcoin clients out there however, many of which are far more lightweight. Some of them can connect to a specified node of your choosing. Software recommendations are off-topic on this site, however.


text:
Why instructions to upgrade Bitcoin Core do not require all new files?
On the BitcoinCore web page, instructions are clear for the upgrade procedure:

“If you are running an older version, shut it down. Wait until it has
completely shut down …  just copy over bitcoind  /  bitcoin-qt  (on
Linux).”

Only 2 files are required to be copied into the Bitcoin installed folder.
Yet, when looking into the whole downloaded installation compressed file, once uncompressed, appears four folders, bin, include, lib, share. All four folders contain files of different size than the ones present in the previous equivalent folders already in the running Bitcoin version.
In all there are 12 different files for Bitcoin-Core 26 .vs. Bitcoin-Core 25.
The Question: Why instructions provided demand to simply copy 2 files where both versions contain 12 different files ?  Why not renew with all 12 newer files ?

Various tools, utilities and libraries are distributed along with Bitcoin Core. These instructions are for the regular Bitcoin Core user who is just concerned about running a node. Users of the utilities / libraries are more experienced and can figure out for themselves how to upgrade.


text:
Does adding more miners create more bitcoin?
I was on another forum and the claim was made that the miners using new technology GPUs are flooding in and because of this there will be more bitcoin produced.  My understanding of block rewards is it's like a horserace between miners (or group of miners) to solve the blocks and the 1st to solve gets all of the reward.
Who is correct?

I was on another forum and the claim was made that the miners using new technology GPUs

GPU mining has been obsolete for Bitcoin mining since around 2014. All mining these days is done using custom chips specifically designed for Bitcoin mining. It is orders of magnitude more power-efficient.

and because of this there will be more bitcoin produced.

Bitcoin has a fixed inflation schedule: 1 block every 10 minutes, and every block currently permits a subsidy 6.25 BTC (a number that halves every 4 years). The difficulty of producing a block goes up (or down) automatically as hashrate is added (or removed). This has a slight delay, so if the hashrate is continuously increasing, blocks will be produced slightly faster than 1 per 10 minutes, as the difficulty will always be slightly behind. This does increase the rate of inflation while it lasts, making the total supply be permanently ahead of schedule. However, due to exponentially decreasing subsidy, the limit is and remains approximately 21 million, regardless of block production speed.

My understanding of block rewards is it's like a horserace between miners (or group of miners) to solve the blocks and the 1st to solve gets all of the reward.
Who is correct?

Block mining is like a lottery, where every hash tried is one ticket. The lottery is always sold out, so there will be always one winner. There is a new lottery on average every 10 minutes.
It is not like a race; a race would imply that the fastest miner always wins. This is not true, everyone wins approximately proportional to what percentage of the network rate they have.

Thanks for the answer ... so there hasn't been a breakthrough in GPUs to allow bitcoin mining even in a pool?

They can, it's just incredibly unprofitable. Even ignoring electricity costs, the wear and tear on the hardware is going to cost more than what you make. This is not ever going to change; custom hardware is obviously more efficient than general purpose hardware.


text:
Transaction pending
I received the bitcoin yesterday, and I was told " it may take up to 30 minutes before your bitcoin is available to trade". But until today they are still not available. I'd like to know the reason and how soon they are going to be available. Thank you.

The most common holdup in this kind of situation is that the Bitcoins are not confirmed.
Depending on the circumstances this may resolve itself in five minutes, take longer than that, or never resolve itself without human intervention.


text:
Failed of genesis!
fruitd: chainparams.cpp:207: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x000000004421dbf94542db9b40e4bc60da8ce6b793f00924cadf5677d364a6a1")' failed.
Aborted
used fork emercoin
https://github.com/emercoin/emercoin/blob/master/src/chainparams.cpp
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTimeTx, nTimeBlock, nNonce, nBits, nVersion, genesisReward);
genesis = CreateGenesisBlock(1533183609, 0, 3712766900, 0x1d00ffff, 1, 0);

what is nTimeTx, nTimeBlock and how generate this?
i used this for generates https://github.com/liveblockchain/genesisgen

https://github.com/emercoin/emercoin/blob/master/src/primitives/transaction.h
const uint32_t nTime;                    // PPCoin: transaction timestamp
The bitcoin genesis block has a timestamp that is nTime.
For emercoin there seems to be two timestamps, one for the genesis block and one for the coinabase transaction. So in this case nTimeBlock is the original nTime and nTimeTx is the transaction timestamp.

how to generate transaction timestamp. this from fork or i used emercoin timestamp. but fail like up there. need tools like genesis block?any clue sir. how to generate this.


text:
Unconfirmed Transaction[3]
Have problem. Sorry duplicate. and still not understand works
And on Bitcoin-QT

PS im confused how to back that money ~_~(cancel it)

Based on the current fee lever from https://bitcoinfees.21.co/, the fee rate should be 200 satoshi/byte, with you tx, you at least include 0.002 as fees, considering the sending amount. I advise you delete this transaction or wait for the network to forget it. you could have a look this article for more details http://coinour.com/index.php/how-to-do-with-stuck-bitcoin-transaction/


text:
How to access market price from Python?
I am struggling to get access to the kind of information I have on cryptowat.ch. For example on Kraken there is an API, but I didn't find how to get the past history, the volume information, etc.
Is there any straightforward solution for this?

Perhaps you can use the Python library CCXT:
https://github.com/kroitor/ccxt
It offers an homogeneous interface for accessing market data at different exchanges like Kraken, Coinbase, Bitstamp, etc...

Here is the documentation:
https://cryptowat.ch/docs/api
https://api.cryptowat.ch/assets
This URL gives you a response with their assets, btc is also there as {"symbol":"btc","name":"Bitcoin","fiat":false,"route":"https://api.cryptowat.ch/assets/btc"}
We can see the "route" is https://api.cryptowat.ch/assets/btc
Which should give us more information:
{"exchange":"kraken","pair":"btcusd","active":true,"route":"https://api.cryptowat.ch/markets/kraken/btcusd"},
https://api.cryptowat.ch/markets/kraken/btcusd
contains information on how to get btc/usd prices etc
.../markets/kraken/btcusd/price
Gives following result:
{"result":{"price":7208.6},"allowance":{"cost":864413,"remaining":7999135587}}
Which is the price in usd for btc on kraken.
In the last URL "kraken" is an asset and "btcusd" is a pair. These can be replaced with different assets(exchanges) and pairs(two currencies).
In order to get past history you can simply use:
https://api.cryptowat.ch/markets/kraken/btcusd/trades
Returns 50 last trades.
You can also pass arguments or "params" in the following way
.../markets/kraken/btcusd/trades?limit=100
.../markets/kraken/btcusd/trades?since=1481663244
Comined:
.../markets/kraken/btcusd/trades?limit=100&since=1481663244
This way you can get past history and all other info.


text:
How exchange platforms work?
I am wondering how exchange platforms such as Kraken or Bitfinex can survive bubble exposions? People exchange real currencies for cryptocurrencies. When a bubble explode a lot of people want to trade cryptocurrencies for real currencies so the exchange platform will lack liquidity.
How do they can survive and avoid bankrupt?

This is not really a bitcoin related issue.  As long as the exchanges have 100% reserves, they can always pay.  This means they need to have the sum of all balances of all customers on their own account.
The problem is that some exchanges apply a fractional reserve.  Using part of the users money to make investments or to cover operating costs.  You are correct to be worried for those exchanges bankruptcy should exceptional selling occur.
Kraken has a concept where they try to cryptographically prove their reserves https://www.kraken.com/security/audit
Not sure if other exchanges also have such a concept.

They can't survive this explosion. New exchanges like binance are coming out and they will replace the old exchanges.
Here's a guide to choose the best exchange if you want -> https://medium.com/@redqop89/trading-guide-for-bitcoin-ethereum-ripple-and-other-cryptocurrencies-6773ab4b6b2


text:
Who decided that segwit2x isn't going to happen?
I have read this article:
https://lists.linuxfoundation.org/pipermail/bitcoin-segwit2x/2017-November/000685.html
Since bitcoin is a decentralized system, who's decided that segwit2x isn't going to be deployed?

Key proponents of the New York Agreement have rescinded their support after large parts of the community opposed their initiative for months. Theoretically, a miner could still activate the fork unilaterally, but the expected value of the Segwit2x network dropped significantly with the exit of said key proponents.

Though its major proponents have called it off, there's a miner with an unknown (likely less than 10%) amount of hash power vowing to continue: https://cointelegraph.com/news/segwit-death-challenge-bitpico-vows-to-fork-as-bitcoincom-goes-100-bitcoin-cash
You can monitor miners who are signaling for Segwit2x by looking at the coinbase of blocks here: https://coin.dance/blocks#blockDetails


text:
What is the cost of setting up a bitcoin account
does it 'cost' anything to set up an account? If bitcoins are virtual, why/how does an exchange rate work?

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

You are asking 2 very different questions so here goes:
1) Bitcoin wallets are free to create and use. blockchain.info, for instance, allow you to create an account and receive Bitcoin instantly. The only real cost is when you send coins out to someone - you have to pay the miner fee. The best you can do is read about it here https://en.bitcoin.it/wiki/Transaction_fees
2) Bitcoin are as virtual as Euros or US Dollars - it's a currency which you can trade like any other currencies. Few notable differences though - Bitcoin is finite, meaning there can only ever be 21 million Bitcoin ever produced. Miners are producing the coins by solving a complex algorithm. The more Bitcoins are mined, the more complex it becomes to mine and therefore more expensive in terms of resources (read electricity and hardware). Nobody can set a price to a Bitcoin, it's a market driven by demand and it is way more volatile than general currency trading. Exchangers just allow users to buy or sell Bitcoin for another currency but there is no guideline. That's why a lot of users are doing arbitrage between different exchangers in order to get the most profit out.
Hope that helps you

Nice answer, just a little correction: the difficulty of mining is actually independent of the number of bitcoins that were found, but rather it solely depends on the amount of mining power that is competing to find blocks.


text:
Bitcoin compilation error: conflicting declaration
I'm trying to compile the Bitcoin source (1) on Ubuntu and I get:
In file included from bench/data.cpp:10:0:
./bench/data/block413567.raw.h:1:40: error: conflicting declaration ‘const unsigned char benchmark::data::block413567 []’
 static unsigned const char block413567[] = {
                                        ^
In file included from bench/data.cpp:5:0:
./bench/data.h:14:35: note: previous declaration as ‘const std::vector<unsigned char> benchmark::data::block413567’
 extern const std::vector<uint8_t> block413567;
                                   ^~~~~~~~~~~
...
/usr/include/c++/7/bits/stl_vector.h:270:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:259:7: note: candidate: std::vector<_Tp, _Alloc>::vector() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]
       vector()
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:259:7: note:   candidate expects 0 arguments, 2 provided
Makefile:10306: recipe for target 'bench/bench_bench_bitcoin-data.o' failed
make[2]: *** [bench/bench_bench_bitcoin-data.o] Error 1

Internet searches aren't giving me very actionable clues.

master latest 3489b715120b1bf7559fbddf03cd87b889fdca47

A temporary solution is to add --disable-bench to ./configure to disable benchmarks until this is fixed.

But this is somehow cause by this line. _raw is not appended for some reason. I'd suggest submitting a bug report at https://github.com/bitcoin/bitcoin/issues

That worked, want to add your comments as an answer? And we'll mark this as solved. I created the GH issue: https://github.com/bitcoin/bitcoin/issues/16479

I needed to remove stale files from old builds, just run make clean.
https://github.com/bitcoin/bitcoin/issues/16479#issuecomment-515791321


text:
How is a stratum connection secured?
Does stratum mining use something similar to "https" to secure traffic between the pool and the miners?

No, all traffic is plaintext. The connections are hijackable and attacks against this have occurred in the past where ISPs redirected hashrate to themselves.

Really?  So there is no way to have username/password logins for the stratum miners either I guess (if it's all plaintext).

They have logins, but it’s all in plaintext so can be stolen by observers or redirected.

Oh.  Do you know a more secure mining method for pools?  And how many miners can that method handle on one pool?

You can wrap a normal stratum socket (or any tcp connection) with SSL using stunnel, but this needs to be supported by the pool as well as the client. As far as I know nobody does this presently.

Thank you but my question was if you know a more secure (than stratum) mining method for pools, and how many miners such pools can handle.  I worry about HTTP because I'm not sure if they handle https and I hear that they don't handle lots of miners at one time.

Stratum is JSON over raw TCP, there's no HTTP involved in it. There's no other protocols in use, 21.co had a binary protocol based on protobuf but there's nothing using that today. It also, was not encrypted or authenticated.

I didn't say Stratum uses http.  But http mining is a thing that exists.  I am trying to decide if using it would be preferable from a security standpoint.

HTTP based mining hasn't existed since 2011 with getwork and getblocktemplate which never gained any adoption. For very latency sensitive things (i.e., mining) HTTP is a ridiculously bad choice.

That's helpful.  Some mining pool software on Github offers HTTP so I thought it was a viable alternative.  I wonder why EthOS still requires you to specify stratum if stratum is all that's used?


text:
Good way to test Electrumx?
Has anyone else gotten an electrumx server up and running lately?
I have just gotten to the point where I'm not seeing any errors during "# service electrumx status", but I'm also not seeing my server listed in my Electrum client.
Can you think of a good way to test whether the server is working?
I would especially hate it if it did appear but still didn't work!  I don't want anyone to lose money because of me.

A good way to test if the server works is to send a small test transaction to yourself.  You will need to tell your client about the server.  For example try using electrum -1 -s localhost:50002.  The -1 makes it so you only connect to one server.


text:
How does BitPay detect unconfirmed transactions so quickly?
I understand that BitPay accepts unconfirmed transactions.  My question is how they manage to find these so quickly?!
In my limited experience, even an unconfirmed transaction doesn't appear on my node for some time.

That is feature of Bitcoin node network.
When your client sends your transaction to network, every node is also sending your transaction to every other connected nodes. In about 5 seconds it is broadcasted in every place in world.


text:
Will bitcoin unlimited affect BTC?
I am hearing about a new crypto currency BTU with another block chain. If BTU comes up,

What will happen to our existing BTC? Can we still use those? Will those be of no use?
Will the price of BTC rise or fall?
Will the price of BTU be same as BTC?
Can we convert BTC into BTU?

Appreciate your quick response.

This is four separate questions posted as one, which is discouraged here.  One of them (#2) is off-topic for this forum.  The other three are valid, but most likely have already been asked and have good, established answers here.  I suggest searching for each question (generically, and not specific to BTU), and asking new questions if you need any clarification.

What will happen to our existing BTC? Can we still use those? Will those be of no use?

At this point it seems likely to me that the BTC chain will survive a hard forking attempt by BTU. Really, except for an impressive hash rate it seems to have almost no other support.

Will the price of BTC rise or fall?

Both. Probably not at the same time. Who knows really.

Will the price of BTU be same as BTC?

No. Most likely they will be freely traded against each other.

Can we convert BTC into BTU?

After the split, the same coins will exist on both chains at first. After disintermediating them, you should be able to sell one for the other, if both have sufficient buyers to maintain any sort of price greater than zero.


text:
Buying large quantites
I am new to this Bitcoin thing but I have a closing next week and will have $50K that I am looking to wire to someone to purchase Bitcoin.  Where is the best place to do this?  What about one that does not require ID as well?  Thank you for your help

You don't say what country, but I assume you are in the United States.
First things first: make sure you have the technical capability to handle the coins and understand how Bitcoin works. You don't want to buy those coins and then lose them due to a technical screwup. Practice first with a smaller amount of money until you are confident you securely handle and store coins.
The better known dealers will require identification. Genesis Trading in NY is one of the larger US brokers.
You can also use an exchange directly such as Bitstamp (in Luxembourg/London) or Bitfinex (Hong Kong) or Coinbase (San Francisco) or Kraken (San Francisco). All will require a lot of identification and verification information. There is an exchange in Bulgaria (?) called BTC-e that has a reputation for not requiring very much information, but they probably require at least a passport scan.
For anonymous trading you will have to use Local Bitcoins, ie individual small time dealers. Each dealer has their own policies.
Your question is kind of a basic question. That you would even ask a question like this suggests that either (1) you need to learn more before trading Bitcoins, or (2) you are some kind of Fed or narc who is looking for information about something they want to attack without really understanding it.

I need to learn more and am trying.   DO you know of a USD wallet where I can have my funds wired and then buy smaller amts of bitcoin?

It will be difficult to find a seller willing to sell such an amount of bitcoins to an individual - even with ID verification. To buy such an amount, that individual will need to fill in an anti money laundering / know your customer form. This can be found on bitbargain and I assume other online bitcoin accounts. Bitbargain is the one I use.
Hope this helps

Thank you.  Do you know of a USD wallet where I can wire my funds and then buy smaller amts?


text:
bitcoin-cli createrawtransaction and purpose of "scriptPubKey"?
I am playing with P2SH on regtest and try to understand the logic of creating and signing tx with bitcoin daemon. I am on version 0.15.1, and try to create a tx.
The used  scriptPubKey results from a simple if/else/endif statement, not from a standard multisig approach. So I manually created the redeem script, and turned it into an address (beginning with "2"). I then created a transaction, that funds this address. Now I want to spend these funds. While creating the transaction, I discovered that the usage of "scriptPubKey" does not change anything in my output.
Example without "scriptPubKey":
bitcoin-cli -regtest createrawtransaction '''[{"txid":"'b5b67997f36627a461cd5ee1951aa775a68faa0c11c50b8f068ea1c7f4a9b087'","vout":'0'}]''' '''{"'mgpe9b44YYYbhDE1dbWosCSQDPYFkkoHjt'":'9.99995000'}'''
020000000187b0a9f4c7a18e068f0bc5110caa8fa675a71a95e15ecd61a42766f39779b6b50000000000ffffffff0178b69a3b000000001976a9140e507731ec9a94d454424f3ca65917a2abb45f4988ac00000000

Example with "scriptPubKey":
bitcoin-cli -regtest createrawtransaction '''[{"txid":"'b5b67997f36627a461cd5ee1951aa775a68faa0c11c50b8f068ea1c7f4a9b087'","vout":'0',"scriptPubKey":"'a914d53c738d730d8623eb2a070833599157beb3f6f687'"}]''' '''{"'mgpe9b44YYYbhDE1dbWosCSQDPYFkkoHjt'":'9.99995000'}'''
020000000187b0a9f4c7a18e068f0bc5110caa8fa675a71a95e15ecd61a42766f39779b6b50000000000ffffffff0178b69a3b000000001976a9140e507731ec9a94d454424f3ca65917a2abb45f4988ac00000000

The result is exactly the same. When the result is the same, what is the purpose of using this field as a parameter to "createrawtransaction"?

I don't see anywhere that scriptPubkey required when you create a raw transaction.
https://bitcoin.org/en/developer-reference#createrawtransaction

Currently, the create raw transaction method only uses the txid and vout parameters from that argument. You can view the relevant part of the source here.
For all practical purposes, you could pass in 00 for the scriptPubKey and still get the same result.

You are right, I've been working with all addresses types and I've never attached it. so yes, it's totally not required. you don't even have to pass anything.

Yup, this was also my assumption, based on my tests (and perception). It’s just that I am not good enough in understanding the sources - and I am not comfortable with the „code is documentation“ approach... thx for confirmation!

@pebwindcraft Where did you even read about passing a scriptPubKey argument there? As far as I can see this is not mentioned anywhere; not in the code, not in the RPC help, and not on the developer documentation on bitcoin.org. There simply is no such field, expected or used in any way.

@PieterWuille Looks like it was mentioned in some issues/examples years ago, and a bunch of tutorials now just copy that: https://github.com/bitcoin/bitcoin/issues/6483, https://bitcoin.stackexchange.com/q/35750/7272

@RaghavSood Ah, I see. I think it's just signrawtransaction that need scriptPubKey (when the UTXO is not known to wallet or node), and people simplify things and pass the same argument to createrawtransaction as well - but it has never had any use there.

@ PieterWuille (and all): indeed, also with the current daemon (v0.16.0) "bitcoin-cli -help createrawtransaction" there is nothing mentioned with "scriptPubKey" in the documentation. I surely used "older" posts. I thought I'd get an error when providing a wrong parameter, just to find out that the above example returns no error. I also tried to provide "scripPubKey_xyz" or "scriptPubKey_abc", or several other parameters. "bitcoin-cli createrawtransaction" would not through an error on these wrong or useless keyword parameters.


text:
Explanation of parameters from bitcoin/src/chainparams.cpp
Please explain the following parameters in bitcoin chainparams.cpp file

consensus.powLimit =
  int256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
         consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
         consensus.nPowTargetSpacing = 10 * 60;
         consensus.fPowAllowMinDifficultyBlocks = false;
         consensus.fPowNoRetargeting = false;


text:
Transaction unconfirmed for 5 days, and I don't think the fee is the problem?
I sent a transaction of ~0.408 BTC February 20th through Electrum and my transaction is still showing up as unconfirmed. I also cannot resend my transaction through Electrum as the coins are still unconfirmed. Here is my Tx on the Blockchain
https://blockchain.info/tx/0a33becac294dd987f2374f3fcbba2b4a37cbca6807e8296e2d439f919cafe36
I included a fee as well. Any idea whats wrong or how I can retrieve my Bitcoins?

The fee you have set leads a "fee per byte" value of ~20 satoshi/byte, as you can see on the blockchain.info. It's too small currently, as transactions with fees lesser than 60 sat/B doesn't seem to be trusted to clear right now, as you may see here: bitcoinfees.21.co. I could help you with clearing it, but I'm pretty sure the thread about it already exists here. The problem is likely solvable, good luck.


text:
Check if an address is new or has been used already
Say, I have an address. I can check if it's watch-only by calling validateaddress. Is there such an easy way to check it that address is new or has been used already?

maybe be a bit more specific, which client you use... I assume bitcoin core? In bitcoin core there is the command line interface (bitcoin-cli), that allows to send requests to the client. Specifications here:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
"getreceivedbyaccount" or "getreceivedbyaddress" could do the jobe here.
Also, there are many blockchain "service" companies, which provide a web interface to look at the blockchain. For example:
https://blockchain.info/
On the top right you can enter an address, and see if you have already transactions used with it.

maybe you should read my question one more time -- RPC INTERFACE OF BITCOIN CORE!!!!!!!

authors: Евгений Королишин


text:
What happens when a node goes offline for a while?
Let's imaging a full node goes offline for a month, so they're missing ~4300 blocks (just using 10min/blk).

Are there any message exchanges that receive transactions to help sync the 'booting' node with the other peer node's mempools? (I.e. compensate for having a empty tx mempool)
Approx. how long it take (presume the 4300 missing block ex.) to receive the missing blocks?
What is happening during this time if the node is receiving propagated transactions? Or even a newly solved block?

Thanks!

Full nodes are always in a perpetual state of "catching up to the network".  This is true if they are just booting up for the first time, have been down for a month, or have been running since the network began.  Nothing is fundamentally different about their operation.
The amount of time a node will take to catch up is determined mostly by a) how many blocks/transactions it still needs to verify, and b) how fast the node is at verifying blocks/transactions.  To a lesser extent, it is also determined by network speed (how fast it can receive blocks/transactions), but the bottleneck is usually the computational power of the node.


text:
Bitcoin Core lost coins
i have lost a bit of coins using Bitcoin Core wallet.
I have send my coins from Bitcoin Core wallet to my address on Bitstamp(copy/paste,no mistake here) and on my Bitcoin Core wallet has said "sent" as allways...than my computer crashed and there was no way of fixing it other than format an re-install Windows. I know it was stupid not to have a backup of wallet, but it is too late for that. I tryed to find the transaction using the addres i have send to, but there is no transaction found.
I have no other info about my wallet, except a couple of addresses that i have generated on my Bitcoin Core wallet, when i was sending coins to my Bitcoin Core wallet.
Is there ANY way i can get my coins back?
And if not where are thay?
Will pay a finders fee :)

There's no way we can tell without the addresses involved or, at the very least, the timeline. Also, your description is vague everything. For example, you say "I tryed to find the transaction using the addres i have send to, but there is no transaction found" which doesn't tell us much because we have no idea what you tried.

Hi,thank you for responding...the addresi have send to is:3Bhe7JyMo5QyhHXMFveCNu9zJgVQbWkd5L i think it was on the 7.4..  i contacted bitstamp(where my reciving  wallet is),but thay said-  there have been no BTC sent to any of your BTC deposit addresses lately. In addition, there are no recent transactions broadcast on Blockchain. We would also kindly suggest you contact your wallet provider, as they should be able to assist you better.

Sorry it was on 6.4.

How long ago did you first attempt to send these coins? I do see transactions from January.

Hi, no i have send just once on 6.april 2017, and none of the block explorers can find it. I think my only chance i still have that i find the wallet data on my hard drive using using one of them recovery softwares. Do you know anything about that... what file am i looking for, and what to do with it,if i do find it? Thank you

You're looking for wallet.dat.

Is there ANY way i can get my coins back?

No because you

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

And if not where are thay?

They are in the blockchain but can never be used.


text:
How to get Bitcoin historical data from Bitcoin-Core?
I installed Bitcoin-Core Wallet and downloaded the whole 130gigs BlockChain. Now I'd like to read the BlockChain Data to know all bitcoin values since the beginning. Not sure how to start. I need that data for making my own graphs in Excel
How can I read data from the whole BlockChain? Thanks.

What do you mean by bitcoin values?

It sounds like you are asking how to build a block explorer. Basically you would activate the full transaction index by adding txindex=1 to your bitcoin.conf. Parse all the history data and dump it into a database. Then keep track of all the new transaction data on your own database as blocks come in with blocknotify or real-time with ZMQ notifications.
https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md#usage
There's also options like bitpay's bitcore that pretty much does the work for you. It does require a lot more HD space though.

My understanding of your question is that you want a tool that parses/queries the blockchain and saves the results into an Excel file. I'm not sure that something like that exists, but if you're willing to experiment with code then there are options.

Abe is a block browser for Bitcoin & similar currencies. Written in Python.
BitcoinJS is a javaScript library for the Bitcoin blockchain.
fast-dat-parser a blockchain parser written in C++.

Each of these libraries is capable of reading the blockchain, and the languages have other libraries for saving data to Excel, CSV, in a database, etc.

Checkout this API:
https://blockchain.info/api
Specifically look at "Transactions & Blocks Data" & "Market Data".
With PHP you can use that API and work with the data. PHP also allows you to create and export to Excel sheets: http://www.the-art-of-web.com/php/dataexport/
For me, because I know PHP, this would be the easiest route to go.

OP is asking how to read data from the blockchain that his Bitcoin Core instance downloaded, not how to use a 3rd party API.

I was just telling him how I would do it as the last line of my answer says. Any bit of information helps that is relevant. Maybe if he knew PHP he would find it easier to do the route I recommended. But I do see your perspective.

authors: Сергей Федосеенко


text:
How to access bitcoins with my private key but no passphrase?
I  utilized a website, bitcoinpaperwallet.com, to randomly generate a Private and Public key pair for Bitcoins storage.
This new Public address is now available for anyone to send bitcoins into.
If I want to make transactions with those newly acquired bitcoins I have to open my bitcoin wallet (it my case it would be bitcoin-qt) and introduce this new private key from the console window to be able to access the funds.
Instructions for such operation apparently is as follow:
importprivkey 5KsomeCaracteresAndNumers765whichIsTheactuaLPrivKey  NameOfKey false
This does not work because the wallet require a PassPhrase. Here is the generated error:
Please enter the wallet passphrase with walletpassphrase first. (code -13)
bitcoinpaperwallet.com  did not issue any PassPhrase for my private-public key.
THE QUESTION:
How do I enter my private key into bitcoin-qt to get access to the funds ?

The passphrase is for the bitcoin core wallet application not the keys and address you generated. See https://bitcoincore.org/en/doc/0.17.0/rpc/wallet/walletpassphrase/

This should be a wallet passphrase that you previously set within Bitcoin Core.  It's only needed so that your newly imported key can be encrypted with the same passphrase and stored with your other keys.  If you have forgotten it, you can start over with a new wallet file.

By the way, if you actually want to be able to spend coins received on the address prior to importing it, you'll have to change the false to true (and wait for a rescan to complete, which may take hours).

re: @NateEldredge 's comment: rather than wait hours, if you know the blocks that include your relevant transactions, you could leave importprivkey ... false and then after that run rescanblockchain ("start_height") ("stop_height"). That would be much quicker, as there is no need to rescan everything if you know the relevant block heights.


text:
If I restore my electrum wallet from seed will I lose my pending transaction
So I have seen everywhere that boosting fees can be a scam and I do not have enough techy knowledge to do so anyhow or for that matter to directly delete my transaction using pythonwallet.
Whilst sending my transaction I noticed I could set the amount of fees on it and naively decided to set it to the minimum grinning at my own cunning and simultaneously frowning at why it would let me do that. 2 hours later when my transaction was unconfirmed I started to think something unusual might have happened and since (24hrs later) I have spent most of my time learning about bitcoin transactions, something I might have done beforehand...
Anyhow, now I am looking to stop my wallet rebroadcasting the transaction in the simplest way possible so that I can recover my money and send it again with a higher fee and having enabled the replace by fee option. Can someone quickly reassure me that if I restore my electrum wallet by seed it will stop the transaction and that my funds will come back to me and maybe give me some info on how long that will take. Thank you.

Your transaction is out in the network. It doesn't need to be rebroadcasted by your wallet (which probably doesn't do this anyways all by itself) in order to survive. It just needs to be in someone's mempool. Deleting your wallet will not stop the transaction. When you delete your wallet and restore it with your seed, you will have access to the same money you have access to now, but the notes you may or may not have stored in your Electrum wallet will be gone.


text:
Lost Account/ Wallet
Back in I want to say 2011-2013 I was working and I was tipped by a man who was all excited to show me this new form of currency. I had created an account that he had sent me coins over. Since then I have lost/ switched phones and can't remember the exact app that I had at the time. Is there any way to look up my name and email?

I feel for you, whatever you were tipped would be worth like 10x now :(. I guess there's no way to retrieve that phone? If you know the guy who tipped you...ask him for his address and search it up in blockchain.info you might be able to find where your address is. Then you just need the password if it was an online app.

Two options: if you had an online wallet, maybe you could retrieve your login via e-mail or something; in case you had a software wallet, you would need access to it to retrieve the private key -- still on that second case, if it was a HD wallet (Hierarchical Deterministic) and if you have the 12-word backup you can recover it on the same software (and maybe on a different one that uses the same protocol).
-
TM

Try the mainstream wallets like Coinbase, blockchain.info, etc and see if they look familiar and try to log in.
The hard part about your situation is that it's kind of the point of the Bitcoin system. Its like cash. So in a essence a few coins fell out of your pocket at the movie theater. It's online cash.


text:
Is the purpose of proof-of-work the immutability of the blockchain?
I have a disagreement with a person: I believe that the primary and most important goal of including proof-of-work (and therefore the nonce) in a block is to make it hard for an attacker to change that block (and since we are talking about a chain the next ones) without committing enough resources to recalculate not only the current but also all the blocks after that. Without it the attacker could simply create forks of the blockchain without any problems (free).
He claims that it is a mechanism is there to solve the problem of determining representation in majority decision making. If the majority were based on one-IP-address-one-vote, it could be subverted by anyone able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote.
Who is more right?

They both seem right to me. If votes are expensive, it's hard for anyone to change the majority vote.

Immutable transactions are a consequence of blockchain-based systems when the following are true:

There is a cost (in currency and in acquiring materials) of producing a block consistent with the rules of the protocol, and this cost cannot be circumvented
The cost is great enough where incurring this cost to increase the length of the blockchain is more profitable than incurring this cost to fork the blockchain
As part of the rules of the protocol, past transactions cannot be altered by future additional data

Proof of work fits into this because it is provably costly. It requires energy, and it also requires development time and materials to create machines that use this energy efficiently. This cost prevents forks from being supported, as you have limited energy and you can only use that energy once.
This contrasts with Proof of Stake, or an IP based voting system because a lack of energy requirement means that there an incentive to support all forks. This is referred to as the Nothing-at-stake problem.


text:
Bitcoin Transaction Speed
If a transaction takes anywhere from around 10 minutes to hours to get written to a block and put on the chain, how is it possible to have things like bitcoin vending machines? In those cases, the transaction would have to be near instantaneous to make it practical.

A vending machine doesn't have to worry about an attack that costs $50 to pull off.

@DavidSchwartz, can you explain that attack in more detail, or point me to some references?

Check here or punch "Finney attack" into your favorite search engine.

Payment channels are a way to prevent double spending in such cases. As per the Wiki

A Micropayment Channel or Payment Channel is class of techniques designed to allow users to make multiple Bitcoin transactions without commiting all of the transactions to the Bitcoin block chain.[1] In a typical payment channel, only two transactions are added to the block chain but an unlimited or nearly unlimted number of payments can be made between the participants.

A possible way for implementing vending machines would involve creating payment channels beforehand with the vending machine company.
Infact, for the vending machine case, an unidirectional channel would suffice. Refer to Wiki for details. Bi-directional payment channels using hashlocks are the key to Lightning network which is used to facilitate off-chain transactions at real-time.

This is my first stackoverflow answer, please point if I anything needs more elaboration/or is not correct

If a transaction takes anywhere from around 10 minutes to hours to get written to a block and put on the chain

Just to have that said: if a proper fee is set, it can be ensured that the transaction will get confirmed within the next block.
Back to the question merit: Performing a double-spending attack is very costly after the transaction has been propagated through the network. There is some risk, but there is some also when accepting cash or credit cards and the vending machines can be often enough fooled with tokens resembling the weight and size of a real coin. There are places, both online and physical that accept small unconfirmed transaction if they are valid, have a proper fee and are already propagated.
Additionaly, there are services such as Coinbase, that additionaly verify transactions between their users. If the transaction occurs between Coinbase accounts, it can be even more sure to appear in the blockchain, even if it isn't yet confirmed.


text:
How to start with bitcoin?
I have been listening about bitcoin from my colleagues and they convinced me to investment into bitcoin. They also suggest me couple of websites to start with. I have started with one of them and invest $150 bit seems no profit from them. Can you guys please suggest the sites or the people to with I can start my investment. Also need some guideline about how that works, sell and buy, how and when and all that primary stuff.

One of the popular trading sites is coinbase.com. There you can sign up and buy and sell - should be straight forward. Of course there are other sites as well.


text:
Trying to claim my bitcoin cash but transaction history doesn't match
Upon discovering the meteoric rise in value for Bitcoin Cash, I decided to actually claim the little Bitcoin Cash that I had from after the August 1st 2017 fork.  I had sold most of my crypto holdings awhile ago but retained about 17 mBTC.  My last valid transaction was a Send of 0.4 BTC to my Coinbase on July 15th which was prefork and left me with the remaining 17 mBTC balance.
I am using Bitcoin Core on a Windows 7 machine with a password protected wallet that is kept in a KeePass database that is protected with a private key I keep on a USB thumb drive. I decided to install Electron Cash and the install asked if I wanted to import private keys from a Bitcoin wallet.  I decided to do this and got the private keys from the Debug Console in Bitcoin Core for all of my receiving addresses.
I can see the correct amount of transactions in the History tab in Electron Cash after importing my private keys, however the amounts are wrong and the dates seem slightly off.  What is most concerning is that the final transaction shows my balance being sent out but the transaction id on Blockchair doesn't seem to match up with what I am seeing in my wallet.  Electron Cash wallet shows my balance as 0 which is incorrect.
BTW, I verified the ElectronCash 3.0 executable against the sig and checksum and my download is legit.
I am incredibly confused and wondering if I did something wrong on the import or if my money was pilfered.  Could this be a bug in ElectronCash 3.0?  Should I try a different wallet?

Where did you get your download from? https://electroncash.org/ ? There seems to be quite an issue with illegit sites. And they will provide their matching signatures and checksums of course.

I figured out what was going on... sort of. At the very least I found where my Bitcoin Cash was and was able to sweep it into another wallet.
It is probably that I fundamentally misunderstood how Bitcoin Core works. I started investigating all of my Send transactions and Receive transactions on Blockchair and found that when I was sending a payment to another address, it would grab the funds from a receive address that had sufficient funds to cover the payment. I naively assumed that the remaining balance in my receive address would stay there, however I discovered that what Bitcoin Core was doing was liquidating the remaining balance from the receive address and sending it to a new address that was also in my wallet.
When I would do tge export of Receive Addresses from Bitcoin Core it would only list addresses that I received funds to, not addresses that still contained unspent Bitcoin. This was why Electron Cash and other BCH wallets showed a zero balance when I brought in the private keys for those addresses. Sure enough when i dumped the private keys for these hidden addresses listed in Blockchair, I was finally able to get the unspent balance and sweep the funds.

Yeah I had the same surprise as you. In the end, I ran dumpwallet and took all keys prior to the snapshot.


text:
How to load a peer list file?
According to this page,

The client will automatically read a file named "addr.txt" in the
  bitcoin data directory and will add any addresses it finds in there as
  node addresses.

However, I can't find any point in the source code where this file is actually read, and I don't know how to verify all the peers known by my node.
Is the "addr.txt" file actually read by bitcoind?
How can I check if the addresses are actually loaded?

This feature is no longer present in Bitcoin Core.  It was removed in 2011.
You can get the same effect by adding multiple addnode= lines to your bitcoin.conf.


text:
What kind of messages are those used by Bitcore
When creating a transaction proposal with Bitcore,
the options include a "message" field, both for the transaction and the single outputs.
Are these messages those used by the Bitcoin network peers (like 'ver', 'inv', etc..)?
Where are these messages stored?

This is the answer I received from a Bitcore developer (see here)

Messages are stored in the BWS server database encrypted by the wallet encryption key.
Therefore, the BWS server maintainer can not see any of the messages, but the copayers can see it because they have the decryption keys.
These messages only exist on the BWS server, so if the BWS server disappears. So does all your messages.
Wallets can be restored outside of BWS, but messages are tied to the BWS server.

I'm not sure, having never used this before, but I think it's a message which is encrypted somehow, and shared among bitcore servers in the same cluster via a message broker.
See README (scroll down to '(opt) message') and INSTALL pages.

I received an answer from the developers on github.
I'm going to post it as the answer. Thanks for helping anyway


text:
How many peers does bitcoind try to connect to?
Let's say a new node try to connect to the network.
Since it doesn't have any node in its peers.dat it makes a request to the DNS seeder and receives a list of addresses.
Now, how many of these addresses will it try to connect to?
What about the same when retrieving addresses from peers.dat?
Is it possible to alter this number by using some option?


text:
What is the difference between Selfish Mining and Block Withholding attacks?
I found contradicting information about these two attacks.
My understanding is roughly this:

Selfish mining is a strategy followed by a miner/pool, in which it doesn't publish new blocks in order to obtain a secret fork which is longer than the main one; at some point the secret fork is published, overwriting the honest fork. This way, the selfish miner/pool obtain more rewards than their share and waste the mining power of other miners/pools
Block withholding is a strategy followed by a miner inside a mining pool, in which it conceals full proofs to the pool administrator in order to decrease the pool revenue.

According to this definition, these attacks are similar in their strategy, but fundamentally different in their actors and goals.
However, I found several sources claiming that selfish mining and block withholding are synonyms.
So, what's the truth?
Are these attacks the same?
If not what are the main differences?

Both involve not instantly publishing a solution to a block (or at all), but that's where the similarities end. The descriptions given in the question are correct and describe the very different outcomes of both behaviours. A person claiming that these terms are synonymous is likely just mistaken by the names being somewhat close.

I've seen the term "block withholding" used for both the "large miner/pool intentionally slows down block propagation" and "hasher doesn't reveal full solution to pool" attacks, while "selfish mining" strictly refers to the former.


text:
Will block chain pruning work for zeronet (Website hosting on block chain)?
Pruning limits block chain by removing old blocks. Will this methodology work for zeronet. One of the perks of zeronet is to be able to access websites (read zites) even without internet connectivity.
So, if your answer is YES. please explain the above scenario as well.
Thanks in advance.


text:
Bitstamp: What type of order to place to buy BTC when the price drops to a certain value?
I am sure this is a simple question but I am having trouble with figuring out the type of order to place on Bitstamp.
Say the price is currently $1100 but I want to buy only if the price drops to $1000, what type of order would I place? I thought this was a "Stop" order, but the Bitstamp UI asks me to specify the amount to buy in USD if the price rises to my given value. I am worried that if I enter $1000 and place this order, my order will instantly kick in because the price is already above $1000.

I figured this out. A "Limit" order is what I wanted to do.
A limit buy order will trigger if the price hits the target or lower. A caveat for anyone unfamiliar like I was: the order won't necessarily be fulfilled at the price your specify, rather it will become a market order which will execute at the next best available price.


text:
Litecoin-qt getblocktemplate ￼Support for 'segwit' rule requires explicit client support (code -8)
I have downloaded the Windows version litecoin client from https://litecoin.org/. I am trying to setup CoiniumServ to serve as a LiteCoin Pool.
Most configuration are done.
However, I am facing this issue. When I try to query getblocktemplate from the litecoin-cli, I will get this error Support for 'segwit' rule requires explicit client support (code -8).
Can anyone help ?
Thanks in advance!

You need to explictly declare the segwit rule:
litecoin-cli getblocktemplate '{"rules":["segwit"]}'


text:
Can i get my double spending bitcoin back in my wallet
I opened my wallet and saw that blockchain sent my bitcoin to a bitcoin address, and it is still unconfirmed after 2 days, can they still return my bitcoin?

Your transaction will eventually get confirmed, or dropped if it takes too long to get confirmed and you will be able to see your bitcoins in your wallet again. Check out the answer from this question: http://bitcoin.stackexchange.com/questions/9046/why-is-my-transaction-not-getting-confirmed-and-what-can-i-do-about-it


text:
How to earn my first bitcoin in baby steps?
I don't know any thing about bit coin , what I know that it digital currency maintained by people and not banks.
How do I start earning my bitcoins ? OK After earning this bitcoins ? What all things I can buy in real world or it just to pay for only services to service provider?

HOW TO BUY BITCOINS
1) From exchanges. Exchanges are many based on countries. UNOCOIN is a popular one for India. Alternatively, if your nationality is different from what I presumed, you can have a look at this site for many exchanges and wallets: COINDESK. You can create a bitcoin wallet here: BLOCKCHAIN
2) Have a look at this link for more detailed explanation: How do you obtain bitcoins?
WHERE CAN I SPEND THEM
You can spend them on websites/services which ACCEPT bitcoins as a mode of payment just like Paypal, Credit Card or Debit Card.

As a supplement to the buying process provided by @trollster -
If you would like to earn bitcoin (rather than paying for them directly) there are a few ways to do so.  Mining is one example, but it requires purchasing specialized equipment and will likely entail a good deal of research as well.  You might choose to sell goods or services in exchange for bitcoin.
A more simple and practical way to earn small amounts of bitcoin is by completing tasks or surveys online.  There is an array of websites that offer this form of compensation - which will vary in terms of compensation level, accessibility, reputation, and reliability.  From my own experience, I can attest to the fact that www.BitcoinGet.com did pay out (which was my biggest concern).  Earning a full bitcoin through this medium alone would take quite a bit of time - but is the only option I can recommend that requires zero capital.
If you do want to earn some bitcoin in that manner, you should still create a bitcoin wallet and an address by following step 1 from @trollster
Welcome to Bitcoin!

can I earn from the blog, if I have good traffic on site. https://androidapksget.blogspot.com/


text:
yesterday evening I send out 0.97 BTC. I checked transaction and It says : " lock time 459355"
are my coins lost ? please help
It says Lock Time: 459355
and still unconfirmed since yesterday

No, your coins are not lost. Either they get confirmed and become available to the recipient, or they are unspent and remain yours.
All transactions created with Bitcoin Core (and maybe also other wallets) set their transaction to be confirmed only with the next block at the earliest. This is done to discourage fee-sniping.
In your case I assume that the current block was 459354, so the transaction was created locked to the next block 459355. Since we're currently at block 459475, the delay of confirmation for your transaction would not be related to the locktime.
For more information please see Why is my transaction not getting confirmed and what can I do about it?.

thanks for the answer! but how long do i have to wait ?

@KonstantinHa: My pleasure. Welcome to Bitcoin.StackExchange by the way. If you're curious to learn how our site works, please check out our [tour]. If the question has been answered to your satisfaction, you may mark this answer as accepted. :)


text:
Blockchain Receive API
I have different question besides coding. It's about API so I though it's not that bad idea to ask it here.
Blockchain has API like that: https://blockchain.info/api/api_receive but every time user wants to make a transaction it will generate a new address for him, but my question is. Could I use same address over and over again? Ex: I'll generate a address for user once he registers. If he sends payment there, callback url will still be called even if he has done it multiple times.


text:
developing a new alt-coin useful or not?
I will try just for educational purposes create my alt-coin. But i have some
questions before to start.

It's possible create the alt-coin since my ubuntu and maintain this alt-coin since my pc if its always turn on?
My last question, at this moment is possible that this new altcoin get some real price in the market?

Someone can guide me a little or say me if will be useful in something create a new alt-coin? And maybe can get be profitable?

Is it useful?
Probably not for the community, but for you because you learn.

It's possible create the alt-coin since my ubuntu and maintain this alt-coin since my pc if its always turn on?

There is a difference between creating and running it. But yes, you can create a coin with your Pc.

My last question, at this moment is possible that this new altcoin get some real price in the market?

If you list it on an exchange and the community believes that it has a value: yes. Otherwise: no.
-
If you have only one Pc, you could create an ERC20-token (Ethereum based) and let the blockchain handle everything.

could you guide me a little how to create an ERC20-token ¿? some tutorial you think is useful or explain well how to do this?

can i put name to this token?

An ERC20 token is based on a smart contract. I uploaded 3 of them (only basics): https://github.com/ndsvw/Ethereum-Web3-SmartContract-HelloWorld https://github.com/ndsvw/Ethereum-Web3-SmartContract-Escrow and https://github.com/ndsvw/Ethereum-Web3-SmartContract-Coinflipping

And this is the basic ERC20 code you need: https://gist.github.com/ndsvw/53ff3cd511498da2dead79b8cd0e693f Yes. You can set a name. It's the second parameter of MySpecialToken() in this file.

ok i will check that. i will try to make it using erc20 token. i checked other way https://github.com/tiagosh/AltcoinGenerator but i think your is best.

can you check this video? https://www.youtube.com/watch?v=jcu4BB7EAx0&feature=youtu.be&t=266 i think is a simple way to make it and like you say blockchain handle everything.


text:
What happens if the blocksize stays at 1MB?
With the current impasse that Bitcoin finds itself in, what are the theoretical and pragmatic implications of the blockchain staying at 1MB for the long term future?
Will this simply mean that transactions will take increasingly longer confirmation times? Or will there be a point where the network will simply not be able to cope with the number of transactions (if the transaction rate continues to increase). I have looked online but haven't been able to find any answers for the blockchain illiterate that explain this.

As long as there is demand for Bitcoin transactions and the hash rate is somewhat stable, Bitcoin will confirm 1MB of transactions every ten minutes in average. Since this is a fixed supply, Bitcoin would not be able to satisfy a demand greater than 1MB per ten minutes and some transactions would never confirm. This is a graceful failure, as it would be rational for miners to confirm the transactions that give them the highest revenue, and thus the transactions that are the most valuable to their users will be catered to first, and transactions that signal less priority get priced out of the blockchain first. These would either move to off-chain solutions or other blockchains in the long term.
It seems obvious that fees would thus adjust respective to blockspace demand and economic value of the transactions. As either grows, pressure to provide more capacity will mount. It seems likely that sufficient pressure would lead to adoption of some capacity increase eventually, be that Segregated Witness an Lightning Network, or increased demand for altcoin solutions.

One option to solve this problem is Bitcoin Unlimited (https://www.bitcoinunlimited.info/) which is all the talk about the hard fork.

@MarcAlexander: Although I'd rather keep this debate away from SE, I must vehemently disagree that BU is a viable solution.


text:
How do I use CHECKLOCKTIMEVERIFY to prevent a transaction being spent before 100 blocks?
I'm creating a Bitcoin based lottery application. An entry into the lottery is a transaction spending 1BTC.
If someone guesses some arbitrary value correctly, they can claim the entry and send this 1 Btc to an address they control.
I wish to have functionality as follows: if no one guesses the correct number after 100 blocks, then I can claim it as the operator of the lottery.
Can I do this via:
Entry transaction
  IF
     CHECKLOCKTIMEVERIFY
    payable to a correct guess
  ELSE
    Payable to my operator public key
  END
Then when I try to spend this entry transaction, I set the nLockTime to the current block.
Throughout I set all the sequence numbers to 0xFFF... So that the transactions are mined.

Yes, you can use OP_CHECKLOCKTIMEVERIFY to make a transaction output unspendable for a certain number of blocks.  However, you can't use it directly in an if-else block as you have described.  When OP_CHECKLOCKTIMEVERIFY executes, it doesn't place a result value on the stack.  It either throws an error (invalidating the transaction attempting to spend the output), or continues executing as if nothing happened.
To create a transaction as you describe, you will need to use multisig, such that one party can spend the transaction as soon as the correct number is provided (input to a hash function, I presume?), OR you can spend it back to yourself after the lock time expires.  This is basically how the lightning network works.  You should check out Lightning Networks Part II: Hashed Timelock Contracts (HTLCs)

Thanks for the info. On the BIP Page Peter Todd suggests a script similar to mine though, right? https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki

Yes, his examples are similar.  Just remember that OP_CHECKLOCKTIMEVERIFY is a consequence of a condition, not the condition itself.  The condition is the 0 or 1 at the end of his example redemption scripts.  That's what determines if OP_CHECKLOCKTIMEVERIFY is called.

Great, thanks. Will come back here with any further questions.

authors: Андрей Быков


text:
Difficulty in obtaining vanity Bitcoin addresses
What is the formula I can use to estimate the difficulty in generating vanity Bitcoin addresses?

Note that address reuse (and therefore vanity addresses) are bad for privacy for yourself as well as everyone else.

It is better to explain by example:
We need to find a vanity address with the prefix "1Love".

The minimum address with this prefix is "1Love1111...1111+ControlSum" and this corresponds to the number Xmin.
The maximum address with this prefix is "1Lovezzzz...zzzz+ControlSum" and this corresponds to the number Xmax.

("1" and "z" are the first and last character of the Base58 encoding used in the bitcoin addresses https://en.wikipedia.org/wiki/Base58)
Then the difficulty of finding such a vanity address is:
diff = (Total number of bitcoin addresses) / (Xmax - Xmin)

For the prefix consisting of the characters "1" there is a special case and complexity that must be considered differently.

Is not (Xmax - Xmin) always equal 58^m?

The probabilities are detailed here:
https://en.bitcoin.it/wiki/Vanitygen#Difficulty_of_finding_a_vanity
"The difficult of finding a vanity address depends on its exact structure (leading letters and numbers) and how likely such an output is given the algorithms involved, which can consist of several pivots where the difficulty suddenly changes."
Difficulty can be quite easy or quite hard depending on the structure and length of the vanity portion of your address


text:
How would I explain SegWit to a non-technical friend?
How can I explain the potential ease of scaling and feature benefits of Segregated Witness to a non technical friend?
How can I explain the potential drawbacks of Segregated Witness in a non technical manner?

The name itself is a good hint as to what it actually does.
What we have today is a "witness" (i.e signature scripts) included in every Bitcoin transaction in non-segwit compliant transactions. This allows every full node within the Bitcoin network to verify the integrity of any transactions.
By removing the signatures in a Bitcoin transaction, you lose the ability to verify the integrity of the transaction. But in reality, not everyone needs to be able to independently verify the integrity of a transaction.
Thus, by segregating the signature from a transaction, we have a smaller transaction that describes the inputs and outputs exactly as it is. But if you want to know for sure that these are verified inputs, you'll look up the Segregated Witness set to find the corresponding scripts to validate the SegWit Transaction.

Some of the major benefits of SegWit are (in no particular order):
1) Effective block size limit increase
2) A solution to transaction malleability (no longer possible for a third party to alter the transaction ID)
3) Facilitate certain payment channel and lightning implementations by resolving the transaction malleability issue
4) Addition of a script version number to allow future script upgrades to be backward compatible
5) Reduced computational complexity of signature algorithm
An easy explainer from Aaron van Wirdum is here (with thanks to Pieter Wuille) https://bitcoinmagazine.com/articles/segregated-witness-part-why-you-should-care-about-a-nitty-gritty-technical-trick-1450827675/

While technically correct that SegWit does theoretically allow that, that is not implemented, hardly relevant (you can already fully prune all blocks while still validating), and really a detail compared to other advantages (removing quadratic hashing, simplified support for high-level protocol, ...).

Here is FAQ about SEGWIT benefits.
If you would like to know more technical details, probably segwits developer guide is very good start.


text:
What economic incentives would help wider geographic distribution of bitcoin nodes?
https://bitnodes.21.co/
Full nodes are important everywhere providing visibility and improved network latency. In areas where bitcoin mining is not profitable due to the high cost electricity or other factors what incentives can be used to increase the number of nodes?
Will 21.co be successful in its efforts to install mining equipment in mobile phones and other consumer devices across the world?

No incentives to run nodes are required. As people in these countries are presented with more use cases to use bitcoin, organic growth in the number of nodes will follow.
International money transfers and a superior alternative to M-Pesa for retail transactions are both attractive areas for growth in some of the areas with limited node counts today.

Will 21.co be successful in its efforts to install mining equipment in mobile phones and other consumer devices across the world?

This is just so bad in so many ways. Mining on a phone makes the least sense of all senseless ideas ever. It took a decade to have nicely powered phones that run more than an hour on a battery load and then add a mining ASIC? And then in the context of "incentivizing full nodes"? In no way is that phone going to be a full node capable of mining (another waste of scarce phone resources if nothing else).
Actually the whole 21 mining thing is very deceiving as their chips mine on their (and only their) pool. Even if you would be running a full node, you'd not be mining on it.
In fact, the entire 21 thing doesn't make any sense at all. I've yet to see anyone explain their marketing blabla.

I agree that their mining devices will never come remotely close to a + ROI but that does not appear to be their goal. If they can bring prices down enough to introduce many people to bitcoin (even if they are only mining minuscule amounts from their pool share) then maybe demand for microtransactions will increase. I am not sure how this will make 21co any money but it seems a net positive for bitcoin adoption

I've heard that before. But that too makes no sense whatsoever. Starting from the fact that what they call microtransactions has nothing to do with bitcoin: they're account balances within that centralized pool you're forced to use. Second: if there's 0 ROI, those transactions are really going to be micro. 3rd: stilll doesn't explain why it would be done with a phone or how that phone is ever going to run a full node. And it doesn't explain why I can't just deposit 0.01 bitcoin to do those microtransactions instead of wasting 0.5 bitcoin on extra chip+ faster phone to mine 0.00001 bitcoin.


text:
Without side chains will transaction fees rise as block rewards fall?
Transaction fees are currently minuscule when compared to block rewards. Even if transaction volume was 10x higher than it is now, this would be the case.
Is there any realistic scenario where transaction fees will not rise substantially to compensate miners for the effort as block rewards continue to fall over the next decade?

You are correct that transaction fees per block are much smaller than block reward, but they are still significant and rising:
https://www.smartbit.com.au/charts/transaction-fees-per-block
Recently the average has passed 0.5 BTC per block. With a 50x rise (easily obtainable if bitcoin use becomes mainstream in certain sectors) the reward would be 25BTC per block based on current fees staying the same.
This would be possible on chain with the combination of SegWit and a higher block size.
Side chains can help slow the growth of the blockchain but how much that is needed and its impact on Bitcoin miner fees remains unclear.


text:
What is the duration of a ban?
I read somewhere that a node is banned for 24 hours.
However I found the Misbehaving() function which makes state->fShouldBan = true;. But I could not find any other function that makes state->fShouldBan = false;. It seems that banning is forever.
If banning is forever, I guess the node also removes the misbehaving peer from its neighbor list, right? But I could not find it.

What do you mean by 'neighbor list'?

Nodes are not keeping a list of neighbors to get data from?

Bitcoin Core maintains a database of possible IP addresses of nodes to consider connecting to, called addrman. I was just confused by your usage of the term 'neighbor'.

When state->fShouldBan is set, the network thread will disconnect the node, and cleanup memory. As a result, the state object disappears entirely. Because of that, there is no need to ever unset fShouldBan.
What does happen is that when the actual ban happens (not just the setting of the fShouldBan field), it is added to the ban table (which is IP based). Entries in this table have an expiration time. The default expiration time for newly banned nodes is controlled by the -bantime option and defaults to 24 hours in the future.

So as I understand the state object is created when a node receives a message from another node, right? And if fShouldBan is set to true, this process is cut. On the other hand, I didn't exactly get when the actual ban happens. Isn't it right after fShouldBan=true;?

A second remark about the IP-based banning. Is it really a good idea? A node can easily change its IP address, no?

The actual ban happens elsewhere, see the connman.Ban in SendRejectsAndCheckIfBanned in net_processing.cpp. A node can indeed easily change their IP address, but they do need to reconnect first, and IP addresses do have a non-zero cost.

Bans last for as many seconds as bantime (in bitcoin.conf) is set to:
-bantime=<n> Number of seconds to keep misbehaving peers from reconnecting (default: 86400)

86400 seconds is 1 day.

Can you explain more about banscore? I was thinking that it is a threshold for deciding if a node should be banned or not, not about the time.

@ÖnderGürcan You're right! I've edited my answer.