Is the Stellar inflation voting public? The Stellar network allows users to vote on who will earn its 1% annual STR inflation. I am wondering - is this information publicly available on the Stellar ledger or somewhere else? How can one find out which account voted for who and how big their voting power was at the time of the vote?

Yes, the information is public and in the ledger history.

you can find how inflation works in Stellar.org's mandate
https://www.stellar.org/about/mandate/#Stellar_creation
and
https://www.stellar.org/developers/learn/concepts/inflation.html

in a nutshell: you can look at the inflation transaction that runs every week and look at its metadata. The metadata will tell you who was the recipient of the inflation.

As far as re-computing the input, you need to:

Download the historical ledger this inflation transaction ran
against (so the one right before it)
(can be skipped to get a fairly close approximation) apply the transactions that precede inflation during that ledger round (can be done with the metadata or running a node)
Look at the balance and InfladionDest of all accounts in the ledger to compute the vote tally. Voting power is the STR balance in the account.

Nicolas


How do I get hash to verify transaction? If I have the public key and signature for a transaction how do I get the hash value that is used in verify(hash, sig, pubkey). I want to know how to work backwards from a raw transaction to get it,  not how to build it.

My question is basically this one

How to verify the signature of a raw transaction

But the answer given I think is for getting the Transaction ID hash which I have tried and it doesn't work.

Here is how things can be done backwards.  Unfortunately, the bitcoin-explorer (bx) verify mechanism works a little differently but somewhat similar to what you were expecting.  Step 4 below might provide details that might be useful for what you are doing. Step 5 below completes the validation offline.

1. Here is the easy way to compute transaction IDs from the raw hexadecimal transactions.

% echo 01000000018a8a9f938c251be60da2711c6bf168c66213fae8e26251fcec47f9a41d0e71e3020000006b483045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d012103c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98ffffffff0200803801000000001976a914d2c6b9c7f146ea4039e6ae67904eb94d479b7ed688ac06d79e460e0000001976a914b85f8cde95fe9b30872e49d5b961a4af5d07518688ac00000000 | bx bitcoin256

9b4912711de5e258a74a529227f43647bc3b2304212fb508c5f8e910d5986270

2. Here are two means (1st is offline, 2nd is online) to extract the Endorsement/Signature and associated Public Key used for the TX_ID 9b4912711de5e258a74a529227f43647bc3b2304212fb508c5f8e910d5986270 input:

% echo 01000000018a8a9f938c251be60da2711c6bf168c66213fae8e26251fcec47f9a41d0e71e3020000006b483045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d012103c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98ffffffff0200803801000000001976a914d2c6b9c7f146ea4039e6ae67904eb94d479b7ed688ac06d79e460e0000001976a914b85f8cde95fe9b30872e49d5b961a4af5d07518688ac00000000 | bx tx-decode

or

% bx fetch-tx -c ~/bitcoin-explorer/bx-mainnet-remote.cfg 9b4912711de5e258a74a529227f43647bc3b2304212fb508c5f8e910d5986270

that both yield:

transaction
{
    hash 9b4912711de5e258a74a529227f43647bc3b2304212fb508c5f8e910d5986270
    inputs
    {
        input
        {
            address_hash a0d48c129cfde8f124a16f4d69bc47fd7fb5780d
            previous_output
            {
                hash e3710e1da4f947ecfc5162e2e8fa1362c668f16b1c71a20de61b258c939f8a8a
                index 2
            }
            script "[3045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d01] [03c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98]"
            sequence 4294967295
        }
    }
    lock_time 0
    outputs
    {
        output
        {
            address_hash d2c6b9c7f146ea4039e6ae67904eb94d479b7ed6
            script "dup hash160 [d2c6b9c7f146ea4039e6ae67904eb94d479b7ed6] equalverify checksig"
            value 20480000
        }
        output
        {
            address_hash b85f8cde95fe9b30872e49d5b961a4af5d075186
            script "dup hash160 [b85f8cde95fe9b30872e49d5b961a4af5d075186] equalverify checksig"
            value 61314356998
        }
    }
    version 1
}

Distinguished Encoding Rules (DER) formatted Signature = 3045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d01

R =

% echo 3045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d01 | cut -c 9-74
00ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed429

S =

% echo 3045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d01 | cut -c 79-142
4efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d

Pubkey = 03c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98

3. The 3rd output of TXID e3710e1da4f947ecfc5162e2e8fa1362c668f16b1c71a20de61b258c939f8a8a contains the original input script that was signed, requires an additional online query:

% bx fetch-tx -c ~/bitcoin-explorer/bx-mainnet-remote.cfg e3710e1da4f947ecfc5162e2e8fa1362c668f16b1c71a20de61b258c939f8a8a

transaction
{
    hash e3710e1da4f947ecfc5162e2e8fa1362c668f16b1c71a20de61b258c939f8a8a
    inputs
    {
        input
        {
            address_hash 3480cd7a92d09974aacc473512ca80a686249498
            previous_output
            {
                hash 4b7b945088ad38de258490d02bdca724548818e1ad184d0e00a2d4d1e82229c8
                index 0
            }
            script "[3046022100da2122351174582ca4f8b9cfc2567bd2c95c3f30be13ce0f20422ba6c2d55806022100af211740671144cc8cbce04e8028e60eb1028af661a8eba77430e4a8615925da01] [02416953ece00bbc3a1ebca108c8961abae0bcc613ecf838bb0e5799202fbe7ae4]"
            sequence 4294967295
        }
    }
    lock_time 0
    outputs
    {
        output
        {
            address_hash ead65b0c5d7abc0af467ae2f34ed1b84a6662fda
            script "dup hash160 [ead65b0c5d7abc0af467ae2f34ed1b84a6662fda] equalverify checksig"
            value 12557630
        }
        output
        {
            address_hash 59cca2f8c91a9784c6c38da5a10f00644238b527
            script "dup hash160 [59cca2f8c91a9784c6c38da5a10f00644238b527] equalverify checksig"
            value 10100000
        }
        output
        {
            address_hash a0d48c129cfde8f124a16f4d69bc47fd7fb5780d
            script "dup hash160 [a0d48c129cfde8f124a16f4d69bc47fd7fb5780d] equalverify checksig"
            value 61334886998
        }
    }
    version 1
}

ASCII encoded script = "dup hash160 [a0d48c129cfde8f124a16f4d69bc47fd7fb5780d] equalverify checksig"

and computing the corresponding P2PKH address:

% echo a0d48c129cfde8f124a16f4d69bc47fd7fb5780d | bx address-encode -v 0

1FfPjjFG1uoA62yiTsje8biYYvEhf8puQP

4. For self awareness, compute Hex encoded script and associated sha256 value:

% echo "dup hash160 [a0d48c129cfde8f124a16f4d69bc47fd7fb5780d] equalverify checksig" | bx script-encode

76a914a0d48c129cfde8f124a16f4d69bc47fd7fb5780d88ac

% echo 76a914a0d48c129cfde8f124a16f4d69bc47fd7fb5780d88ac | bx sha256
0d9288118ccdc74e6ce85ced746aa48afbd30eb70f58e4ce009a78dd96faf33d

5. Confirm signature is valid using an offline command:

% echo 01000000018a8a9f938c251be60da2711c6bf168c66213fae8e26251fcec47f9a41d0e71e3020000006b483045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d012103c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98ffffffff0200803801000000001976a914d2c6b9c7f146ea4039e6ae67904eb94d479b7ed688ac06d79e460e0000001976a914b85f8cde95fe9b30872e49d5b961a4af5d07518688ac00000000 | bx input-validate -i 0 03c0f217eb4428c61d47d8aa084a28c3d3d26f43b6569283f08fec5451a5fc8c98 "dup hash160 [a0d48c129cfde8f124a16f4d69bc47fd7fb5780d] equalverify checksig" 3045022100ad775acd2d0b14904771c28754e0e510ecd8af842732c5c15a0899d1e28ed42902204efb34805a958174f6a6273444cde7f97cf38cec0d96d17c7921490f58e6379d01

The endorsement is valid.


Can Bitcoin save the U.S. Post Office I noticed this article and was thinking about the possibilities of the U.S. Post Office seriously considering Bitcoin.

http://www.bloomberg.com/news/2014-02-07/could-bitcoin-be-answer-for-profit-starved-post-office-.html

Too Soon?   Too many people don't understand crytocurrencies?

There are some fundamental legal problems with this, as the Post Office is a creature of the Constitution and thus a creation of the United States government. It's not at all clear that the Post Office has authority to engage in brokering financial transactions. It's even doubtful that Congress has the power to allow the Post Office to do that.

That said, for the sake of argument, let's assume the Post Office starts brokering Bitcoin transactions. What then? Well, the point of Bitcoin (oversimplification ahead) is that it is not controlled by a government, is anonymous, and is secure. How many Bitcoin users are going to transact Bitcoin with a government agency whose job it is to route documents to people all over the planet, but is notorious for losing, mishandling, or misdelivering its cargo? I don't see it.

For that matter, how many American citizens or politicians will support inserting the Post Office into the volatile and rapidly evolving crypto-currency world? The two things the Post Office has done predictably over the last few years, other than deliver other people's mail to me, are lose money and ask for taxpayer bailouts. Add in the complexity of a major financial institution and the possibility of a market crash, and you have the makings of a major disaster (think something like LTCM + national debt horror rolled into one).

This doesn't mean I see some nefarious scheme here to "take over" Bitcoin or something. It just means this sounds like a hairbrained idea thought up by a bureaucrat who doesn't really know what Bitcoin actually is.


Missing 25% of my btc after a resync... I've got a wallet with bitcoin in it that I've had since 2011 or earlier. I was just claiming XLM using my receive addresses and the total XLM I received is about 75% of what I should have.

I checked every receive address on blockchain.info and the total btc is about 75% of what I have.

I'm not sure what to do from here.

edit: For the past few years I've had x bitcoin... the blockchain is rebuilding on my wallet right now and I'm really worried somehow I now have 25% fewer btc... wtf. I have a year and a half left to catch up on but a major receipt of btc was two years ago. I see that in my wallet but nothing else.... still 25% missing..

