What will happen when SHA 256 needs to be replaced? MD5 used to be the hash algorithm. Everyone loved it, but now, not so much.

What will happen to bitcoin if flaws are found in SHA256 in the future?

I'm assuming you mean what will happen to Bitcoin if SHA256 is discovered to no longer be suitable for use as Bitcoin uses it. First, such a thing is likely to happen very gradually. We'll first see hints of weaknesses and attacks that currently take millions of years will shrink to thousands of years and then hundreds of years. So there will be plenty of time to arrange a change.

Note that Bitcoin addresses also use RIPEMD-160, which is likely weaker than SHA-256. However, the way they're used, weaknesses in RIPEMD-160 might not actually create problems for Bitcoin.

Basically, whatever changes needed to be made to the protocol would have to be worked out. Possibly any other changes deemed advantageous could be made at the same time, since protocol-breaking changes are rare. Some fields may need to be expanded.

A particular block would be picked, after which the new methods would start. Everyone would have to upgrade before then.

I think every effort would be made to keep the block header size the same so the mining algorithm didn't have to change. This may mean having to add an intermediate header. The intermediate header would contain the larger hashes of the previous block, transaction tree, and so on. The hash of the intermediate header would go in the block the miners try to mine, reducing its three hash fields to just one. (And allowing the nonce to be expanded to 64-bits! Yay!)

If addresses or transactions had to change, then after that chosen block, new-style transactions would be permitted. Coins not transferred to new-style accounts might become vulnerable to attack, in theory. Because Bitcoin transactions already have input and outputs that function in a logically independent way, there would be no problem with importing coins with an old-style address/signature and sending them to a new-style address.


AWS ELB for Bitcoin node discovery? I was able to locate the following discussion (and a few others that were marked duplicate of this one) on node discovery in Bitcoin:

How do Bitcoin clients find each other?

I guess, the primary challenge is, the number of nodes is not under any one's control. So, a traditional load balancer wouldn't know in advance the number (and IP address) of the nodes. Thus, it wouldn't know how to balance the load. (Or, maybe it can figure out dynamically, not sure).

But, suppose, I wanted to launch a private version of Bitcoin where I had control over number of nodes that can ever be online. Then, I could set-up one URL on AWS ELB, for all clients to connect, where this URL will have all the nodes 'behind' it. Note that, it doesn't necessarily have to be AWS ELB; it could be the HAProxy or others.

Is this feasible?

For a detailed list of types of nodes, see this wonderful graphic from the book, 'Mastering Bitcoin'.

I think your scenario would work if you have a way of broadcasting the ELB address (or preferably CNAME) to known entities across a network. For instance we know from a previous answer "Several host names (such as dnsseed.bluematt.me) are maintained that resolve to a list of IP addresses known to be running nodes." (bitcoin.stackexchange.com/a/3537/44818).


Can the number of transactions per second ever overwhelm the network? I'm coming at this from a point of view that assumes Bitcoin has been widely adopted as a currency worldwide and is essentially mainstream. Every day people are using Bitcoin in the same way that they use their credit cards today.

Will the transaction volume at this level be sufficient to overwhelm the Bitcoin network given that transactions are processed differently to those of the credit card companies?

There are three parts to this:

The miners have to verify each transaction that will go into the block and all transactions that are in the block they will be basing their own work on
Each client needs to look for transaction destined to their own addresses, which can get hard if you have a large address pool
Since all transactions are broadcast the network itself could potentially be flooded.

