Why the "Unspent Transaction Output Set" is called "UTXO", not "UTOS"? Just out of curiosity, the Wiki says UTXO means "Unspent Transaction Output", but what does each letter mean in the acronym?

That seems to be a typo. Unspent transaction outputs are usually called UTXO's (Unspent TransaXtion Output).


Can a miner's hashrate be derived from shares submitted at a given difficulty? Trying to generate useful stats about client activity in a pool. If a quantity of submitted (timestamped) shares is known, and the difficulty of each share is known, how can the client's aggregate hashrate be determined?

hashes = shares * share_difficulty * 2**48 / 65535

thus:

megahash_per_second = shares_per_second * share_difficulty * 4295.032833


Listen for transaction on specific address How can you listen for a transaction on a specific address? I'm working on building a lightning network watchtower and the first thing I need to do is detect when someone closes a channel.

Lightning implementations already have implemented the functionality to watch the blockchain to see if the funding TX was spend (and the channel closed) Often this is outsourced to the Bitcoin fullnode. I suggest to look at their code base for this functionality and modify the relevant code snippet to include a watchtower solution you want to create.


How can Bitcoin protect itself from a "dumb majority soft fork"? Let's say a majority of miners change to using software that prohibits timelocks. This would be a softfork, so the blockchain would still look valid to nodes using the previous software, however nodes that mine blocks with a timehash would be orphaned from the network by the mining majority and outpace any chain containing timelocks. No chain that contains timelocks could grow, and existing nodes would treat the chain with new rules as the one true chain.

How would the users/miners that want to keep the use of timelocks be able to recover in this situation?

If the users who want to keep the use of timelocks do not constitute even a significant minority of users, they're simply out of luck. There's no mechanism for a minority to force the majority to tolerate rules the majority doesn't want.

Assuming the users who want to keep the user of timelocks are significant, they first communicate their intention to miners to take their business elsewhere. If they leave, they will take a good sized chunk of the ecosystem with them, reducing the value of the remaining system.

Even if they're not a majority, most users will not want even a significant minority to leave. So they can put additional pressure on the miners. The ultimate threat if the miners don't do what an economic majority of users want is that users can change the hashing algorithm changing the miners' precious ASICs into expensive space heaters. Or, to be more precise, changing them into expensive space heaters a bit faster. The miners definitely don't want that.


nSequence win OP_CSV in child tx must be equal to nSeq parent tx? When I create OP_CSV  transaction I need to set nSequence to the same number (in blocks)
e.g.

3 OP_CHECKSEQUENCEVERIFY
nSequence = 3

But when I trying to spend this tx (after 3 blocks confirmation) I have to generate transaction with the same nSequence as parent.

Otherwise I'm getting error (when I'm trying to spend with different nSequence)

non-mandatory-script-verify-flag (Locktime requirement not satisfied) (code 64)

But I wont set the nSequence to child transaction, because, in this case, I can't spend immediately child transaction.

Do I need to set some flag or something?

I believe your misconception is that the nSequence value must be set on the transaction that creates the CSV output.

This is not required. All that's needed is setting it on the spending transaction's input which spends it. This will indirectly require that output to have a certain age when it is being spent.


Ripple network overhead I like the way Ripple provides effectively instantaneous transaction verification.

When building consensus how much traffic and their equivalent of orphan blocks are accumulated?

Is communication throttled at all?

Is the candidate set processed by the network or the founders?

When building consensus how much traffic and their equivalent of orphan blocks are accumulated?

Once a consensus round starts, the amount of information that needs to be distributed is fixed, since new transactions cannot be introduced. If there's no reason a transaction shouldn't be included, then almost all honest nodes will ask that it be included. If there's any reason a transaction shouldn't be included, then the avalanche algorithm quickly excludes it.

  Is communication throttled at all?

Each validator rate-limits how often it changes its position. There is no reason to send a position that is already obsolete due to the decisions made by other validators.

  Is the candidate set processed by the network or the founders?

Once each validator determines that a particular candidate set has a super-majority, it applies the transactions in that candidate set and signs the resulting ledger. If a super-majority of validators sign that ledger, then we have a new "last fully-validated ledger".

Any transactions that could have gotten into that candidate set but didn't are then recovered using a deterministic process.

  how much time does the average round consume?

The network bases each round's timing on the previous rounds, trying to make the round a little bit faster if it can, but making it slower if it must.

There are a few minimum timings to ensure network stability. A ledger must be open for at least two seconds in order to ensure nodes have a chance to finish processing the previous ledger. A consensus cannot be declared for at least two seconds after the ledger closes to ensure nodes have a chance to take an initial position before other nodes conclude there is a consensus. (These are absolute minimums. If needed, they will rise.)

This makes a typical consensus round take about 5 seconds, plus 1 second for each additional avalanche needed to reach consensus. The number of rounds tends to grow logarithmically with the number of nodes and linearly with the network diameter (time it takes for a flooded message to reach the majority of nodes). We don't expect the timing to get over 10 seconds, even with a large network, so long as the network is confined to Earth.

Underperforming nodes will "bow out" of the consensus process to prevent the network from becoming as slow as the slowest node. Overperforming nodes will slow down to prevent the network from becoming as fast as the fastest nodes (as this would reduce decentralization). The algorithm is designed to self-regulate to keep the fastest subset of sufficient size operating.


How old does one need to be in order to mine or use Bitcoins? How old does one need to be in order to mine or use Bitcoins? Do I need to be 18 years old, or just 13? Is it illegal if a child uses Bitcoin?

Anyone can use Bitcoins there is no age specification. It's good that you start with crypto currencies at early age so that you can make a handful of money while you turn 18 but don't get do indulge into cryptos so that you put all other things aside.


calling getaccount rpc method on foreign address calling getaccountaddress method on an address associated with the default account return "" the name of the default account. The problem is calling getaccountaddress on foreign address that doesn't exist in the local wallet will return "" !

Shouldn't this method in the last case return an error or something ?

i think the solution here is to call validateaddress method to check this address ismine or not.

You can't do that. The client only keeps indexes of the balances of addresses you own. There is no ability to query the balance of arbitrary addresses.


Do transaction fees remain stable in bitcoins, or adapt to purchasing power? The Bitcoin price now is about $660 per BTC, and if I send some, the transaction fee will be about 0.0001 BTC or roughly $0.067. When the Bitcoin price moves to $1200 per BTC, would the transaction fee still be 0.0001 BTC, i.e. then $1.79?

If the price goes to $12000 per BTC, and I just want to sent $5 to $10, would I also need to pay the such a high transaction fee?

Your understanding is correct. If the required fee rate on the network remains the same (denominated in BTC) and the value of BTC rises against USD, then the transaction fees rise in USD terms.

In reality, there are many factors which affect what the actual required transaction fee will be, such as time/day of transaction (there's generally less competition for block space over weekends), size of transaction and if the transaction uses segwit (since segwit witness data is discounted).


Does the getwork id value do anything? When sending a getwork request, one always includes an id value. Does this value have any meaning? Will it cause problems to have multiple miners use the same id? Furthermore, if I wanted to send some extra information to a mining pool server, would id be an okay place to do it or should I add my own extra field?

If you are talking about the Bitcoin API, getwork only requires data field, which is a place to put your solution.

However, I do believe that you are talking about the id field of a JSON RPC command. It is used to identify a response to a given request. Generally, it might not be the best place to put extra information. There are already a few extensions to the getwork protocol that you might want to use instead.


Migrate Wasabi Wallet to BlueWallet I am looking to use an transfer an existing Wasabi Wallet to BlueWallet.
I tried using the extended private key but no luck.
Is this even possible?

Is this even possible?

Yes.

In General
You can move wallet contents from almost any Bitcoin wallet software to any other Bitcoin wallet software that supports the same standards. For example, if the first wallet supports Bech32, you will need the second wallet to also support Bech32.
There are only a couple of small pieces of data that need to be copied into the new wallet and exactly how you do this depends on the specific wallet software used. We should remember that just because something is possible doesn't always mean it is easy.
The general process is to transfer the private keys. In the case of HD wallets, you can effectively do this by one of several methods, including:

Using a seed-phrase (also known as recovery-phrase or backup-phrase) that conforms to a known standard (BIP39, Electrum, etc).
Using the master private key, typically in wallet import format (WIF)

You also need to specify the derivation path as this determines which  Bitcoin addresses had been created by the first wallet from the master private key.

Specifics
If we look at the specific wallet you mentioned, Blue wallet allows you to import wallet contents from a variety of other software and allows you to specify a key in WIF format.
To extract a master private key from Wasabi you may need to resort to tools like https://github.com/lontivero/ExtractXPrivWasabi (untested, no idea if it is safe, best to inspect source, build from source, run on computer without ethernet or WiFi  etc, isolated from any network)


Addresses found in wallet.dat that start 00 14 I found a list of addresses in my dumped wallet.dat file that all start 00 14...    They are script=1.

What are these encoded with and how to decode?

More than likely these are native segwit address scripts. Native segwit scriptPubKey start with 0014 followed by a 20-byte public key hash. There is an online tool available for encoding the public key hash into its native segwit address representation. Note that although the risk of using such tools is minimal in terms of security, there is a possible risk toward privacy. I have not personally verified/reviewed the code for this online tool and you should proceed with caution.

Remove the 00 14 section and paste the remaining 40-character string (20 bytes) into the "Data" field. The associated bitcoin address will be displayed on the right-hand side under "Encoded data".


I want to distribute small amount of bitcoins What should I be aware when I want distribute say 0.0001 bitcoin to 50 bitcoin wallets.
I this be done with one transaction? what are the implication of transaction fees?

I want my students to experience the bitcoin phenomena.

I read this on bitcoinfees.com

If any of the outputs (including any change) of your transaction are less than 0.01 BTC, then a fee of 0.0005 BTC is required.

This is called bitcoin dust. Smaller transactions as you intend todo comes with a fee.


What are the drawbacks (if any) of encrypting your wallet with Bitcoin-Qt? Basically, is there any reason not to encrypt your wallet? The only drawback I can think of is forgetting your passphrase and losing access to all your bitcoins.

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

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

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

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

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


How can bitcoin coins have real values? I had this question for some time and i couldn't have a clear answer.

How can a new entity (coin) have a real value, in USD for example, and be able to trade with it when it has no real life equivalent like Gold.

anybody has an answer ?

First of all, "real value" is a questionable term. Some people deny a concept called Intrinsic Theory of Value. Anyway I can give us some reasons:

1) Limited supply and increasing demand