If you are having a hard time syncing (maybe poor internet connection?) , try getting all your private keys using the API command "dumpwallet" and then importing them into the Electrum wallet ( there will be an option to import private keys when starting a new wallet, and import private keys into an existing wallet). Electrum, available at https://www.electrum.org, will sync almost immediately since its an SPV client and you can check your balance.


How do decentralized exchanges prevent front running? With the coming rise of decentralized exchanges for bitcoin and altcoins. How do these exchanges prevent front running of trades? Since all the transactions are transparent, what stops someone from monitoring the blockchain to detect a big order coming in and then immediately execute a similar trade before it?

For those not familiar with front running: it is the process of market/price manipulation. If I know, that a big purchase of s.th. valuable will happen, the amount of this would get more rare on the market and it's price may rise. Therefor I could quickly do my own purchase of such a good, speculating that the price will rise, and sell it after the big transaction at a higher price.

In the bitcoin world this is not excluded. Imagine that you are within a big financial corp, and this institute asks the trading desk to buy bitcoins for 10mio Euros. An employee could see this planned trade, and do a quick self trade before. So this is within corporations.

In the public bitcoin space, there is no indication of a "big" trade, that will happen on the blockchain. Usually a tx is composed and then sent into the network, to the nodes that you are linked with, and from there to the whole network. So if you could see this UTXO with an enourmous amount in your node, you have the time to create your own tx to do front running. It would need to get into a candidate block, before the "big" tx joins a block which is then minde. I do not see that there is a guarantee to do so. It might get different when a miner comes into the play, and he is hand crafting a tx, but I am not 100% sure... He would have to be fast enough, that no other miner has a candidate block, that get's into the blockchain before him...


How does Mastercoin avoid double-spend attacks without it's own blockchain? Bitcoin's main innovation is the blockchain, responsible for making sure that the same bitcoin cannot be spent twice.

Mastercoin rides on top of bitcoin, but does not have it's own blockchain.

How does Mastercoin avoid double-spend attacks?

The answer is double-layered:

Mastercoin uses Bitcoin for timestamping. It's impossible to revert the transaction at the Bitcoin level without doing a Bitcoin double spend (super costly).
Mastercoin clients track the state of the system including how much is stored at each address. If a client double spends by sending two contradicting Mastercoin transactions, the second one will be discarded as an invalid spend by any client that parses the transaction stream.


Difference between bitcoin and testnet, really Other than what is listed in the wiki, what is the difference between the two networks?

Could you sell test Bitcoins for money if you could find someone willing to buy?

What would happen if you tried to send test Bitcoins to a 'real' account and vice versa?

Testnet bitcoins are less widely used in commerce than mainnet, and are not perceived as intended to be a currency.
Yes, you're unlikely to fetch a significant price though.
The transaction will not be recognized as a valid transaction. It would essentially be an irrelevant jumble. In fact the client wouldn't allow you to send anything because the address won't match the format of the respective network.


Why do so many Bitcoin wallets and accounts exist? Why so many bitcoin wallets do exist? Why it is not just single like other conventional currency? Multiple wallets means I have to have multipe accounts; is it possible to transact among multipe wallets bitcoins and if yes is it without fee?
For bitcoin account, public key is actually address which will be used in bitcoin transaction (sending bitcoins to me). And private key is used to decrypt the transaction. I also got to know that the key can also be changed. If my understanding is correct, what is the actual key for the bitcoin account?

What exactly was a bitcoin wallet intended to be?

Multiple wallets means I have to have [multiple] accounts;

The original creator of Bitcoin, Satoshi Nakamoto, wanted to create a currency for internet use which did not depend on any trusted third parties! Originally all wallets were software programs that you downloaded and ran on a personal computer. You would only have one wallet, not multiple.
There were no accounts, no exchanges or other businesses that you had to trust with your money. That was deliberate. You can still use Bitcoin like this today.
Over time people and businesses have seen an opportunity to offer services to people who either don't understand the original intent or who want to treat the currency not as a currency but as a speculative asset to be traded. These businesses have set up custodial accounts and have often described those accounts as wallets. These "custodial" wallets are not the type of wallets that the founder of Bitcoin intended.
You don't have to have multiple accounts. You don't have to have any accounts. You can use Bitcoin with no accounts whatsoever. Just download the wallet software of your choice, transfer all your Bitcoin to that wallet and close all your other accounts.

What is electronic cash?
Consider the way most USA citizens use US dollars. Very few of them ever buy and sell US dollars. They just receive their income in US dollars and spend their money at businesses that accept US dollars for goods and services. There is never any need for these people to buy US dollars or to "cash out" their US dollars.
This was how Satoshi Nakamoto and other early adopters hoped that Bitcoin would be used.
--
Two hundred years ago, many US citizens would have received their wages as US dollar bills (banknotes) and would have used those for all their spending. They
wouldn't need a bank account at all. Their finances could be totally cash based.
Nowadays many countries are moving rapidly towards a cashless society where all money is controlled by banks.
Nakamoto wanted a return to a cash based system where people, not banks, controlled their own money. But he wanted it based on an electronic currency that could be used online and which wasn't controlled by governments - because governments use inflation to effectively take money from savers.
So Bitcoin was intended as a return to a cash-based society, but one that could be used online and not subject to government or bank control
So each person would have a single wallet, no accounts.
You can still use Bitcoin like this.

The role of Cryptography

private key is used to decrypt the transaction.

The Bitcoin network does not use any encryption. So no decryption is necessary.
The private keys are used to provide a mathematical proof that you have the right to spend amounts of Bitcoin associated with a Bitcoin address (or more correctly, associated with a Bitcoin script that can usually be represented as a Bitcoin address).
Private keys are effectively used to prove ownership of money.

I also got to know that the key can also be changed.

Not really, however you can use a transaction to move money to the control of a different private key.

what is the actual key for the bitcoin account

The Bitcoin network doesn't know about or keep track of accounts. Many Bitcoin wallets don't have any sort of account concept.
If you have an account with some sort of trusted third party, the way that works is proprietary and may be different for each business.


Why are coin miners (such as GUIMiner) a "threat" in Windows Defender? I opened up my GUIMiner and I got a rather unfriendly "Win32/CoinMiner" threat of "Medium."

I installed this program knowingly, so should I be concerned? Is this just a problem because people have been installing miners on people's machine unknowingly (which would be a bad thing)?

It is because of hackers that bundle the CPU miners in their viruses causing unaware AV makers to ban the miners that are being used. (including cgminer due to the fact it was cpuminer)

EDIT: According to nmat, there are also virus GPU miners.


What is cross-input signature aggregation and how would it work? I'm seeing lots of mentions of cross-input signature aggregation (CISA) lately. It appears to be something that one can do with Schnorr signatures. What is the main idea of CISA? What would a transaction look like that makes use of CISA?

Schnorr Signatures and public keys can be aggregated (added together) such that
S1 + S2 = S3 and P1 + P2 = P3 where (S3, P3) is a valid signature-pubkey pair IFF (S1, P1) and (S2,P2) were valid signature-pubkey pairs.
Because of this, if a transaction has n inputs, the signatures of those inputs can be aggregated, so the transaction only needs one signature and public key even with any number of inputs, whereas a regular transaction would need n signatures and public keys.
The main benefit being block space (fee) savings.


Is there any address monitoring application with support for multiple cryptocurrencies? This would be beneficial for all long-term investors who have many different cryptocurrencies in their portfolio and don't usually perform any transactions. Simply just to check whether your money are still there. No need to login into all your wallets, entering passwords etc. With support for many different cryptocurrencies.

I have just decided to develop such an application for my own use (it is open source, you can check it here - Cryptocheck ), but maybe there is already a good solution for this.

The best option for monitoring your accounts without logging into your wallets is to use block explorers. Blockchain data is public and block explorers are made to explore this public data: blocks, transactions, accounts, account balances.
Here are a few:

Bitcoin, Litecoin, Dogecoin:
https://live.blockcypher.com/

Ether, ERC20 tokens:
https://etherscan.io/

WAVES, Waves assets:
https://wavesexplorer.com/

ZCash:
https://explorer.zcha.in/

Most of these block explorers also have API solutions.
I have created a playlist showing how to use the zChain ZCash block explorer API here: Zchain ZCash block explorer API - INTRO


What's the best mining option if you weren't worried about power costs? If you had a free power source and took it out of the equation, what would be potentially the best option for bitcoin mining?

You have limited space, so for about one or two computers tops. What hardware would you choose ultimately based on the basis it's available today?

e.g. Can top end graphics cards still be as good as a FPGA setup?

Can FPGA's out do ASIC in the aspect that the hardware is cheaper/ more accessible? or is it still not worth while in comparison?

At time of writing it still possible to run a GPU farm but at the speed of the increase in difficulty this will not last for long.

The second presumption with this is that you are not paying for the hardware, its very unlikely you would even  break even if you had to purchase hardware at this time. The only real option in a competitive market is to go down the ASIC route.

Performance in a good quality ASIC can be 100 x that of a top end GPU. The price tag could realistically be about the same. There is zero comparison.


Unconfirmed Bitcoin transaction Please help me.  I have an unconfirmed Bitcoin transaction since three days. Below is the hash ID

a7f5f1989e0bbefeb012b22fbc8f011e5b6b0e66e802ea24242dc1d7878869bb

I would try an ATM if available in your area they seem to be alot faster, I've never waited more than 30 minutes and most of the time they are extremely fast.


Anonymous transactions technology for a cryptocoin? I’m thinking of investing in a cryptocoin with anonymous transactions feature. So far there are 3 well-known technologies for that: coinjoin (Bitcoin), masternodes (Darkcoin) and CryptoNote (Bytecoin). CryptoNote looks more appealing due its innovative ring signatures technology. Can anybody explain which option would be the best and why?

CoinJoin in Bitcoin does not provide full anonymity and Darksend feature in Darkcoin is merely an implementation of the CoinJoin specification. CryptoNote, on the other hand, allows for completely anonymous transactions through ring signatures and one-time keys. It’s also blockchain analysis resistant. If you are looking to invest in CryptoNote-based coin, Bytecoin is the one to go for. It’s been around for two years (launched in 2012). Has no premine (at least there’s no evidence for that). The developers’ team is reliable and committed. The community is growing steadily. Check out this website http://bytecoin.org/