The first two are pretty simple to solve since most computers already can process up to 100 transactions a second (resulting in roughly 10*60*100=60'000 transactions per block) and this can be pushed by investing in larger hardware to do the processing, and offloading verification to trusted third parties.

The last part is harder to solve as it results in possibly O(n^2) messages going around the network. Here a more structured network might do the trick, but all attempts so far to create a structured network have been dismissed.

Last but not least the blockchain grows linearly with every transaction which uses diskspace on every client. This has been partly solved by Satoshi in his paper.


How would a decentralised exchange work? The idea of decentralised Bitcoin-fiat exchanges has been floating around. (For example Mastercoin, Ethereum and Bitshares claim to be able to do it.)

How would such a decentralised exchange work?

It is possible, and not conceptually difficult, to extend the way ownership of Bitcoin is determined in a decentralized way using the blockchain to more complicated constructs such as the ownership of other things or the commitment to contracts, including offers to trade at certain prices. Yet there are two nontrivial issues a decentralized exchange, or its underlying protocol has to solve: How to enforce trades (solving the counter-party risk any exchange has), and how to detect if a trade has occurred.

Obviously there are many ways all of this could be settled. For example, exchanges in real finance leave fulfillment and enforcement to the trading parties and the authorities, but that has huge real-world problems even with a limited number of tightly regulated and registered participants that one may hope to avoid in a decentralized approach.

There is a simple solution for exchanging (specially designed) cryptocurrencies where ownership and contract fulfillment is determined by a blockchain. At least typically, protocols enabling a decentralized exchange include at least one such cryptocurrency, such that as a partial solution an automatic escrow can be implemented. But full automation requires that the ownership of the other currency involved in the exchange can also be automatically established, i.e. it must also be some kind of altcoin.

To extend this to cover fiat currency, there must be some form of agreement to honor the obligation to transfer fiat and to reflect its completion in the decentralized exchange. Sadly, this is at the core of all kinds of blockchain-based contracts: How do we get them to be enforceable, ideally by becoming legally binding? I see two possibilities:

Limit trading to participants that sign some kind of real-world contract to honor them in a way that makes them legally enforceable. This has the problem of being difficult to do in a truly decentralized way, unless legal systems start to recognize at least some kind of digital id and digital contracts.
Require some kind of security deposit to be confiscated in case of breach of contract---possibly from both sides of a contract or exchange-brokered trade, to remove profitability for both sides in the event that one party fails to deliver a fiat payment or that the other party fails to admit having received it. Sadly, designing a system where it is ensured that no kind of fraud pays off is not easy and may require a very large security deposit, giving this approach severe disadvantages as well: A cyber-troll willing to suffer a loss could cause someone else to suffer an even larger loss (and potentially blackmail such a victim into letting the troll get away with a profit), and potential users wanting to use the exchange because they need cryptocurrency may find it difficult to cough up a cryptocurrency-based security deposit.


Is it possible to use xpub address to monitor balance from previously generated addresses? I'm trying to find a way where I can view balance of my ledger nano s wallet without always attaching it to computer all the time.

I found something called xpub address which allows me to generate public addresses without my hardware wallet, I am now trying to figure out if there is a way (api ideally) to use this xpub address to view balance from my previously generated addresses.

Certainly. If you use the master public key (the xpub that you have), you can enter it into a site like blockchain.info to get the balances of many of the addresses derived from that key. Generally software that do this sort of monitoring (including your wallet software), only search a few addresses (all of the ones that have been used in a transaction and then some number ahead of those) so it may miss some of your transactions.

You can also setup a desktop wallet software like Electrum to work with your Ledger Nano S. This allows you to get new addresses and monitor your balance without having the device connected and still be able to connect your Ledger to spend from it when you want to.


How to create descriptor watch-only wallet with bitcoin-cli in Bitcoin Core 0.21? Using only command line (no GUI), how can I create watch only wallet based on descriptor and get first unused address?
This is the descriptor:

"wpkh([00000000/84h/0h/0h]xpub6DP....xyz/0/*)#checksum"

this is the bitcoin-cli command to list addresses based on this descriptor:

./bitcoin-cli deriveaddresses
"wpkh([00000000/84h/0h/0h]xpub6DP....xyz/0/*)#checksum" "[0,2]"

How to create actuall watch only wallet so that I can get automatically first unused address?

First create a descriptor wallet with createwallet:
bitcoin-cli -named createwallet wallet_name=mywallet descriptors=true

This will make a descriptor wallet named mywallet.
Then import a descriptor into that wallet using `importdescriptors:
bitcoin-cli -rpcwallet=mywallet importdescriptors '[{"desc": "wpkh([00000000/84h/0h/0h]xpub6DP....xyz/0/*)#checksum", "range": [0, 1000], "timestamp": "now", "internal": false, "watchonly": true, "active": true}]

This will import the descriptor with an initial keypool of 1000. Any new bech32 addresses you request (with getnewaddress or from the GUI) will come from this descriptor.


How do new Cryptocurrencies prevent a 51% attack? I've seen similar questions, but not specifically in reference to new altcoins.

When a new cryptocurrency is released, the developer(s) have limited amounts of resources. What prevents a group from carrying out a 51% attack while the mining network is still small?

I realize there isn't likely any benefit to the group carrying out the attack, since coin value will subsequently be lost, so the motivation would probably be carnage or the desire of eliminating a rival coin.

One possible reason to not attack a coin with weaker security is the lost opportunity cost. In order to attack a network, the attacker will need to devote hashing power to the attack.

If they did not stage an attack, they could use that hashing power to mine a profitable coin instead. The benefit of the attack must at least outweigh the lost opportunity cost of engaging in the attack.


How to pass password with special characters to RPC API via curl? When I set a simple password in my .conf file

rpcuser=user
rpcpassword=password

I can contact my wallet using curl from the command line like so:

$ curl --verbose --user 'user:password' --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:18332/
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 18332 (#0)
* Server auth using Basic with user 'user'
> POST / HTTP/1.1
> Host: 127.0.0.1:18332
> Authorization: Basic dXNlcjpwYXNzd29yZA==
> User-Agent: curl/7.50.1
> Accept: */*
> content-type: text/plain;
> Content-Length: 74
>
* upload completely sent off: 74 out of 74 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Τετ, 21 Ιούν 2017 08:59:30 GMT
< Content-Length: 52
<
{"result":14.13139559,"error":null,"id":"curltest"}
* Connection #0 to host 127.0.0.1 left intact

But if I set a more complex password with special characters, such as

rpcuser=user
rpcpassword=!@#$%^&*()

then the call fails with 401 - Unauthorized

$ curl --verbose --user 'user:!@#$%^&*()' --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:18332/
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 18332 (#0)
* Server auth using Basic with user 'user'
> POST / HTTP/1.1
> Host: 127.0.0.1:18332
> Authorization: Basic dXNlcjohQCMkJV4mKigp
> User-Agent: curl/7.50.1
> Accept: */*
> content-type: text/plain;
> Content-Length: 74
>
* upload completely sent off: 74 out of 74 bytes
< HTTP/1.1 401 Unauthorized
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="jsonrpc"
< Date: Τετ, 21 Ιούν 2017 09:03:05 GMT
< Content-Length: 0
< Content-Type: text/html; charset=ISO-8859-1
<
* Connection #0 to host 127.0.0.1 left intact

It doesn't seem like the password was mangled at the shell level. It was passed verbatim.

$ echo dXNlcjohQCMkJV4mKigp | base64 -d
user:!@#$%^&*()

There must be a way to do this, because bitcoin-cli works with the complex password just fine.

$ bitcoin-cli getbalance
14.13139559

Looking into bitcoin-cli.cpp it seems the client is using basic HTTP auth, which is consistent with what the wiki says.

strRPCUserColonPass = GetArg("-rpcuser", "") + ":" + GetArg("-rpcpassword", "");

...and later on...

evhttp_add_header(output_headers, "Authorization", (std::string("Basic ") + EncodeBase64(strRPCUserColonPass)).c_str());

Can someone please figure this out for me?

I want to know because I'm trying to pass complex passwords into EasyBitcoin-PHP and failing.

Thanks.

It seems that this is a bug in Bitcoin Core. I will take a look at it.

Edit:
I see the problem now. You have # in your password. The config file parse will interpret # as the beginning of a comment. So this means that it thinks the rest of your password is considered a comment by the config file. You cannot use # anywhere in the config file or everything after it will be interpreted as a comment.

In your example, the rpcpassword that Core is using is !@. To have # in your rpcpassword, I think you will actually need to use the rpcauth option which uses hashes instead of putting the password string in the config file.


How do you regenerate all 2-of-2 multisig addresses from two xPrivkeys? If I want to get the private and public keys of all transactions that have happened on my multisig wallet. How would I do that?

It's a 2-of-2 multisig setup. I have an xPrivkey on my computer and an xPrivkey on my phone.
How do I combine these keys to generate the list of private keys and the corresponding list of public keys.

The purpose would be to redeem my BCH.

Trying to generate all possible combinations would probably go on forever. I would suggest you figure out what the derivation path used on you BCH wallet was (will probably be /m/44'/145'/0') and then loop through different combinations to generate different multisig addresses.

How come you only have the xPrivkeys and not the mnemonic words?

If you had the mnemonic words I would suggest recreating the wallet on the same wallet app by importing your seeds and the wallet should scan addresses associated with those keys.


Can free bitcoins from faucets be actually spent? Suppose that I have a wallet with 0.001 bitcoins, from dozens of micro transactions (6000 satoshi in average). That means if I want to spend them, it must be concatenated and the transaction fee would be higher than the actual value?

You could consider creating a new address with 0.01 BTC on it, then sending the concatenated amount at 0 trx fee to each of the addresses containing the smaller amounts.

So:

0.01 -> first address
First address (now including the 0.01) -> second address
second address (now including the 0.01+first address -> third address

... ad nauseum.


Where can I find proof of work in the Bitcoin Core source code? Does anyone knows which part of the Bitcoin Core source code contains the proof of work for mining, creating of block and adding to blockchain? What are the files and functions involved?

The mining functionality that does background mining in the Bitcoin core was removed in August of 2016. See the following change log:

https://bitcoin.org/en/release/v0.13.0

The mining code itself is still available for testing and experimentation and is located in the files called "miner.cpp" and "miner.h" which are in the main src directory.


Bitcoind gui client, wallet client with peer preference, node manager first time user here so politely point out any thing I have done wrong.

I am looking for three things, but first let me explain the situation and use case:

I am using bitcond full node on a headless FreeBSD OS server. There is no GUI of any kind.
I am able to use CLI RPC (from an SSH session) to send commands to bitcoind. It works but I'm not a fan of it. I'm able to view account and wallet detail.

I would like to have working, using very secure technology/products:

A very secure 'remote wallet' GUI client that can 'connect' to bitcoind over the IP network. Use case will be 99.999% local LAN only, but if I want to allow it via WAN/Internet I can.  I realize the risks involved doing that over the Internet, but that is what I am looking for.
A bitcoind full node GUI manager. Please do the not confuse this with the first.  This application allows me to use a GUI to securely manage the node itself, via IP.  I'm guessing this would also be via RPC.
A wallet manager application like Armory, but one that allows me to configure it to securely peer only with my full node. Thus when I make transactions, the transactions are securely between my local PC wallet and my node.

See what I mean? I've done lots of looking, but no luck yet. Much thanks all.

yup, see what you mean. Hopefully my answer is not disappointing. It is to my knowledge not existant. I'd reason this way:
I don't think it's the application, which should secure the network layer. Vice versa is the way to go on (layered approach). Create a secure network layer, and run the app on top of it. Otherwise all apps would build their own security layer, and I doubt there are enough security specialists...

The layers of the underlying OS allows to achieve security.

  A very secure 'remote wallet' GUI:

define secure :-) Well, why not tunnel X over a VPN or through ssh?

  A bitcoind full node GUI manager:

is the same.

  A wallet manager application:

again, security built into the app is against principle of layers. You can tell your full node, from which IP to connect.


Is there a limit on the size of the block header? I know that the current bitcoin block size limit is about 1,000,000 bytes (1 megabyte) of data. This includes both the block header as well as the transaction data.

On the other hand, the typical size of a block header is 80 bytes, or 128 bytes if padding is included (as depicted below):

Now, I have been completely unable to find any information as to whether there is a limit on the size of the block header. The block header is typically 80 bytes, but is it against protocol if a miner adds so much data that the size of the block header increases to about 192 bytes or 256 bytes?

For example, a goofy miner (for some pointless reason) adds a lot of irrelevant information after the nonce section, and the block header size increases to 256 bytes. Would this block header be considered valid?

The only valid header is 80 bytes, no more, no less.

The other stated length of 128 bytes is part of the internal SHA256 hashing algorithm (its input must be a fixed multiple of 64 bytes), it's not represented anywhere in this format. Likewise, the null padding added when hashing the header is not ever considered to be part of it.


Is it true that if I buy Bitcoin and plan to hold it for 10 years and sell, then Coinbase, Robinhood, or Gemini can prevent any theft? It is said that Bitcoin can be subject to being stolen if I have it in my wallet on the smartphone, and is more secure in the Ledger.
However, if I buy it using Coinbase, Robinhood, or Gemini, and just hold it in my account for long term, such as 10 years, and suppose the account itself is not hacked, does that mean it is quite safe against theft?  (that is, not much different from some stocks in my Robinhood account?)

It is said that Bitcoin can be subject to being stolen if I have it in my wallet on the smartphone, and is more secure in the Ledger.

That is wrong. They are both "in the Ledger".
Although we speak of having money in a wallet, in reality the money is all kept track of in the blockchain (which is more like a transaction journal than an accounting ledger). The only important information in a wallet is a secret number known as the master private key.
So the money is in the same place regardless of whether you use a wallet to control your money yourself or whether you give all your money to some business in return for an IOU that just gives the illusion of owning money.
If the business has the secret key on their computer - you have to hope their computer isn't hacked, is well-managed and that the business doesn't have a dishonest owner, dishonest employees or dishonest office cleaners.
If you have the secret number on your computer, you have to take care that your computer isn't hacked, you have to make backups and look after them.

is more secure in [a hardware wallet]

Yes, a hardware wallet such as the Trezor Model T or Ledger Nano are among the safest places to store a private-key. You still need to make a secure copy of the recovery-phrase in a separate and safe place. You still need to practice recovery.

if I buy it using Coinbase, Robinhood, or Gemini, ...  and suppose the account itself is not hacked, does that mean it is quite safe against theft?

History demonstrates that exchanges are not quite safe against theft
Although it depends what "quite safe" means to you.
See the story about Quadriga-CX. I'd say look at MtGox and all the others but for many of these we can't tell if they were hacked or if the owners colluded in the theft. Prior to failure, many of these were either the most trusted exchange in existence or among the most trusted.
You also open up another attack vector - access to your login credentials entered via your computer or phone (or cybercafe WiFi).
You might think big exchanges employ a lot of security experts, however their information systems complexity and security problems are much larger in scope than yours are when running a single-person's wallet on one device.
General advice is not to keep any money on exchanges that you are not currently actively trading.


How does blockchain.info calculate the "Estimated Transaction Value?" Consider the following transaction:

https://blockchain.info/tx/aa5eb27652bd85dc444ea2508bf0ff6ff1b484141e2d7e69f31976fafb21e06e

Each of the output addresses has never before been used, and there is only one input address. Why does blockchain.info guess that 0.7695 BTC has been transacted with 3.7216 BTC as change rather than the reverse (see "Estimated BTC Transacted")? Does it just pick the second address as the change address?

In other cases, I am able to guess similarly to blockchain.info, for example:

(1) If multiple input addresses are used, the change address should not be greater than the lowest input address (unless, of course, this is being purposely obfuscated).

(2) If both of the output addresses have been used before, they may run a degrees-of-separation query to try to connect one of the output addresses more closely to the input addresses, more closely identifying it with the input addresses and therefore as the change address.

(3) If only one of the output addresses has been used before, it is more likely to be the change address according to the heuristic in (2) because by definition the used address is more closely "connected" than an address that has never been used.

But what heuristic could be used if each of the output address is new? The spending pattern of the input address? Randomness? Thoughts?

You can see how this question affects views of the total/daily volume on Bitcoin in aggregate by comparing/contrasting both of the "Estimated Transaction Volume" charts available on http://www.blockchain.info/charts. They claim the second chart adjusts for change, but provide no details about the algorithm.

For transactions with one input it is hard to guess what is the change and what is the real payment. However because they may be have statistics so they can may be guess that for a ~4 BTC input there are 70% of probability that the change is the bigger output and the money spent the smaller one when both output addresses are new.

Now if you have a transaction with several inputs (Like ou have already explained in your question) it is much more easier to guess.
If you have :

As input
1Pi87D6NUPB5BxcuowYN4Lj3WLCSFGsuLN (0.24379822 BTC)
1PgBMDggd7GGCifDd1881vdvNe8pkn5BWk (0.08787591 BTC)

And as output
1B6tvnE3oP3mwoA4RMrYXWVup4Z73G6bDw -  0.05377413 BTC
1DswmdznL6exZzN6akJpsPUc4ZWRZo9JQc - 0.2778 BTC

In this case you can be pretty sure that the spent address is '1DswmdznL6exZzN6akJpsPUc4ZWRZo9JQc - 0.2778 BTC' and the change '1B6tvnE3oP3mwoA4RMrYXWVup4Z73G6bDw -  0.05377413 BTC'.

Because otherwise there would be only one input.


What is the difference between Exchange & Offer in the Monetary System for NXT / Ardor Platform? When creating a new monetary system coin on the NXT/Ardor platform. What is the difference from Exchange and Offer?

What does the following mean in the Exchange Window?

Minimum Rate
Effective Rate

What do the following mean in the Offer window?

Buy units (Initial)
Buy units (Limit)
Buy Rate per unit
Sell units (Initial)
Sell units (Limit)
Sell Rate per unit

Please refer to the official monetary system documentation https://bitbucket.org/JeanLucPicard/nxt/issues/205/monetary-system-documenation section "Currency Exchange".
The NXT wiki also has an excellent walk-through of the process in https://nxtwiki.org/wiki/Monetary_System#Exchange_an_Exchangeable_Currency


What happens if you create and lose an Mt. Gox redeemable code? When you create an Mt. Gox code, you are shown a long textual code, and the amount is immediately deducted from your account.

What happens if you lose the code (e.g. your computer accidentally shuts down before you copy-paste the code into someplace safe)? Mt. Gox already shows the funds as if they don't exist in your account (even before they are redeemed).

If there a way to restore lost codes?

The code appears in your account history.  If it hasn't been redeemed, it also appears here:

Funding Options -> Redeem Codes

It also has a Cancel if you don't wish to use it (it simply redeems it to your own account).


Is there already reached consensus on network upgrades like Taproot, Submarine Swaps? I have read about some very interesting new protocol amendments. I am not asking for their explanations, but would be great if anyone explained  their current status, if they are still considered to be implemented (do you know when?), or if they have been removed from consideration...
Is majority of relevant stakeholders in consensus and for these changes, any struggles to be expected like with segwit?

MAST/TAPROOT

SCHNORR

Submarine Swaps

Drivechain Sidechain, by Paul Sztorc

MAST/TAPROOT
SCHNORR

These improvements are specified in BIP340, BIP341, and BIP342. These documents are fairly mature, and there seems to be community traction for them (though, disclaimer: I may be biased as I'm a co-author), but it's inherently hard to predict when activation will happen.

Submarine Swaps

This is a Lightning feature, as far as I know. It requires no Bitcoin protocol changes, and as far as I understand it, no Lightning protocol changes either - it's usable today.

Drivechain Sidechain, by Paul Sztorc

I haven't paid much attention to this.


Compressed keys default for brainwallet? I'm somewhat confused re compressed addresses...
Assuming I were to make a brainwallet using "correct horse battery staple" as my passphrase gives 1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T (uncompressed pubkey) & 1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8 (compressed pubkey).
Both show evidence of being plundered by bots "watching" easy targets like these.
But which is the standard? ie Is uncompressed or compressed key the preferred format? A better way to phrase this is...
"What format of key will be used going forward; compressed, uncompressed, or a combination?"

The compressed keys are better for use.
Because the redeem transaction size will be smaller, so one can save a fee.
Unfortunately, the original design of brainwallets created uncompressed keys.
And now this setting is default.
It is too late to change the default behavior of this.
Let us say that "uncompressed" keys are standard de-facto.


What makes millisatoshi real? In the Lightning Network, it's possible to pay in units a thousandth of a satoshi, a millisatoshi.

But you can't redeem them directly on the main chain when closing a channel, it will be subject to a round error, your value will be 'trimmed' of some millisatoshis.

But how they can exist before that? Is that part of the LN based on trust? The nodes store the number somehow, but what if the decided to change it? How can the digital signatures 'cover' the value, if they sign only the data of a on-chain transaction?

Millisatoshi's are the unit in which channel balances are accounted for. They are a necessary accounting unit, if the aim is to enable very small lightning payments amounts, which represents a protocol design choice. If I wish to send, let's say, 1 satoshi on lightning, the routing fee should necessarily be denominated in a sub-satoshi unit, or else fees could only be 1 or 0 satoshis.

However, there is a difference between accounting for and actually delivering this balance on the Bitcoin blockchain. Two nodes may negotiate a balance in millisatoshi's, but the signed commitment transactions cannot actually deliver this balance, only to the closest Sat value.

Millisatoshis are not captured in HTLC's of commitment transactions, since these are denominated in sat's. So in the case of a unilateral channel close, the delivered balance will differ from the one negotiated between two lightning peers. A collaborative channel close can also not deliver a balance denominated in fractional Sats.

Therefore, millisatoshi's are a real accounting unit, which enables very small lightning payments (and even smaller fee capture along the way), whilst trading off deliverable balance accuracy during channel closing (The rounding can go both ways).

There is no trust involved, it is clear to each participant independently what the channel balance is (mSat), and how much of the balance is deliverable(Sat) in the Blockchain during any Channel state.


How to generate a coinbase transaction? I am creating a miner in C++ for solo mining, and am struggling to create the proper coinbase transaction.
Say I have a bc1 address, like bc1qfc7fameteuguetm0kfzypnvf2ju6wppdvj6tkc , what would be and example of a coinbase transaction with this, and how would I get to it?
https://developer.bitcoin.org/reference/transactions.html
01000000 .............................. Version

01 .................................... Number of inputs
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ...  Previous outpoint TXID
| ffffffff ............................ Previous outpoint index
|
| 29 .................................. Bytes in coinbase // height+message below, byte length
| |
| | 03 ................................ Bytes in height
| | | 4e0105 .......................... Height: 328014
| |
| | 062f503253482f0472d35454085fffed
| | f2400000f90f54696d65202620486561
| | 6c74682021 ........................ Arbitrary data // custom data, include extranonce here
| 00000000 ............................ Sequence // i thought this was all Fs?

01 .................................... Output count
| 2c37449500000000 .................... // coinbase value
| ????????????????? ............. // here, how do i properly fill this part??
| 00000000 ............................ Locktime

These are the parts needed to create the data for the transaction.
Everything up to the output, i understand. but i dont know what to put between the coinbase value and locktime. how does the address convert to hex? what OP codes do i need? and is this transaction layout correct?
And then I would then hash it and input it as a new transaction into the block as like so,
tx = {
  "data" : "<hex string mentioned above>",
  "hash" : "<double sha256 of data above>",
}

is that the only data i need for the json?
Thanks in advance.

To create a coinbase transaction you need to send this RPC command to your Bitcoin-Qt
createrawtransaction '[{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":2147483647}]{"Your Bitcoin Adress":Amount}'
Why 2147483647 ?
Because the vout must be numeric, and you can't put 0xffffffff
So this will give you 0x7fffffff and the easiest way to do that is to change manually the 7 to f
Now as required in BIP34 you must include the block height inside the scriptSig otherwise your coinbase transaction will not be valid
PS: Be aware of little and big endian


Start a Private Bitcoin Network Is there anyway to create my own Bitcoin Network?

I'd love to put my first block into self-own Bitcoin Network and make it grow : )

Any ideas?

If you just want to play around or test your apps then bitcoin-core's regtest mode might be what you're looking for.

Developer examples on regtest mode: https://bitcoin.org/en/developer-examples#regtest-mode

A tutorial to get you started: https://geraldkaszuba.com/creating-your-own-experimental-bitcoin-network/

If you want to fork bitcoin and create your own altcoin this guide can be useful: https://bitcointalk.org/index.php?topic=225690.0


Can Bitcoin Core be made to display/enter amounts in USD or other fiat currencies? Every time I need to make Bitcoin payments, I have to switch many times between Bitcoin Core and my separate Bitcoin currency converter. For example, to see how much that transaction fee is in USD.
It would be very useful if it could be made to display a fiat currency instead.
Since this requires reliance on a third-party service, I understand why this is not built in.
However, can't I enter in the configuration file something like:
currency_converter_url = 'http://127.0.0.1/btcconverter/'

And then Bitcoin Core could make requests such as:
http://127.0.0.1/btcconverter/?satoshis=123456&to_currency_code=USD

In order for my own script to output how much that many satoshis are in USD currently, so that it can display it to me.
Is this possible? It would be extremely useful.

No, this is not possible in Bitcoin Core. You will have to use a third party wallet software such as Electrum if you want this functionality.
There also isn't any standardized format for exchange rate APIs, so you will be limited to the exchanges that are already built into the wallet you select.


How Bitcoin Core calculate extended private masterkey from hdseed I am testing a Bitcoin application, and to test the signing of transactions I use regtest with Bitcoin Core. But I have some problems, the first I have already published in a question that I still have no convenient answer.

But the problem generated by this new question is:

If a Bitcoin Core wallet can be saved and loaded with just the hdseed, then the extended private masterkey is calculated from it. Then, how Bitcoin Core calculate that?

Thanks in advance

Conversion from a HD seed to a master private key is specified by BIP 32.

It is done by computing a HMAC-SHA512 where the key is the text Bitcoin seed and the data is the HD seed itself. The first 32 bytes (256 bits) is the master private key. The last 32 byte is the chaincode for the master key.


Hash pointers: Are hashes of data used as addresses? I am wondering how hash pointers are implemented in reality. Currently, I am reading this article about hash pointers. According to this website a hash pointer allows both to request data and to verify its integrity. The following picture is supposed to illustrate the basic structure of a blockchain

Obviously, the input of the hash function is the pointer to some data in memory. At the same time the hash is supposed to be the hash of the stored data. How is this possible? I can't imagine to interpret hashes of data as addresses.

The hashes are not of addresses, they are of blocks. The "hash pointers" (in the blockchain, those are just hashes written into the header of a block, it doesn't actually point to anything) are the hash of the block that precedes the block that the hash is in.


LTC Pool With Friends? Is there a way I could set up my LTC mining pool so that my friends could join? I've been having really good luck lately!

P2Poolis a good way to do that. It can be hard to set up but is the best way to do it.


Calculation of arbitrage profit I have made calculations based on 3 exchange buy and sell orders. (Cryptsy, C-cex and Bter) and have taken DOGE/BTC market into account.

Both cryptsy and C-cex have the same calculations to get the net total amount(Final amount including transaction fee) for both buy and sell order.
In these exchanges Both buy and sell exchange transaction fee are  in terms of BTC  for DOGE/BTC market. But bter has different calculation on sell order and same calculation for buy order as in cryptsy and C-cex. Here  buy transaction fee in terms of BTC and sell transaction fee in terms of DOGE.

I am greatly confused about calcuting profit? Kindly look at both Cryptsy and Bter websites to see  the difference between sell orders.

DOGE/BTC Market

case (1): Both buy and sell exchange transaction fee are  BTC (cryptsy-buy, C-cex- sell)

Buy Exchange = Cryptsy

Sell Exchange =  C-Cex

buy amount = 1 DOGE

sell  amount = 1 DOGE

buy price =  0.0000038 BTC    //taken from cryptsy exchange  DOGE/BTC buy

sell price =   0.0000042 BTC  //taken from Ccex exchange  DOGE/BTC sell

buy_ex_txn_fee = 0. 002 BTC (0.2%)

sell_ex_txn_fee  = 0. 0015 BTC (0.15%)

Buy order:

Total = buy_amount * buy_price (Total = 1 * 0.0000038 = 0.0000038 BTC)

buy_txn_fee =  Total * buy_ex_txn_fee (buy_txn_fee  =  0.0000038 * 0. 002 = 0.000000008  BTC)

buy_order_Net_total =   Total +  buy_txn_fee (buy_order_Net_total = 0.000003808 BTC)

Sell order:

Total = sell_amount * sell_price (Total = 1 * 0.0000042 = 0.0000042 BTC)

sell_txn_fee =  Total * sell_ex_txn_fee (sell_txn_fee  =  0.0000038 * 0. 0015 =
0.000000006  BTC)

sell_order_Net_total =   Total - sell_txn_fee (sell_order_Net_total =  0.000004194 BTC)

Profit:

 Profit =   sell_order_net_total – buy_order_net_total (Profit =0.000004194 BTC -  0.000003808  BTC = 0.000000386 BTC)

Case (2): (For the same DOGE/BTC market buy transaction fee in terms of BTC(cryptsy) and sell transaction fee in terms of DOGE(Bter))

Buy Exchange = Cryptsy

Sell Exchange =  Bter

buy amount = 1 DOGE

sell  amount = 1 DOGE

buy price =  0.0000038 BTC

sell price =   0.0000042 BTC

buy_ex_txn_fee = 0. 002  BTC (0.2%)

sell_ex_txn_fee  = 0. 0018 DOGE (0.18%)

Buy order:

Total = buy_amount * buy_price (Total = 1 * 0.0000038 = 0.0000038 BTC)

buy_txn_fee =  Total * buy_ex_txn_fee (buy_txn_fee  =  0.0000038 * 0. 002 = 0.000000008  BTC)

buy_order_Net_total =   Total +  buy_txn_fee (buy_order_Net_total = 0.000003808 BTC)

Sell order:

Total = sell_amount * sell_price (Total = 1 * 0.0000042 = 0.0000042 BTC)

**// sell_ex_txn_fee is in terms of DOGE. How should I calculate profit?**

Profit:

Profit = ???

Am I heading in correct direction? Is there any other easiest way to calculate profit? If possible kindly explain me with sequence of steps?

The formula for sell_order_Net_total will be:

 sell_order_Net_total = sell_amount * sell_price * (1- sell_ex_txn_fee)

The final profit:

Profit = sell_order_Net_total - buy_order_Net_total

Keep in mind that there are also transaction fees between the two exchanges. If you have traded all your DOGEs for BTC on 1 exchange, and BTC for DOGEs on the other, you'll want to mix both accounts with an equal amount of DOGE/BTC. The transaction fees should also be accounted for if you want to trade between exchanges.


Who is responsible for ensuring that the bitcoin protocol is not violated in the network? Who is responsible for ensuring that the bitcoin protocol is not violated in the network?

The market forces behind the supply and demand of bitcoin
Miners
Consensus of the miners
Developers of the bitcoin protocol

There is no single entity responsible for ensuring the rules of the protocol are not violated. Rather, bitcoin is a decentralized network, so all participants must adhere to the protocol’s rules, or else the network will ignore them.

This is accomplished by a network of full nodes, that relay and validate all transactions and blocks against the network’s rules. All of the nodes together form the decentralized network, so to join the network you must adhere to the rules defined by the node’s code.

  The market forces behind the supply and demand of bitcoin

This will determine the price, but the price will not affect the ability of participants to violate the networ’s rules, nor will it ensure that rules are not violated. The rules must be followed whether the price is $1 per bitcoin, or $1 million per bitcoin.

  Miners

Miners work to secure the blockchain record, they will validate transactions in the same way other (non-mining) full nodes do, and they will ensure only valid transactions are added to the blockchain.

  Consensus of the miners

Same as above. Note that even if a group of miners decided to violate the network’s rules, then the network (full nodes) would simply ignore any new (invalid) blocks found by those miners.

  Developers of the bitcoin protocol

The developers collaboratively write and refine the code that runs the network, but this does not give them absolute powers to violate or change the rules. Their code works to ensure that everyone involved in the network is behaving, and that any misbehaving nodes are banned.


timestamp different block explorers are not the same I'm kind of confused why the timestamp of a block is different when checking different block explorers. I think normally this is the time the block was found, no?
So, when I check a transaction in blockchain.info, it has a different timestamp then blockexplorer.com. The difference in this case in 1 hr and 5 minutes. Any ideas why?

Both explorers show two different time stamps. "Received time" is the time that the transaction was first seen by the block explorer (relayed over the peer-to-peer network).  "Mined time" (shown by blockchain.info under "Included in Blocks") is the timestamp of the block in which the transaction was included.  You'll note that both explorers agree about the mined time as being 12:05:22 UTC (note blockexplorer.com is displaying it in your local time zone, which I guess is UTC+1).

For received time, blockchain.info shows 12:00:17 while blockexplorer.com shows 12:05:22 (same as mined time).  So one possibility is that the transaction was actually created and posted to the peer-to-peer network at 12:00:17 (or earlier), and blockchain.info received it over the network at that time.  But for whatever reason, the transaction didn't make it to blockexplorer.com over the network; it didn't see the transaction until it got the block in which the transaction was included.

It's hard to guess why that would happen.  But it appears from the screenshot that this might be a non-standard transaction, which most nodes will not relay.  Maybe blockchain.info is better connected to those few nodes which will relay them.


Sent Bitcoin Payment Frozen? I sent a payment from Coinbase to someone and they see the transaction but the funds are not depositing into there wallet it has been 4 days.  What is going on please help?

Hash
3e94ad695a30a94ab38f66ccb4bbc1b7fc70d9990ed6b6881d923af87cba8b96

According to blockchain.info, not only has the recipient received the funds, but they appear to have already spent them again.


What Protocol is used in miner and Pool communication? I've been reading something about this, and I read about stratum, GBT, getwork. I wanna ask if what protocol are they using (HTTP?, TCP?). I am +1 to beginner so what I am asking now might be wrong please do correct me

Most use the stratum protocol which sends JSON data over a TCP socket. Some pools also support the getblocktemplate protocol which works over the JSON-RPC (i.e. it uses HTTP requests).


Transaction and Node Proximity Questions Say I am a node (M1) in the bitcoin network who wishes to spend some set of bitcoins (T). M1 selects address (A1) with an associated node (M2) that he wishes to transact with and uses some process (F) involving T's private key to sign over T to A1 to be controlled by M2.

My question is how does T get broadcast to the bitcoin network? What model does the software enforce to announce a transaction has occurred? How is this message relayed and what kind of bandwidth does the relay require? Do all nodes reach participate in the transaction relay or just some? How does a miner decide to verify transaction T during his block solution hunt? How many transactions are considered to be a minimum for a block and how many are considered to be a maximum? And finally how long does a miner wait to fill his transaction queue for a given block solution hunt?

You add the transaction T to your (the sender's) unconfirmed transactions pool. From there on, it is treated like any other transaction. Then, your client will send a "inv" message to it's peers saying it has a transaction with hash H. (H being the hash of T) If the peers don't have it, they will send a "gettx" message requesting it, and your client will send it to them. They then add it to their list of unconfirmed transactions and they will do the same thing with their peers.


Bitcoin Halving - What is it? How is it calculated? Does it affect my bitcoin balance? I have read a lot about the halving that is set to take place later this year, but my question is how is halving calculated? Will it also effect my bitcoin balance as a whole?

The halving takes place approximately every 4 years. It is programmed in the software.

It will not affect your current bitcoins at all. It only affects the newly mined bitcoins which will be 12.5 after the halving (instead of 25).

The halving is expected to influence the price of bitcoin. With less supply the price will probably rise given that demand is the same... at least in the long run, since supply could also stay the same or even increase if people that were holding bitcoins start to sell.


mSigna : return address I installed mSigna, connected it to a full node and created an address.
Assumed I bought 1BTC from some exchange platform and it is received on this address. How can I spend 10 mBTC without paying a transaction fee of 990 mBTC ?
Does mSigna create automatically a return address and automatically pays 990 - the transaction fee I chose to this address or must I do it by hand ?
Thanks.
Francis

mSIGNA creates a change address for you. You do need to tell it what fee you want to pay - we are working on adding better automatic fee estimation, but for now you need to specify it yourself.


How much will I earn by running Bitcoin-Qt? I'm running Bitcoin-Qt on a dedicated server with a good connection (although, only a modest cpu). What is the frequency with which I will earn bitcoins?

Transaction fees are earned only by miners.  Running Bitcoin-QT, you will relay transactions and blocks for other people, but this does not earn you any fee.


Can I use my Electrum seed without Electrum? Assumptions:

I've memorized my electrum seed and will never forget it
In the future, I'm robbed of everything but mind and body
In the future, Electrum software is not easily accessible or I can
only access thin clients

Question:

Is there another way to use my 12 word seed?

HTML port of Electrum hosted somewhere?  iOS wallet that's electrum compatible? Etc.

Is there a reason it's local software and not just HTML? (other than someone dedicating the time)

Is there a reason 12 word seeds aren't universal across wallets that use 12 word seeds?

As Electrum is open-source software, we can probably safely assume it will never go away. That is, even if the devs were to take it off of github etc, there are likely thousands of copies of the source code distributed on the nets. But let's say all the electrum servers were taken down and for whatever reason you couldn't run a python interpretter (not very likely). Again because Electrum is open-source, the algorithm for transforming a seed into a private key and the derived private keys is known. So in theory, you could just do the math and generate your private keys manually from your seed. Practically, if you can get hold of a python interpretter, you can restore an Electrum database and dump all of your private keys without ever connecting to the internet. From there, sweep the balances into any wallet such as Bitcoin-QT.


Electrum won't send bitcoin: ascii error I was trying to transfer some bitcoins from my electrum wallet to coinbase. However Electrum I get this ascii error whenever I attempt a transfer:

"ascii codec can't decode byte 0xb6 in position 2: ordinal not in range(128)

I have no idea on what's causing this.

It is a bug, it was reported and fixed yesterday:
https://github.com/spesmilo/electrum/issues/1967

I will make a new release later today, that will include that fix.


Will Flattr support Bitcoin? It would be great if it would be possible to spend Bitcoins via Flattr. Does anybody know if there is something planed?

Your timing is perfect. Yesterday Flattr announced that they were going to implement Bitcoin.


Why, how, and when should an intermediate LN node terminate/resolve its HTLC(s) off-chain? I once heard an attack against LN, which was called "flood & loot": https://medium.com/blockchains-huji/flood-loot-a-systemic-attack-on-the-lightning-network-5c3dac7bba24
The 3rd step of that attack was described as follows:

III. Resolving payments on the last hop
After all payments were successfully routed and the HTLCs were added to the target node’s channels, the target node resolves all payments by returning the required secrets and claims these funds for himself. At that point, the target node could gracefully close his channels and leave with the funds sent by the source node. Once each victim acquires the secrets, he sends them back to the source node, asking to resolve the HTLCs and move their amount to the victim’s side of the channel. The source node refuses to resolve the payments and ignores any further messages from his victims.

So what does "resolve the HTLC" here mean? I see a mechanism titled "HTLC Off-chain Termination" in the LN whitepaper - does the term "resolving" here refer to this mechanism?
If so, I then think that, resolving/terminating HTLCs of the target node off-chain gives the attacker advantage (or gives the victim disadvantage) when the HTLCs of the source node is not yet resolved/terminated off-chain. Because, once the HTLCs of the target node are resolved, the victim will completely rely on the HTLCs of the source node being executed (rather than expired/refunded) to merely avoid fund loss, at best, meanwhile, the attacker will profit by stealing fund from HTLC expiry/refund, even in the worst case the attacker still won't lose anything.
So, what if the victim node in the middle then refuses to resolve the HTLCs with the target node as well, as long as the source node refuses to resolve its HTLCs with the victim node in the first place?
Why, how, and when should an intermediate LN node terminate/resolve its HTLC(s) off-chain?

First I would recommend to read BOLT2 in the section normal channel operation in order to understand exactly how and when htlcs are resolved. The whitepaper is heavily outdated and only explains the principles.
That being said the problem of your question remains.
To answer your question : intermediate nodes should resolve HTLCs as quickly as possible but that depends on the outgoing peer.
Let us assume the following path :
A-->B-->C-->D
As soon as D resolves the HTLC off chain C should resolve with B. And B should then resolve with A. The problem occurs if A stops talking to B. In that case B cannot resolve its HTLCs while it paid C who has was reimbursed to pay D before. Unluckily B can only resolve its HTLC with A after it resolved the HTLCs with C. The idea of doing it the other way around would not work and remove the trustless property of the routing.
In theory this should not be a problem for B as B can trigger a force close of the channel and resolve the HTLCs onchain.
This however yields several practical questions which can lead to the described attack:

what if the timelocks of the HTLCs expire soon? (Then A can claim those time locked outputs)
what if the mempool is full and fees are high? First B has to pay those fees in order to get its HTLC included and settled however once the timelock is over A could also claim those outputs with higher fees. In case A and D collaborate A has as much money as the HTLC is worth.
getting the commitment transaction in before the htlc timelock expires might become tricky as the fees of commitment tx are prenegotated and if A stops talking can't be adopted.

The third point might lead to the scenario of the second which can lead to the first. In such cases weired effects can happen and B can lose its funds that are in the HTKC as B has paid C but won't get reimbursed by A even though it has the proper signed onchain transactions.
A node generally does not want to force close the channel as that is expensive. Especially if that nodes expects to claim htlc outputs. However if the htlc timelock gets to close the node should consider to already close the channel to get the commitment txcinfirmed and be better prepared in the sense of having a time window to to get its HTLCs resolved without A being able to interfere.
Sorry that I can't give you a definite answer here. That is exactly part of the problem / attack and makes it so subtle


When do you need to run bitcoin-qt -rescan? I was under the impression that the -rescan flag was no longer needed for some time now. Can someone document precisely, when does one need to run bitcoin-qt -rescan? How has this changed throughout the versions of bitcoin-qt?

This answer might help: https://bitcoin.stackexchange.com/a/1251/11026

The gist is that a -rescan was needed, when you were restoring an older backed up wallet that didn't have all the transactions in your current blockchain reflected. Basically the client then goes through your blockchain to see if there are any transactions that affect your wallet.

However, you don't have to worry about this anymore since the client now checks automatically if the wallet is on the same level as the currently downloaded blockchain, and if needed, does the rescan:

https://bitcointalk.org/index.php?topic=6642.msg99812#msg99812

Hope this helps.


Why doesn't the number of shares in my miner match the number of shares reported by my pool? It was my understanding that I have found a share, when the miner reports accepted:...(yay).

However, the number of shares I'm being credited with in my pool is much lower than the number in the miner.

I'm talking about total shares as I have always used the same pool, and I haven't reset the miner so far. So, both should refer to the same frame of time.

Why doesn't the number of shares in my miner match the number of shares reported by my pool?

It's possible that your pool is doing something similar to P2Pool:

  Q: Why does my miner say it has found a lot of shares but p2pool say I
  have only found a few?!
  A: The real P2Pool difficulty is hundreds of
  times higher than on normal pools, but p2pool essentially lies to your
  miner and tells it to work on relatively easy shares so that it
  submits shares every few seconds instead of every few hours. P2Pool
  then ignores any submitted shares that don't match the real share
  difficulty. By doing this, P2Pool can more accurately report your
  local hash rate and you can see if you are having problems with too
  many stale shares quickly


How do I still have connections without forwarding port 8333? First of all, this isn't a problem I am having, I'm just curious how this works.

If you run your node with port 8333 open, you'll receive a large amount of connections after being online for a while.

If you run your node without port 8333, you still have connections, but it usually won't exceed around 7 connections.

My stupid simpleton logic tells me I should have no connections if that port isn't open, but that clearly isn't the case.

So my specific questions are:
How do I have any connections at all without using port 8333?
If it is using another port, why is the limit at 7?
The node still relays txs to peers, just less of them, so I'm assuming it is not a security issue?

When your node is not accepting inbound connections (either because there's NAT in the way or because you passed -listen=0 to Bitcoin) it still makes "outbound connections." These are connections to other Bitcoin nodes that are listening on a public port. Your node makes a maximum of 8 outbound connections. (Source.)

When you make an outbound connection, your router notices that you opened the connection, and forwards any reply packets to you. See How NAT / PortForwarding / TCP/IP works? Your router does the same thing when you browse the web.


How does an individual access the Bitcoin Core repo and contribute to it in the case that GitHub boots Bitcoin Core or the individual off GitHub? It is not looking like Bitcoin Core will be moving from GitHub anytime soon (unless forced to).
How does an individual access the Bitcoin Core repo and contribute to it in the case that GitHub boots Bitcoin Core or the individual off GitHub?
What should an individual do in advance to prepare for this scenario?

Nothing interesting happens if github bans bitcoin, the repository will be uploaded on a different host. Git is a decentralized application and several mirrors exist already. The contributors also have local copies of the repository so no code will be lost.
The biggest problem would be that the github issues and comments will be lost since they are a github feature (not part of the git repository).


Cryptofinance plugin pulling wrong data for KNC Seems there are two "KNC" tags on Coinmarketcap... Kyber Network and KingN Coin. Any idea how I should pull the Kyber Network data using this plugin? Right now it's pulling the KingN Coin info...

There are over 60 coins out there that share the same symbol. You would have to use the full name of the coin to pull the data instead of ticker. According to the documentation:

  To find the coin full name, simply go to its CoinMarketCap page and copy its name from the URL. For instance Cosmos URL is https://coinmarketcap.com/currencies/cosmos/ so we’ll copy cosmos

However, you need to keep the quote currency in symbol. So if you are getting the data of Kyber Network in terms of bitcoin, you will have to use =CRYPTOFINANCE("kyber-network/btc")


What are some counter arguments for NXT (nxtcoin) "premine" or initial distribution setup? Whenever someone brings up NXT (nxtcoin) as a topic, many people's first reaction is the initial distribution of how nxt was setup. Many consider this a "premine" event and see it as a potential failure in the coin itself as the initial 75 stakeholders controlled the majority of it.

What are some arguments that one can give to help clarify this way of distribution?

Arguments of Nxt creator are written here - https://nxtforum.org/initial-distribution/initial-distribution-of-100-pos-currencies/:

  Initial distribution of the coins and the forging schedule are more
  serious problems than they appear at first glance. A 100%
  proof-of-stake currency needs at least a small part of the coins to be
  distributed in the beginning because these coins is the only forging
  instrument. A forging schedule has a lot of influence on initial
  distribution and must be defined in the first place.

  The PoS algorithm used in Nxt has such properties that give a little
  advantage to an account that holds more coins comparing to an account
  with a lower amount. If every block subsidizes the forger with extra
  coins (in addition to the fees) then bigger accounts become even
  bigger by following the compound interest curve. In a currency with
  selfish forgers most of the coins would be absorbed by very few
  accounts that would lead to centralization of the currency. Because of
  this all the coin in Nxt were distributed at once in the genesis
  block.

  Bootstrapping requires to make a decision how to do the initial
  distribution. We consider three main schemes, any other scheme can be
  represented as a combination of them.

  The first scheme – all the coins go to a single account controlled by
  one entity that transfers coins to the others in exchange for work
  done for development and promotion of the currency. This scheme is
  completely unacceptable because it’s not “compatible” to decentralized
  nature of cryptocurrencies.

  The second scheme – all the coins are split equally among a group of
  people. This approach faces some problems. A Sybil attack can be
  easily conducted by an entity to acquire a significant part of the
  coins. Such a counterattack as usage of a certification service can’t
  be used because majority of potential users won’t agree to reveal
  their true identities. Another possible counterattack, based on
  proof-of-resources approach, can’t give “fair” distribution because
  the resources are distributed in “unfair” way. Anyway, even if the
  Sybil attack could be significantly mitigated, the second scheme is a
  bad choice because the history of humankind teaches us that an economy
  driven society where all individuals own equal amount of resources is
  unsustainable and even utopian. (Note by CfB: It would be interesting
  to hear opinion of NEM guys on this issue…)

  The third scheme – all the coins are distributed in “chaotic” way.
  This scheme doesn’t have disadvantages of the previous ones, no
  centralization, no necessity to deanonymize users, no need to
  counteract Sybil attacks. Economy and sociology sciences state that
  distribution of the coins will follow the Pareto 80-20 principle. An
  important note should be made. The fact that (almost?) all the
  societies conform to this principle assures that the third scheme is
  the best one. The Pareto principle seems to be a result of universal
  but yet unknown laws of nature. If the distribution follows the
  principle then with high probability we can assume that our system
  will sustain for a long period of time. The previous schemes will
  transform into “80% of coins belongs to 20% of entities” systems
  anyway, but the third scheme has such an advantage that it doesn’t
  need to survive the period of instability.

  According to the described above logic Nxt was created by issuing all
  the coins at once and distributing them by following the last
  distribution scheme.

  Initial distribution has two properties – percentages and number of
  participants. Common sense says that number of participants should be
  as large as possible.  This seems to be true, but we should take into
  account that every system has three main stages of the progress –
  bootstrapping, normal functioning and decaying. We consider only the
  first two because our goal is to create an ever-functioning system.

  We shouldn’t ignore the lessons of history. Societies created by a lot
  of people are abnormal phenomena. Number of participants in the very
  beginning should be rather small than large. This is an arguable
  statement but disputes on the issue lay out of the scope of this
  paper. The creator of Nxt preferred a small number of “founders”
  because he had no possibility to do several experiments on finding the
  best number nor he had time to build a theory that could predict this
  number. The most stable economic systems were always bootstrapped by a
  few people (feods, corporations, etc.) so it was safer to follow a
  similar way.

  Now, half a year after the launch of Nxt we see that it didn’t die and
  keeps growing at fast pace. This lets us guess that the choice of
  BCNext was a correct one.


How do you exchange bitcoin for real money? I have been wondering this question for a while now, so I am using NiceHash and my bitcoin address should be going to my bitcoin wallet but I want to know are there any legit sites that give you real money (AUD) in exchange for bitcoin since there is a lot of scam sites that don't actually give you money instead take your bitcoin, so if anyone knows a site that is NOT a scam and is legit for exchanging.

(NOTE: I would like to exchange to something like a credit card or PayPal)

To exchange Bitcoin with another currency, you are really selling your bitcoin to someone else in return for "real" money. One popular exchange site is LocalBitcoins. This site offers many different methods of exchange.

To the best of my knowledge, selling bitcoin using PayPal violates their terms of service, although some sites do offer this.


Could Bitcoin have a fixed difficulty? Could Bitcoin have a fixed difficulty, how to implement that for a test and what would that mean in terms of mining? Would there be a difference if mining with a big rig or just a wallet?

If the difficulty were unchanged from its original target of 1, today there would be 16 trillion blocks mined every 10 minutes.

This would break the network instantly, it would not be able to maintain consensus, and would be creating something in the order of 33,000,000 gigabytes of blocks per hour, which would exceed all storage available in the world and consume all of the available internet bandwidth.

Suffice to say, this wouldn’t be ideal.


HD wallets and multisig Is there any standardized way to define HD wallet accounts used to participate in multi-signature transactions? How do existing multisig wallets derive their keys from the seed it? How is Bitcoin Core doing it, as it has added support for both, HD wallets and PSBTs, recently?

Okay, I found this information about Copay, one of the few multisig mobile wallets:

Depending on the key derivationStrategy, addresses are derived using BIP44 or BIP45. Wallets created in Copay v1.2 and forward always use BIP44, all previous wallets use BIP45. Also note that since Copay version v1.2, non-multisig wallets use address types Pay-to-PublicKeyHash (P2PKH) while multisig wallets still use Pay-to-ScriptHash (P2SH) (key addressType at the backup):

[...]

BIP45 note: All addresses generated at BWS with BIP45 use the 'shared cosigner index' (2147483647) so Copay address indexes look like: m/45'/2147483647/0/x for main addresses and m/45'/2147483647/1/y for change addresses.
Since version 1.5, Copay uses the root m/48' for hardware multisignature wallets. This was coordinated with Ledger and Trezor teams. While the derivation path format is still similar to BIP44, the root was in order to indicate that these wallets are not discoverable by scanning addresses for funds. Address generation for multisignature wallets requires the other copayers extended public keys.


Is there a self contained C/C++ code snippet out there to validate a Bitcoin public address? I tried looking through the Satoshi Client to grab the necessary code. It ended up being too difficult for me as my expertise is not in C or C variants. And the fact that the code use boost made it that much more difficult. Is their a code snippet out there that does not rely on any external libraries except for maybe the SHA256 hash function?

This isn't precisely what you asked for, but it should be a good starting point.

https://bitcointalk.org/index.php?topic=1026.0

import re
import math
from Crypto.Hash import SHA256

def validate_bitcoin_address(self, value):
  value = value.strip()
  if re.match(r"[a-zA-Z1-9]{27,35}$", value) is None:
    raise ValueError("Contains illegal characters")
  version = get_bcaddress_version(value)
  if version != 0:
    raise ValueError("Not a standard bitcoin address")
  return value

__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
__b58base = len(__b58chars)

def b58encode(v):
  """ encode v, which is a string of bytes, to base58.
  """

  long_value = 0L
  for (i, c) in enumerate(v[::-1]):
    long_value += (256**i) * ord(c)

  result = ''
  while long_value >= __b58base:
    div, mod = divmod(long_value, __b58base)
    result = __b58chars[mod] + result
    long_value = div
  result = __b58chars[long_value] + result

  # Bitcoin does a little leading-zero-compression:
  # leading 0-bytes in the input become leading-1s
  nPad = 0
  for c in v:
    if c == '\0': nPad += 1
    else: break

  return (__b58chars[0]*nPad) + result

def b58decode(v, length):
  """ decode v into a string of len bytes
  """
  long_value = 0L
  for (i, c) in enumerate(v[::-1]):
    long_value += __b58chars.find(c) * (__b58base**i)

  result = ''
  while long_value >= 256:
    div, mod = divmod(long_value, 256)
    result = chr(mod) + result
    long_value = div
  result = chr(long_value) + result

  nPad = 0
  for c in v:
    if c == __b58chars[0]: nPad += 1
    else: break

  result = chr(0)*nPad + result
  if length is not None and len(result) != length:
    return None

  return result

def get_bcaddress_version(strAddress):
  """ Returns None if strAddress is invalid.  Otherwise returns integer version of address. """
  addr = b58decode(strAddress,25)
  if addr is None: return None
  version = addr[0]
  checksum = addr[-4:]
  vh160 = addr[:-4] # Version plus hash160 is what is checksummed
  h3=SHA256.new(SHA256.new(vh160).digest()).digest()
  if h3[0:4] == checksum:
    return ord(version)
  else:
    raise ValueError("Bad checksum")


RPi3 Mining Node Wallet Address Configuration I am using a RPi3 as a stock bitcoin mining node. I am getting it all set up. I am not expecting to ever actually mine any coin. I am just doing it for fun and learning.

I know that if my node were to mine a block it would create a transaction for the bitcoins that it earns by doing so.

My question is where do I set that public wallet address to receive those coins? I am using a tutorial to set up the software and it doesn't say anything about setting that address.

I have also searched everywhere I can think of and can't find any information on it.

Support for the built-in CPU miner was removed in Bitcoin Core v0.13 (see https://bitcoin.org/en/release/v0.13.0#removal-of-internal-miner), so this issue is moot.

Historically speaking, the built in miner asked the built-in wallet for an address. So it was not configurable - you just had to use the internal wallet RPC to manage the funds you got out of mining.


Why is SHA-256 mining secure? My understanding is the when you are mining bitcoin you are looking for a string, or maybe a binary number (a) such that if you 'add' a to the block (b) you get a number (c) whose hash begins with a bunch of zeros.
My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?
What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?

It's not possible because there are 2^256 (approximately 1 followed by 77 zeroes) possible hash results. You would have to try an awful lot of possible values for a2 to find one that happened to produce precisely the same hash output. The stars would burn out first.

What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

No, it is not simple appending. That would produce very, very long numbers. It's an operation that has three important characteristics:

It produces an output smaller than its input. This makes it irreversible because information is lost. You cannot reverse the hashing operation just as you cannot reverse addition. If I add two numbers and get 10, you cannot tell me which two numbers I added because that information has been lost.

A small change in the input produces large changes in the output. That is, changing a single bit of the input changes roughly half of the bits of the output, and it is not easily predictable which bits that will be. It mixes the input quite thoroughly to produce its output.

The output is long, 256 bits. As a result, brute force trial and error to get particular outputs is not practical.

You can read more on the SHA-2 family of functions (which includes SHA-256) here.


ways to improve bitcoin tx finalization time On GDAX website, they claim that 3 confirmations is needed to finalize your tx in. I assume they've done thorough research on this and might've come up with some logic to protect themselves from temporary branches.

In a few other posts, I often found people say at least 6 is needed. I mean obviously it's trade-off between efficiency and robustness, but just wondering what are some of the possible ways to push this number to the lower end while keeping the system as robust as possible.

According to the Bitcoin wiki who refers to this Analysis of hashrate-based double-spending:

No amount of confirmations will reduce the success rate to 0.

If the attacker controls more hashrate than the honest network, no
amount of confirmations will reduce the success rate below 100%.

There is nothing special about the default, often-cited figure of 6
confirmations. It was chosen based on the assumption that an attacker
is unlikely to amass more than 10% of the hashrate, and that a
negligible risk of less than 0.1% is acceptable. Both these figures
are arbitrary, however; 6 confirmations are overkill for casual
attackers, and at the same time powerless against more dedicated
attackers with much more than 10% hashrate.

So as you stated, it is nothing more than a trade-off.


Why does the initial blockchain download get stuck part way through? I am trying to get Bitcoin up and running on a fairly underpowered laptop and Windows Vista using Bitcoin-Qt 0.5.0.1. After installing and starting the program, I am stuck at at the syncing stage at 92150 blocks and 0%, and have been for several hours. What could I try to get the program working?

Restart OS, restart Bitcoin, try forwarding port 8333 on your router to your machine.  If there is no progress after that, you might consider deleting all the files in your Bitcoin data folder except wallet.dat (if you have made any transactions, deleting wallet.dat will make you lose your Bitcoins). If you just want to use Bitcoins casually, or don't want to wait for the client to sync, you can consider using an eWallet.


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

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


When a node receives a transaction, what steps does it do to verify that transaction? I know that it verifies the block hash by calculating each hash of the contiguous blocks in order, but does it verify the balance of each wallet sending the transactions as well? And does it do the block hash calculation every time, or does it just do it when it starts up?

When a node receives a transaction, they perform the following steps at a high level.

Inductively, they already have a set of validated transactions; these belong to the blockchain they have adopted as well as their current mempool. From this, the node has extracted a UTXO.

Ensure that the inputs of the new transaction reference valid outpoints in the UTXO. This ensures that the money being spent is real.
Verify the Law of Conservation, i.e., that the sum of value of the outputs does not exceed the sum of the value of the inputs. This ensures that no new money is being created. The one exception to this is when a new coinbase transaction is received with a newly mined block; in that case, new money can really be created.
For each input of the new transaction, ensure that running the scriptPubKey script attached to the outpoint it connects to with the parameters specified in the scriptSig of the input, leaves the Bitcoin Script stack with a non-zero value at the top. Most of the time, this is the step where the digital signature validation happens and ensures the money is being spent by its rightful owner.

The last step above has many subcases and can function in various ways depending on whether the transaction involves a segregated witness or an attached indirect script, for example.

Lastly, once a transaction is validated by the above steps, the UTXO of the node is updated so that they can validate further transactions.

None of the above has anything to do with block validation. Block validation is a separate mechanism from transaction validation. Transactions are validated even when they don't belong to blocks. One of the block validation steps is to validate all block transactions with the above algorithm. Transaction validation does not require calculating any block hashes.


The "work" in proof of work How does proof of work function?

Why does the "work" in proof of need to have zero utility for the economics of the cryptocurrency to be viable.

If the mathematical problems done by miners had value by themselves beyond blockchain purposes, a miner could work on two parallel blocks at the same time to try to pull a double spend, without losing much money with electricity, bandwidth and other mining costs.


Sybil attack countermeasure In Bitcoin Wiki Weaknesses: Sybil attack they mention that:

"Bitcoin makes these attacks more difficult by only making an outbound connection to one IP address per /16 (x.y.0.0)".

Why would this make a Sybil attack more difficult? Is there a reason for choosing a /16 subnet or is it randomly chosen by the developers with no background?
Wouldn't it be more secure to choose a smaller subnet?

When you are buying servers you can order multiple IP per one server, typically in the same /8 or /16 subnet. So 1 server can serve as 100 or even 1000 Bitcoin nodes.

Ordering lots of IPs in lots of different /16 subnets is rarely possible for the same server.

Hence this change makes it harder/more expensive to launch 1000's of rogue Bitcoin nodes - you will have to distribute them across large number of servers in different datacenters.


Application of proof of work in bitcoin Proof of work in spam

I understand very well how proof of work is used to prevent email spam for example. Reasoning is since computing the right hash (e.g. with predefined number of zeros for example) for a single email is expensive, it will not be desirable for people sending spam to million recipients to compute that hash for each email. Now this reasoning makes perfect sense.

Proof of work in bitcoin

However, I don't know how the proof of work system is used in bitcoin, more precisely:

which problem does it try to solve
and more importantly how does it solve this

Can someone explain it (in layman terms)?

To have a useful payment system, if I have some asset the system supports, I have to be able to send it to Alice if she is a user of that system. And I also have to be able to send it to Bob if he is a user of that system. But if I can do both of these things, the system stops being useful. So, for bitcoin, somehow sending bitcoins to Alice must prevent me from sending them to Bob and vice versa.

Traditionally, this would be accomplished by a central authority. For example, my bank can process checks in the order it receives them, approving them if I have a sufficient balance and deducting that amount from my balance. The bank can prevent me from sending the same money in two places. But bitcoin has no central authority.

Bitcoin's solution has several pieces.

First, it groups transactions into blocks. Second, it chains blocks into a blockchain.

Third, it has rules for what is or is not a valid blockchain. For example, a chain that includes two conflicting transactions is not valid. So, in my example, either a blockchain can include my payment to Alice or my payment to Bob, but not both. This works because all transaction and state information is public, so nobody would ever accept any blockchain with conflicting transactions unless they chose to foolishly harm themselves.

But we still have one problem left -- how do we ever get everyone to agree on which blockchain is valid if there's one that includes the payment to Alice and one that includes the payment to Bob? That's where proof of work (mining) comes in.

It consists of two steps:

1) To add a block to the blockchain, you must do a very large amount of computational work.

2) You will be rewarded with bitcoins for doing this large amount of work, but only if the blockchain that contains the block you added becomes the one everyone agrees on.

And lastly, one more rule: We agree on that valid blockchain that has required the most computing power to generate.

Under reasonable conditions, this assures that everyone will eventually agree which of the two transactions is valid. Miners are incentivized to build on the longest, valid block chain they know of, because that gives them the best chance of being rewarded. Thus longer chains will tend to get longer and shorter chains will tend to be ignored. Eventually, one chain will be so much longer than every other chain that we everyone is mining on top of it and nobody is mining on top of the other and there is no chance the shorter chain will ever be longer.

Once that happens, and the longer chain contains one of my two transactions sufficiently deep in the chain, we can all agree which way my bitcoins go. And no central authority is needed.


Does LTC price correlates to BTC price? I always expected the LTC and BTC exchange rate to show synchronous tops/bottoms, but to my surprise LTC seems to remains stable during BTC crashes (and vice versa).

Is this because I'm a novice at chart-analysis, or is there really little correlation?

Assuming that the BTC price is falling against USD, either BTC/LTC will remain stable and LTC will crash proportionately against USD or LTC/USD will remain stable and BTC will crash against LTC or something in between.  Otherwise, there will be arbitrage opportunities by changing by using LTC as an intermediary between BTC and USD


How does Transaction Remote Release work? How exactly does TRR (Transaction Remote Release) work?

What are the similarities (and differences) with the way TOR works?

TRR is like Tor in that it chooses random routes, and uses public key cryptography to secure communications. The major difference is that where Tor creates long-lasting bidirectional channels, TRR would use low-latency single-use one-direction transaction forwarding. At time of writing, there doesn't seem to be a public TRR implementation, so I'm basing this off of this paper.

There is one missing part, though.

Tor uses something called "perfect forward secrecy." In Tor, the private key of a node is useful for pretending to be that node, but it can't be used to decrypt communications after the connection has closed.

To see why this is useful, imagine the following scenario: Your ISP captures a TRR encrypted communication. They see that the first encrypted portion was sent to A. They find A, and get their private key. They decrypt the first layer of the message, and see that the second node is B. Repeat until they see what transaction was hidden within.

This works even though A, B, and C never kept any logs of where they sent the transaction. The way to fix this is either:

use the node's private key to establish an intermediate key, and throw the intermediate key away after the connection closes, or
rotate the node's key very frequently, at least every hour.


What kind of node connects to your full node and doesn't share blocks with you? When running getpeerinfo I can see that a number of connected nodes return a synced_blocks of -1.

Some of these have been connected for days, so:

Is it correct to assume that these nodes are never attempting to propagate blocks around the network?
If so, what's their purpose if they're not propagating block data around the network?

You can see what I mean here: http://learnmeabitcoin.com/explorer/node/

It could be a blockchain analysis node of some sort (eg. Chainalysis or similar), or it could be a pseudonode.


Transaction verification vs block mining I cannot clearly understand if the transaction verification is done over a single or double phase. This is my understanding.

Once a transaction is completely assembled, its inputs and outputs defined with all the conditions, the inputs can be checked to make sure the sender has enough balance to process the transaction.
Block mining is performed to time stamp the transaction and prove that it existed at a certain timing. Therefore block mining is more of a confirmation that the transaction has occured at a specific time rather than checking the validation of inputs.

If what I said is correct, who performs step one. Is it done by the receiver to make sure that the sender actually owns a real balance to make the payment?

If what I said is wrong, are step one and step two done together by the miner. And can someone please provide more detailed description of this verification process of inputs and time stamping because the none of the previous questions and answers address this clearly.

The connected peers do the first one. If it is invalid, they don't relay to other peers and the transaction gets forgotten. If it's valid, then peers relay it to their peers and then miners include the transaction in their block.


Is it possible to avoid a ~$40 fee for a 220-input transaction? I want to transfer all my BTC from my old Electrum wallet to a new one, so that I can claim Bcash using Electron Cash without risking losing my BTC. The problem is that my ~0.143 BTC came from hundreds of transactions (cloud mining, faucets, etc.) and even with the lowest fee on the Electrum slider (confirmed within 25 blocks), the total fee is 0.013 BTC!

Is there any way I can avoid such a huge fee, while ensuring that my money is sent. There is a 'replaceable' fee option in Electrum. Does that mean that I could try to set the fee/kB very low and up it if nothing happens, without risking my BTC getting lost?

UPDATE: I sent a transaction off with replaceable fees at ~8 satoshi/byte, thinking that there was nothing to lose. It was confirmed in less than an hour :-)

bitcoinfees.21.co shows that fees are fairly low currently. You may try to export keys from your old electrum wallet, and load them into a new Electrum wallet (then you don't need to "transfer"), and go from there. The newer version allows to set tx fees in Saoshi/Byte.
Alternativly:
If you are on OpenBSD, Linux or MAC, you could give it a try with these shell scripts: github.com/pebwindkraft/trx_cl_suite (you don't want to provide your private keys or similiar to anyone!).
I used the tools last recently to create manually a tx (c9908124e59a2794f3807b366be7d235ff7654251adcdf396e209236341b3c32) with 20 Satoshis per Byte, having a size of 18KBytes.


Bitcoin full node - how to run a pruned node, explaining pruning? can you explain please how I can run a "pruned" node instead of storing all 300GB of data? Is there a difference how you turn your btc client into "pruning" mode among the different clients, bitcoin core, bitcoin QT, electrum?

If i run one of those 3 mentioned btc clients, I would like to know how to turn that program into "pruned mode"?

Any security factors to keep in mind when using pruned node mode?

Thanks

Running a pruning node simply means enabling the prune setting.

In Bitcoin Core, that can be done either in the bitcoin.conf file by adding a line "prune=N" (where N is a number in megabytes), or through the Qt GUI in the settings screen.

Electrum is not a full node, and never downloads or verifies blocks at all, so there is nothing to prune.

There is no difference in security, only in features. A pruned node cannot serve old blocks to other peers, and can't be used to rescan old wallets (because the block data is not available).


What happens if an exchange's order book has only Market Orders If a bitcoin exchange offers Market Orders, let's suppose there are X buy orders at market price, and Y sell orders at market price  (no limit orders):

How are these matched and at what price, since there is no "lowest or highest" price currently on the order book?

This situation would not exist. True market orders (buy or sell) cannot just "hang" around. If they are not executed immediately against existing limit orders, then they should be cancelled. The case in which they would not be executed would be if there are no orders on the other side. In which case it depends on how the system handles the orders but it should either say it can't fill it and never place the order to begin with.


How to sell bitcoins for cash? If I want to sell bitcoins, assuming I was successful in either buying them or selling a service or a product and accepting bitcoins instead of normal cash. How can I convert the bitcoins back to cash ?

Another option would be to use an exchange which can withdrawal USD/EUR (depending what you want). A good option for that is Kraken, as they have very low withdrawal and trading fees. You can trade your bitcoins to USD/EUR, and then withdrawal to your bank account. And no, I am in no way associated with Kraken, just a happy customer there


Bitcoin address does not show transaction/balance from Coinbase purchase I purchased a bitcoin using a Coinbase account. When I try to verify that transaction to the address, I can't see any activity or balance for the bitcoin address that Coinbase shows as mine. Coinbase, however, still shows my purchase activity and balance correctly on my account.

Has this something to do with the way Coinbase or such wallet services work? Or is there something wrong? Do I actually have the bitcoin or not?

The coins you purchase are stored in an address owned by Coinbase.  This allows them to buy and sell coins using their hot wallet as well as allowing them to move excess coins to cold storage.  It also allows them to process send requests between Coinbase users using off-blockchain transactions.

The coins won't show up in an address owned by you until you send the coins to a non-Coinbase address.  When you do send the coins, two transactions will be generated by Coinbase.  The first transaction moves the coins from an address controlled by Coinbase to a new address controlled by you.  The second transaction then moves the coins from this address to the address you specified in the send request.

You can send coins to any of the addresses shown in your Coinbase wallet.  Or you can generate a new address at any time to receive deposits.

Since Coinbase keeps just a percentage of the coins in their hot wallet, this can lead to a delay in sending coins if they need to move coins from cold storage back to their hot wallet.


How can we send bitcoin? As I know,we can send bitcoin from our own account to other's account without specifying private_key.
So I wonder why we have to store our own private key carefully

Private key gives you access to your account and your funds.
Public key is used for receiving funds to your private account.

Similar to a bank account, only you can log in with your private information. But anyone can send you money if they know your account number which can be public.

If someone gets your private key, they will thereby have access to your account and take all your funds. Don't ever share your private keys.


Are wallet credentials really safe? I’m using Copay as my Bitcoin wallet. I see it is opensource with the code available in github. What guarantees that they uploaded binary based on that source code? Does it go through Apple approval? Storing more money in bitcoin, I want to be sure my password / credentials are safe and that the developers are not sending out in a hidden way, via backdoor.

You don't have any guarantee. You are relying completely on the developers to submit the binary application file based on that source. You are also relying on Apple not to manipulate the application binary once it gets to them.

It's no different with Bitcoin Core or any other wallet or software. In all cases you're putting your trust in whoever does the build and the source and tools they use.

One option is to look at the history of the software. If it's relatively mature and has had no faults, either malicious or competency related, then it may be safe to put a degree of trust in it.


How to retrieve readable private key from bitcoinjs-lib I'm still new to bitcoin and experimenting a lot with bitcoinjs-lib in JavaScript.

How do I create a readable string from a private key?
This is my current setup:

      const seed = bip39.mnemonicToSeed(seedPhrase)
      const bitcoinNetwork = bitcoin.networks.testnet
      const hdMaster = bitcoin.bip32.fromSeed(seed, bitcoinNetwork) // seed from above
      const keyPair = hdMaster.derivePath('m/0')
      // try to get private key as readable string
      const privateKeyBuffer = Buffer.from(keyPair.privateKey)
      const privateKey = privateKeyBuffer.toString('utf8')
      console.log('privateKey → ', privateKey)
      // fail to get private key as readable string
      const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey })

any ideas for me?

use .toString('hex') instead.

  Don't export / import individual private keys when you are using BIP32 HD keys. IT IS DANGEROUS.
  .toString('hex') and .toString('base64') are readable string representations of Buffers, but no crypto apps use them. The accepted format for individual private keys are WIF. But like I said, IF YOU ARE USING HD KEYS, ONLY STORE/EXPORT/IMPORT YOUR SEEDPHRASE OR AN XPUB.

Source: From this Github thread.


is it possible to be able to buy cryptocurrencies other than bitcoin, litecoin and eth with USD I've been looking online for quite sometime but it doesn't seem like I can find this exact answer. I've been looking to buy some cryptocurrencies but I'm hoping to be able to buy them with USD.

I know that I can go to coinbase, open an account, buy bitcoin, or ether and then transfer it to an exchange such as bittrex or bitstamp and get coins using those two main cryptocurrencies.

What if I want Ripple or DASH and want to buy it directly at the price that it's at, and i do not want to buy Bitcoin or Ether to get it (since the prices are so high).

Basically I'm not interested in buying Ether or Bitcoin, i'm looking to buy some other cryptocurrencies that are very low in price.

Am I able to do that - or do I HAVE to use Bitcoin or Ether to buy the desired ctyptocurrencies.

Your issue makes no sense; the price of the intermediary currency is irrelevant.

Say you want to buy $600 worth of Bloopcoin. Bloopcoin's exchange rate is around $60 per Bloop, so you expect to get 10 Bloop.

Unfortunately only markets to buy with BTC are available, and (assume) BTC's exchange rate is $6000 per BTC. You can still buy 0.1 BTC for $600, and then use those 0.1 BTC to buy 10 Bloop.

If BTC were instead to be at $12000 per BTC, you'd only be able to buy 0.05 BTC for $600; but if the Bloop exchange was $60 per Bloop, those 0.05 BTC would still buy you 10 Bloop.

I'm aware this is not a full answer to your question, but perhaps it addresses the "since price is so high" comment you made.


Is there a lite wallet for Bitcoin Cash Free money, is free money.  Last week I transferred my distributed BTC funds to a BTC lite wallet so that I could be holding funds before the Bitcoin Cash fork.

I now have some BCC sitting in a BCC account, but I need to move it to an exchange.  I've searched and searched, but I can't find a simple, straightforward answer.

Is there a lite wallet or a (moderately) safe web wallet that will allow me to import my keys and withdraw my funds?

Also, I'm well aware of security risks with web wallets.  I've already deposited all of my funds back to their respective exchanges and the BTC account is empty, and I plan on never using it again.  Now, all I want to do is access my Bitcoin Cash funds as painlessly and quickly as possible.

http://www.electroncash.org/

But you may have problem to setup this wallet if you use non-english windows 10 version. For example with cyrillic letters


cURL to Bitcoin-Qt on Mac fails I followed gavinadresen's answer at Bitcoin-Qt command line control on Mac. When I enter the following in terminal, it works:

open Bitcoin-Qt.app --args -server

I've put in the following into my bitcoin.conf file:

rpcuser=yourname
rpcpassword=password

I entered the following in terminal:

curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/

The above prompts me for the password and then it shows the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

<TITLE>Error</TITLE>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>

401 Unauthorized.

The above output doesn't look right.  Aren't I supposed to get data from Bitcoin?  How do I get the curl command to work?

Three things to check :

Is there rpcssl=1 in your bitcoin.conf ? If so, set it to 0 or make HTTPS connections only
Have you set rpcallowip=127.0.0.1 ?
Try connect to http: //yourname:yourpassword@127.0.0.1:8332/ directly

And the fourth thing to check (as I saw your answer) :

Check if you have correctly entered your username and password ;)