Bitcoin (as some other cryptocurrencies) has a fixed supply, which is currently 16,8 millions of units but it is going finish in the next years, when it hits 21 millions of units.

This supply of units is totally public through its ledger, which brings us an authentic and transparent scarcity.

According the classic economic model of Supply and Demand, if the demand increases and the supply does not increase in the same speed, the price will increase.

2) Bitcoin is a more effficient payment system

You can send an amount of money for an relatively small fee in a short time. The current systems simply can't send 3000 USD from NY to Japan in 10 minutes for 2 USD less than 1 USD and the next updates can make it cheaper and faster.

3) High liquidity and media coverage

Anyone can trade relatively small amounts of bitcoin in Internet. It doesn't have the same limitations or restrictions that other markets have, like trades with minimal amounts. It has more liquidity than stock market, as you can trade in smaller positions.

So, if the Bitcoin market is bullish it trends to be really bullish, specially when media coverage show how bullish it is and much high it is performing, which brings more interested people to the market - even people who doesn't know exactly how Bitcoin works, how its blockchain works, etc. It happened specially during 2017. So we have an explosive scenario, where:

Bitcoin price increase much more than other investments in the same
timeframe
Media coverage about Bitcoin performance increases people
curiosity
Bitcoin is easy to trade in relative small amounts and
people buy some Bitcoin
Repeat.


How do I change the default blockchain Database download location for NXT? I'm testing out the nxt client and was wondering how do i change the default database download location? Its currently downloading to the current folder (nxt_db).

From nxtforum.org "Move blockchain location" at http://nxtforum.org/nrs-client-how-to-help/move-blockchain-location/

  look in /conf/nxt-default.properties.

  In the #### DATABASE #### section, you will find by default

    # The nxt_db folder is expected to be in the current working directory, will be created if missing.

    nxt.dbUrl=jdbc:h2:nxt_db/nxt;DB_CLOSE_ON_EXIT=FALSE

  NRS will create the database folder in D:/nxt_db.

  You can also leave nxt-default properties with default values, and create a user properties file called "nxt.properties" in the same /conf folder. Any values in nxt.properties will override defaults in nxt-default.properties, so a nxt.properties file defining nxt.dbUrl will work the same as the previous edit.

Hope this helps.


Got the Bitcoin Wallet. How do I transfer money into it? I've got active connections & there are blocks downloaded but I don't know what to do next. Presumably I need to transfer some money in there so I can buy bitcoins. But how?

Any suggestions gratefully relieved.
Thanks.

It is not possible to buy bitcoins from inside the client. What you need to do is this:

Find someone that you can buy bitcoins from. One way is to use an exchange, such as Mt.Gox, that let's you deposit USD (or some other currency) and then buy bitcoins.
In the Bitcoin client (assuming you use the original client from bitcoin.org), get a Bitcoin address from the "Receive coins" tab ("New address..."). Using a new address for each transfer will increase your anonymity.
Transfer the bitcoins you bought to your new Bitcoin address. If you use Mt.Gox you would use the "withdraw" option. The bitcoins will then show up in your client.


Altcoin Solo mining Help / Advice I am kind of stumped. I have been mining for about 6 months and have been trying out various methods in that time. I have used CPU, GPU (a combo of both) and most recently been using some older ASICS.

I have used the ASICS in pools and have got them working without any errors, so I thought I'd try my hand with solo mining. Since my ASICS hardware is NOT very new or powerful, I deduced that starting with some scrypt and sha256 altcoins might be best.

I did quite a bit of reading and got to a point where i was ready to start mining (wallets downloaded, configs created and start configs pointed to the correct wallet RPC and port etc.) However, once my miner starts running, (in this case my Butterfly-Labs Bitforce 60GH/s sha256 miner setup for acoin) bfgminer starts up, just like it does when I mine to a pool; finds my hardware, finds my "pool"/host URL shows the block identifier saying it detected a new block and it even shows that it is submitting shares (in verbose mode, informs me "new best share") but it does NOT show that my shares are being accepted like it does when I'm mining in a pool.

(Screenshot)
http://prntscr.com/jm2ob6

Can anyone give me some feedback as to what i might be able to do to fix this?

Thanks in advance!

Shares are an accounting mechanism to allow for miners in a pool to prove how much work they did towards finding the next valid block hash and fairly divide any rewards. With solo-mining, there are no shares to account for, none to be accepted, since it is only you mining. This means if you successfully find a valid hash you will get all of the reward from it.


If I send a BTC to an offline cold storage, does the transaction in the blockchain appear when i send it or when i receive it or not at all? If I send a BTC from my hot or exchange wallet to my cold storage does it has to pass the blockchain or can the blockchain be bypassed? If it has to pass the blockchain, when does it appear in the block explorer? when I send it? when I receive it (the cold storage comes online)? or not at all?

It seems that you have a misunderstanding of how Bitcoin transactions work.

Transactions are not things that are sent directly to the receiver. The recipient does not need to be online to receive Bitcoin as they do not have to do anything to acknowledge a transaction. Instead, when you someone Bitcoin, the transaction you create is broadcast to the entire Bitcoin network. Whether the recipient receives the transaction is irrelevant.

Once the transaction is broadcast to the Bitcoin network, a miner should include it in a block and thus it becomes part of the blockchain. Being included in a block means that the transaction has "confirmed". While it is not in a block, it is "unconfirmed".

If the recipient is offline when you broadcast the transaction, and the transaction confirms (i.e. is included in a block) while they are offline, they will see the transaction in the blockchain as they sync the blockchain.

So in your example, the transaction will be broadcast to the network, and a miner will include your transaction in a block. It does not appear in the blockchain when you send it, but it will appear in it shortly after. Whether your cold storage wallet is offline or online does not matter as there is nothing that needs to be done by the recipient in order to receive Bitcoin.

Block explorers generally listen to the Bitcoin network for unconfirmed transactions, so as soon as they receive your unconfirmed transaction, they will make it searchable. If they don't see it, once it is in a block and they receive the block containing it, they will display it as well.


a few questions about how HD wallet works I've read through HD wallet from various resources and have got the basic understanding about it, but am still confused by a few details

1) Each non-hardened public keys (thus addresses) can receive certain amount of Bitcoins. How's my total UTXO calculated? Is is simply the sum of all UTXO or there's some other mechanism automatically pool all these UTXO into somewhere

2) Kinda depending on the answer of 1), how does it work to send Bitcoin to some else in the case of HD wallet? If all public addresses have their own UTXO, then the wallet has to choose a number of UTXO as inputs for each new transactions. Is it how it works?

3) Do we use master private key to sign every transaction?

Thank you for your help

1) ...How's my total UTXO calculated?...

Each node calculates it's own UTXO set, there is no single 'global UTOX set'. You may own some subset of the UTXOs, but there is no pooling. If you receive payments to the same address more than once, each one will be it's own UTXO.

  2) ...If all public addresses have their own UTXO, then the wallet has to choose a number of UTXO as inputs for each new transactions. Is it how it works?

Yes, and each wallet may perform coin selection differently when authoring a new transaction. Some wallets even allow manual selection when sending transactions.

  3) Do we use master private key to sign every transaction?

No, each UTXO can only be signed by the child private key for that particular address. In the case of an HD wallet, the xpriv key is used to derive the child private key for each address. Those child private keys can then be used to sign transactions.

Each address derived by an HD wallet looks just like any other bitcoin address, there is no way to know it came from an HD wallet. So in order to spend the UTXO, you need to present a signature made by the private key of that specific address. The network does not know that your address was derived from an xrpiv key, so if you use your xpriv key to sign the transaction, it will be invalid.


Following SegWit implementation, is BIP-146 signalling and implementation still on the docket? Is BIP 146, which defines using the low S value, still on the docket to be signalled and implemented given that SegWit fixed the txid malleability issue by moving the witness outside the transaction? I'm asking because it can fix the wtxid malleability which now requires re-syncing of transaction data when it is changed from what it was originally relayed.

Also, will the implementation be a soft-fork which would treat this transactions as non-standard but miners can still include them in the block, or will it treat the transactions with high S value as invalid?

Bitcoin-core already enforces low S-values as a standardness rule for transaction relay, but making a transaction non-standard does not cause a softfork.

BIP-146 does call for a softfork by making high S-values in tx signatures invalid, not just nonstandard.

The BIP also states that the majority of txs on the network already adhere to the low S rule, as of Aug 2016. To quote from it:

  The reference client has produced LOW_S compatible signatures since v0.9.0, and the LOW_S rule has been enforced as relay policy by the reference client since v0.11.1. As of August 2016, very few transactions violating the requirement are being added to the chain. For all scriptPubKey types in actual use, non-compliant signatures can trivially be converted into compliant ones, so there is no loss of functionality by these requirements.


What Software Patterns does the Bitcoin source code use? I'm a Master Student in Computing Science and currently investigating the Bitcoin source code on the Software Patterns that are used. Part of the assignment is to ask the community to guide us.

I would like to ask you if you know any Software Pattern in the source code. In order to give you a view of our scope, below is a list of Patterns covered (Design Patterns and Architectural Patterns).

Thanks in advance,

Patrick

Object Oriented Design Patterns:

Factory Pattern
Adapter Pattern
Composite Pattern
Facade Pattern
Proxy Pattern
Observer Pattern