What kind of attacks do exactly check-points prevent? I'm aware of this post and this one.

If it's used to prevent an attacker from forking old blocks (or chain), then a client can detect it because the fork length would be shorter than the length of the existing (correct) chain.

Question: What exactly would happen if we don't use checkpoints?

Also, are they only for thin clients?

You are correct that any client which sees two different forks can easily determine which one is longer.  But consider the following possibilities:

The node might never see the longer fork.  This can happen in case of a Sibyl attack, where the attacker has control over the victim's Internet connection and arranges that the victim only connects to evil nodes.  These evil nodes will only send blocks that are part of the shorter, malicious fork, and the victim will assume that this fork is the "real" chain because there is nothing else to compare it to.   So the victim will believe the attacker's view of the transaction record, at least until they manage to get connected to an honest node.  Checkpoints ensure that such an attacker can only manipulate the victim's view of history as far back as the latest checkpoint, which at least puts some limit on the damage that can be caused.
The longer fork might be the "evil" one.  This could happen in the case of a 51% attack, where an attacker who controls more hashing power than the rest of the network decides to fork the chain and "rewrite history" from some point in the past.  With their hash power majority, they can eventually make their fork longer than the "real" one.  A checkpoint ensures that they can only rewrite as far back as the checkpoint.

In each case, this is a rather minimal restriction on the attack; the ability to rewrite history back to the last checkpoint is still devastating.  But it might help in reducing the chaos until the victim can connect to an honest node (in the Sibyl case) or until other protocol changes are adopted (in the 51% case).

See  also Do checkpoints in the block chain help to avoid a 51% attack that rewrites the entire blockchain?

These apply to both full nodes and thin clients.

Also, as mentioned in the post you linked, if you know you don't need to worry about these attacks, then you can decide not to verify every last detail of the chain before the checkpoint, which will save computation and let you sync the blockchain faster.


Estimated amount of Bitcoin users I am writing a Business plan and attempting to make some financial projections based upon the population of bitcoin users, has anyone publicly produced any estimate as of 2014 of how many active users are within the bitcoin ecosystem?
If not, has any project, research paper or organisation attempted a partial count or proposed a methodology for counting the amount of users in the ecosystem?

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

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

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


Did I pay a fee to transfer from Coinbase to Blockchain? I recently transferred from Coinbase to my Blockchain wallet. At the time and in my transaction summary it shows a fee of .0002 . However I still have the same amount I started with. Who paid this fee? It didn't seem to come out of my btc.

Coinbase covered the fee. I believe they do this in order to simplify things for their users (so that if it says you have x BTC, you can transfer x BTC, not (x minus transaction fees) BTC).

Of course, they pass the cost along to their users in their buy/sell price and fees.


Issues decoding the words to transaction hex I had asked a question earlier about compressing the transaction hex as it was used in a project that involved sending text messages (160 characters limit per message):
Compress transaction hex string
So I have used a different approach and here's the project details: https://github.com/prayank23/OfflineTx
Converting transaction hex to words is working as expected. I have issues decoding the words to transaction hex using python code mentioned here: https://gist.github.com/grubles/41a8ab74afe2cee6ef7128b07438455b
It doesn't return the last 4 characters when trying to decode the words.
Values used in this example:
Tx hex: 02000000000101e939fb23e9991ebbc75fd08c736da32ca12d98a4ff1b8e970e97f5661927ee410100000000fdffffff02b0a90a000000000016001421e2f997b3bd36e273eaca365da8515a389444ae40420f0000000000160014829e2dbcf6b7f31bc93633971f71f6f6b9b5f89e0247304402200f8e3e573be749caf1964a85707bf540de2e7b367ae46c23bd4f21932ff82346022062dc3007072cd5a19b45e479525f4829bc48be4fd3c21b5a9ae34bcf9a3a3ccf0121020f88c7db36cbb492e80d3062fc19db55bed82687498f8cfe6d0cf47adf6687aa49f31b00
Words: answer frost position wrote message message actually calm energy iron dust valley music rock core blink regret frighten wife moonlight weave shove pride add mystery veil press gentle collapse aunt like like like skin tool patient dirt muscle holy like like like apple also also goodbye bone raise women along rainbow approach caught drag radio concern rose hate great yell worse forever stuck like like like alive bid tool shy flood truly house knock fade blow paint forest street stain mock never murder plant void history sentence rant often loose often utter book explain born point throughout hero gone worship closet canvas please sanctuary too although upon truly shimmer wow rather laugh simply twenty creation take garden innocent bench kiss companion reveal nine shall stolen angel dark candle dew anymore disguise darling happiness bound treat morning group weave stand grown ourselves rhyme bowl consider grace worse other torment like half law shower fruit reality dread third barely enough nail match rare manage tower honor ready

Grubles shared the reason why this didn't work and I had issues while decoding in this tweet thread: https://twitter.com/notgrubles/status/1336709747756724227

Required the hex to be divisible by 8 basically. If it wasn't the encoder would chop off the remainder. So when you would go to decode the words, you would end up with more or less the same result as you began with but with some bytes missing at the end.

New and improved hex to mnemonic encoder/decoder based on Joe Reuther's script. Mainly useful for camouflaging bitcoin stuff (addresses, PSBTs, etc) or for moving transaction data between online and offline computers w/o using QR.
https://gist.githubusercontent.com/grubles/69762512cd4e954722c03a0df1bc44ac/raw/b1a4d85dd70bfc972a6ab05a93d3432bf300d1b6/pgp-words-improved.py


How can I check if a bip32 xpub key is valid using python? I'm on the hunt for some python code that will tell me if a string is a valid bip32 xpub key but I'm having trouble finding any.

I also would like to check if a string is a valid bitcoin address.
Here is an example I found for this purpose but it doesnt seem to work - http://rosettacode.org/wiki/Bitcoin/address_validation#Python

Please help :)

The code you linked works for me in Python 3.4, so I'll assume you're looking for something for Python 2.7.

This code is straight from here on GitHub:

import base64, hashlib, collections, struct

def int_to_bytes(int_rep, min_length = 0):
    """convert an unsigned integer to a string of bytes (in big-endian order)
    :param int_rep: a non-negative integer
    :type int_rep: long or int
    :param min_length: the minimum output length
    :type min_length: int
    :return: the raw bytes, zero-padded (at the beginning) if necessary
    :rtype: str
    """
    assert int_rep >= 0
    hex_rep = "{:X}".format(int_rep)
    if len(hex_rep) % 2 == 1:    # The hex decoder below requires
        hex_rep = "0" + hex_rep  # exactly 2 chars per byte.
    return base64.b16decode(hex_rep).rjust(min_length, "\0")

dec_digit_to_base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
base58_digit_to_dec = { b58:dec for dec,b58 in enumerate(dec_digit_to_base58) }

def base58check_to_bytes(base58_rep, expected_size):
    """decode a base58check string to its raw bytes
    :param base58_rep: check-code appended base58-encoded string
    :type base58_rep: str
    :param expected_size: the expected number of decoded bytes (excluding the check code)
    :type expected_size: int
    :return: the base58-decoded bytes
    :rtype: str
    """
    base58_stripped = base58_rep.lstrip("1")

    int_rep = 0
    for base58_digit in base58_stripped:
        int_rep *= 58
        int_rep += base58_digit_to_dec[base58_digit]

    # Convert int to raw bytes
    all_bytes  = int_to_bytes(int_rep, expected_size + 4)

    zero_count = next(zeros for zeros,byte in enumerate(all_bytes) if byte != "\0")
    if len(base58_rep) - len(base58_stripped) != zero_count:
        raise ValueError("prepended zeros mismatch")

    if hashlib.sha256(hashlib.sha256(all_bytes[:-4]).digest()).digest()[:4] != all_bytes[-4:]:
        raise ValueError("base58 check code mismatch")

    return all_bytes[:-4]

def base58check_to_hash160(base58_rep):
    """convert from a base58check address to its hash160 form
    :param base58_rep: check-code appended base58-encoded address
    :type base58_rep: str
    :return: the ripemd160(sha256()) hash of the pubkey/redeemScript, then the version byte
    :rtype: (str, str)
    """
    decoded_bytes = base58check_to_bytes(base58_rep, 1 + 20)
    return decoded_bytes[1:], decoded_bytes[0]

BIP32ExtendedKey = collections.namedtuple("BIP32ExtendedKey",
    "version depth fingerprint child_number chaincode key")
#
def base58check_to_bip32(base58_rep):
    """decode a bip32-serialized extended key from its base58check form
    :param base58_rep: check-code appended base58-encoded bip32 extended key
    :type base58_rep: str
    :return: a namedtuple containing: version depth fingerprint child_number chaincode key
    :rtype: BIP32ExtendedKey
    """
    decoded_bytes = base58check_to_bytes(base58_rep, 4 + 1 + 4 + 4 + 32 + 33)
    return BIP32ExtendedKey(decoded_bytes[0:4],  ord(decoded_bytes[ 4:5]), decoded_bytes[ 5:9],
        struct.unpack(">I", decoded_bytes[9:13])[0], decoded_bytes[13:45], decoded_bytes[45:])

In particular, you'll want to call base58check_to_hash160() to check a "normal" address, or base58check_to_bip32() to check a BIP-32 extended address (an "xpub" or "xprv"). They will either return the results of decoding the address, or raise ValueError if the address is invalid.

It's technically licensed under GPLv2, but if you'd like me (as the original author) to relicense it under something less restrictive for your project, e.g. BSD or MIT, I'd be happy to. Please just let me know in a comment.


Verify that WIF corresponds with bip32 extended public key I have a bip38 encrypted private key that I lost the password to, and I have its corresponding extended public key. I want to brute force passwords as I have an idea of what it might be, but I need to check if the decrypted private key is valid. This is for a multi sig 2 of 2 wallet. One of the keys is bip39 which I have the mnemonic seed for, the other is the bip38 which I do not.
const decryptedKey = bip38.decrypt(encryptedPrivateKey, "some password generated by brute force");

What do I do with this decrypted private key in order to validate that I used the correct password during decryption? I know I cannot just convert it to bip32 and then check if the xpubs match, but is there a way I can validate this so I know if the password is correct?

This is for a multi sig 2 of 2 wallet. One of the keys is bip39 which I have the mnemonic seed for, the other is the bip38 which I do not. What do I do with this decrypted private key in order to validate that I used the correct password during decryption?

A couple things.
Your encrypted bip38 private key will not decrypt with an incorrect password, so you'll know you are using the correct password if the decryption is successful.
Additionally, for multisig wallets it is very important that you save the redeemscript after initial creation. If you didn't you can re-create it, but you need to know the public keys that were used to create the wallet AND the order they were used in the multisig wallet.
If you are able to decrypt your bip38 key you can take the resulting WIF and calculate the public key and then you recreate the multisig address and it's redeemscript to see if it matches. If not trying switching the order of public keys.


What is fuzz testing? I've been looking at the Bitcoin Core PR review club sessions on fuzz testing here and here.
Can you explain at a high level what is fuzz testing?

In the paper The Art, Science and Engineering of Fuzzing the authors define fuzzing as “a process of repeatedly running a program with generated inputs that may be syntactically or semantically malformed”.
Fuzz testing is not a new concept. It was introduced in the early 1990s but at the present time its potential for finding bugs has not been fully explored in the Bitcoin Core codebase.
Of course fuzzing is a technique not only used by those seeking to prevent bugs in a software project (defenders) but also those seeking to exploit a bug (attackers). There is a danger that if projects like Bitcoin Core fall behind the state of the art in defense techniques that attackers could take advantage.
Matt Corallo discussed fuzz testing at London Bitcoin Devs in February 2019.

Fuzz testing is a general testing approach of black boxing a test case that takes as input some random set of bytes, running a program on it and trying to make it crash. This is primarily used for decoders, things like that. They have proven to be very, very, very effective at taking an image decompression library or something that processes untrusted data off a network and making it crash, finding vulnerabilities in it, finding stack overflow, buffer overflow kind of vulnerabilities. They are not just completely dumb, like shove in random bytes. They actually instrument the binary. Usually what they do is they instrument the binary, and you can do this in hardware or in software, and detect when a given input has found new paths in the program. So you map out all the if statements and all the branches in the program and if it finds an input that hits a new branch then it considers that input interesting and it will mutate that input a little bit more than other inputs.

Matt Corallo added at Advancing Bitcoin in February 2019:

Fuzzing has been incredibly useful across the software world but mostly for finding vulnerabilities in things like image decompressors, image decoders, message deserializers, that sort of thing. And what it does is you write a program that takes as input some arbitrary string of bytes and you do something with those bytes and the fuzzer tries to make you crash. So if you have some image decoder or decompressor often times it will find a bug where you used too much memory, you have an out of memory condition and you have a DoS vulnerability there. Or maybe it will find a bug where you have some buffer overflow, something like that. Or whatever depending on the language you’re writing in. Fuzzers have been amazing. You can go look up all of the various CVEs and vulnerabilities they’ve found. We’ve been playing a lot with them in rust-lightning and we have the standard ones of just make sure all of our message deserializers don’t crash or don’t use infinite memory. But we also have some allow nodes to do completely arbitrary things. So we have one fuzz target that runs a full node and can receive bytes on the wire. This allows you to literally do anything that another node could do to you possibly in a fuzzing environment where the fuzzer is trying to creatively crash your program and comes up with different inputs that might exercise different code paths


Why would a Bitcoin miner take less than the full reward? In "Mastering Bitcoin", the author notes (source):

  The maximum number of coins mined is the upper limit of possible mining rewards for bitcoin. In practice, a miner may intentionally mine a block taking less than the full reward. Such blocks have already been mined and more may be mined in the future resulting in a lower total issuance of the currency.

I understand that a possible answer is "just because" but I'm wondering if there are other reasons behind such an action.

Likely you're correct, it's not useful in practice. People could, however, use value destruction as an costly signal.

Voting example; I run a poll of mining pools; number of Satoshis less than the full block reward, up to 5, is the vote for which of 5 proposed algorithms to run in the future. Once a majority of blocks over some time period vote for option X, everyone agrees to switch protocols. (This could allow identityless voting by miners.)

Commitment example; A miner can "promise" something, and commit the value destroyed as a signal that they are willing to do it. If a miner wants to extort the network, such commitment could be effective in showing that they are serious.


Bitcoin Pro API - How do you format start/end time for Historic Data? I don't understand how to format the start and end time per https://docs.pro.coinbase.com/#get-historic-rates

The sample time is "1415398768" which makes no intuitive sense to me, and when I tried looking up ISO 8601 time formats, none of the formats I found have 10 digits like the bitcoin sample.

This time format is known as Unix time. It is the number of seconds since 00:00 UTC, January 1st, 1970.


What GUI clients support multisig transactions? Are there any major current UI wallets (desktop/mobile/web) that support creating / spending multisig transactions?

Armory is a client for advanced users that has support for multisignature
https://bitcoinarmory.com/


What happens if you copied private key and try to use it again? I am very new to bitcoins. I have one question. Suppose some one copied their private key and saved it in their harddisk. Next they will do the transaction. Now since you already copied the private keys can you use it again?

How bitcoin prevent this?

I am asking this because. I wish to create something smaller for my brothers  school project. So I am out of ideas on how to prevent this.

Every private key owner can spend any amount of coins on appropriate address, but every coin on any address can be spent only once. After spending the coin it is suggested to go into another address which has another private key.

upd: Technically they are stored on the blockchain file (>200GB now), which of course is able to copy and wanted to be copied, but your private key is the only ability to let your coins be moved in the chain - if (and only if) you have the proper key. So, the proper key is hard to get and easy to lose and you might not like the idea to copy it except of backup operation.


Segwit change address from Regular address I would like to move my bitcoins to a Segwit Electrum wallet, however - I don't want to pay the high fees for the initial transfer.
I though about using the change address, so that when I make payments with the regular Electrum bitcoin wallet, the change will be automatically sent to the Segwit address. Is it possible with the non-Segwit Electrum wallet? How do I set it up?

It's not possible to do this automatically. Electrum doesn't mix and match segwit and non-segwit address types in the same wallet.

My suggestion is to first educate yourself on what using an Electrum segwit wallet will mean. Electrum uses bech32 addresses. You can read more about the implications of that here.

Next, if you decide you want to move to segwit after all you can create a new electrum wallet choosing segwit as the type and then move your coins there. In order to save money you can low ball the fee. Fees are actually quite low these days so you should be able to do this quite cheaply.

Electrum allows you to send money to multiple addresses in a single transaction so the next time you send bitcoin you can choose to send the balance funds in your wallet to an address in your new segwit wallet. To send to multiple addresses you enter the addresses as follows on the pay to field on the send tab:

1BitcoinEaterAddressDontSendf59kuE,0.5
bc1addressdfdfdfdfdfdfdfd,1.55

That is addresses and amounts separated by commas. Each address + amount on a separate line.


bitcoind: How to find the block from a TXID? I'm using bitcoin-cli. I have a TXID, and I'd like to find which block it is in. Either the block hash or block count would be fine. What's the best way to do this?

I've tried using gettransaction < txid> and going from there, but I get this error:

error: {"code":-5,"message":"Invalid or non-wallet transaction id"}

Bitcoin Core doesn't maintain an index of transactions which are not relevant to you by default to save space and processing time.

You need to run your node with txindex=1 in the configuration in order to create one, and changing the option on an existing node requires you do do a bitcoind -reindex. A reindex is equivalent to doing a full network sync again but will use all of the block files you already have on disk for the process. When this is complete you will be able to look up arbitrary TXID using the getrawtransaction RPC (gettransaction only applies to transactions in your wallet).

$ bitcoin-cli getrawtransaction 74cffe12b2d58ac2e2bc13de5519428639267e2faffb85bbbfec60d8be7cdb50 1

{
  .....
  "blockhash": "0000000000000000027d382ef7c586e0e97f623e685c9f927e78865420f72b5f",
  "confirmations": 2,
  "time": 1444654960,
  "blocktime": 1444654960
}


What happens to coins after Bitcoin Cash fork? I'm new to Bitcoin and I read that there is a fork going to happen on Aug 1st to create Bitcoin Cash (BCC). From https://ethereumprice.org/ethereum-classic-and-bitcoin-cash/?a=1&b=https://ethereumprice.org/ it is estimated that Bitcoin Cash is going to have a value of ~$310. And it also says that the balance of Bitcoin (BTC) in a wallet will be copied to Bitcoin Cash.

So if I have 1BTC now, which values to ~$1700, after fork, I can have 1BTC + 1BCC with an approximate value of $2000. Is this correct?

If you have 1 Bitcoin (BTC) before the hard fork, you will have 1 Bitcoin (BTC) and 1 Bitcoin Cash (BCC) after the hard fork.

Whether you can spend those BCC depends on who has control of your private keys.
If you currently keep your BTC on an exchange (Coinbase, GDAX, Poloniex, ...) you need to check their policy w.r.t. the fork, since they control your private keys for you.

Coinbase for example has expressed that they will not interact with the BCC blockchain. This means that you will not be able to spend/sell your BCC until they either interact with the BCC blockchain or release your private keys to you.

If you keep your BTC in a paper wallet, you have control over your private keys, and 1 BTC will indeed result in 1 BTC and 1 BCC after the fork.

Today the value of 1 BTC is roughly $2700. BCC futures were trading for $350 last time I checked.

What the value of 1 BTC + 1 BCC will be after the fork is hard to predict and is subject to demand and supply on the markets.


Trying to create a bitcoin public/private key using bitcoin-core I want to create a single bitcoin address to which I can send and receive funds too.  Using the bitcoin-core console, I typed in the following:

Input:
    getnewaddress

Output:
    Address: mhYC9ybAa2aHivEjYzyp7WcMXtpcmJvgV2

Input:
    validateaddress mhYC9ybAa2aHivEjYzyp7WcMXtpcmJvgV2

Output:
    Public Key: 02b33243d76c40e310a4214d8459f59d569f19f5804a26f0e1d70cf28d605411b3