Architectural Patterns:

Layered Decomposition Pattern
Pipes And Filters Pattern
Data Repository Pattern
Model View Controller Pattern
Client Server Pattern
Peer to Peer Pattern
Publish Subscribe Pattern
Broker Pattern
Message Queue Pattern

i don't think you can find many Object Oriented Design Patterns in the btc-source-code. but there is one example i know:

the blockchain itself is like a composite pattern:
you have a general type called Block. two types inherits Block: MinedBlock inherits from Block and GenesisBlock inherits from Block. A MinedBlock has one attribute of the type Block called PreviousBlock.
(here you can also find the singleton pattern: you need exactly one GenesisBlock-object.)


Retrieve Bitcoin wallet details We have a bitcoin wallet which we tried to update as it was dormantfor some 8 years plus but we were unable to do so as we haven’t got the Bitcoin wallet details.

Is there any way of retrieving my Bitcoin wallet details as we don’t have the wallet ID details.

If you have access to the hard drive or computer, you can follow the steps here to recover your wallet.


CHECKMULTISIGVERIFY with public key hashes? Is it possible to create a script that implements m of n pay to public key hash neatly? One way to do it would be to make use of OP_IF. But, that's not neat.

CHECKMULTISIGVERIFY can implement m of n, however, it takes public keys instead of public key hashes.

Thanks

I think I've figured out how to do it. (Not neatly, though.)

Here's a 3-of-5 pay to multi-pubkeyhash:

scriptSig: <key1> <key2> <key3> <sig1> <sig2> <sig3> <pos1> <pos2> <pos3>
scriptPubKey: <hash1> <hash2> <hash3> <hash4> <hash5>

// key1

// get the key <key1> and hash it
+2 13 OP_PICK OP_DUP OP_HASH160
// copy pos1
+1 9 OP_PICK
// check 2 < pos1 < 7
+0 OP_DUP 2 7 OP_WITHIN OP_VERIFY
// copy to alt stack
+0 OP_DUP OP_TOALTSTACK
// get hash at pos1
-2 OP_PICK OP_EQUALVERIFY
// check signature
-1 11 OP_PICK OP_SWAP OP_CHECKSIGVERIFY

// key2

// get the key <key2> and hash it
+2 12 OP_PICK OP_DUP OP_HASH160
// copy pos2
+1 8 OP_PICK
// check 2 < pos2 < 7
+0 OP_DUP 2 7 OP_WITHIN OP_VERIFY
// check pos2 < pos1
+0 OP_DUP OP_FROMALTSTACK OP_LESSTHAN OP_VERIFY
// copy to alt stack
+0 OP_DUP OP_TOALTSTACK
// get hash at pos2
-2 OP_PICK OP_EQUALVERIFY
// check signature
-1 10 OP_PICK OP_SWAP OP_CHECKSIGVERIFY

// key3

// get the key <key3> and hash it
+2 11 OP_PICK OP_DUP OP_HASH160
// copy pos3
+1 7 OP_PICK
// check 2 < pos2 < 7
+0 OP_DUP 2 7 OP_WITHIN OP_VERIFY
// check pos3 < pos2
+0 OP_DUP OP_FROMALTSTACK OP_LESSTHAN OP_VERIFY
// get hash at pos3
-2 OP_PICK OP_EQUALVERIFY
// check signature
+0 9 OP_PICK OP_SWAP OP_CHECKSIG

(The number at the start of each line is how many stack elements that line adds or removes.)

The idea is that the spender provides the keys, the signatures, and the index of the hash that they're signing for. (keyN, sigN, and posN.) To prevent someone from providing the same index three times, we check that pos1 > pos2 > pos3. It's much longer than an equivalent multisig script, but on the plus side we do fewer signature verifications. (Normal 3-of-5 multisig will do up to 5 signature operations, but we only do 3.)