Input:
    dumpprivkey mhYC9ybAa2aHivEjYzyp7WcMXtpcmJvgV2

Output:
    Private Key: cRYUqjikPgyVsWGfL26Q2i26vAAizgurajhW8mBZf2mRCM9NKf5W

Questions:

Are those 3 values all I need to save to ensure I can easily send and receive funds?
To receive funds, do I need to use the [Address] or the [Public Key] value?
The [Public Key] seems to be a hex value, and the Private Key seems to be a hash value, is it possible to extract the hex value of the [Private Key] using bitcoin-core console?

Note:

The above values were created on the testnet.
I understand that technically I only need to save the [Private Key] and can generate the [Public Key] from the [Private Key]
I understand that I will have to specify a change address so I don't lose any balance if I do not spend the total amount.

If you are asking about the bare minimum thing to store to ensure that you can send and receive funds, then it will be the private key (which you already know). But to make transactions via the core, you only need to store the private key you get from the dumpprivkey api call and the address for receiving funds.
To receive funds you have to use the address.
I am unaware of any core API which would give the hex value from the private key you get from dumpprivkey. However, it is a really basic encryption scheme and you can decode it back to hex using any programming language.

This would be useful for a detailed explanation.


Why does bitcoin core need to download the blockchain I understand that the blockchain is what keeps track of who has what coins and makes sure that everything is correct and secure, but why do I have to download it?  Isn't that where the miners come in?  Don't they keep track of the blockchain?

Certainly miners, and many other users, keep track of the block chain.

But if you don't download and verify the block chain yourself, what will you do when you want to know whether a transaction is valid?  You could ask a miner, but what if they decide to lie to you?  You would have to trust them to tell you the truth.

Part of the Bitcoin security model is that you don't have to trust anybody.  When you verify the block chain for yourself, nobody can trick you into believing that an invalid transaction is valid, or vice versa.


Creating a unconfirmed bitcoin transaction I know that it's sounds ridiculous, but i need to create an unconfirmed bitcoin transaction that will be unconfirmed for 2+ hours.I came to a conclusion that i need to create a 0 fee transactions but can't find a solution to make it and broadcast. Another variant was to set the min. fee ( 1sat/byte ) , but sometimes it's got confirmed after 5-10 minutes.How can a achieve the desired result ?

You can achieve this with timelocks.

The bitcoin wiki says "A Timelock is a type of smart contract primitive that restricts the spending of some bitcoins until a specified future time or block height."

EDIT

Further, it reads:

CheckLockTimeVerify

In late 2015, the BIP65 soft fork[6] redefined the NOP2 opcode as the CheckLockTimeVerify (CLTV) opcode, allowing transaction outputs (rather than whole transactions) to be encumbered by a timelock. When the CLTV opcode is called, it will cause the script to fail unless the nLockTime on the transaction is equal to or greater than the time parameter provided to the CLTV opcode. Since a transaction may only be included in a valid block if its nLockTime is in the past, this ensures the CLTV-based timelock has expired before the transaction may be included in a valid block.

CLTV is currently used in CLTV-style payment channels.

Relative locktime

In mid-2016, the BIP68/112/113 soft fork gave consensus-enforced meaning to some values in the nSequence field[7] that is a part of every transaction input, creating a "relative locktime"[citation needed]. This allowed an input to specify the earliest time it can be added to a block based on how long ago the output being spent by that input was included in a block on the block chain.

CheckSequenceVerify
Also part of the BIP68/112/113 soft fork was the CheckSequenceVerify opcode[8], which provides for relative locktime the same feature CLTV provides for absolute locktime. When the CSV opcode is called, it will cause the script to fail unless the nSequence on the transaction indicates an equal or greater amount of relative locktime has passed than the parameter provided to the CSV opcode. Since an input may only be included in a valid block if its relative locktime is expired, this ensures the CSV-based timelock has expired before the transaction may be included in a valid block.

Hope this helps.


Why does my bitcoin "to US dollar" worth change when the stock market is closed? My bitcoin wallet "US dollar" amount is changing. It's Saturday the market is closed. How is this happening?

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

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


Watching and spending from a huge number of offline private keys We plan to accept bitcoins on our eshop website. What we want plan on doing is:

1) Keep all private keys always offline (cold storage).

2) Generate at least 100,000 keypairs of which only one will be stored on our web server.

3) Frequently change our Bitcoin addresses on our webserver to prevent third parties from knowing how many Bitcoins we have received in total. The web server will only contain our public key (Bitcoin addreses), not any of the private keys.

Now my questions are:

I) Is there a way to monitor the SUM of all bitcoins sent to ALL of our addresses?

Something like a wallet that supports import of a huge number of "watch-only" addresses without requiring the import of the private keys? If the wallet is an application, it must support SOCKS proxy connections. (Armory allows watch-only keys, but I don't know if it supports mass bulk import and SOCKS proxies? Also, it seems to be suffering severe RAM overuse bugs as of now, according to its developer...).

II) Is there a way to sell the SUM of all bitcoins ever sent to ALL of our addresses AT ONCE?

III) Will an attacker be able to find out how many bitcoins we have earned in total?

Thanks!

Direct answers to your questions:

I) Technically this is not too difficult. Looping through every new transaction on each received new block does not take too many resources and checking each transaction against 100,000 public keys is no problem at all. However, I do not know of a tool that would do exactly so. (For example, blockparser can output all the balances of all the addresses in the entire block chain in under a minute.)

II) No. You can not transfer all the received bitcoins in one transaction as the maximum size for a transaction is 1 megabyte. That would be able to spend the money on, say, 4000 different addresses at once, but no more. Of course, you can give all the private keys to somebody else "all at once", which enables them to spend the coins - but such a party would be unlikely to accept the sale as successful before transferring all the coins in to new addresses, just in case you kept the private keys as well.

III) No, if you keep the attacker from learning all the public keys. If, for example, the public key currently on the web server is easily viewable, the attacker can just poll your website, note down all the public keys seen and then check all the transactions for the keys. However, if you reveal the public keys only to legitimate buyers (or something) or do not reuse keys ever, the attacker has no way of knowing the full set of keys that belong to you. This also requires some care on the spending side of the coins - if you do a transaction that links the coins to your site somehow, this can be observed.

However, there are some more advanced methods of using bitcoin public keys that will achieve more than what you have asked here. You can see for example Hierarchical Deterministic Wallets. The choices are numerous and the best way to achieve your goals might not be the most obvious one.


Transaction fee in Bitcored Does the transaction fee of bitcored or bitcoind change everyday?

Am I required to set transaction fee of bitcoind by using settxfee method?

Does the transaction fee of bitcored or bitcoind change everyday?

It will often change because it will estimate the fee for certain confirmation targets (e.g. confirm within 4 blocks). The fee estimation will update with each block, so it may change every day. It may also change more or less frequently than daily depending on the transaction situation for each block.

  Am I required to set transaction fee of bitcoind by using settxfee method?

No. You only need to do that if you want to specify the transaction fee instead of using the estimation. I recommend that you use the estimation as setting the fee yourself will often occur in overpaying or underpaying.


Found old Bitcoin wallet of mine, but has unconfirmed transactions from 2013 I found one of my old wallets.dat from way back, so I loaded it up and see that I had transactions but they never got confirmed. I can't remember if I just never let them run? But how would it be showing me the history if they never got confirmed? And is there a way to get them confirmed or to sync up so they will appear in my account balance?

I tried to send a small amount to the  wallet to wake it up haha.
Any thoughts or tips?

If they are outgoing transactions they will always appear regardless of how far behind the synchronization is. Any unconfirmed transactions will have long bounced back to your wallet by now. Try going on the command prompt (.cmd) on your computer and type in:

"C:\Program Files (x86)\Bitcoin\bitcoin-qt" --zapwallettxes=1

Or try:

"C:\Program Files\Bitcoin\bitcoin-qt" --zapwallettxes=1

Your bitcoin core wallet will re-scan and the bitcoins will show up on your wallet.

If they are incoming transactions that you are waiting for you will just have to leave the bitcoin core wallet open until it synchronizes to the date the bitcoins were received. This will probably take a few days.

Hope this helps...

James


How does CryptoNote prevent a 51% attack and double-spending? How does CryptoNote prevent a 51% attack and double-spending?
 I’m interested to know what is the mechanism that protects CryptoNote coins from 51% and double-spending attacks.

The debates still remain whether 51% should be cause for concern. CryptoNote is protected against it in the same way Bitcoin deals with the issue. One difference is in that CryptoNote-based coins, especially the first ones such as Bytecoin (BCN), use egalitarian PoW (CryptoNight) which makes the coin CPU-minable and ASIC resistant. CryptoNight allows for fairer hashrate distribution among individual miners and ensures smooth currency emission. When it comes to mining pools, in theory, having comprised more than 50% of the coin’s network one might be able to affect the next few blocks, launching a double-spending attack by holding on to enough power to confirm the majority of transactions. However, this would take a huge amount of expense and the data about the double-spending taking place would likely appear on the block chain for all to see. Moreover, such an attack could possibly destroy the integrity of the system as a whole, causing the price to crash. This is not something anyone with a vested interest in the affected coin would want.

As for the double-spending problem, CryptoNote deals with it by employing ring signatures and key images. If a rogue user creates more than one ring signature using the same private key, these signatures will be linked together which indicates a double-spending attempt.

In order to provide linkability, CryptoNote introduced a special key image which is created by a user while signing a transaction. It is the value of a cryptographic one-way function of the secret key, or in other words it is actually an image of this key. It is computationally infeasible to find a collision (two different private keys, which have the same image). In case of double-spending attempt the system immediately reject any new ring signature with a duplicate key image. It won’t be able to pinpoint a misbehaving user, but it does prevent any double-spending attempts.

There was never a documented occasion of a double-spending attack in the history of Bytecoin (BCN) or any other CryptoNote -based coin.

Read this for more details https://cryptonote.org/inside/


Who operates WeExchange, the first Ripple Gateway? Is it operated by OpenCoin, the company behind Ripple?

https://weexchange.co/

https://ripple.com/wiki/Gateway_List

Nope.

The contact page lists

WeExchange Australia, Pty. Ltd.
WeExchange, Inc

Of course, I don't know that for a fact. The whois is registered to a privacy protection company, which doesn't really fill me with confidence.


Whats the easiest way to go from BTC to GBP? Paypal solution? Is there anyway of being able to transfer bitcoins to pound sterling to a paypal account at all? I struggle to find any solutions in this area so that I can make regular conversions. Even just to a UK bankaccount is ok, but Paypal is prefered? even if it means getting small fees as one would expect.

I assume you are asking about how to convert your BTC into GBP.

For small quantity, you can do a direct sales at one of the many bitcoin community forum, such as bitcointalk.org (particularly, the Currency Exchange sub-forum).  There is currently an active thread on the forum, where someone is buying large quantity of bitcoin and payment via cash deposit into your UK bank account.

For large quantity, you should check out major exchanges, such as MTGOX, and receive your money via Bank Wire.

Accepting payment via Paypal and other reversible transfer services should be avoided, as the buyer can take your bitcoin and reversed the payment at a later date.


How to execute bitcoin transactions in a decentralized way? I'm working on a project to automate donating bitcoins to charity every time Elon Musk mentions #Bitcoin on Twitter. To make this possible, people who want to donate would need to send bitcoins to an address holding all the coins in the meantime. And then when the condition is met (Elon mentions #bitcoin in a tweet), the bitcoins would be sent to the bitcoin address of a charity.
Obviously for security reasons, I shouldn't know the private key of the address holding the donations or that would allow me to steal the donations. So I'm trying to figure out how can the donations be sent to charity without any one person knowing the private key of the wallet?

What you're asking for is called Oracle and as we speak there are no perfect implementations of it. It's an ongoing problem to be solved for example it's hard to weed out false information. I advise you to read more about it outside this forum.


Why is Public Key aggregation in MuSig described as a product of the public keys? In the the MuSig2 paper, it is described that:

Each signer randomly generates and communicates to others a nonce
Ri=g^ri; then, each of them computes R=∏ni=1Ri,c=H( ̃X,R,m)where
̃X=∏ni=1Xiis the product of individual public keys

I would expect that an operation of two or more points on an elliptic curve would be described as an addition operation, such as the sum of individual public keys {X1...Xn} (not the product of individual public keys). The paper describes the aggregation of public keys and public nonce values as a product. Am I misunderstanding the actual operation occurring here? Why is this the product of curve points?
In other words: my understanding is that adding points on the curve involves the geometric operation of drawing a line between two points and finding the third point that intersects the curve (with flip across x-axis). When it comes to doing things like combining public keys and public nonces, is the same geometric operation still occurring? Isn't this still described as 'adding' points on the curve?

This is purely a matter of notation.
The points on the elliptic curve form a cyclic group. A group is a set with an associated identity element and a group operation. People need a symbol for that group operation. In some contexts it is more common to use an addition symbol (and multiplication representing repeated application of the group operation), and in other contexts it is more common to use a multiplication symbol (and exponentiation representing repeated application of the group operation).
Both notations are commonly used, and it has no effect on the actual operations. It's just a question of how to write what. There are even somewhat heated debates on this topic. You may even notice one of the MuSig2 paper's authors commenting in that thread.
One thing to point out that may explain this, is that the MuSig2 paper not ever mentions elliptic curves. It needs prime-ordered groups in which certain assumptions hold, but beyond that it could be any group - and the paper states, in Section 3.1, "The group G is denoted multiplicatively". This is the case for most cryptography based on the discrete logarithm problem: it works for any group. And historically, the first type of groups used for this purpose were integers modulo a prime numbers (with certain other restrictions) - where multiplication is the obvious choice for the symbol. You may also notice it is called the "discrete logarithm" problem, and not the "discrete division" problem.
At the same time, in the context of elliptic curves, you're right of course that the operation is called point addition - and repeated application of it is called point multiplication. I personally prefer it as well, as means you get a more obvious correspondence between scalar and group operations (e.g. s = k + H(R,P,m)x for computing a Schnorr signature vs s·G = k·G + H(R,P,M)·x·G = R + H(R,P,m)·P for verifying it, as opposed to Gs = R·PH(R,P,m) in multiplicative notation), and avoids sometimes nested layers of superscripts in typesetting.
EDIT: Tim Ruffing pointed out to me that the real reason for using multiplicative notation in MuSig2 is because the paper started as a revision of the MuSig paper, which also used multiplicative notation. The MuSig-DN paper uses additive notation, however.


Why are transactions grouped into blocks?(puzzle creation) Why are transactions grouped into blocks (PART 2)?

Let's say we have just put a block on a chain. At that moment does a protocol create a new unique puzzle to be solved? Is the new puzzle known before that moment? Can different puzzles coexist at the same time (so that users solve different puzzles in parallel)?

EDIT: Puzzle in this sense means a combination of target (that changes every 2016 blocks), a hashing function, and other protocol imposed requirements miners use to guess the solution.

The "puzzle" metaphor may not be helpful.  The goal is always the same: create a block whose header has a sufficiently small hash value, less than the current target.

So every miner can create a block any way she wants, as long as it meets the general requirements of the protocol (all transactions are validly signed, block reward is no larger than the current standard value, etc), and then start varying the nonce value in hopes of finding one which makes the hash sufficiently small.  There is no single centralized authority or protocol that hands out blocks for people to work on.

In practice, this means that no two miners are ever working on exactly the same block.  Two different solo miners will have different blocks, because each will have a coinbase transaction that pays the reward to his own address.  Two different members of the same pool will be assigned different variants of the same block, in order to avoid duplication of work (perhaps each will put his own identifier somewhere in the block).

The target is, in some sense, uniquely determined by the protocol.  The Bitcoin protocol specifies how the target is to be computed, based on the timestamps of prior blocks; this is what ensures that it adjusts with the total mining power of the network to keep the block time approximately constant at 10 minutes.  It should be the case that all miners on the network are using the same target value to compare with their blocks.

So in that sense, everyone is trying to solve the same "puzzle" (aiming for the same target), but everyone is trying a different approach to do so (a different candidate block).

The target only changes every 2016 blocks (approximately every two weeks).  So most of the time, you can know what the target will be after the next block: same as the current target.  If the next block would be a multiple of 2016, then you will need to wait until it is mined, because its timestamp will be involved in the computation of the next target.


How to convert HD wallet master key to extended key and child keys in javascript? I'm trying to learn how HD wallets work internally by writing javascript code that can derive child keys from parent keys. So far, the only thing I've been able to do is convert a BIP39-generated seed to a master key and chain code. I can do that successfully.
Now I would like to convert the master key to an extended key, the long string that starts with xprv. I'd also like to know how to derive child keys from these, and obtain the private key for signing with any of the accounts.
I've been using this confusing BIP32 document as a guide so far, but I'm getting nowhere with it. As far as I can tell, before you derive any keys, you have to serialize the ones you already have.
The serialization process is described like this:

Extended public and private keys are serialized as follows:

4 byte: version bytes (mainnet: 0x0488B21E public, 0x0488ADE4 private;
testnet: 0x043587CF public, 0x04358394 private)
1 byte: depth: 0x00 for master nodes, 0x01 for level-1 derived keys, ....
4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
4 bytes: child number. This is ser32(i) for i in xi = xpar/i, with xi the key
being serialized. (0x00000000 if master key)
32 bytes: the chain code
33 bytes: the public key or private key data (serP(K) for public keys,
0x00 || ser256(k) for private keys)

This 78 byte structure can be
encoded like other Bitcoin data in Base58, by first adding 32 checksum
bits (derived from the double SHA-256 checksum), and then converting
to the Base58 representation. This results in a Base58-encoded string
of up to 112 characters. Because of the choice of the version bytes,
the Base58 representation will start with "xprv" or "xpub" on mainnet,
"tprv" or "tpub" on testnet.

Here is the javascript code I wrote in attempting to follow these instructions.
const crypto = require ('crypto');
const base58 = require ('base58');

const master_key_hex = '5a02ee5cb622f15a4e7ab3dfe7faa9861738da2ae7bb936c685af4dd7b1fbdee';
const chain_code_hex = 'abfbc73691eaad7ca4eb5e25bc51c5804af221cc27a23460634498497f92c92c';

// the 78 bytes of data
var data = '0488ade4';
data += '00';
data += '00000000';
data += '00000000';
data += chain_code_hex;
data += '00' + master_key_hex;

// add the checksum
const hash_1 = crypto.createHash ('sha256');
var sha_256_1 = hash_1.update (data, 'hex').digest ('hex');
const hash_2 = crypto.createHash ('sha256');
var sha_256_2 = hash_2.update (sha_256_1, 'hex').digest ('hex');

var data_with_checksum = data + sha_256_2;

//data = Buffer.from (data_with_checksum, 'hex');
var result = base58.encode (data_with_checksum);
console.log (result);

I tried it with a string and with a Buffer and it gave me the same error message both times. The error message is:
Error: Value passed is not a non-negative safe integer.

I have a feeling I am not even close to doing this right. Does anyone know how it should be coded to derive child keys from a master key?

The base58 module is designed for Flickr; it uses a different alphabet ordering than Bitcoin, and only handles fairly small numbers not the size Bitcoin needs. For Bitcoin use bs58 module plus one other fix: the checksum is not the whole SHA256d but only the first 4 bytes, or since you store it in hex the first 8 chars:
const bs58 = require ('bs58');
... same except
var data_with_checksum = data + sha_256_2.substring(0,8);
var result = bs58.encode(Buffer.from(data_with_checksum,'hex'));
->
xprv9s21ZrQH143K3mfksXFtCXmQBeuA4wJqhcEJKgxzocJqadRRZZZvW2quiv9XiRw9BipJgvjbGLipAH5ZT9868uA4LFwJexUaJus2EVe4FXq

However, as the bs58 page says, there is a bs58check module that combines the checksum and encode for you:
const bs58check = require ('bs58check');
... first two parts only, computing data
var result = bs58check.encode(Buffer.from(data,'hex'));
-> same