(Standard disclaimer about using untested scripts applies. If I made an off-by-one error above, all your money's gone.)


bitcoind deamon create new account for every user I'm new to this bitcoin and seems confused a little.

I need a system where I need to create new address for every user(personal account) where they will transfer some bitcoins to it and buy some products from my website.

So, I've started bitcoind and through bitcoin-cli, I've generated new address(getnewaddress) and send some bitcoins to it.

But on the transactions screen, it shows payment to yourself and the balance of the account doesn't change.

Can anyone, please help me how to create a new individual account address for every user and make the transactions. It should have a password or a private key also for security.

NPM Package I used : https://www.npmjs.com/package/bitcoin-core

Bitcoin-Core can manage different 'accounts'.
You can can create a new account by using 'getnewaddress':

bitcoin-cli getnewaddress "accountname"

If the account name exists, the address will be added to that account,
otherwise it will create a new account with that name.
You can see what accounts you have by using 'listaccounts'

For other options see: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Note that these accounts are still considered part of a same "wallet", as it they belong to the same user.

If you want to separate them completely, you can run different instances by using different data folders.
Use the '-datadir=/path/to/data' option when running bitcoin (and again everytime you use 'bitcoin-cli') to tell bitcoin which "account" it has to use.

E.g.:

bitcoind -datadir=/home/user/btc1/ -daemon
bitcoind -datadir=/home/user/btc2/ -daemon
bitcoin-cli -datadir=/home/user/btc1/ sendtoaddress <address-of-btc2> <amount>

Note that you can also use different configurations by placing different bitcoin.conf files inside each data folder.


How are Ledger Nano S private keys protected? I've read quite some material but it boils down that there "is a chip" on Ledger Nano S and the private key never leaves it. But what I would like to know is the following.

Is it encrypted? If so, how? Using my PIN?
I know the device is reset after 3 false tries while entering the PIN, but is the private key really encrypted inside this chip? Otherwise one could (in theory) remove the chip, put is somewhere else and read it out.

Any thoughts?

Ledger uses a secure element chip to store the private key.

In simplified terms this means that the private key is stored on a special chip that is almost like a small computer with a Operating System with a very strict and well defined interface. This interface is designed to NEVER allow an extraction of the private key except during the creation of the key when the seed is shown on the display. The only operation that uses the private key that is supported is to send input (read transactions in terms of bitcoin) that the chip signs with the private key, and then returns the signature. Therefore the only output you could get from the chip is the signed transaction, and never the private key, no matter where you put the chip.

Secure element chips are not a new invention by Ledger, but actually a technology used in many other use cases (other examples are passports and credit cards). Ledger uses a Javacard with version 3+, which supports creation of ECC keys that have size of bitcoin keys.
It should however be noted, that even though the chips are designed to never let anyone extract the key from the chip, even with physical access to it, a well motivated and funded actor (like NSA) could theoretically extract the private key.


What is the method to determine the total market capitalization of the Bitcoin market? When I look at the following site it says (at the time of writing) that the total market capitalization of Bitcoin is $125,927,574,809 AUD.

Now I think you could do this by running through the entire history of transactions on the blockchain, adding them all up, and multiplying by the current price. But there is probably a better way.

My question is: What is the method to determine the total market capitalization of the Bitcoin market?

"Bitcoin market cap(in AUD)" = "Number of bitcoins in circulation"   X   "Value of single bitcoin(in AUD)"

The same as a market cap of some company: "number of their shares" X "value of single share".

Market cap means what would be the money you get if you sell all the bitcoins at current price.

Number of bitcoins in circulation can be calculated by going through all blocks of the main blockchain and sum the bitcoin reward of each of them.


Bitcoin reversible strange transactions I am aware that a normal bitcoin transaction cannot be reversed once broadcast and confirmed on the network. My question is whether it is possible to create a strange transaction with an unusual redeem script which would allow the sender to reverse the transaction when this information is provided.

The wallet software might not accept this transaction as spendable but this does not matter as it is supposed to be an unusual transaction. Ultimately my question is whether such a transaction is possible at all but if not, how would I go about creating it?

What you are looking for is a type of smart contract.  But be aware, that smart contracts in Bitcoin are generally comprised of multiple transactions, rather than a single transaction confirmed in a block.  You would need this initial transaction to "fund" the contract, and then further transactions that spend the outputs of the funding transaction, based on your conditions.

For example, your initial transaction can be written as to say:

"This money can be claimed by the recipient after a certain amount of time OR it can be reclaimed by me right now if I have some piece of provided information."

Now if the time period expires, it can be assumed that the recipient will create a transaction spending the outputs of the first, thus claiming the money.  However, if the sender has this special information you speak of, he can spend the outputs immediately before the recipient gets a chance.

You can use either nLocktime or OP_CHECKLOCKTIMEVERIFY for the time restriction, and you can use Lightning Network style hash locks for "when this information is provided".  Keep in mind this is just a simple example of what a potential smart contract solution would look like for you.  You would certainly need to design your own to meet your own requirements.


Double signature requirement of Breach Remedy Transaction In the Lightning Network Paper (https://lightning.network/lightning-network-paper.pdf), Breach Remedy Transactions seem to require signatures by both channel members. I infer this from this description in the paper:

  When a new pair of Commitment Transactions (C2a/C2b) is agreed upon,
  both parties will sign and exchange signatures for the new Commit-
  ment Transaction, then invalidate the old Commitment Transaction. This
  invalidation occurs by having both parties sign a Breach Remedy Trans-
  action (BR1), which supersedes the Revocable Delivery Transaction
  (RD1). Each party hands to the other a half-signed revocation (BR1)
  from their own Revocable Delivery (RD1), which is a spend from the
  Commitment Transac- tion. The Breach Remedy Transaction will send all
  coins to the counterparty within the current balance of the channel.

(Emphasis by me.)

I do, however, not understand why this is a requirement. It seems to me that it's possible to design the Revocable Sequence Maturity Contract in such a way that only the signature of the Breach Remedy Transaction's issuer is required, not additionally the one of the redeeming party.

Is my notion correct? If not: Why not?

If we assume "half-signed" implies that both parties sign the transaction, then the Breach Remedy transaction would also include the spend from the other output in the commitment transaction which would then also require Bob's signature. This logically makes sense (but is not explicitly stated in the paper) as it would reduce transaction fees and consolidate UTXOs. But yes, you are correct, there is no need to have both parties sign the Breach Remedy transaction.

The current protocol design actually does away entirely with the Breach Remedy and Revocable Delivery Transactions by using special scripts which enforce the rules that those transactions would enforce by existing. This script uses a relative lock time (with OP_CHECKSEQUENCEVERIFY) to enforce the Revocable Delivery rule. It also uses a revocation key which can be generated by the party performing the revocation after a commitment transaction has been revoked, thus doing away with the Breach Remedy transaction. The output script construction is described here.


What OSes don't yet have Bitcoin clients? Bitcoin has clients created for many OSes already, but which (semi-)significant operating systems don't yet have a Bitcoin client created for them?

Is there some opensource code I can use as a template to create a Bitcoin client for an OS that doesn't yet have a client?

The bitcoin source is free derive and redistribute. I believe some microarchetectures (some flavors of ARM?) are currently unsupported.


CoPay wallet won't open on my Phone My Copay Wallet won't open on my Android phone. When I tap on the app the Copay Logo comes up then the screen turns white.

My ohone is an android  not IOS.

Please try to open copay on another mobile phone and see if it gonna work,
some countries may block access to bitpay servers which are few, to avoid country citizens using bitcoin.

if so, try to install some VPN software and try again. if still doesn't work, you have to open an issue here https://github.com/bitpay/copay/issues with more details about your mobile phone.

if you don't want to do so, you can install copay on your laptop or any other device and import your mnemonic phrase there.


Is it actually possible to create a "verifiably unspendable" address? The Bitcoin.it wiki article about proof of burn mentions "verifiably unspendable addres" and this method has been used by Counterparty to create XCP.

Is it actually possible to create an address that is "verifiably unspendable"? If yes, how? Or does "verifiable" just mean extremely hard, the way it is extremely hard to find a private key for any public key?

Or in other words: Are there valid Bitcoin addresses for which it's possible to mathematically prove that there is no private key?

Every valid ECDSA public key corresponds to some valid ECDSA private key.  Bitcoin addresses are not actually public keys though, they are a 160-bit hash of a particular binary representation of the public key.

You asked:

  Are there valid Bitcoin addresses for which it's possible to mathematically prove that there is no private key?

As far as I know, the answer to that is no.  To construct such a proof, you would have to somehow consider the enormous set of all possible public keys, and prove that none of them have a binary representation whose 160-bit hash would match the Bitcoin address in question.  The point of hash functions is that they cannot be easily inverted, so you can't just get a list of all the valid inputs that would result in the same hash.

The number of ECDSA public keys (approximately 2^256) is vastly greater than the number of Bitcoin addresses (2^160).  So the average Bitcoin address actually corresponds to about 2^(256-160) = 2^(96) different public keys.  So it seems like it would be hard to find an address that corresponds to 0 public keys.


bitcoin dust spamming - could the blockchain be rendered useless? My concern isn't with individual bitcoin users but governments, what if a government spammed the network with say $1 Billion dollars worth of tiny dust transactions, including fees? The backlog of unconfirmed transactions would seem to effectively render the blockchain useless at that point and people would no longer have trust in or want to wait for transactions to confirm. This seems like it could be a major issue for the protocol...are their any defenses in place currently for some type of attack like this?

Perhaps only for other dust sized transactions with minimal fees. Dust transactions with small fees are low priority and are NOT guaranteed to be confirmed in the order the transaction was placed but rather by the priority. So lets say there is a backlog of 1 million dust transactions, I could create a transaction using 1 output for 0.01 and include a fee of 0.0002 and it should be included in the next few blocks, well before any of those 1 million dust transactions.


Check password for ethereum wallet I have ethereum wallet and wish to check if some password was used to create it.
How this could be done?

You could check by starting a geth console and using the personal.unlockAccount function:

$ geth console
> personal.unlockAccount("address", "password")


Reasons Behind Finding an IP addresses of Miners I am wondering if Finding IP addresses of each miner, can help the transactions to be processed by them without waiting time in mempool or not?
I do not understand clearly why people are looking for IP addresses of the miners?
Thank you

Ordinary Bitcoin users would not care about the IP addresses of miners. Every Bitcoin node simply tells its peers (the "neighbors" of the node) about any new transactions they hear about. This way, the transactions get relayed across the network until everyone has heard about them, including the miners.
The waiting period is independent of how quickly the transaction gets to miners. Miners are constantly trying to find a block and succeed at random intervals. Whenever they find a block, they include whatever transactions they know about that pay the most fees, so beside a transaction just missing to get into a block, the wait is independent—it's simply until the next block is found that they fit into.
It's not clear to me in what scenario people might be trying to find the IP addresses of miners. Two that come to mind would be researchers that are trying to map Bitcoin mining activity, and attackers that want to hijack hash power.


Could any standard fee transaction be double spent by using a higher fee? I realize that if somebody makes a transaction without any fees and there have not yet been any confirmations, then the transaction could be double spent by just spending the same inputs to a different address, but with a standard fee.

My question is, if somebody sends a transaction with a standard fee, and there have yet to be any confirmations, could that transaction be just as easily overridden by rewriting the transaction, but with a higher fee? If so, what would be the implications for a party that accepts zero confirmation transactions such as BitPay?

The original design assumes a common behavior of processing the incoming transaction on FIFO basis. That means the first transaction received by a miner wins and all conflicting transactions received after it will be ignored (no matter if the first one is already confirmed or not).

While this standard behavior is beneficial for the Network as a whole, some "smart" miners might employ a bit different approach: when building a block, always take the transaction with the highest fee, no matter the order in which it was received.

It might seem this is just a marginal misuse of the protocol and there won't be enough rogue miners doing this, so it doesn't matter. Well, unfortunately, there already is (at least) one mining pool that tries to build its business exploiting this idea. Should it prevail, services accepting zero-confirmation transactions will need to reconsider their policy.


Please help me to solve unconfirmed transaction I tried to send a bitcoin transfer and it is still unconfirmed and I have my block chain account set to "use recommended fee" by default. Can anyone help me get this confirmed or teach me how to get it confirm (or how to raised the tx fee to get it be confirmed faster? Many thanks for your kind support.

Here is the link:
https://blockchain.info/tx/c6816a387cb0ca8e33bb7b200372ce05919f6003034faaeecb1f72436827b32b

Patience grasshopper!  According to 21's block confirmation estimator with your 10.21 sat/byte fee your tx will likely confirm in the next ~3-32 blocks.  For future reference though, if you would like to add a higher fee check into using recently added RBF (Replace By Fee) functionality that was recently added to bitcoin core and multiple wallets.  Here is a bitcointalk thread that discusses this at length for numerous wallet clients:
https://bitcointalk.org/index.php?topic=1802212.0


What is the mathematics behind the maximum number of 21 million bitcoins that can be generated? How is this number 21 million bitcoins arrived at? What is the mathematics behind this number? Or is this number a constant that can be changed in the source code?

every detail of bitcoin can be changed by the developer by editing the source code. 21million was satoshi nakamotos design decision. afaik this number is not directly contained in the source-code. every ~10minutes a new block will be created. every 210000 (~every 4 years) blocks will the block reward be halved. so in many years (after many halvings) miner will not anymore really earn blockrewards because the blockrewards are approximately 0btc. => then virtually no new bitcoins will be created. that is why the entire amount of bitcoin is limited. (but the miner still earn the transaction-fees).


Can new OP codes be added with a soft fork? I understand that P2SH transaction types were added "softly" by repurposing a Tx message that is already valid, so old nodes won't reject them in blocks.

Is there a similar method to adding new script OP codes without a hard fork? In other words, how will old nodes interpret "No Op" commands after they have been repurposed for the upgraded protocol?

Yes. Before P2SH, the most popular proposal for solving the problem that P2SH solves was OP_EVAL, which did just that: it repurposed OP_NOP1 as OP_EVAL.

A P2SH script looks like this:
[script input...] [serialized script] | OP_HASH160 [script hash] OP_EQUAL
The equivalent OP_EVAL script would look like this to old nodes:
[script input] [serialized script] | OP_DUP OP_HASH160 [script hash] OP_EQUALVERIFY OP_NOP1
Old nodes would only check that the serialized script matches the given script hash when hashed. The other stuff would be ignored.

New nodes would see:
[script input] [serialized script] | OP_DUP OP_HASH160 [script hash] OP_EQUALVERIFY OP_EVAL
New nodes would understand OP_EVAL, so they'd check that the serialized script matches the given script and execute the serialized script. An OP_EVAL transaction might be seen as invalid for new nodes and valid for old nodes, but not the other way around. That's what makes it a softfork. If the majority of mining power is using the new rules, then this is not a hardfork because the longest chain will always converge to a state that is valid for both old and new nodes.

Depending on the new opcode's behavior, it may be necessary for new nodes to verify scripts twice to ensure that certain scripts can't cause hardforks. Scripts are verified once using the old script rules and once using the new rules.

The OP_EVAL proposal was eventually replaced with P2SH because it was discovered that OP_EVAL accidentally allowed Turing-complete scripts, which the Bitcoin developers didn't want. P2SH is very simple (and a bit weird) in part so that similar accidents would be easy to avoid. But there wasn't any technical problem with this method of adding a new opcode. Moreover, there's nothing restricting the behavior of new opcodes. For example, OP_EVAL could have interpreted its input in a different, Turing-complete language, though there are various reasons why this might not have been a good idea.


How do I solo mine with bitcoind-rpc? I found this script: https://github.com/jgarzik/pyminer
But it uses getwork RPC call, which resulting me this:
error code: -32601
error message:
Method not found

From https://en.bitcoin.it/wiki/Getblocktemplate:

It supercedes the old getwork mining protocol.

Does it mean that getwork is no longer an option for miners? If so, how do I solo mine with getblocktemplate?
I never worked with this protocol, but from what I read on wiki, it apparently forces me to connect to pools. My task is to do solo mining by all means.
Could you please provide or refer to example Bitcoin RPC call, that would:

Get a job to mine
Send mined block hash with all the mined info (nonce, etc.)

If possible, please, do not refer me to third-party software like bfgminer, etc. I'm implementing my own miner, and I need to know RPC calls to do it.

Unfortunately, the information presented on Bitcoin Wiki is misleading. All I had to do is to call getblocktemplate with
{
  rules: ["segwit"]
}

JSON object (it happened to be crucial to pass exactly a JSON object, not a string). And for the work completion all I needed to do is to send submitblock request.
Hope it helps someone who's also struggling to find any info about solo mining with
Bitcoin RPC.


Is the electrum android private key secure? I have used electrum for many years on my desktop pc, and have alway felt very secure in doing so because of my ability to use a very strong password to encrypt my seed phrase with. However I just started using the android version and have some concerns.

The android version requires me to select a PIN but it is only 6 digits long? How does the android version of electrum ensure that this tiny keyspace (1 million) stays secure?

The android version requires me to select a PIN but it is only 6 digits long? How does the android version of electrum ensure that this tiny keyspace (1 million) stays secure?

The PIN is not used as a master seed in this way. It may be used as an additional source of user-supplied entropy, but the wallet's seed will be generated in a cryptographically secure way, using other sources of randomness to provide sufficient security.

I am unfamiliar with the specifics of Electrum's implementation, but there are generally two possibilities here:

1) the password / PIN is simply used to encrypt the wallet, and is not used as input for the seed

2) the password/ PIN is used as a '13th/25th word' that acts as a password on the mnemonic. Find more info here. Also, from BIP 39:

  A user may decide to protect their mnemonic with a passphrase. If a passphrase is not present, an empty string "" is used instead.


How does a share hash compare to a block hash? Can a miner view the contents of the current block? Is it true that a share hash is simply the same thing as a block hash, but with a lower difficulty?

Is there any way for a miner in a pool to get a list of all the data being hashed (not sure if that is simply the merkle tree, or everything from ListTransactions)?

If the answer is "no", what is the underlying data that is being hashed, and how is it used?

Yes, a share hash is a hash of a bitcoin block. Some of them are above the bitcoin network difficulty which means the block is valid. Most are not, and can only be used to show that you are mining (and at what rate).

The data being hashed is the block header. The block header contains the merkle root which is created from the transactions. The transactions are not part of the block header. A bitcoin block is the header plus the transactions.

With the GBT (getblocktemplate) mining protocol you do get all the data, including transactions. This could be used to try and detect if the pool is doing something bad. It could also be used as you say to let the user see the transactions he or she is including in blocks. With GBT there is even the possibility for the miner to remove or add transactions, if supported by the pool. Most of this is still not implemented by miners and pools.

Stratum had an extension to allow you to fetch the transactions for the block you are currently mining. I'm not sure if any pools support it, though.

So far Stratum seems most popular, probably due to its efficiency (low bandwidth usage and fast block changes). GBT, which aims for the transparency you are talking about, has a lot more overhead.


Fastest device to perform single-threaded SHA256 hashing I am in the process of designing a cryptographic Proof of Storage (PoS) that relies on single threaded computation of SHA256 hashes. In practice, my algorithm is equivalent to computing for some string S the value SHA256^N(S) = SHA256(SHA256(SHA256(...(SHA256(S)))).

This forces anything computing that function to use only one thread, as each SHA256 step needs the output of the previous as input.

Now, I know that ASIC miners exist that can compute SHA256 hashes at an enormous rate. This, however, is due to their parallelism: completing Proofs of Work (i.e., finding zeros of hash functions) is an embarassingly parallel problem and can be computed very fast on massively parallel devices. This is not what I am looking for.

What I am looking for is the fastest device that would be able to compute my function, i.e., single-threaded computation of a SHA256, then the SHA256 of its output, the SHA256 of the result and so on.

I thought that maybe in this case the best hardware would be the fastest CPU in terms of single threaded performance: I found here that Intel Core i7-7700K could be a good place to start looking for.

Is there any other known specialized hardware device that could carry out the task faster?

Well, existing Bitcoin mining hardware would indeed not be any good for iterated hashing, as it's not designed to do that. However, SHA-256 is not a hardware resistant hash function. The most complex operation in the hash function is addition modulo 2³², which is quite easy to implement in hardware.

An attacker could implement a fast SHA core on a chip, which would consist of calculating a single round as fast as possible. This is the opposite optimization as a Bitcoin miner: miners prefer very many parallel cores that run at slower clock speeds to save energy per hash. Such a hypothetical chip would definitely be much faster than a CPU at calculating iterated hashes.

What you want is a memory-hard hash function such as Argon2. Its execution requires fast cache, which is plentiful on commodity CPUs but costly to build into other hardware. It has a parallelism parameter where you can allow up to, say, 4 cores. Iteration of the function will not be any faster past that number of cores, and custom hardware will not increase the attacker's speed.


What does this indicator mean in the right bottom cornor of the official Bitcoin wallet? Circled in red:

When I hover over it I get the message "8 active connections to the Bitcoin network". Should Is this number too low and how do I change it?

That icon indicates the state of your connection with the rest of the Bitcoin network. "8 active connections" mean that you are connected to 8 other clients.

Since you got 3 of the 4 bars with 8 active connections, it is enough. As far as I remember, I always had 3 bars, so I guess it's the default setting. Probably, to get the last bar you will have to manually configure more nodes to connect with.

When you have 1 or 2 bars, there can possibly something wrong. Maybe your firewall blocks the port for Bitcoin (8333).


Proof of work: How are target, difficultly and number of leading zeros related to each other I'm aware of this post, this and this one.

I'm a bit confused with the terms. I don't understand how a number of leading zeros, target and difficulty are related to each other. Also, I don't understand how the number of zero's are calculated for the next target.

The target is a number which the hash of a block header must be less than or equal to in order for that block to be considered valid. This target number, when represented as a 256 bit number, has several leading zeros. The actual number of leading zeros is irrelevant and doesn't matter to anything, but us humans talk about the number of leading zeros as a way to understand what mining is doing with the target. It is easier for people to understand that a hash must have some number of leading zeros which is specified by the target than it is for people to understand that the hash is a very large number, and the target is a very large number, and that the hash must be less than the target. Otherwise, the number of leading zeros is irrelevant. The number of leading zeros is based on the target.

The difficulty is also kind of irrelevant. It is just something for us humans to understand how much work is being done to mine blocks. The difficulty is an alternative representation of the target and is just the highest target value possible divided by the current target value.

Of these three things, only the target actually matters. That is what is used to determine if a hash is valid and that is what is changed every 2016 blocks. The number of leading zeros and the difficulty are just different representations of the target to make it easier for people to understand.


What's the point of the "clean jobs" parameter in Stratum's "mining.notify" protocol? As I learn about the Stratum protocol, which allows a mining pool to coordinate work with its workers, I was curious what the "clean jobs" param in the mining.notify method means.  Per the spec -- https://en.bitcoin.it/wiki/Stratum_mining_protocol , it can be either true or false.  What I don't understand is why would it be false.  The wiki says if its false, "If false, they can still use the current job but should move to the new one after exhausting the current nonce range".  My question is what logical reason would a pool give to a miner to do this?  I'm assuming if new work comes in it means someone on the network has hashed the block and therefore there's no more potential for rewards.  So why have a worker waste his time continuing with a job that someone else has already completed?

My question is what logical reason would a pool give to a miner to do this?

To queue jobs to the miner. The server could tell the miner "here's work for you to do when you finish what you're currently working on". Since jobs are stateless and individualized (i.e. each job is only being worked on by that one user/worker), a server could queue jobs for the miner before it finishes its current job in order to avoid down time. So long as a new block hasn't been found, this is faster than the worker asking for another job when it finishes its current one.

  I'm assuming if new work comes in it means someone on the network has hashed the block and therefore there's no more potential for rewards.

That's a bad assumption to make. For a given block, there can be lots of new work. New transactions could be generated, ExtraNonce1 can be incremented to provide new work, etc.

  So why have a worker waste his time continuing with a job that someone else has already completed?

IIRC jobs are individualized, so a miner is not doing work that a different miner is doing.


How can you calculate the inverse of S component of signature, while you cannot do it in ECC to calculate private key from public key? When verifying the signature in bitcoin, we calculate S^(-1) * hash(m) * G + S^(-1) * R * pub_key and verify that this is equal to the temporary public key. Given the same logic, why can't we use it to calculate private key from public key?

for example: pub_key = priv_key * G. Modify it to: priv_key^(-1) = pub_key^(-1)*G and then take get the priv_key by taking inverse of LHS.

I just want to understand the math that makes us calculate S^(-1) in the first case, but does not allow us to do it in the second case.

The semantics of multiplication are different in your two equations.

As for the first equation. The s-part of a signature is an element in a group (represented by a number) so the inverse exists and is easy to compute (or even well known)

In the second case you take the numerical value of the private key and compute the multiple of this with a base point. With that notation the "inverse" becomes equivalent to finding the discrete logarithm in this additive group. In ecc it is not known how to compute the discrete log efficiently

I guess this answer is somewhat frustrating. I recommend learning about Groupe theory to understand the differences in notation.


How does "headers first" affect BLKxxxx.dat structure? Assuming a full node running Bitcoincore v0.10 (with txindex=1), how exactly does the new "headers first" functionality affect the structure of the blockchain data? (Specifically, the blkxxxx.dat data, though perhaps I'm unaware of other files which are ancillary to the data structure).

The README.md for the release specifies that there's no v0.9.x back-compatibility for v0.10 blockchain blk data.

  Because release 0.10.0 makes use of headers-first synchronization and
  parallel block download (see further), the block files and databases
  are not backwards-compatible with older versions of Bitcoin Core or
  other software:

  Blocks will be stored on disk out of order (in the order they are
  received, really), which makes it incompatible with some tools or
  other programs. Reindexing using earlier versions will also not work
  anymore as a result of this.

How then, does the 0.10 version blk data get parsed by the client? And by extension, why does "headers first" change the structure at all, given it seems to logically set up "a template" for the Tx data to sit?

To the best of my understanding, it's just that the blocks are stored in a different order. Headers first synchronization makes use of parallel downloads and the blocks are downloaded (and then stored) out of order. It used to be the case in older versions that blocks were downloaded and then stored in order, so that's whey they added the comment to the README.

I believe it doesn't change the structure of how any individual block is stored, just that they are now likely to not be in the proper order.


How would one relay a raw tx double spend to a node that accepts it? All of the pushtx sites reject the tx as a double spend. Would I have to run my own node through bitcoind? How would one do this?

You will have to have custom software that can broadcast the transaction for you. Basically any and all nodes and transaction broadcast services will fully validate the transaction before it is broadcast. One part of that is checking for double spends, so you will need software that does not do this. AFAIK, there is no publicly available software that does that, so you would need to write your own broadcaster.


Accidentally spent unconfirmed funds, when will they clear? I accidentally rushed when transferring some funds from my wallet before they had been fully confirmed, now the transaction has been unconfirmed for quite some time and I was wondering how long it might take to process?

Is there some way to cancel the previous transaction and execute another one now the funds are confirmed?

The transaction has the following id: aa7bd2ad6657dad1c2152edf6d7fdfd59cbc4e4385a792f741b50b32bcf68be1

Thanks for any help.

The fee is too small. So, it will take many hours to be confirmed.

Don't worry, the second transaction will be confirmed after the confirmation of the first one.
It will take many hours, but they will be confirmed.


Ludicrous transaction fees from Coinbase? I moved 0.16 BTC from my Coinbase online wallet to another one. I got 0.0017 BTC of transaction fees which looks a little bit too much. I was expecting an order of magnitude less, something like 0.00017 BTC

How Coinbase work out the fees? Is it possible to choose from different fees options?

EDIT:

I just moved a much higher volume of BTC at almost no fees, very weird :-)

Why Coinbase doesn't let the user choose the fees?

Coinbase likely calculates the fees dynamically based on the current fees being included in recent blocks. This is to keep your transaction competitive so it makes it into a block. One of the worst feelings is when your transaction is sitting there for days unable to make it into a block because the site you sent from didn't use high enough fees.

Is the fee you're reference the fee you actually paid, like your 0.16BTC ended up only having 0.1583BTC? My guess is your looking at the total batch fee on the transaction your BTC was included in rather than what you personally paid. I haven't seen my bitcoind fees as low as 0.00017 in a long time, 0.0005 is more like it at the moment, but like you say 0.0017 does seem high, especially if it that was paid entirely by you.

Its possible recent blocks contained significantly higher fees that caused Coinbase to jump their tx fees as well. As we know with the 1MB block limit, transactions have been experiencing high competition to get included in a block. But my suspicion is you're looking at the total fee for the tx that Coinbase sent out (which would include other peoples addresses).

From Coinbase: https://support.coinbase.com/customer/en/portal/articles/815435-does-coinbase-pay-bitcoin-miner-fees-?b_id=13521

  Yes, Coinbase pays the miner fees (typically 0.0003 BTC) on external
  transactions in order to ensure these transactions propagate
  throughout the bitcoin network quickly. For very small transaction
  amounts you may be prompted to pay the transaction / miner fee.

This claims you shouldn't have paid a fee at all. Is it possible you're just looking at the TX fee that Coinbase paid for your transaction?


Why can't we switch private and public keys? If private and public keys are performing the same task (although asymmetrically), but I mean each one can encrypt something that only the other one can decrypt, can I create a paper wallet and share my "private key" and just keep my "public key" private?

The ECDSA signature algorithm used by Bitcoin doesn't have symmetry between its private and public keys.  If you read about how the algorithm works, they aren't even the same type of mathematical object: a private key is an integer, while a public key is a point on an elliptic curve.  They do not, in your words, "perform the same task."  So you can't do that.  (It's not at all clear why you would want to, in the first place.)

In fact, ECDSA is an algorithm for digital signatures, not encryption; ECDSA can't be used to encrypt or decrypt secret data at all.

The property that "each one can encrypt something the other can decrypt" is a special feature of the  RSA algorithm.  In this particular cryptosystem, signing and verifying (and encryption/decryption) use the same process; people sometimes say that signing in RSA consists of "encrypting using the private key". One could interchange the roles of the private and public keys, and the algorithm would still work mathematically.   But this isn't a general feature of all asymmetric cryptosystems.

(Even for RSA, although mathematically you could switch the private and public keys, this would totally blow its security: as typically implemented, the public exponent is an arbitrary integer that doesn't have to be secret, and people usually just use 65537.  But the private exponent is hard to compute without knowing the primes used to generate the key. So if you released what was intended to be the "private" key as your public key, people would have no trouble guessing the other key as well, and then you have no security.)


Unconfirmed Transaction new can someone help me with this?
thank you
https://blockchain.info/tx-index/1b8e3e8064d28e6728212169f1479c1b359a88452854844afa562de1e6d6d800

Only wait for confirmations, the transfer is fine.

Here you can see that have 0/6 confirmations at this time: https://live.blockcypher.com/btc/tx/1b8e3e8064d28e6728212169f1479c1b359a88452854844afa562de1e6d6d800/


How do i get max and circulating supply of a Blockchain? Hi how do i get the circulating supply for etc Bitcoin, Ethereum and so on?

I am not talking about coinmarketcap's API i want to get these data myself.

Is there any tutorials on how to do this anywhere and can i do it with an automated script in PHP?

Well, you need to download your desired blockchain and find all of the UTXOs and their value, add all of them together find the total circulating supply. I would personally do it using python.


Any exchange available for using virtual cards like Payoneer? Is there any bitcoin exchange available for trading bitcoin with virtual cards like payoneer? I know there is coinmama and locabitcoin, but they are mostly P2P. Is there something like cex.io ? Unfortunately cex doesn't support virtual cards.

Thanks.

Have you tried Coinbase? They accept Visa/Mastercard of all forms, I believe. Also, they're MUCH cheaper than Coinmama.


How can Forks and Orphan Blocks be used to attack a Blockchain? So I'm trying to learn about the security aspects of Blockchains and one of the papers I'm reading (https://arxiv.org/pdf/1904.03487.pdf) states that Forks and Orphaned Blocks can be used to attack a Blockchain. Now, I've read up on what Forks and Orphaned Blocks are, but I'm still not certain about how they can be used in order to attack a Blockchain. Can anyone help clear this up for me?
Thanks.

The paper you link to includes attacks on blockchain applications as "attacks on blockchain". Personally I would restrict "attacks on blockchain" to literal attacks on the underlying blockchain rather than applications built on top. Regardless there are a number of theoretical attacks on blockchains (51 percent, selfish mining etc) but I don't think we have any evidence of them being executed on Bitcoin at least.
Selfish mining is when miners collude to withhold newly mined blocks and start mining on top of them without announcing the newly mined block to the network. It is not an attack on the blockchain per se, rather than the profitability of other honest miners. In this case honest miners may mine a block that ends up getting orphaned because they were unaware of the latest blockchain tip.
A 51 percent attack on the other hand is most definitely an attack on a blockchain. If a miner tried to execute a 51 percent attack (with 51 percent of the network hashrate) they could theoretically include a double spend in the chain with the most accumulated proof of work. In practice the attack may fail as full nodes on the network reject the chain with the double spend in a block and fork to a chain that doesn't include that block. This resource from MIT highlights some examples of attempted 51 percent attacks on blockchains other than Bitcoin.


How big is the bitcoin community 1st of Feb. 2012? I really do not know what kind of metrics are available for measuring the size of the Bitcoin community, but I am interested in any metrics indicating how many users of Bitcoins that there are. Some example metrics could be:

Number of registered users on forums
Number of wallets
Number of wallets with bitcoins in them
Number of non-mining clients running
Number of installations of default client

It would be excellent to see these numbers in relation to some numbers, like the size of the BitTorrent community (or maybe the old Napster community) or whatever, to get a better understanding of the number, but this is not necessary.

Have a look at:
http://bitcoinstatus.rowit.co.uk/

Nibor on the bitcoinj mailing list has created a whole series of charts about the bitcoin p2p network.


Can anyone explain these bandwidth download spikes that are linked to bitcoind? I am running bitcoind on a linode.com vps server and they provide some really great graphs to the owner of the account.

I logged in and noticed these spikes the other day: http://i.imgur.com/aWoWfie.png

Every minute that those graphs were being generated, bitcoind was running at about 400MB of memory usage and exactly 10 connections to the Bitcoin network.

Any anyone explain the green download spikes shown in the picture I linked to above?

I am positive that I did not upgrade my system or perform and other downloading during the time frame seen on the graphs.

The green in your graph indicates outgoing traffic. More than likely, those spikes indicate transfer of blockchain or unconfirmed transactions to newly-initialized nodes in the Bitcoin network.


How can an online wallet be more secure than paper wallets or cold storages? Recently, after I was reading that some bitcoin early adopter lost 750 BTC due to theft from his macbook, I was looking for the most secure storage solution for my coins.

I already know about paper wallets and cold storage solutions but I somehow came across reading about multisignature online wallets being more secure than the traditional systems.

I came across BitGo.com and they claim to be more secure than paper/cold storage but as easy to use like an online/mobile wallet:

Is this really possible? I was doing some research myself and learned they are using multisignature wallets with three private keys:

One encrypted private key holds BitGo with a passphrase only known by them.
Another encrypted private key holds BitGo with a passphrase chosen by me.
One encrypted backup key which only I hold with my own passphrase.

Now there are several use cases, I tried to deposit and withdraw some small amounts, and it's really easy. It seems they use their key on server side an my key on client side to sign the transaction. All I have to do is entering my passphrase to unlock the key.

In addition, if BitGo ever ceases to exist I can still use my own two keys to access the coins without using the service offered by BitGo.

But, to be honest, this sounds to good to be true. Now I'm wondering:

Is there a way BitGo (or an attacker who compromises BitGo) can access my funds because they hold two keys? Or is this really trustless because all depends on my passphrase?
Isn't entering my key's passphrase at their website a weak point which could be abused by attackers (or even the service)? Or is my password really only processed client-side?
Is such a solution really more secure than cold storages?

I tested it by creating a secure wallet on BitGo.

They gave a multisig address for deposits. 2/3 of keys are needed to withdraw Bitcoins. BitGo holds one key, you get private key and backup key.
You don't need to printed private key to withdraw Bitcoins. the passphrase is enough (apparently the key is derived form the passphrase).

BitGo cannot do Bitcoin transactions without user consent, because they (claim to) lack the other halves of the key. This protects againt some attacks. E.g. the site doesn't have a hot wallet which could be emptied if there is a breach on the server.  BitGo forces SMS two-factor authentication to be activated upon sign up. This is good too, protecting against lose of credentials due to stealing or phishing.

If the BitGo infrastructure gets compromised all created wallets after the compromise are compromised too, as the attack can capture keys upon creation. So ultimately you are placing trust on BitGo. They could also blatantly lie you and hold all copies of the created keys, as they are creating the keys, not you. Even if the key creation happens in a web browser using JavaScript you are trusting the code they give you to run.

BitGo is still an online site. If you store your passphrase in a password manager or web browser and your computer gets infected you can lose your Bitcoins, even without interaction from you. BitGo is also subject to malware attacks which modify the withdraw requests in-fly. However "the mad general problem" cannot be solved if you are not doing any checks outside the online world e.g. manual phone calls and confirming by voice. You always need to trust the device you are using to do the withdraws.

BitGo has a nice process and good instructions how to create a multisig wallet and they are also holding a third key themselves, which you can access through password and SMS confirmation. You could create a similar set up yourself, even in safer manner, but BitGo may save you from some hassle. BitGo is also safer than any Bitcoin wallet service where you hold no private keys at all.

The conclusion: lots of marketing promises, ultimately an online site, but may be safer than your average Bitcoin wallet service. You need to trust BitGo. Not safer than your own cold wallet / multisig solution if you know what you are doing.


Namecoin: is there any rationale behind the (apparently foolish) choice of having the domains cost an irrelevant price? When I first heard of namecoin an address costed 50 NMC, now they are priced 0.01 NMC.

This means they are as much as free, and the only thing preventing someone from just brute-force registering tons of them is... that it is pointless to do so, because due to this problem itself, namecoin is essentially a worthless project.

Using a bitcoin-like currency to handle DNS was a nice idea at first, and I have no clue about what could have caused them to mishandle the design so much.

Question is, did they state somewhere the reasons behind this apparently foolish decision to set the registration prices to "basically free" after a little while? Didn't anyone point out how stupid that idea was?

When I first looked into this issue the low price for name operations struck me odd, too. But the rationale behind it is to allow to register as many names for as low a price possible. You need to realize namecoin is not only about domains and the dot-bit project is only the first large namecoin project. namecoin is a generic name/value accounting system.
Still, because dot-bit was the first project based on namecoin the design had an initially high price for registering names to prevent squatting. Actually it worked very well, if it had not been there I and others would have registered thousands of domains much earlier.

there was a discussion about fees and thoughts about modifications here: http://dot-bit.org/forum/viewtopic.php?f=2&t=360

By now almost a 60000 domains have been registered so imho it is more important to have low name prices to allow other usage of the namecoin system than to further prevent squatting: possible use cases


How to create a valid BTC Block? I know Javascript is not the Language for this matter, however i believe it's the easiest to understand and would be very easy to anyone to port to any other language.

what i am trying to understand is how do i "hash" transactions, "create my own 12.5" transaction concat, append, rehash, hash it once again... as i see here and there...  it all seems very confusing, anyone could explain a bare basic implementation of step by step on what is needed in order to create a valid btc block?

my ultimate goal is to get any random block here https://blockexplorer.com/, and using the exactly same nonce as input recreate the same result

Your question involves quite a bit.
Mining is done with conjunction of a wallet.
A lot of the work is handled by the wallet.
See the RPC getblocktemplate
Also run help getblocktemplate to see more information, that will point you to a few BIPs (B22, 23, 9, and 145) for further reading.

Basically (simplified) you do a getblocktemplate and then you repeatedly hash it (while incrementing the nonce) to get a hash that meets the difficulty criteria.

I hope this is enough information to get you started


Regtest not paying address in mined block I have set up a local 5 node bitcoind regtest network with unique ports using compiled bitcoin core 14.2. I can generate blocks, send transactions between nodes, and mine those transactions using a python miner that I constructed. However, the payout for mining always goes to the node that I last generated 101 blocks and not to the address in the minded block for the node I am using to mine.  I have verified that the correct address is included in the mined block and have started to look at the bitcoid code to see what might be happening on that side of the equation. When I spin up the 5 nodes I am using the same binary but with different command line config params.

I am new to bitcoin and have been doing this for the past two months to learn how it works.  I've tried researching this problem and so far nothing has turned up and I will continue to debug the miner and core.  In the meantime, I would greatly appreciate if anyone has any suggestions about what could be going on and how to address it.

Thanks,
:D

Newly generated coins cannot be spent until 100 blocks have been mined on top of the block creating those coins. This requirement means that it will seem like the address from 101 blocks ago was paid, but rather it is just that the coins mined 101 blocks ago are now spendable.


What if the bitcoin blockchain grows to the point it cannot be decentralized anymore? I read the bitcoin white paper and am in the process of readin ethereum's. The second paper reads at one point : "Currently, this is viable for some desktop computers and not phones, and later on in the future only businesses and hobbyists will be able to participate."

Doesn't this mean that some day the remaining blockchain nodes will only be controlled by the very few ones that have the money and infrastructure required, as the smaller nodes won't be able to stay on the long run ?
Doesn't this mean that as time goes, the blockchain becomes less decentralized and more centralized ?
If so, another consequence would be the decreasing security of the blockchain : the remaning powerful nodes would gain the ability to fake transactions, right ?

How Bitcoin will scale into the future is a topic of much debate.  I will try to steer clear of too much opinion, and just give you the basic factors at play.

First, understand that there are different types of nodes on the Bitcoin network.  There are nodes that mine, there are nodes that keep full copies of the blockchain, and there are thin client nodes that only store the information required to maintain a single wallet.

The thin clients are what make up the vast majority of network participants, since this is what a normal user of the Bitcoin network will be running.  Since they don't store the blockchain, they don't care how much it grows.  The other two types of nodes are the ones where we are concerned with centralization.  They are what really represent the infrastructure of the system.

First, there are "full nodes", which keep full copies of the blockchain on hand.  These nodes provide requesting clients with historical blocks and transactions stored in their databases.  They also relay current transactions and blocks to other nodes, and verify the validity before passing the data on to other peers.  This provides the "plumbing" of the network and a first line of defense against malicious network participants.  It should be stated that there is no direct financial incentive for running a full node, yet it does require you to store the full blockchain (although some pruning is okay).

Second, there are mining nodes.  As the network has evolved from the specs laid out in the original whitepaper, mining nodes have become hyper-specialized.  Where at first, all full nodes had the option of mining, nowadays nearly all mining is done by mining pools.  These pools run their own networks of participants, and those participants only deal with hashing blocks they receive from the hub of the mining pool.  The nodes actually doing the mining are not running full nodes, but are relying on the mining hub to run full nodes and participate in the Bitcoin network.  Although the miners, themselves, can be very decentralized, there is already a certain degree of centralization of mining pool operators.  However, this is not due to the size of the blockchain, which is a negligible cost to a mining pool.

So, as the blockchain grows, it makes it less and less feasible to run a full node, yet this is not a problem for mining nodes and pools.  Full nodes are not paid for their service, so it becomes harder to justify running one if the data storage becomes expensive.  Luckily, data storage costs trend downward at a geometric pace, while the blockchain grows linearly (currently ~1MB/10min).  This means it is still feasible to run a full node for the foreseeable future.

I should also note that although there isn't a direct financial incentive for running a full node, there are several indirect incentives.  Running a full node allows a network participant to operate in a trustless manner.  This is important to many people for a variety of reasons.  For example, any online wallet or exchange company would typically need to run their own full nodes so that they don't have to rely on others for their core business.  There are many other reasons to run a full node as well, which will help to counteract centralization.


How does Bitcoin currently mitigate Sybil and Eclipse attacks? What countermeasures does Bitcoin currently have in place to limit Sybil attacks (ie of full nodes [not miners]) and eclipse attacks?

In particular, it seems like an important countermeasure would be to attempt to give your connections only about as much resources (bandwidth/processing/etc) as they're giving back to you, so as to ensure that a sybil attacker must cost approximately the same amount as an honest node. But I get the feeling this doesn't exist. Does it?

Are there other countermeasures in place currently?

A sybil attack is prevented by using proof of work. Overwhelming the network with nodes cannot substitute for the hash power required to create the proof of work that must be presented in order to get the network to accept a new block.

An eclipse attack is more difficult to prevent:

  Bitcoin Core only makes an outbound connection to one IP address per
  /16 (x.y.0.0). Incoming connections are unlimited and unregulated, but
  this is generally only a problem in the anonymity case where you're
  probably already unable to accept incoming connections. See
  https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack.

As far as I'm aware there is no such logic implemented to equalize the network resources between nodes.


Why are r and s modulo N? (not P) As Peter Wuille mentions here, the ECDSA signature values (r, s) are modulo N (eg verifying ECDSA signatures, where u1 = z * w % N), whereas the rest of the ECDSA functionality in Bitcoin seems to be modulo P.

Why is this so?

Good question! There are two concepts here. The finite field Fp, and the EC Group defined by secp256k1.

In Fp, elements are just numbers modulo p. Addition, Subtraction, Multiplication, and Division are all defined for this finite field.

In the EC Group, however, each element is a pair of elements in Fp, such as (f1, f2). You can add and subtract these pairs to get different pairs, but the addition and subtraction has little to do with the addition and subtraction of elements of Fp (technically it uses those operations under the hood, but it's not direct addition. That would be pretty boring if (f1, f2) + (g1, g2) just gave you (f1+g1, f2+g2)).

Also note that since these pairs are a mathematical Group, rather than a field, there's no way to multiply two pairs. You may have seen the syntax k*G before, but this is just shorthand for adding G to itself k times, k is an integer rather than another element of the EC Group defined by secp256k1.

Additionally, if you look at the ECDSA algorithm, you will see that here the final elements are (r, s), but just because it is a pair does not mean it is a pair that lives on the secp256k1 curve! This is a pair of integers mod n (the curve order), as defined by the algorithm, not a point on the curve.


What is/are the first proposal(s) of blockchain or alternatives? I am writing a thesis about blockchain and part of my writing is the history of blockchain, so far I found the first proposal was “How to Time-Stamp a Digital Document” in 1991 by Haber and Stornetta. Source: https://www.quora.com/What-is-the-history-of-blockchain-technology

The second proposal was by the unknown Satoshi Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System”.

So my question is there any other proposals before the Bitcoin implementation of blockchain?

In addition to "How to Time-Stamp a Digital Document", in 1992, Bayer, Haber and Stornetta incorporated Merkle trees to the design, which improved its efficiency by allowing several documents to be collected into one block in a book "Improving the Efficiency and Reliability of Digital Time-Stamping"


How is it possible to launder bitcoins? Some services, such as bitcoinlaundry.com, claim that they can launder your bitcoins.

Since all bitcoin transactions are publicly logged, how is this done? Wouldn't it be possible to trace back the transactions and find out the initial address?

Say I received 10 bitcoins on a Bitcoin address I publicly advertise for donations. Anyone looking at the blockchain can put that address in a search engine and find me. Now say I want to use those 10 bitcoins to buy drugs. If the drug dealer's bitcoins are traced, they'll point right back to me.

Now I can create a lot of accounts if I want. And I can pass the 10 bitcoins I received through those accounts and then to the drug dealer. But likely because those accounts aren't used anywhere else, the trail would still lead right from the drug dealer to me.

Now suppose I put my 10 bitcoins in an account created just for me by a Bitcoin laundering service. And you and Fred do the same thing. Then the service sends my coins to Fred and your coins to me. Then I spend the coins I got on drugs. Now the trail looks exactly the same as in the non-laundering example, except the  trail leads straight to you instead of me -- a pretty good deal for me, not so much for you.


Are the keys in a multisig transaction output hashed? Pay to public key hash scripts hash the recipients public key for added security.

Is the same done with the public keys that make up part of a multisig script?

https://en.bitcoin.it/wiki/Script doesn't seem to indicate they are.

Typically, you will use P2SH (pay to script hash) for multisig transactions, which means the transaction output does not contain the full script (with full public keys), but instead a hash of that script - and the full script is revealed when spending. See BIP16 for more information.

When this is done, you get the same effect: the transaction output does not contain a public key directly.

Note that there is indeed a  small security benefit to this (it takes 2^160 steps in theory to reverse the hash function, while it takes 2^128 steps to find a private key for a given public key), but there are larger advantages (like the sender not needing to know the full script, and less data in the database of unspent transaction outputs that every full node maintains).


What's the proper way to scale p2pool? At the moment I have ONE linux server acting as the "APP" server for bitcoind/p2pool applications and another linux server with nginx proxying web traffic from the APP server, while behind CloudFlare.

What would be the proper way to scale out p2pool in this scenario? My thoughts were:

Create a cloud load balancer for the APP servers
Take a server snapshot of my single APP server
Spin up 2 more servers from that server snapshot and place them behind the load balancer
Update the DNS to point to the floating IP of the load balancer

Is this the proper way to scale up p2pool ?

Disclaimer: There is no "proper" way to do anything :)

Some people think that P2Pool is hard to scale. But it can be scaled easily by dividing it into smaller pools that feed into the main pool.

This is beneficial for a lot of reasons but two important ones that come to mind are hardware restrictions (like what you seem to be getting into) and small miners being unable to revive payouts because of P2Pool's sharechain's difficulty.

This could be done any number of times, in a peer-to-peer way to achieve an acceptable difficulty; and eventually it will have to be done multiple times, if, for example, the P2Pool difficulty is in the petahashes, and people are still mining in the kilohashes

This could also be done with non-peer-to-peer, "standard" pools (and has been done), by having them feed into the P2Pool network.


Bitcoin stuck, not syncing I recently converted from Chakra Linux to Opensuse 13.1 without formatting the home partition (I took a chance) and didn't have to do the usual reloading of email, documents and bitcoin started working straight away after I installed it from opensuse repo. Chakra installation had bitcoin-qt 0.8.6 and opensuse loaded bitcoin-qt 0.9.1. So, basically, it found the files in the home partition and seemed to carry on from there. I do have a backup from before the conversion. Bitcoin 0.9.1 did add a quite a few blocks before the error. So, maybe it wasn't the transition to opensuse that did it.
Now the wallet is six days behind. Here is quote from debug.log. It is 'catching up' from block 297123.

2014-04-23 20:59:35 ProcessBlock: ACCEPTED
2014-04-23 20:59:45 UpdateTip: new >best=000000000000000087be011f611f80fd4d3d917780a27850fb878512f492f828  >height=297123  log2_work=78.143683  tx=37308919  date=2014-04-22 09:43:51 >progress=0.993196
2014-04-23 20:59:45 ProcessBlock: ACCEPTED
2014-04-23 20:59:56 ERROR: CScriptCheck() : >447f1be22db9cca6b7539a66b54f99ea11c1c0316a72915d34d8a1c86d00ebcf >VerifySignature failed
2014-04-23 21:00:03 EnvShutdown exception: Invalid argument (22)
2014-04-23 21:21:02 CheckForkWarningConditions: Warning: Large valid fork found
forking the chain at height 297123 >(000000000000000087be011f611f80fd4d3d917780a27850fb878512f492f828)
lasting to height 297131 >(00000000000000004866bff18fa3e4378486920d6b9dc7f332f9f0bc18bd247e).
Chain state database corruption likely.

Any suggestions on how I should proceed?

A signature check failed for a valid transaction. This likely indicates a CPU or RAM problem with the system you're running on (even though you don't see regular errors in normal operation, Bitcoin does so many computations during validation that it's likely to see them more).

The result of this is that bitcoind marked the chain this transaction was in as invalid, and rejects new blocks in it.

To rebuild your database, you can start the client with the -reindex flag (if you exit while rebuilding, it will pick up where it was stopped on the next run).

One workaround that helps in some cases is running with -par=1, making validation only run in one thread. This seems to reduce the load enough to make some CPUs not cause errors anymore.


Why does bitcoin not have something like nicknames? It would be much easier to exchange bitcoins if everyone could have one or more unique nicknames on the blockchain. Of course what should not be possible is that other people can check the balance by just using a nickname. Wouldn't there be any technical solution to achieve that?

In bitcoin, there are no usernames, just addresses that are derived from cryptographic keypairs. Since an address is derived mathematically, when each node hears about a new transaction, it can simply use the right math equation to independently verify that the rightful owner of an address is attempting to spend the address' funds. This is done via cryptography, using asymmetric keypairs and cryptographic signatures.

In your example, each user could claim a username, but now we have a problem: how will everyone know who owns each username? How can I confirm that you are the rightful owner of your username, and consider your transactions valid?

A website that has usernames/passwords keeps a central database with all of them stored, so when you sign in, their server can check your password and allow you online. But the bitcoin network does not have a centralized server on which to store usernames/passwords. Instead it is a decentralized network of individual users.

So, you could have every node store all of the usernames, but that could becomes really resource intensive! And also very bad for privacy (remember, all of the blockchain’s transaction are a public ledger). For these reasons (and probably some others), storing usernames requires a more complicated solution for a decentralized network, whereas the addressing scheme used in bitcoin works quite well, even if addresses are tough for humans to read.

It is worth noting, there have been 3rd party services that allow you to claim a username, and then if someone wants to pay you they can do something like visit a URL (eg. www.nicknamePay.com/sebbo) and be presented with a btc address. In that example, the website could manage you wallet for you, while you can just tell associates to visit an easy-to-remember URL.


What is the relationship between the Digital Signature and the Public Key So, I can see this is in the unlocking script:

<Cafe Signature> <Cafe Public Key>

Taken from mastering bitcoin. What is the difference between the two? I don`t find it easy to google.

They are very different. If you look at their byte values, you will notice that they are different lengths and have different formats.

In essence, public keys are identifiers and signatures are cryptographic proofs.

A signature is produced by taking a private key and a message and performing a signature algorithm with those two pieces of data as inputs. For Bitcoin, we use the Elliptic Curve Digital Signature Algorithm (ECDSA). In Bitcoin, the message is a modified version of the spending transaction.

A public key is derived from a private key and can be broadcast publicly. It is used in the verification algorithm for ECDSA to verify that the private key for that public key was the one that produced a signature for a given message.

So the signature is a proof that the private key for the specified public key endorses are particular message. In Bitcoin, it means that the owner of the private key approves that spending transaction.

Additionally, signatures are generally one time things. They change with the message. You can also get two different signatures for the same message and private key combination. Those two signatures will still be valid and are valid independently. Conversely, public keys (and private keys) are permanent. They don't change unless you replace them.