And the same github user also has bip32 and bip32-utils modules that probably do the whole job for you, although the readme's are fairly limited and you'll probably need to look at the code (I didn't have time).


Calculate Coin Supply at any given time The total number of coins mined/available should be readable from the blockchain.
But is also possible to calculate the number of coins which were/will be available at any given time?

Yes. Thats possible. I wrote a python program that returns the supply at a given block (works with future supply, too):

#!/usr/bin/env python
# -*- coding: utf8 -*-

def btcSupplyAtBlock(b):
  reward = 50
  supply = 0
  y = 210000 # reward changes all y blocks
  while b>y:
    supply = supply + y * reward
    reward = reward / 2.0
    b = b - y
  supply = supply + b * reward
  return supply

block = 514227 # you want the supply after which block?
print(btcSupplyAtBlock(block))

supply at block 0: 0
supply at block 100,000: 5,000,000
supply at block 514,227: 16,927,837.5
supply at block 1,000,000: 20,187,500


signmessage and verifymessage CLI commands not accepting Address from getnewaddress? I am trying the following commands on my v0.19.0.1 Core implementation:
CLI signmessage $(CLI getnewaddress) <message>
and the identical
CLI signmessagewithprivkey $(bitcoin-cli dumpprivkey $(CLI getnewaddress)) <message>
Both times I get Error code: -3 "Address does not refer to key"
All my addresses are wrapped-Segwit (3...). Does this mean since its P2SH there is no way to find the privkey from the address?
Thank you

signmessage and verifymessage only work with legacy type addresses. They do not work with segwit addresses. There is ongoing work to introduce a new message signing standard that will work regardless of address type.
Some discussion about why they only work on legacy addresses can be found in this issue: https://github.com/bitcoin/bitcoin/issues/10542


What does OP_CHECKSEQUENCEVERIFY (OP_CSV) do? Some people have suggested repurposing OP_NOP3 as a new opcode, OP_CHECKSEQUENCEVERIFY.

What would the new opcode do? Why is it useful? Can't the signer choose the sequence field when they sign?

OP_CHECKSEQUENCEVERIFY (a.k.a OP_RELATIVECHECKLOCKTIMEVERIFY) can do relative lock times (used for sidechains and lightning).
It basically checks, if an input's sequence number is smaller than the sequence threshold (1 << 31 = 2147483648), and if so, it will compare the nLockTime against the sequence number of the input.
More info:

https://github.com/ElementsProject/elementsproject.github.io/tree/master#relative-lock-time
https://github.com/maaku/bitcoin/commit/fd9864c3a3c6f2942bc0775c6c725aa379f9d616
https://lightning.network/lightning-network-paper.pdf


How to import address to a wallet which runs in pruned mode I am running Bitcoin Cash node with prune=99000 mode enabled. So, I tried to import addresses of BCH from another BCH wallet by using importprivkey method and I am getting an error: Rescan is disabled in pruned mode.

How could I import addresses in prune mode from another wallet?

Thanks!

Form bitcoin-abc I have found this

# Enable pruning to reduce storage requirements by deleting old blocks.
# This mode is incompatible with -txindex and -rescan.
# 0 = default (no pruning).
# 1 = allows manual pruning via RPC.
# >=550 = target to stay under in MiB.
#prune=550

So, the command import address should call the -rescan (in Bitcoin core yes), for reconstruct the story of the private key.
So from the moment of your error message, I believe the correct answer is.

No you cannot import a private key in prune mode


Can the price of Bitcoin ever be stable to the USD? It seems like the only way to sell BTC for products/services is to have the BTC reflect how other currencies are doing. I'm not great in economics but can it ever be stable?

No currencies are stable unless they have a central bank making it artificially stabile. When that is said, the stability will largely be depending on the size of the economy. I do not, however know exactly how to measure the size of the Bitcoin economy, but I assume it should be measured in terms of the total amount sent between people or companies over a period of time (which would be similar to the measurement of GDP).


Is the change address always at the same position in the vout array of a raw transaction? When using the sendtoaddress command, does the Bitcoin client automatically place the change address at vout array position 0?
I would assume so, because bitcoin works through a sequence of procedures.

No, it picks a random position.

The purpose is to make it hard for people observing the blockchain to know which is change and which is the payment, as that would make tracing easier. This is also the reason why change outputs use new keys to send to.

Note that there has been a bug for a long time that made it always end up in the same position. It was fixed over a year ago, IIRC.


Given a block, is there a list of all hashes for all possible 2^32 nonce values? I am working in a computational research lab, and we're taking a look at Bitcoin. I'm trying to develop a simulation of Bitcoin mining for a nonexistent computer architecture.

I want to simulate the mining of a single block (say... the Satoshi block) without actually doing the work. To my understanding, each block in the chain has the winning nonce that enabled the miner to mine the block, but I also want to enumerate:

all of the losing hashes
other potential winners that could have worked

Part of our simulation is the mathematics of our simulation (and the hypothetical architecture) could operate on all possible hashes at once.

A 256 bit hash for all 2^32 nonce values[1] of a block is only 2^(8+32) bits, or about 137.4 gigabytes.

I know this sounds like a silly question, but is there some place to download all 137.4 gigabytes of hashes for the Satoshi block or some other block? Otherwise, what is the best way to generate them? Can I pick up an old ASIC miner and have it write every single hash to a hard drive?

Footnotes:

[1] I know that there are extra sources of variation in the transaction list, coinbase nonce, timestamp, etc., but we are currently limiting the scope of our simulation to just the original nonce while keeping everything else constant.

I know this sounds like a silly question, but is there some place to download all 137.4 gigabytes of hashes for the Satoshi block or some other block?

Nope.

  Otherwise, what is the best way to generate them?

Here's a program that does what you asked. It's a modification of Ken Shirrif's example mining program. It mines the genesis block.

It produces hashes at 2 MB/s on my laptop.

  Can I pick up an old ASIC miner and have it write every single hash to a hard drive?

Maybe, but it wouldn't really be faster than doing it with your CPU.


Is mining still profitable? We all know that mining is supposed to keep the Bitcoin system secure. However, difficulty has risen so much that costs for power currently outstrip possible revenue for mining for a large portion of hardware - not only CPUs, but also many GPUs. Essentially for everything but specially built mining rigs.

That is, if you don't take transaction fees into account. Are they already high enough to support mining? Or are mining rigs going to be enough to keep Bitcoin secure?

edit: the question is about the current situation, not some arbitrary point in the future.

There are two factors that define the profitability of mining, and they tend to change somewhat independently of one another or at least lag one another quite significantly.

The first factor is difficulty. Blocks should be generated every 10 minutes on average, regardless of the amount of processing power available to the network, so difficulty adjusts how hard it is to find the solution to a block. This factor is based solely on the total hashrate of the bitcoin network.

The second factor is price. Assuming we're speaking of profitability in terms of US Dollars or other fiat currencies, we have to account for our earnings in the same currency that was used to pay for our costs. To my knowledge there is not (yet) a power company that will allow you to pay your electric bill in bitcoins.

From personal experience I can say that my dedicated rigs consume about $4 worth of electricity to produce 1 BTC and if I'm lucky enough to be average my hardware will have a long enough MTBF (mean time between failures) that its cost amortized over the life of the machine will perhaps bring that up to $4.50 or $5 per coin. At today's rate of $8.69 per BTC, it is still profitable though just barely.

CPU mining cannot produce at a high enough efficiency to be worth the electricity cost, and the same can likely be said for less efficient GPUs. Of course some folks don't pay per kilowatt-hour for electricity usage and for these folks ANY kind of mining is still profitable.

There are also a few folks on the forums selling FPGA boards which, though quite expensive up front, consume only 10-15% of the electricity of a comparable GPU. A single Xilinx Spartan6 board, for example, produces 100 MH/s at a little under 7 watts, compared to a Radeon HD 5830 which produces around 200 MH/s (without overclocking) at about 108 watts (54 watts per 100 MH/s).


Hashrates for Opteron and Xeon CPUs I'm looking for the benchmarked hashrates of both a 1.0GHz Opteron 2007 CPU, as well as a 1.2GHz Xeon 2007 CPU. I looked here but didn't see them mentioned.

Also, on that references page, I don't see anything mentioned for how the hashrates were computed. What mining app is being used as the benchmarker for all those stats? Thanks in advance!

Although those particular CPUs aren't listed, you can infer from the other CPUs in that table that the hashrate will be only a few Mhash per second. CPU mining isn't cost effective today. (Which is why the list of hash rates for CPUs is fairly out of date.) See also this question about whether CPU mining is worth it.

To answer your follow up from the question comments, it's not entirely clear how ASICs will change mining because the number of ASIC machines shipped has been so limited.  If ASIC vendors could deliver in volume at the promised amounts of GHash, yes, they would probably be the only lucrative way to mine going forward. But all predictions regarding the future of mining have to be taken with a grain of salt: it's always hard to predict the future. The end of GPU mining has been predicted for a couple years now, but the rising exchange rate has been keeping it alive.


Cheating ASICs and Mining Software I've noticed the recently solved block hashes have started with a number of zeros (8 last time I checked). Couldn't we just tell our mining hardware/software to assume the first few digits are in fact zeros and give us a head start?

All block hashes start with a certain number of zeroes by design. The nature of a hash is that knowing something about the output does not help you figure out what the input is supposed to be (at least in theory). So in short, no.


What is the age of the youngest known Bitcoin developer? What is the youngest age of someone known to have submitted a Pull Request to Bitcoin Core?

https://github.com/whitj00

Whit Jackson, 15 is the youngest I can find. Github does not list the ages of PR authors:)

http://www.coindesk.com/15-year-old-developer-ethereum-whit-jackson/

edit: I am not sure of his exact birthday. He may have been 14 when submitting this PR for bitcoin.org:

https://github.com/whitj00/bitcoin.org/commit/b3ef809c7c63c9ededa4f4ad40ef5ff314434fe8


Bitcoins transactions over 1000 confirmations, but amount remains red I'm newbee,

I did several payments about 14 days ago.
There are 618 confirmations, but the amount remains red and nothing happens.
See the example of my blockchain wallet and 4 more examples.
The balance of my blockchain wallet is Zero.
In the other examples i have more then 1000 confirmations and still rising every hour.
What do I wrong ?

In the "Amount (BTC)" column on the right side of your window, a red number means money that you are sending out, and a black number means money that you are receiving in.

(The second row should have the amount in red too, but it is in black merely because the low is highlighted/selected with the cursor.)

The transaction pictured in the screenshot is indeed confirmed: txhash 90d43acff8c70d8ad2e8d09a6457b76caafc521501d71b573e9927939df8978c.


How does the block discovery rate of a mining rig relate to the overall computing power of the network? Is it correct to say that, since the difficulty will keep the block generation rate at 6 per hour on average, that with one-sixth of the network computing power, I will get one block per hour, on average?

Put differently, can I express my expected average block discovery rate to always be 6 per hour multiplied by the fraction of total computing power I own?

I'm asking this because I keep getting confused by the profitability calculations that rest on the difficulty, which is a totally opaque value for me, even though I know in theory what it means. I would like to employ some measure that I can use more intuitively.

This is approximately correct. You will actually get a bit more than one block per hour because so long as hashing power is increasing, the difficulty will lag behind the actual computing power.


Possible attack vector of BIP32 HD wallet I've been reading about BIP32 HD wallet and it's implementation and came across a few questions regarding the possible known "attack" vector of leaked private child keys and known xpub parent key leading to the discovery of the parent private key.
Given the following path of an HD wallet:

m/b/p/c

Where m is the master node derived from a seed, b, p, c being indexed nodes in different depths.

Imagine that a server is watching and creating receiving c addresses from p's xpub. If one of c's node's private key gets leaked and the server gets hacked, thus revealing xpub to the attacker, the attack could now generate p's xpriv and with that, all of c's node's private and public address could be derived by the attacker (hardened c nodes included).

First question: If p was a hardened node, could the attacker still calculate its private key from it's xpub and a child's private key ?

Second question: Could the attacker "climb up" the depth (calculate parent's xpriv) from p all the way over to m after calculating p's xpriv from the leaked c key and p's xpub ? Would a hardened b or p make a difference here ?

Third question: If a private key from c's depth was leaked and the attacker knew m's xpub, could the attacker calculate m's private key or does the exploit only permits calculating the direct parent of a leaked child ?

Bonus question: Could anyone give actual use cases for using one or more hardened nodes in a path ?

First question: If p was a hardened node, could the attacker still calculate its private key from it's xpub and a child's private key ?

Yes. It doesn't matter how p was generated. What matters is how c is generated.

  Second question: Could the attacker "climb up" the depth (calculate parent's xpriv) from p all the way over to m after calculating p's xpriv from the leaked c key and p's xpub ?

Only if the attacker also has b and m's xpubs. An important part of the derivation is the parent's chaincode. The chaincode is part of the xpub and if the attacker does not have the chaincode, then he cannot derive the parent's private key.

  Would a hardened b or p make a difference here ?

If the attacker had b and m's chaincodes, yes, hardening would make a difference. Hardening entirely prevents this attack. However hardening does not allow someone to have an xpub and be able to generate keys without the private key.

  Third question: If a private key from c's depth was leaked and the attacker knew m's xpub, could the attacker calculate m's private key or does the exploit only permits calculating the direct parent of a leaked child ?

The attack only operates on a child key and its direct parent extended public key.

However, given m's xpub and cs private key, it may still be possible to recover m's private key even though it is not c's direct parent. If b and p are derived using unhardened derivation, then m can be used to derive b and p's xpubs. From there, with all of those xpubs, the attacker can work backwards from c in order to get m.

If b and p are hardened, then it is not possible.

  Bonus question: Could anyone give actual use cases for using one or more hardened nodes in a path ?

Take BIP 44 for example. It define a standard derivation path of m/44'/0'/0'/i/k. The xpub at m/44'/0'/0' is given out. But since it itself is derived with hardened derivation, if any of m, m/44' or m/44'/0''s xpubs are leaked, the user's master key is still safe since hardened derivation is used.

Additionally, Bitcoin Core derives all keys using hardened derivation. This is because it uses BIP 32 for the easier backup function (you can use an older backup and still get all of the same keys) rather than for the auditability.


Your posted transaction has a tx fee of 0.5 XTN:

Version:  1  tx hash 7f1aa3a20163a9d4058940dd6af29b3f7aefc037b2f3b21133a1413a990bc4e7  192 bytes
TxIn count: 1; TxOut count: 1
Lock time: 0 (valid anytime)
Input:
   0: mjKj3fFKUBMfYiozTw4jngpuDQRjarn62F from 32b88bf17552d1d8075e4086836fa587b40a16a0076877136144e445be0e9d65:1      2000.00000 mBTC  sig ok
Output:
   0: mrMEaWKfkJZcAN52VqNxKkF21uvf9HF9G7 receives   1500.00000 mBTC
Total input    2000.00000 mBTC
Total output   1500.00000 mBTC
Total fees      500.00000 mBTC

which exceeds the default max imposed by Bitcoin Core of 0.1 XTN (or BTC). Please try adding the -maxtxfee=<amt> option to bitcoind's command line, and report back if you're still having difficulty.


Large number of dust inputs sum to nice round numbers. How and what wallet used? Consider the bitcointalk donation address 17RTTUAiiPqUTKtEggJPec8RxLMi2n9EZ9.

This has many incoming transactions with large number of dust inputs (hundreds) that sum to nice rounded numbers as in the following examples:

ba930f48aae32b8915a6e413ed297060291fec7fc916cf57b0751e0f77c41df2 (inputs sum to 0.05)

c0f25cc0f008ac935b3a38fecdea42e062ba3e3e7395161a2ad1b38754ee31c0 (inputs sum to 0.05)

1f4e0b21e6edd0dc1148116200426f390880e3e33ae0723de8415836874f7a3e (inputs sum to 0.5)

These can't be coincidences. What wallet is being used here? Does it solve the "subset sum" problem for each transaction to ensure that the sums are round numbers? I know the problem won't be hard for such small sizes but still needs solving.

Another explanation might be that one of the input transactions is intentionally created to cause the sum to be a round number.


Claiming Bitcoin Cash - where did I go wrong? I read multiple guides on how to 'claim' the BitcoinCash I'm apparently entitled to as a BTC holder.  I outline below the steps I took; but at the end of this process my Electron Cash default_wallet shows a 0 mBCC balance.  Please suggest where I might have gone wrong and what I can do about it:

In Bitcoin-Qt, generate a new receiving address
Send all my coins to the new receiving address

I started with 1.13BTC.  Now my Bitcoin-Qt wallet shows a balance of 1.129BTC and under 'recent transactions' it shows the Fee for the transaction.  The 'type' is 'Payment to yourself' and the Amount is -0.0023BTC

From the Transactions tab, I open the Details for this transaction.  It says 'Total debit -1.129BTC, Total credit 1.129BTC, Transaction ID 32...(64-digit hex string)'
At https://blockchain.info I entered the Transaction ID and see all the details.  I can see 4 Addresses on the Left and 1 Address on the Right (1JC...)
In Bitcoin-qt I go to Debug > Console and run dumpprivkey 1JC... with the full address.  It outputs a private key (50 characters, alpha-numeric)
I download and run Electron Cash 2.9.2, create a new default_wallet and 'Import Private Keys' pasting the 50-character private kay from the Bitcoin-Qt Debug output

Electron Cash shows the Public Address (1JC...) in the Addresses tab, with Balance 0, Tx 0

Bitcoin.info says the following about the transaction:

Inputs and Outputs

Total Input
1.13157047 BTC
Total Output
1.12926194 BTC
Fees
0.00230853 BTC

You may have gone wrong by exporting the private key of your /new/ wallet. You want to export the private key of the /old/ wallet and import that into Electron Cash. It isn't clear from your description if you got this right, and that would be one explanation.


How do people know that less than 1000 people own 50% of all bitcoins? I read this post on this site:
Who are creating all the alternate cryptocurrencies?

In it, there is a answer saying:

  An article about a month ago was written about the owners of Bitcoin
  and we know that 47 people owned about 1/4 of the Bitcoins and 927
  owned over 50%.

I am quite curious, how do the people know who owns how much? What if the owners are lying?

All Bitcoin transactions are public, in the sense that everyone can see which addresses sent and received the coins. (However, this includes no information about who owns the addresses.) This is an essential part of the Bitcoin protocol: you can verify the validity of a transaction that sends coins to you, by tracing the "chain of custody" of those coins all the way back to their creation,   and checking cryptographically that each transaction along the way was properly authorized.

So since transaction data is public, everyone can see the balance of every address. Thus it's possible to determine that 927 addresses own over half of all coins in existence. This doesn't tell us who the human owners are! It's quite likely that some of those addresses belong to the same people, meaning that wealth is actually concentrated in even fewer hands. On the other hand, it's also possible that some of those addresses are shared property; for instance, some could belong to a mutual fund.


Orphaned blocks on September 13, 2014 I'm new in the Bitcoin World. Today I did my second transaction for just 0.005 BTC but 2 hours after, it's unconfirmed yet. The transaction is in the block 320385 and it is orphaned. I saw the statistics for orphaned block in blockchain.info and today are 10 orphaned blocks and this is a high value according the graphic.

My cuestion is:

1.- How much time will my transaction to be included in other block?.

2.- What happened on september 13, 2014?, Why are there 10 orphaned blocks?

Thanks

Today I did my second transaction for just 0.005 BTC but 2 hours after, it's unconfirmed yet. The transaction is in the block 320385 and it is orphaned.

Is it in a block, or is it unconfirmed?

  block 320385

Which block 320385? This one or this one?

  today are 10 orphaned blocks and this is a high value according the graphic.

Huh, that's pretty odd. Screenshot for posterity:

It's unusual for blockchain.info to be wrong, but it definitely is in this case. This is the best chain that my client can find:

2014-09-13 01:59:04.460 UpdateTip: new best=000000000000000000652d48e212a9fdb16ce57d7097b76200a2fe5e9cd643fe  height=320406  log2_work=80.639033  tx=46574398  date=2014-09-13 01:56:16 progress=0.999993

The chain that blockchain.info thinks is invalid appears valid to my client. They'll probably have it sorted out in a few hours.