How to import a HD wallet from an extended private key

Response to clarified first part

You're pretty close, I suspect you want something simpler like this (and then typing in the xprv you extracted from an Electrum 2.x (unencrypted) wallet file):

bx hd-private --index 2 --hard | qrencode -o - | feh -

In particular, don't include the bx hd-to-wif step, that's probably what's tripping you up.

When you do the import/add-new-account in Mycelium (2.3.0+ required), make sure you're choosing the Advanced option, and then do the scan.

Once you're done, the resulting keys/addresses will be along a path of m/2'/c/i.[1]

If you ever need to do a recovery (i.e. if you lose your phone), you can import the same xprv you imported into Mycelium into a new wallet in Electrum (using the restore wallet option). It may not be documented, but Electrum 2.x will also accept an xprv during a restore, and then it will generate the same c/i path that Mycelium uses for imported xprvs.

I haven't tested any of this though... please test it out before relying on it!

Response to original first part

(this is mostly irrelevant to the clarified question)

To answer the first part of your question:

An Electrum 2.x extended master private key can be directly imported imported into Mycelium for Android (version 2.3.0+), no conversions or path derivations are required. It will result in the same list of addresses being generated in both Electrum 2.x and Mycelium. It turns out you were just overthinking the problem ;-)

This means you can just run qrencode -o - | feh - and paste your extracted xprv directly in.

More details on inter-wallet compatibility can be found here: https://bitcointalk.org/index.php?topic=1000544.0. For your specific case of exporting/importing an xprv, you can look at the third tab in the referenced spreadsheet.

Incidentally, the reason they are compatible isn't obvious. Both use BIP-32, however (as Wizard Of Ozzie already pointed out) Mycelium uses a path of m/44'/0'/a'/c/i, whereas Electrum 2.x uses a path of m/c/i.[1]

What makes them compatible is that Electrum 2.x exports the master key at the root position, however Mycelium assumes that the key was exported at the m/44'/0'/a' position. Mycelium then derives keys by appending an additional c/i path to the imported key, which is the exact same c/i path with Electrum appends to it's root key (m). A diagram might be more clear:

Electrum 2.x:           m/c/i
Mycelium:     m/44'/0'/0'/c/i
                       ^^ key being exported/imported

[1]:
a = account index
c = 0 for external, 1 for internal (change)
i = key/address index
' means hardened


BIP32 HD Wallets: HMAC vs. "just" Hashing the Seed

I found this answer by David Schwartz under the cryptography tags in stackexchange, it may answer your question: HMAC . It basically states that HMAC is smaller in size and takes less CPU to compute.


Are coinbase.com purchases effectively bitcoin futures?

One they credit your account you can transfer your bitcoin out to another wallet, you do not have to sell it through them, but you could at a later time if you wanted to.

Unfortunately Coinbase is also known to just cancel an order if the price sharply rises between you placing it and them delivering the bitcoin, your US dollars are then returned to your bank.


What are the major components of a bitcoin full node's bandwidth usage?

Receiving transactions from other nodes
Sending transactions to other nodes
Sending the entire blockchain to other nodes so that they can sync

Note that with compact blocks, block relay does not consume nearly as much bandwidth as it used to. Compact blocks allow blocks to be relayed with way less data. The bulk of a node's bandwidth is taken up by transaction relay.


how to calculate the inputs to raw transactions?

The structure of a transaction is documented in the tx section of the Bitcoin protocol specification.  To make the inputs, you need to find outputs from previous transactions that have not been spent yet, and you need to write a little script to unlock each output.

The script that you write will run first, and it will put some data on the stack in the script's execution environment.  Then the script that was embedded into the transaction's output will run, and it will evaluate whether your script supplied the right data.  The scripts of the outputs generally are pretty simple and only follow a couple of standard forms, so if you can recognize which form it is then you should be able to come up with an input script that satisfies it.  You might look at the isStandard function in Bitcoin Core to understand what scripts are standard.  The Solver class used there is problably the class that generates an input script for an output script; essentially it solves the puzzle of producing data that will be accepted by the output script.

I think if you follow the links above and look into it you should be able to figure out what is going on.


How is 'profitability' calculated on Coinotron?

It divides the block rewards given multiplied by the value of the currency in USD by the difficulty to generate a this same reward on each cryptocurrency.


Why did they have to expand the nonce value range?

They didn't. Nonce is still 4 bytes [1]. Miners don't have to wait when they run out of nonces. Miners just adjust another nonce (the extraNonce) in the first transaction (i.e., in scriptSig of the coinbase transaction [2]). That gives them another ~4 billion tries for the first nonce.


Are all 'metal wallets' functionally equivalent?

Just to be clear/nitpick, the products you've linked to are designed to act as highly resilient physical backups for a bitcoin wallet. It doesn't really make much sense to refer to these metal plates/etc as 'metal wallets', as they cannot perform any normal wallet functions (send, receive, etc). Rather, they are just a way to store a backup for the seed that will (re)create your wallet using the appropriate software.

Within the context of wallets, is it correct that a metal bitcoin wallet needs to store both public and private keys?

Not explicitly. These days when you create a new wallet you will likely be presented with a mnemonic seed phrase, in the form of 12/24/etc words. These words are the backup for your wallet, if you input them into some wallet software (and follow the correct derivation path) then you will get access to your wallet.
So these metal backup plates are built to have your seed phrase engraved into them in some way or another. By using metal, you can protect your backup against things like fire or water damage.
Note that you could engrave a private key itself into metal, but given the chance of transcription error, you can perhaps see the reason that mnemonic seed phrases are very popular: they are human-readable and thus easier to error-check. A mistake could be extremely costly! You don't want to lose access to your bitcoin.

I'm looking at some metal wallets and want to clarify that the're all basically the same in that they'll give you different bits and bobs which are then must be physically arranged?

The function of them is the same: keep your mnemonic seed phrase safe. So if you use one, you should choose a design that you find to be:

durable
easy to set up
easy to understand
secure against accidental scrambling (what happens if you accidentally drop it? etc)
easy to store securely

Maybe there are some other considerations, but those are the obvious things that come to mind at least.

One consideration that is less obvious: purchasing a product like that can be really bad for your operational security / privacy. The company you purchase from will likely have a database of all past customer information. As example: not long ago, there was news that a major hardware wallet manufacturer' customer database was hacked, and customer information was stolen (note that no BTC was compromised). Since then there have been reports of phishing attacks targeting those people, since they are obviously bitcoin users.
With that in mind, consider the option of instead just purchasing:

an alphabetical metal punch set
a hammer
a stack of wide flange washers
a nut/bolt of appropriate size to fit the washers

You can then stamp each word onto a washer. Be sure to number them as well, so that you can ensure they don't get scrambled out of order (this would be very bad!). If you want, you can just stamp the first 3-4 letters of each word, since no two words in the BIP39 list have the same first 3 letters.
This is a very simple, secure, and private way of backing up your wallet, which will probably be cheaper than any of the products listed on that site, especially after considering the price of shipping.
This is what a metal punch set looks like, for reference:

Or, are some metal wallets etched or otherwise "written" and then sent to the user? Because that seems a very trusting act, to provide a private key to some third party.

NO. You should absolutely not ever use a pre-engraved product, creating private keys is something that the user should not be trusting a third party to do. You leave yourself at risk of theft from the third party, any one of their contractors, postal workers, customs agents, etc.

I would think something like: 'minting physical bitcoins' would the point of such a wallet. Obviously not minted, but just storing the public/private key on metal for reference.

The Casascius coins you linked were created as collectibles, more than secure offline storage, but in principle the function is similar. Note that those coins contain the info for private keys, that were generated by the coin's creator, so he is a trusted third party in this case (in spite of the warnings above).
You may also be interested in a product called the OpenDime (disclaimer: I have nothing to do with OpenDime, and have never used one, but they look cool), it allows for physical transfer of bitcoin without requiring trust that your counterparty will not keep a copy of the private keys. Note however, that the Opendime is NOT recommended for longterm physical storage, so while it is physical, it is functionally different than the backup methods described above.


Ardor Transaction was generated on a fork error

I got this same exact error when I tried to sign a mainnet transaction using a testnet API, so, make sure you are using the same network..


Tracing Bitcoins to their original blocks

Yes you can, every transaction in the bitcoin network is registered in a public ledger called blockchain. You can query this ledger via http interface like https://blockchain.info/api/blockchain_api

I don't think will be costly but it depends how many hands your bitcoin passed. When you find transaction without a sender, you have to stop, this are mined (generated) blocks


Can someone explain what exactly is derived address?

Your address does not change. Probably your wallet is showing you only those addresses that have non-zero balance. It is called derived addresses because they are generated iterating over the index number according to the BIP-44 derivation.

  What is the maximum number of Derived Address for m / 44 / 0 / 0 / 0 / * ?

That is capped by the index number, which is 32 bits. So you will be able to generate 4,294,967,296 addresses. However, the the first 4,294,967,296/2 = 2,147,483,648 are reserved for non-hardened derivation and the other half is reserved for hardened derivation.

  Are all the address valid and working? Meaning, can I send a payment to any of the address from the Derived Address and will I still get the cryptocurrency?

Yes, if you control the private key related to the address, you control the bitcoins sent to that address. Using the seed words, any decent wallet would be able to generate addresses using the BIP-44 derivation and the private keys that control them.

  If I import any listed Derived Private Key to another wallet, can I use the funds in there?

Private keys derived from the extended private key is no different from other private keys. So if you import that private key into a wallet, you will be able to control the funds sent to the address generated from that private key.


Does it also work the other way - that is, does transaction with high fee pays for child transaction that has low fees, given that they are both in the mempool? Or is the policy only "one way", from child to parent.

The policy is one-way: the parent doesn't pay for the child.

The child can't be included unless the parent is included, so effectively the miner can choose to include none of them, only the parent, or both the parent and the child.  The miner will choose what pays the most for its resources. This means sometimes it will include a low fee parent in order to be able to include a high fee child but it only works in that direction.


"Bittrex ... out of option" ok, i noticed, but if you ask "Which exchanges are good for altcoins?" the answer i think is mainly:
binance, poloniex, bittrex, cryptopia, yobit


Is there some resourses where I can sell pc time for mining?

A PC's general purpose CPU is so far outclassed by specialized mining chips (ASIC's) that its value for mining is almost null. Perhaps the only instance where a PC could be useful for mining is at the very beginning of a crypto-currencies life cycle, when has just been launched, and very few are mining it. But when ASIC mining hardware joins the coin's network, difficulty will rise and render CPU miners inconsequential.
If you expand the definition of PC to include ASIC mining hardware, then the idea of selling hash power is interesting though. I found the following reference to this idea: https://en.bitcoin.it/wiki/Hash_Market


How do people know that less than 1000 people own 50% of all bitcoins?

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

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


What does it mean to "password protect" your wallet on Multibit?

Your wallet.dat file contains your private key. By default this is saved in clear text. Meaning that anybody who gets a hold of this file, could see the private key and therefore spend your money.

When password protecting this file, to see the private key, you need a password. MultiBit uses a well known Java library to "password protect" it. It's all open source and well peer reviewed.

If you don't trust MultiBit you can still encrypt your wallet.dat file using other software. You must also understand that if you decide to unprotect your wallet file, it's not necessarily the case that people will be able to steal your money; they would still have to get a hold of the wallet.dat file.

So, it's best practice to password protect it, so in case you lose your file, or a hacker enters your computer, they won't be able to spend your money because they would need the password.


Have any books has been written about Ripple and Litecoin?

I found a few books on Amazon that may interest you.

Ripple Book

Generic book explaining Ripple

Litecoin

These books can be very generic.
For understanding the technology, I would recommend that you read the white-paper (yellow-paper if super interested).

Whitepaper-Ripple

Solutions using Ripple

Ripple whitepaper explained

Video Resources

Ripple consensus algorithm explained

Litecoin explained by its founder

P.S. As of writing this answer, there's no official whitepaper for Litecoin, as it is a fork of Bitcoin and uses similar underlying technology with the claims of being faster than its predecessor.


All you need to receive funds is a valid bitcoin address. To create a bitcoin address, users will generally use some software that is capable of creating the cryptographic keys that the bitcoin address is derived from.

So, in the most simple terms, all you need to do is download some Bitcoin wallet software, which will then provide you with a bitcoin address you can receive funds to. All you need to do, is copy that address and send it to the person who wants to pay you.

Note that for every payment, you should send a new receiving address (any good wallet will give you a new address automatically each time a payment is received. This is very important for your privacy (and the privacy of those you transact with).

  Do I need to make a transaction with an existing account before receiving first time payments to legitimate verify my account?

Absolutely not.


Where Bitcoin is kept and what fees are included when liquidating Bitcoin

Bitcoin "banks" are markets, not savings institutions. When you buy a bitcoin, you have bought a bitcoin; the money becomes the seller's. When you sell a bitcoin the money becomes yours and the bitcoin becomes theirs; similarly when you buy something with a bitcoin.

Since the value of bitcoins is not nailed down, there's no question of a transaction fee; you just agree with the other person on what the price of the goods is in bitcoins (or on what the conversion rate to/from other currencies will be). If you don't like the price or rate one person charges, you go elsewhere.


My wallet won't load because it says it contained a duplicate transaction. Are my coins lost forever or can i load it some other way?

This was a bug that was fixed in v0.4.1 (26 June 2012) so I presume you are running an earlier version. If you download the latest version from multibit.org your wallet should load ok.

Sorry for the inconvenience.


Can Cryptocoins be spent through payment services?

No, a cryptocurrency wallet does not itself have any link or correspondence to fiat (traditional) currency. If the payment processor doesn't explicitly support Bitcoin or other cryptocurrency, then they are not interoperable.


Are there any example of Bitcoin being used for IOT application?

That makes no economic sense. If such a thing did make economic sense, everyone would already be doing it, raising the difficulty until just the point where it no longer made sense. There is no way the bitcoins generated could justify the additional electricity consumed.

This is equivalent to arguing that if you have a bit of ground beef left over from making tacos for your family, you can make a hamburger and sell it to compete with McDonald's. McDonald's is 100% optimized for making and selling hamburgers cheaply. There is no way you could justify the costs involved in making and sell a single hamburger.

The supply of newly-mined Bitcoins has a fixed, known rate. If the most efficient miners spend X dollars to mine a Bitcoin, then they will increase the amount of mining until it costs them almost X dollars to mine a Bitcoin. Unless you can compete with their efficiency, which you can't because everything about their operation is intended to maximize their efficiency, you will lose money.


Where are the BTC from my paper wallet gone?

It seems someone obtained your private key. If you are sure you did not authorize this transaction, consider that paper wallet compromised and never use it again. If you generated the wallet online (just by opening the website), your keys may have been stolen by malware / keylogger of some kind.

If you need to generate a paper wallet, a better way is to download the source code and run it on a computer disconnected form the Internet. Disable all browser extensions or use a freshly installed and up-to-date browser (e.g., if you usually use Chrome, install Firefox just for this task). Check your computer for viruses.


Are Ripple IOUs e-Money under European law?

This all depends on what asset the IOU represents and by extension what it can be used for.

If in the case of USD or EUR etc they are accepted for payment of goods or services by a third party who is not the issuer then they are e-money.

In this case the issuer has to be either authorized or registered as an Electronic Money Institution (EMI).

The key difference between this and a deposit account is that no benefit can be given for holding on to the e-money over time such as interest.

They are redeemable for face value minus any reasonable charges.

Ripple IOUs can also be for bitcoins for example. However since they are not considered legal tender - you cannot pay your taxes in bitcoins for example, they are considered barter or the same as gold. These IOUs are not e-money.

If I were to issue Ripple beer IOUs which could be exchanged in any pub worldwide for a beer these would still not be e-money if they were only exchanged for beer since this is a closed market. I could not use my $50 worth of beer IOUs to buy a book for example. If book stores and other establishments started accepting them at face value then they would become e-money USD.

The UK FCS does a good job of explaining

http://www.fca.org.uk/firms/firm-types/emoney-institutions


How to run my own Ripple RPC server (full node)?

error: control directory has bad permissions 777 (must be >=0755 and <=0775)

Could it be a permissions problem?


Does my Electrum wallet become less secure if I keep generating seeds until I see one I like the look of?

Yes, this does reduce your security. The fact that the seed words were generated randomly becomes meaningless if you use a non-random process to select the seed that you actually use. For instance, it is entirely possible (though very unlikely) that a random password generator would generate a phrase such as "Columbus sailed the ocean blue in 1492". You might say gee, what luck - that is a great password to remember, I'll use that one. Yet, a password cracker that tries meaningful phrases before moving on to random strings will be able to crack this password in the initial phase, even though the probability of randomly generating such a phrase is the same as for any other character string of the same length.


How to see the balance change from each block

Addresses are not stored on the blockchain in the typical format (Base58 or Bech32). They are stored as ScriptPubKeys.
To update each address, you would have to run getblock and parse each output's ScriptPubKey to an address and then find the Address of each input and remove those.
Bitcoin does track the existence of every currently existing coin in what's called the UTXO set.


How can I progmatically generate bitcoin address with in WASABI Deskstop wallet?

Maybe a hacky way, but you can export the xpub/zpub to electrum and do it there with a bit of Python.

Another option would be to use the same public key with this website that seems to be able to generates a CSV of addresses: https://iancoleman.io/bip39/


Is there any blockchains that has implemented a 2fa type of security measure?

text to be provided in order send out.

Who would be sending this SMS, who would be generating the secret?

The Bitcoin blockchain does support multi factor authentication by way of OP_CHECKMULTISIG, where you can have multiple keys simultaneously control a single output. This is auditable (you can tell what keys signed) and requires no third party trust.

  Currently someone can steal your btc private key and send all your funds away.

Quite literally, the reason for wanting to protect the private key from being stolen in the first place.


You might be able to run chrome on an ASIC. But if you did, whatever it mines in a tab would not make use of the ASIC hardware.

Firstly, an ASIC is not a general purpose computer, it cannot just run whatever software you want on it. It does have a small general purpose computer for managing the ASIC hardware, but that is a low powered computer. This low powered computer has a CPU which you could compile a version of Chrome for and copy the binaries to it. Then you could start an X server to get a GUI over the network and view it on another computer.

However, this would not be useful to you at all. Chrome would not be able to use the ASIC hardware. It can only use the general purpose CPU, which, in this case, is super low powered. It would not mine any more coins than a regular computer, in fact, it will most definitely mine much much less, if any at all.


Balances in Bitcoin are stored in Unspent Transaction Outputs utxo. UTXO can be used as inputs when a transaction is created. They can only be spent completely, while the resulting transaction creates new ones in the process, redistributing the balance to the recipients of the transaction. Spent transactions refers to Transaction Outputs that have been expended.


How to track and handle double-spend attacks?

You can just wait for enough confirmations. Most wallet and blockchain websites will show you the number of confirmations for a transaction id.

If it is a small transaction (less than 100 Bitcoins) then waiting for 3 confirmations should be enough. 6 confirmations means that roughly 10% of the network has confirmed your transaction and is the ball park used by many cautious services.

Every confirmation takes a minimum of around 10 minutes.

It has happened less than 15 times that transactions with 3-4 confirmations were reversed and it has happened almost 1000 times that transactions with only one confirmation was reversed. (What is the longest blockchain fork that has been orphaned to date?)

So, technically, it's really so difficult to pull off a double spend after 50 minutes, that nobody has ever done it.

If it does happen, the whole transaction basically just "never happened" so the transaction doesn't take place and the whole amount is "lost".


If SegWit only increases the capacity to only 2-4x only. Wouldn't we have the same issue in a few years again?

Just like a hard-fork blocksize increase SegWit  will not solve the scalability issue by itself. Either provides chiefly a fixed factor increase in capacity.

SegWit is also a way to kick the can down the road, but in comparison to the hard-fork blocksize increase, it also solves other issues, doesn't require a hard-fork, and makes blocksize increases less problematic: SegWit resolves an issue where transactions require quadratic effort for verification. The problem was highlighted by the "megatransaction" created by f2pool last July. While capacity only increases linearly with bigger blocks, effort to verify blocks increases at a super-linear rate. For SegWit transactions the transaction verification takes linear effort, making bigger blocks cause less of an advantage for the author of the latest block. Hence, SegWit helps reduces centralizing pressure on mining in the face of capacity increases.

On-chain scalability is always limited to linear growth anyway: For every transaction that you resolve on-chain, you need to provide the storage space on-chain. While we will be able to go down that route for a bit, it is unsustainable for large amounts of transactions and we wouldn't be able to reach e.g. the transaction counts corresponding to the payment counts of credit card companies.

Scalability improvements need to make better than linear use of the blockchain capacity.
Unlike a hard-fork blocksize increase, SegWit sets the stage for further improvements in the future. One promising proposal is the Lightning Network, which compounds numerous payments at the cost of two or three on-chain transactions. Another exciting improvement is the introduction of Schnorr signatures. Schnorr signatures are smaller than ECDSA signatures, but due to their homomorphic nature allow for both signature aggregation and key aggregation. In addition, Schnorr signatures enable the use of adaptor signatures that allow for a wide range of smartcontracts to be created with Scriptless Scripts.

Last but not least, SegWit introduces Script versioning. This allows to specify which version of Script to use to interpret a transaction, allowing multiple versions of Script to coexist safely at the same time in the network. Script versioning allows much easier deployment of Script improvements to expunge bugs and vulnerabilities, or to add new features like Schnorr signatures.


Is it considered bad practice to have a wallet "cloned" on both a smartphone and a desktop PC?

It is merely a question of security. If your copy of the private key in wallet A (phone) is compromised, you can lose your coins. If your copy of the private key in wallet B (PC) is compromised, you can lose your coins.

Assuming both copies are secure, you basically just have a backup of your private key.

As for whether or not having two copies like that is secure or "best practice", that depends a lot on how you handle your computers, and there are better experts out there that can answer that.

One thing you cannot do is double spend. If they use the same private key, one wallet is the same as the other, and trying to spend out of both will result in an unconfirmed transaction on one of them.


i need help getting my bitcoin back from an address

A bitcoin address represents a public key.  When you generated the address, did you also get or write down the corresponding private key?

If you have this private key, you can import it into any bitcoin wallet and you'll be able to return the BTC to the old address.  In fact you'll be able to send the BTC anywhere you want to.


Can I sign and redeem many outputs at the same time? (shrink the size of a tx Input)

Unfortunately by design, each scriptSig is verified slightly differently, so a different sig is required to redeem each input.


What is NTime rolling/nonce range? And what miners support it?

NTime is the integer timestamp in seconds.  It is one element on the block header. Each second NTime increases by one.    "NTime rolling" is a getwork parameter indicating how many seconds forward a miner can still consider this getwork valid (by incrementing NTime locally).

To understand how this is used lets first take a look at Bitcoin Block Header.

For a given set of transactions only two elements in the block header change between hash attempts.

NTime - current timestamp (changes every second)
Nonce - 2^32 number (changes every hash)

So to construct a valid header a miner must have the current value of these two rapidly changing elements.  The other elements of block header are also needed but changes occur much less frequently and trivial for the pool to handle.

The basic (inefficient) method to handle these two variables in a getwork request is for the pool to explicitly provide both values in every single header. The pool will provide one getwork every second.  A miner with less than 4.2GH/s however will on average find < 1 nonce per getwork. As an example, a miner which can execute 100MH/s will cover the nonce range (2^32) in 40 seconds.  The pool will need to issue 40 getworks per share.  The avg # of getworks per share will depend on the speed of individual miners however a significant amount of excess communication is occuring.

Now both nonce range and NTime are highly predictable so a miner could simply be given a starting point and locally change both values.  Doing this significantly reduces the number of getwork requests required to cover the same number of hashes.

By allowing the miner to roll the NTime forward for 10 seconds the pool can cut the number of getworks from 40 to 4 seconds.

There is also a benefit for fast miners which are already efficient.

A 2 GH/s miner will find on average one nonce every 2 seconds.  With an NTime rolling value of 10 seconds.  The same getwork will enable the pool to acheive 4 nonces per getwork.

The NTime rolling value instructs the miner how far it can increment NTime (in seconds) before needing to request new work.  So a NTime rolling value of 4 means the miner can use this header for 4 seconds before considering it stale and likewise a value of 40 indicates to the miner it can use same header for next 40 seconds.  Pools can use increasingly large NTime values however there are diminishing returns.  A block is found on average every 600 seconds, and periodically transactions need to be included.

Still an optimal Ntime rolling value ensures the pool is only updating getworks when work has actually updated in a meaningful way (elements changed other than nonce or time).

An example:
A pool provides a 100MH miner a block header containing the current ntime, a nonce range of 0 to 2^32 (full nonce) and an NTime Rolling value of 40.  The miner would hash until the local time increments 1 second (roughly 100 million hashes) then it would increment NTime value and continue to hash for another 1 second (roughly 100 million more hashes).  Once it has incremented NTime 40 times it must request new getwork.

Proper use of NTime rolling improves pool efficiency by reducing number of getworks per share.  In your example I speculate that Slush looked at the pool logs and determined that some miners were requesting work "too often" indicating they were ignoring or incorrectly using NTime Rolling value.   Obviously a pool operator would want all miners to use latest protocols such as NTime rolling, and Long Polling as it allows a pool server to handle a higher throughput with same amount of hardware, bandwidth and other resources.

I don't have an exhaustive list but as far as I know any "relatively recent" miner supports NTime rolling (as in released in last 6 months).


What is #Hash in bitcoin from a layman's perspective?

A hash is like a unique identifier, perhaps like a barcode, usually written in hexadecimal as a string of numbers an letters. Bitcoin specifically uses the SHA-256 hash algorithm in most places (it also uses RIPEMD160 in some places). You can 'hash' any data you like, and get such a unique identifier. For example the hash of a transaction is called the TXID (transaction ID). If you change any small part of the transaction then the entire hash changes. Same with blocks, the hash of a block header is used to uniquely identify that block and make sure nothing has changed. Anyone can verify that the header hashes to the same hash, to test for integrity. And it is also used to make mining difficult - a special requirement is placed on each block hash that it has to be less than some target (or that it has to start with a certain number of 0s). One of the key aspects of a hash is that there is no way to reverse it, hashing is a one way function, you cannot take a hash and find out the data it came from.


Distributing 1 satoshi to every user on stack exchange or some other online community

A few projects have done this (although more recently with EOS and Ethereum). The only notable one I can remember off the top of my head is Clamcoin:

  Every person who had Bitcoin at block 300,377, Litecoin at block 565,693, or Dogecoin at block 218,556 was given ~4.6 CLAM.

This has spawned a few digging services over the years, where you can upload old LTC, BTC, or Doge wallets (after removing those coins, of course) and get Clamcoin out.

On Ethereum, 0x31a240648e2baf4f9f17225987f6f53fceb1699a distributed 0.000000007777777777 ETH to some 174,655 addresses as a marketing gimmick for an ICO called Safe. Many other Ethereum ICOs conduct air drops, usually with some rules like "Any address that sent or received ETH between X and Y blocks".

More recently, some EOS projects have been "spamming" free 0.0001 EOS to various accounts

I do believe that Clamcoin is the only major example of distribution based on community participation at that scale, though.


What will happen when the blockchain size will reach 1 Tb? Or 10 Tb?

The database itself does not hold the blockchain. LevelDB is really only used to index where blocks are stored on disk, to store the UTXO set, and to store the current chainstate. So if the blockchain were to be terabytes in size, it should be fine.

The problem would actually be downloading the blockchain and verifying all of that data within a reasonable amount of time.


When did merged Namecoin-Bitcoin mining start?

The switch to merged mining is scheduled for Namecoin block 19200.  At the time of this writing, the Namecoin network is on block 18805, so 395 more blocks need to be solved.

The last 29 blocks on the Namecoin block explorer were solved in an average of 108.79 minutes each.  Extrapolating from this, 395 blocks should be solved in just under 30 days, so sometime around September 29th.


There is nothing in particular stopping exchanges from using CoinJoin to construct transactions with other exchanges, but rather there does not appear to be any demand for this.  For example both JoinMarket and Wasabi1 have APIs that could be used.

In the future this situation could change if something like Schnorr signature aggregation capabilities are adopted by Bitcoin. In that situation, CoinJoin transactions could be noticeably smaller (and therefore cheaper) than many separate single-output transactions.  This still seems very unlikely though as the exchanges are more likely to simply batch their own transactions rather than working with other exchanges.

Until a significant percentage of users demand privacy, exchanges are unlikely to change anything.  There may also be regulatory issues with them providing such an option.


Under what circumstances would a server submit new work to a miner?

The problem you are describing could be due to pool optimisation, as it is easier to prune 1 minute old shares than probably it is to look through 10 minutes of shares in order to validate them.

As for why a miner would request new work from a pool, other than as a result of longpolling or finishing a work, might be due to the work becoming invalid with time (with standard protocol a miner would request work every second). Alternatively, the miner is trying to be malicious and trying to make the pool do extra work.


What if TX_A gets orphaned due to forks? What happens to TX_B?

It will be considered invalid, and your Bitcoin will not be spent. It will only be considered valid on the other forks, assuming they don't also invalidate the block. Usually the forks, if they are trying to play by the rules of the Bitcoin network, will also invalidate the block because the longest chain is always the valid chain.

Also, this should be referred to as an extinct block, see https://bitcoin.stackexchange.com/a/5869/60443


Can a miner not find a share in his work unit?

A good pool should manage difficulty levels so that every qualified
1 worker finds at least some share.  It may be a very small share, but something should be counted.

1 By qualified, I mean a processor in the same league as the rest of the pool.  If you join an Intel CPU miner to a pool of ASIC miners, your miner would not be qualified, and it would be appropriate to not get any shares.


Have there been any ICO (Initial Coin Offerings) that has been backed by redemption of a physical product?

I know at least two such ICO's EcoBit, which claims to be the "WORLD'S FIRST-EVER GREEN BLOCKCHAIN PROJECT".

One thing that I like about the project is they have actually started physical work and have posted videos of their progress on their Facebook page (do check them out).

Another one that I know so far is mona.co,

  Introducing Monaco - world's best cryptocurrency card. Spend and send
  money globally at perfect interbank exchange rates, saving EUR30-40 on
  every EUR500 equivalent spent.


Blockchain.info's blockcount API call giving error, alternatives?

Another public API I found for this:

https://blockexplorer.com/api/status?q=getBlockCount

But the best one so far, is blockR.io because it even has testnet support:

MainNet: http://btc.blockr.io/api/v1/coin/info

TestNet: http://tbtc.blockr.io/api/v1/coin/info


Bitcoin-cli getbalance returning negative value

It is possible to an account balance to be negative.

Accounts do not correspond to on-chain transactions 1:1. They are a separate layer within Bitcoin Core. Non-obvious functionality like allowing accounts to go into negative is why they entire account system has been deprecated and will soon be removed.

You should either track separate accounts at an application layer, or use the new multiple wallet system in Bitcoin Core 0.17.0 to create a separate wallet for each account.


Why am I not getting payments on my bitcoind on an amazon ec2 instance?

Your client needs to be fully synchronized for your transactions to show up, otherwise it's not aware that these transactions ever took place.


Why doesn't Lightning have DNS bootstrapping?

It does!
There is even a BOLT for it (check out: https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md )

from there you have the following example:

dig lseed.bitcoinstats.com AAAA
lseed.bitcoinstats.com. 60      IN      AAAA    2a02:aa16:1105:4a80:1234:1234:37c1:9c9

Christian Decker is maintaining the dns seed list. I even used this in my autopilot (the c-lightning wrapper). check out:

  def __get_seed_keys(self):
        """
        retrieve the nodeids of the ln seed nodes from lseed.bitcoinstats.com
        """
        domain = "lseed.bitcoinstats.com"
        srv_records = dns.resolver.query(domain,"SRV")
        res = []
        for srv in srv_records:
            bech32 = str(srv.target).rstrip(".").split(".")[0]
            data = bech32_decode(bech32)[1]
            decoded = convertbits(data, 5, 4)
            res.append("".join(
                ['{:1x}'.format(integer) for integer in decoded])[:-1])
        return res

    def __connect_to_seeds(self):
        """
        sets up peering connection to seed nodes of the lightning network

        This is necessary in case the node operating the autopilot has never
        been connected to the lightning network.
        """
        try:
            for nodeid in random.shuffle(self.__get_seed_keys()):
                self.__clogger.info("peering with node: " + nodeid)
                self.__rpc_interface.connect(nodeid)
                # FIXME: better strategy than sleep(2) for building up
                time.sleep(2)
        except:
            pass


Blockchain.info "Too Many Requests" - Alternative solutions that can be hosted by myself

You should check https://github.com/janoside/btc-rpc-explorer
BTC RPC Explorer is a simple, database-free self-hosted explorer for the Bitcoin blockchain, driven by RPC calls to your own Bitcoin node. It is easy to run and can be connected to other tools (like ElectrumX) to achieve a full-featured explorer.
Whatever reasons one may have for running a full node (trustlessness, technical curiosity, supporting the network, etc) it's helpful to appreciate the "fullness" of your node. With this explorer, you can explore not just the blockchain database, but also explore the functional capabilities of your own node.
Live demo available at: https://explorer.btc21.org


worker showing offline in nanopool my rig shows it is hashing. Need help please!

Same here. Glad to hear I'm not alone but still curious what is going on. Are you using SMOS or Windows for mining? I have a rig on Windows and rig on SMOS and both show offline but are hashing fine.

I do have a rig that has been running for weeks just fine and today it shows it has rebooted 5 times. I wonder if nanopool is having issues or something.


It sounds like you may have sent your bitcoin to the wrong address, if that is the case it is likely gone. The 0.05 btc is sitting in address 1JERLf..., and has not moved since the coinbase withdrawl. If you control that address then there is no issue

You can try 'reset Jaxx cache', the wallet software might be experiencing some sort of bug and not displaying your balance correctly.

It may be worth checking any other wallet software you have, to see if you sent the btc to that wallet instead of Jaxx, and got mixed up about which wallet you got the receiving address from.


Standard SI prefixes. Kilo, Mega and G is for Giga, obviously. Just multiply the value with 10^9 to get the base value.


What happens to my transaction if it is not accepted by miners?

Nodes will eventually drop transactions if they remain unconfirmed for too long (or if the inputs for a tx are confirmed in an alternate transaction). The time this takes to happen can vary from 3-14 days usually, depending on the nodes' config. Block explorers may cache transactions for longer than that, however, and may continue displaying them long after they have been dropped from the mempool.


Want to have private key of my brc address

I do not know the site but it is just easier create a new address on a wallet that allows to export the private key and send your bitcoins to it.


Is there a documentation of the first altcoins timeline?

When posting I forgot about this cool site that does exactly that!


How do I get number of pending transactions for an arbitrary blockchain

Due to the decentralized nature of blockchains, the state of transactions is relative.  A pending transaction is one that your node has seen and verified as valid, yet your node has not seen a block that includes it.  This might not be the same state that other nodes see.

For example, one-block chain forks are a common occurrence, where there is a disagreement on the network as to which block is the next valid block.  This will usually resolve itself when a block is found on top of one of these two blocks, but in the meantime, there is disagreement about which transactions have been included in a block.

There is also the possibility that your node has not seen a transaction, whereas other nodes (including mining nodes) have.  You wouldn't have this transaction in your list of pending transactions, even though there are miners actively attempting to include it in a block.  The opposite is also true, where you have seen a transaction, but miners are ignoring it for whatever reason.  Bitcoin is actually pretty good about these scenarios, so it normally isn't an issue, but it is a possibility.

In addition, there is the question of a transaction's validity.  Even though you can be fairly certain that a transaction is valid without independently verifying it with a downloaded copy of the blockchain, you can only be completely sure if you do independently verify it.  If your node is ever wrong or in disagreement with the network about a transaction's validity, then you may consider it pending whereas mining nodes will never include it in a block.  Again, the opposite is also possible.

In order to see which transactions your node (assuming Bitcoin or Bitcoin-based) has "pending", you can use the getrawmempool RPC command.

Further reading:

bitcoind getrawmempool without downloading the full blockchain

Is it possible to view unconfirmed transactions with the bitcoin client?


Procedure for Deriving Payment Addresses

The method for deriving child keys from extended keys is specified in BIP 32.

Note that the specific derivation paths for xpubs, ypubs, and zpubs are not defined by BIP 32 but rather are constructions created by Electrum and SatoshiLabs. These have a specific meaning described in SLIP 132. Their encoding is the same as described for xpubs in BIP 32 but with a different prefix byte.


How transactions will take place once all the blocks have been mined

Or there is no limit on blocks to be mined, instead, there would be no rewards for mining after 21M coins?

This is correct, although the miners still get all the transaction fees as reward, there is just no block reward like there is now with 12.5 BTC


Exchange API - more frequent high and low value

These functions return the high or low over for the past 24 hours.  You can poll the API for this data as often as the API allows for (600 times over 10 mins according to your link). The data that it returns does only consider the past 24 hour prices however.  If you want to find out the high and lower prices over a longer time frame you will need to look at historical ticker data and determine the high and low values returned from the data set that you are requesting.


How do I use Multisig transactions to handle escrow needs?

There are two basic templates for using multisig for "escrow", 2-of-2 and 2-of-3. In both cases, you can currently use bitcoin-qt's raw transaction API to create the addresses and transactions.

In 2-of-2 you do the following:

Create a multisig address which requires signatures from both the buyer and seller.
The buyer sends funds to this address.
Seller ships the product.
When the product arrives, the buyer and the seller sign a transaction sending the funds from the multisig address to the seller.
If the order is cancelled amicably, the buyer and seller sign a transaction sending the funds from the multisig address to the buyer.

This doesn't require any 3rd party, but it does have several failure modes, e.g. extortion, negligence and so on.

In 2-of-3 you do the following:

Find a relatively trustworthy escrow/mediator.
Create a multisig address requiring 2 signatures out of the buyer, seller and mediator.
Buyer sends funds to this address.
Seller ships the product.
When the product arrives, buyer and seller sign a tx sending funds to seller.
If the product doesn't arrive, mediator verifies this fact, and buyer and mediator sign a tx sending funds to buyer.
If the product arrives but buyer refuses to pay, mediator verifies this fact, and seller and mediator sign a tx sending funds to seller.

This requires a 3rd party, but the trust requirement is limited. As long as buyer and seller cooperate the mediator doesn't do anything. A problem requires 2 out of 3 parties to defect, unlike traditional escrow where the escrow can ruin it himself.


In a confidential transaction, what guarantees that the sender packed the correct ephemeral public key for the pederson blinding factor?

What guarantees that the sender packed the right ephemeral public key? What's stopping the sender from packing a different ephemeral public key, preventing the receiver from figuring out the blinding factor and the transaction amount.

The fact that the receiver wouldn't treat the result as a valid payment.

This is no different from them sending the right amount to the wrong address.


What is the maximum character length when sending a NXT message?

Right now it's 1000 bytes. Text is converted into bytes by using UTF-8 encoding.

Don't hardcode this limit, use "maxArbitraryMessageLength" parameter returned by "getConstants" API request.


Bitcoin Withdrawn from Cryptobridge not showing up on my Bitcoin Core Wallet

I have no information on Crypto-bridge.

Currently, no transactions seem to have been broadcast to the network for your address.

You should confirm that you sent BTC to you Bitcoin Core wallet (and not altcoins with a different symbol, not BTC). I would get in touch with Crypto-bridge customer support to enquire.


Received coins in offline Armory wallet that had not yet been synced

Is the delivery address valid even though armory was never connected to the internet ?

Yes. There is no need for a wallet to be online to receive Bitcoin.

  can i access the funds at a later time with the private key that was generated by armory ?

Yes. Once Armory and Core are fully synced, you can access the funds. Alternatively you can export your private keys and import/sweep them into another wallet and access your funds from there.


public key generated when importing PK different from original pub key

There are several different types of bitcoin addresses, which can be derived from the same private key. You can see this question for some more info about the different types.

So it sounds like your bitcoin-core wallet is creating P2SH-P2WPKH addresses, but then when you imported it into other wallets, they are deriving a P2PKH address.

So the fix is to instruct the wallet that you are importing the address to, to derive the correct address type. Not every wallet will be able to do this, but some of the more feature-rich options out there should be able to do so.


But the progress of a blockchain is how fast it reaches consensus, and this does not seem to require all nodes to verify all transactions as the longest chain can spread throughout the network before every transactions on it is verified by all the nodes.

All nodes having received a block does not mean that the network has come to consensus. Consensus occurs when all nodes on the network agree on what the blockchain is. This can only happen once every node has verified all blocks and their transactions. So verifying all blocks and transactions is actually a bottleneck.


Unconfirmed transaction. How to make my wallet made whole

It's not possible to remove your transmitted transaction from the network.

Even if you shut down and clean your own local client, other clients around the world have it in their mempool. That's why your local client reflects the balance minus the amount you sent, even though it's not confirmed. That's how it's supposed to work, Bitcoin TX's are supposed to be irreversible even before being mined.

So, Bitcoin does not have a TX revocation network message available.

Only thing you can do is, before this unwanted TX is confirmed, to use another client, which either didn't see your TX or allows you to craft TX's and broadcast them, to submit a new transaction containing a much higher fee and same UTXO's. (Double spending on purpose.)

This new TX will cost you the fee, but if you set your own address as beneficiary, the funds will return to your wallet and the old transaction will get discarded by the network as a double spend. This higher fee is your cost to revoke the old unwanted TX. All this has to be done before the old TX is confirmed in a block.


MtGox is a roach sack of bugs. People start with it for liquidity and fame, but it is the least reliable bitcoin exchange. Anything else is better.


How does initial exchange of inventory work when both nodes have different chains?

They will exchange chainwork. The one that claims a lower chainwork will query the other to confirm that its claim for a higher chainwork is legitimate. If it can confirm the claim, then it will switch to the chain with the higher total work.


OP_RETURN in rawtransaction rejected with error code -25

There is no txid=a713489612f927ccc3c410173a8d616d6f17df0774e3e79d7715b4cfc72ec6a4 in blockchain. You are trying to spend non-existed output.


Which Exchanges Allow Short Selling/Margin Trades with USD/BTC or USDT/BTC

There's apparently a website that reviews various exchanges that allow trading on margin:

http://margintradingbitcoin.com/

OKCoin and Bitstamp are the two that I've heard of on there.


Where did I do wrong? How can I add 'b' to the hash?

The block hashes need to be byteswapped. Instead of 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, you should have 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000.

  But I still got "not found". Why...

This key-value pair is not always present.

  I could get some data. I think the following code should retrieve the "blk00000.dat" block file information, right?

Yes.


How do I do the maths for starting a bitcoin mining startup in Kuwait?

There are many bitcoin mining profitability calculators all over the web:

http://www.bitcoinx.com/profit/
https://mining-profit.com/calculator
http://www.coinwarz.com/calculators/bitcoin-mining-calculator

You would have to get your hands on some hardware, which can be quite expensive indeed. The only advantage you have is the recurring electricity cost, but note that the hardware is not cheap and often takes many months to make profitable. You'll need a good contact at BitMain or some other ASIC manufacturer so you can get your hands on the latest hardware early so you can mine them for the longest time.

Best of luck!


No wallet currently supports creating replaceable transactions conveniently. To work around this, you can manually create raw transactions from scratch.

The following are suggested instructions for use with bitcoin-cli.

To create a replaceable transaction. You can use "createrawtransaction" to manually add inputs and mark the "nsequence" field to a value less than 0xffffffff. If you would like to replace the first transaction created this way. You will have to dump the transaction to free the UTXOs for use again using the "abandontransaction" command.

Once you've dumped the first transaction. You should be able to repeat the process above then increment the "nsequence" field. This new transaction when broadcasted should then be accepted by any node that supports full RBF.


How do I use my Bitcoin-Qt wallet address on Blockchain.info?

You have to unlock your wallet, export the private key for your address and then import it to Blockchain.info. You don't even need Bitcoin-Qt then, because they store your privkey and your money!


Is this considered safe enough?

Nothing is "safe enough" if we do not know the cost.

OK, if you have $100k in bitcoins the 12-words phrase is safe enough.

If the 12-words phrase is the seed to the "Method of destroying the Universe" I would recommend to add at least 11 bits of entropy and use 13 words.


Capturing IP address of transactions submitted to Bitcoin

So a node that creates a transaction needs to propagate it. It will connect to other nodes. Usually to some reasonable number like 8 nodes (please see getpeerinfo on your client).

As a mental exercise: If the 8 nodes (that I randomly selected from the network) belong to the same person, that person will have the possibility to capture 100% of my traffic. My IP address will be known, but also there could be a selective attack that prevents my transaction from being broadcasted (i.e. he/she decides to drop it based on my sending bitcoin address).

The more nodes the attacker has, the more chances to have all outgoing connections from the victims plus the possibility to do data analysis. Also more chances of dropping (selected or random) transactions.

I don't know the economics behind an attack of this nature. Buying 5000 VMs to run nodes could cost a lot.

Examples are out there that they ask for bitcoin to set up full nodes, like https://classic-cloud.net/ [1]. as 2016-04-01 they have 810 nodes running. So you can imagine that they could be able to track some transactions to IPaddress.

Edit: [1] as of 2019-05-17 this is not longer a page that has stats about nodes, but rather a blog.


How do I install a second independent C-lightning node on the same machine as one with an already operational node?

Unless you want to test multiple versions of the lightningd binary, there is no need to check the source code out multiple times, since the binaries can be shared among multiple instances.

Assuming you are in the root directory of the source code, and you've executed ./configure and make, you can start multiple instances like this:

$ lightningd/lightningd --log-level=debug \
                        --lightning-dir=/path/to/lightning-dir1 \
                        --addr=0.0.0.0:1111 &

$ lightningd/lightningd --log-level=debug \
                        --lightning-dir=/path/to/lightning-dir2 \
                        --addr=0.0.0.0:2222 &

$ lightningd/lightningd --log-level=debug \
                        --lightning-dir=/path/to/lightning-dir3
                        --addr=0.0.0.0:3333 &

Each of these commands will start a new node with its own directory and with its own port.

Notice that you'll also need to tell lightning-cli where to find the various instances you're trying to talk to. For example the following will run the help command on the second instance:

$ lightning-cli --lightning-dir=/path/to/lightning-dir2 help

I usually will set up a couple of aliases for each instance that I run:

alias lcli1="lightning-cli --lightning-dir=/path/to/lightning-dir1"
alias lcli2="lightning-cli --lightning-dir=/path/to/lightning-dir2"
alias lcli3="lightning-cli --lightning-dir=/path/to/lightning-dir3"

Then you can just use lcli1 help to talk to the first instance.

If you'd like to run multiple versions, the procedure is identical, with the key difference that you need to compile and run these in the source code directory of the corresponding version that you are trying to run.


sendtoaddress command doesn't work with bech32 bitcoin core 0.17

It sounds like you are using the wrong address type for the network that you are on. Regtest bech32 addresses begin with "bcrt".


Is the news story about the missing hard drive containing £4 million GBP of Bitcoins technically feasable?

Yes - it's feasible.

Bitcoins are released at a constant rate determined by the protocol. At the time, 50 Bitcoins were being generated for every block(this is now 25); and blocks are supposed to be found every 10 minutes. Miners compete amongst each other for this prize.

In 2009, you could mine using your computer's CPU and you were only competing with very few other people. There weren't large mining pools and dedicated hardware, so it was easy for anyone to run the client and mine hundreds or thousands of Bitcoins. It was so easy that you wouldn't think that losing your wallet was a big deal.

Maybe, but it'd be a lot of work.

All transactions - including mined Bitcoins - are recorded in a publicly accessible global ledger. Many people download the entire transaction history on their own computer, and there are tools for working with it. It might be possible with some detective work to try to track down what address they were likely stored in using the clues given, but it's not easy.

Nope - if you lose your wallet those Bitcoins are lost forever.

That's terrible for the person who owned them, but it doesn't impair the rest of the Bitcoin economy. It makes the value of the remaining Bitcoins go up to compensate.

There are already exchanges that will hold your wallet for you if you're worried about things like this. They're more secure than holding them on your personal computer, and in the future it's possible some of them might offer insurance or other guarantees in case they lose your money.

It's a design feature that there's no administrative body who can restore your Bitcoins. You would have to trust this administrative organization not to abuse their power. The developers of the original Bitcoin client have no more power than anyone else using Bitcoin.


For a bitcoin-forked complementary currency: would it be difficult / impossible to limit the mining to some agents on the market?

Am I right that by implementation everybody with a client is theoretically able to mine?

Yes, it just won't be very effective without dedicated mining hardware.

  Would it be possible (without changing half the code base) to limit the right to mine to some charitable groups and giving the other agents just the permission to do transactions?

Yes, you can do that. You don't have to change very much of Bitcoin to do it, either.

You change Bitcoin so that instead of a block header needing a certain amount of work to be valid, it needs a signature from a certain public key. Then, you distribute the private key to all of the organizations that should be able to mine.

You need to change the code in one other place: the mining logic. Instead of hashing continuously, the nodes that create blocks will do it by waiting a fixed amount of time after the last block, creating a new block, and signing it. (Avoid creating two blocks in two places simultaneously. There are three strategies for avoiding this: wait a random amount of time before creating a block, elect a leader who creates the block, or have a round-robin system.)


Nodes maintain multiple databases, they do not just store the blockchain and scan it every time it wants to do something. These databases include a block index (so that it knows where to find a block) and the UTXO set. The database containing the UTXO set is what matters here. That database contains the identifiers for every single UTXO and the UTXO itself. A UTXO consists of a spending condition (known as the scriptPubKey) and an amount.

A node will begin building its UTXO database when it starts syncing the blockchain. As it validates blocks, it goes through every transaction in that block and adds to its UTXO database the outputs that every transaction creates. It also removes every UTXO that is spent by a transaction. So once a node is fully synced, the UTXO database contains every Unspent Transaction Output in a way that is easy to lookup.

So when validating a transaction, to determine whether the inputs have not yet been spent, the node will try to find the UTXO using the txid and output index (a UTXO's unique identifiers) in its UTXO database. If it is successful and gets exactly one result, then it knows that the UTXO has not been spent. If it gets no results, the UTXO has already been spent and thus the transaction can be marked invalid.

Once the node has the UTXO for an input, it can proceed to verify that the input satisfies the spending conditions. The spending conditions are contained within the UTXO in a field known as the scriptPubKey. The scriptPubKey is a script written in Bitcoin's transaction scripting language. It is half of a program. When combined with the scriptSig that is provided in the transaction input, the program should be complete and executable.

So the node will (essentially) take the scriptSig, append the scriptPubKey to the end of it, and execute the resulting program. If that program completes execution and returns true, then the script is valid and the spending conditions have been met. Thus that input is valid. If all inputs are valid, and the rest of the transaction checks pass (locktime checks, outputs have valid amounts, etc.) then the entire transaction is accepted as valid.

If you noticed, I mentioned that UTXOs have spending constraints, not owners. This is because UTXOs don't have owners. Some can be spent by anybody because the spending constraint says that anyone can spend the output. All that a node cares about is that the spending constraints are met.

But we as humans care about owners, so there are a subset of spending constraints that are commonly used to indicate that someone is an "owner" of a UTXO and is the only person allowed to spend it. These spending constraints basically say the following:

"in order to spend this output, the spender must provide both a public key which matches this particular hash  and a signature over the spending transaction produced with the private key of the public key with the aforementioned hash"

This spending condition can be abstracted into human terms as saying "the person with the private key that corresponds to the public key whose hash is in the script owns that output".


Jeff Garzik wrote a binary protocol for pushpool originally.

BitPenny uses a proprietary protocol to get p2pool-like benefits.


Does mining in a pool with a bigger hashrate mean more bitcoins?

No, payments are distributed proportionally to the contributed work.

The chance to find a block is proportional to the hash-rate of a mining entity. So, if watched sufficiently long you could expect to get the same percentage of all rewards as the portion of the total mining power you contribute. This principle remains the same whether you solo mine or pool mine (minus any fees the pool costs you).

However, the pool combines its power to find more rewards, which it distributes among its contributers according to the size of the contribution of shares to the pool. I assume the operator gets a percentage of the reward in some fashion. That way you gain a steady small income instead of winning the lottery every few decades.

So, whether we are talking about mining pools in the network or participants in a mining pool, if watched for a sufficiently long period of time the entity with 10 GH/s will earn 12.5 times the amount of the entity with 800 MH/s.


bitcoin's PoW, real time of creating one block

It is likely that a given block template will not produce a valid block for any nonce value, and so if that happens the miner will adjust some other values in the block template (such as the extranonce, the timestamp, the transaction ordering, etc), and then run through the entire nonce range again, to see if their newly adjusted block template will produce a valid block.

So just looking at the nonce value for a particular block does not tell you how many hashes were performed, it only tells you which nonce produced a valid block for that particular template. Before mining that block, chances are the miner ran through the entire nonce range many, many times, but with slightly different block templates.


Can a blockchain's transactions be reversed?

The Bitcoin blockchain is not absolutely immutable, it is probabilistically immutable.

We say this because the history of transactions (the blockchain) is secured by mining power, and mining success is a probabilistic. Given a certain amount of hashpower, we expect that we'll find a block within some certain amount of time - but it is possible to find the block on the first attempt, however incredibly unlikely that may be. So for an attacker to re-write history, we expect that they will need a majority of hashpower on the network, otherwise probability is working heavily against them. For more info see section 11 of the original bitcoin whitepaper.

So the finality of a transaction is related to what portion of hashpower is being controlled by 'honest miners'. Thankfully, there are heavy financial incentives for miners to behave honestly, and so after a decade of operation, we haven't seen a majority-attack against the network take place.

The DAO hack was a different situation: ethereum developers decided that rolling back the chain to erase the DAO hack (and all transactions that had happened since then) was a good idea. This led to an interesting conundrum: what is the real guarantee offered by a blockchain? Is it probabilistic immutability? Or is there more to it than that? How much does the human element weigh in, and control the outcome? Why did the Eth developers have such power?

This is an important test of one of the core tenants of a system like Bitcoin: does any group control the protocol? How large of a group is needed, before effecting a change becomes possible?

If every single bitcoin user decided that it was a good idea to change the protocol to include a mandatory cat image with every transaction, then it would be simple to make the change (after all, everyone already agrees, and will implement the change). However, if only a small portion of users want to make this change, then they will need to convince the rest that it is a good idea. As the network grows and more users come on board, this becomes increasingly difficult to accomplish.

For bitcoin (or any blockchain) to succeed, it is paramount that no small group is able to make these sorts of decisions unilaterally, otherwise that group would represent a huge threat to the network. If the group were compromised by a bad actor, they could wreck undue havoc on the network.

This is a crucially important point: having a large, decentralized network with many users makes it more difficult to enact change. If a network has a small number of users, it will be easier to convince a majority of them to make the change.

Looking at Bitcoin's history, we can see that it is extremely difficult to force a change onto the network. Some of the most influential businesses, persons, miners, and some developers pushed heavily for a change in the base block size in 2016/2017, but were unable to convince the majority of network users to go along with it, and thus failed.

Even the developers cannot unilaterally push a change onto the network. They can propose changes (including rolling the chain back), but if the users (ie those that run nodes) do not agree with the change, then the devs cannot force it through. The open source process involves a ton of peer review and is a transparent process that would be difficult to push a contentious change through. Anyone is free to propose a change, of course, but the onus is on the proposer to convince everyone else that it is a good idea.

TL;DR:

As a user, you should want some guarantees that the system of money you are buying into will not be arbitrarily changed or rolled back at some point in the future. This means at least two things:

There is a large amount of mining power securing the network (and no large pool of hashpower that could be pointed at the network exists otherwise).
No small group of people can easily force a change onto the network.


Is it acceptable / encouraged to ask for ID and keep a photocopy for OTC Bitcoin transactions?

In OTC, it is totally up to the mutual agreement of the two parties, if you are a financial business that has to comply with AML laws, you will have have to ask for these info, but that may mean some counterparties will shun from you.


Can I make and host bitcoin wallet in my own website to get rid of using 3rd party wallets

First off, you'll need to have full access to your server, because you need to be running a Bitcoin-node (constantly) connected to the Bitcoin Network. So a simple shared server won't cut it. You could connect to your remote Bitcoin-node. But in that case, you still need a server to run that node.

The programmer's way:

Install and run a Bitcoin-node on your server. HOW
Learn how to use JsonRPC in your preferred programming language.
Use the API to program your own virtual wallet.

(basically how all online wallets more or less function)

The lazy programmer's way

Install and run a Bitcoin-node on your server.
Use a third-party DIY self-hosted wallet, like Coinpunk

(Note: as indicated on the website, such projects are still very beta. Careful.)


How is Recipient's Public Key Used When Receiving Coins (if at all)?

how does the network know that Alice meant to give these funds to Bob?

Transactions have different parts, an input section that specifies which funds are being spent (and proves the spender is authorized to spend them) and an output section that specifies the recipient(s):

Looking at it in a little bit more detail, outputs contain the amount to spend as well as the public key script (scriptPubKey) that will be used to determine whether or not a future spender is authorized to spend the funds.  The input identifies the funds being spent by their hash (the transaction identifier) plus the indexed number of the output in that transaction, and then provide a signature script (scriptSig) containing data that is evaluated in the context of the scriptPubKey to determine whether or not the spender meets the spending conditions.  In a conceptual model, the scriptPubKey is a public key, the scriptSig is a signature, and the signature has to be valid for the public key over all the data in the spending transaction (minus the signature itself).  (That's not exactly how it really works in Bitcoin, but that's the principle.)

  it seems to me that the network would encrypt the Alice's signature with Bob's public key

Bitcoin's consensus protocol doesn't use encryption.  In Alice's transaction, she places an output saying "pay  100 bitcoins"; when Alice signs the whole transaction, she both proves that she's authorized to spend those 100 bitcoins and protects all the data in that output against change by any third party (because they can't create a signature using Alice's private key).  (Assuming Alice has sole possession over her private key, there's no multisig in use, ECDSA hasn't been broken, etc...)

  The other way I can see it working is if the network creates transaction 2 with Bob's public id in it, and that only Bob can use the funds in that transaction record because to spend those funds, Bob will need the private key.

This is conceptually correct.  In practice, the protocol just evaluates scriptPubKeys and ScriptSigs, which can do whatever they want within the limits of the language, rather than having a specific notion of key-based identifiers.

  is there anything about the protocol that ensures Alice's transfer of ownership reaches the intended recipient?

Alice's signature protects her transaction against modification (with the same caveats as listed before).

  If she makes a mistake in the recipient public key, is there any way for her to correct her mistake if Bob never receives the coins?

If the transaction has not been confirmed, Alice can create an alternative version of the transaction, broadcast that, and hope the alternative gets confirmed.  After confirmation, there's nothing Alice can do to change the spending conditions (scriptPubKey).

It is possible for Alice to pay a scriptPubKey that allows her to reclaim the funds if they haven't been spent by Bob within a specified amount of time.  This mechanism is used to prevent denial-of-service attacks in payment channels, but I've never heard of anyone using the mechanism to ensure they paid the correct address.  In typical Bitcoin operation, there's no way to reclaim bitcoins paid to the wrong address.  (Note: for this reason, the common form of Bitcoin addresses starting with a 1, 3, or bc1 all contain checksums that help wallets detect typos (but this detection is not perfect, and if Alice accidentally pays an address that is valid but the wrong address, e.g. she pays Charlie, then there's nothing the wallet can do to help her or Bob).)

Images in this answer are from the Bitcoin.org Developer Guide, MIT licensed, which goes into more detail.


Why do exchanges have a buy/sell column in their trade history?

Yes, if someone buys at a particular price, someone else must sell at that price. But they didn't place their orders at the same time. The buy/sell indicates the direction of the filled order. This is needed to make sense of the price.

Imagine an apple exchange where no trades are occurring. Then someone walks in and buys or sells an apple for $1. Do you care whether the person who walked in bought or sold? Well, yes. If the person bought an apple for $1, that means before they walked in, someone was willing to sell an apple for $1 but nobody would buy it. If that person sold an apple for $1, that means before they walked in, someone was willing to buy an apple for $1 but nobody would sell it. So without knowing the direction of the transaction, you can't tell what the price is telling you about the state of the market prior to that transaction.

This is very important in a market that isn't very liquid. For example, say the cheapest anyone is willing to sell a Bitcoin is $1,000, but the most anyone is willing to pay for a Bitcoin is $900. If it stays that way for a while, all the executing buys will be at $1,000 and all the executing sells will be at $900. If you just saw alternating $1,000 and $900 prices without knowing all the buys were at $1,000 and all the sells were at $900, you'd think the price was changing when it's actually constant. Orders that don't execute at all aren't listed because no money changes hands. So the people selling at $1,000 and buying at $900 won't be listed as transactions.


It's a complete irrelevancy. It is still early, and Bitcoins are worth on the order of $3 each. If you want to be an early adopter, buy Bitcoins now.

If Bitcoins never become really valuable, what difference does it make whether it's fair or not? The sums involved will be modest.

If Bitcoins ever do become really valuable, what difference does it make whether it's fair or not? You can buy Bitcoins now for a pittance and get the same benefits as the early adopters.

This is just petty jealousy. It's no different from the folks who missed out on Google stock or Apple stock when it was cheap. It's not just about hearing about Bitcoins first, it's about investing first, and taking the risk of loss. That's how everything works. Maybe it's not fair, but that's how it is.


It's a bit apples and oranges. At Coinbase you are actually purchasing cryptocurrency that you then own and can move elsewhere if you wish, whereas at eToro you are opening a CFD (contract-for-difference) position, which is similar to trading futures in that you don't actually own any bitcoin but are rather speculating on the price movements of bitcoin.

At Coinbase, you pay a percentage of your total purchase price. You also pay a percentage fee when you sell. (Sidenote: By using their associated trading exchange GDAX, you can avoid paying these fees, but you'll need to learn how to use their interface).

With eToro, you pay a fee each day your position is open. That is why the fees are listed as "OVERNIGHT FEE (PER 10 UNITS)".

The conversion fee listed on eToro (in pips) is for if you are depositing in a different fiat currency than USD and they have to convert it for you; it doesn't have to do with crypto specifically. A pip is the smallest trading unit of the currency in question. For most pairs it is .0001, however Yen-based pairs are only displayed to two decimal places so it is .01 in that case.


Transaction still listed as 'pending' after 12 hours

The higher the number of unconfirmed transactions (in the mempool) the longer will take to confirm your transaction unless you give a higher fee.

I recommend watching current mempool where you can see the number of unconfirmed transactions and it gives you an idea how "clogged up" is the Bitcoin network.

Unconfirmed transaction will either confirm or expire (not sure but I think it takes 3 days to expire).


Why does my BIP32 implementation throw different results than other web implementations? They also disagree with each other tho

This line:

msg=("0" + hex(int.from_bytes(pub_key,"big"))[2:] + str_i(0)).encode()

is incorrect. You are converting the bytes of the pubkey and index into a hex string which you are then hashing. That is not correct. You are supposed to hash the bytes directly, not the hex string.


What can you do in case the number of blocks becomes greater than the maximal number of files that can be stored in a file system (ext4, FAT, etc.)?

This is an issue of inodes, a feature mainly in Unix filesystems (like ext4) which is a fixed-size table storing metadata of all files on the partition. When the partition is created, a fixed number of inodes is created.

On my 500GB drive using the default ext4 from Ubuntu, I have 27 million inodes (this can be checked using df -i if you're on Linux), many times more than the number of Bitcoin blocks in the blockchain. Thus I don't run into this issue, and I imagine most people don't - it's possibly something to do with the specific filesystem/setup you're using.

ext4 specifically doesn't have a cap on the number of files in a directory, so splitting the files into multiple directories would be unlikely to help. FAT32  however has a limit of 65,534 files per directory, the solution there is not to use an outdated filesystem like FAT32.

Generally there are two ways to approach this sort of issue:

Increase the resource (make more inodes)

This can be done by specifying a larger number of inodes when creating the partition, which is relatively easy to do (example) but requires foresight that you're going to be running a node on the partition. Alternatively, make another partition with the required number of inodes.

Use the resource more efficiently (use fewer inodes).

Perhaps the simplest way to achieve this is to just stick multiple blocks in a file - I'm not sure how this would work from an architectural point of view but it's something that would have to be implemented in the client.


Is it possible to create a Bitcoin URI with multiple outputs?

No, this is not possible according to BIP 0021. The BNF grammar for the bitcoin: URI scheme starts with:

bitcoinurn     = "bitcoin:" bitcoinaddress [ "?" bitcoinparams ]

Since bitcoinparams has no address information, this means that exactly one output address is required.


Local Testnet3, where do the new coins get sent to?

Newly mined coins are immature and cannot be spent until 100 more blocks are mined.

bitcoind does not show immature coins as part of your balance, but you can see them using the listtransactions command, as I explain here.


Blochchains that support data privacy and/or strengthen parties pseudonymity

For question 1 and 2, ZCash (not Zikas) provides some solutions.
It's based on Bitcoin's code and has 2 types of addresses:

non-shielded: they behave exactly like normal Bitcoin addresses
shielded: you can't know how much they are transacting nor to whom they're sending funds (unless it's to non shielded addresses).

If you only use shielded addresses, and only send funds to shielded addresses, it's impossible (just from looking at the blockchain) to know how much zcash you have, nor with whom you're transacting with. However, creating shielded transactions is slow (it takes minutes IIRC), and your wallet has to scan the full blockchain to know if you've received payments.

OTOH, shielded transactions give you the possibility to attach a custom memo to them which will be private between you and the recipient.


A hard fork is by definition one that does not get solved. At least not by the rules of the system, as it is essentially an incompatibility between the rules assumed by separate nodes.

But think about what can cause such a thing:

An incorrect (=not identical to the rest of the network) implementation forks off. In this case it will always certainly be clear who is "at fault". For example, in the 0.7 vs 0.8 fork, there was a bug in the 0.7 (and older) clients that limited them in an unknown way, but 0.8 was at fault for not correctly mimicking the bug. As keeping such a weird and inconsistent limitation would hold the network back, and be risky in itself, the bug-free behavior will become allowed after may 15. However, if old full clients remain on the network after that date, they will end up on a fork, and this fork will not resolve.
Two implementations arise that knowingly implement different rules, perhaps because of ideological disagreement about what the rules should be. If both are economically significant and have significant mining behind them (which in neither case necessarily means a near-majority), this is pretty much a disaster. The incentive for consensus is huge, as disagreement effectively means granting every old coin hold to spend it once on each side.

Regarding decentralization, I think you mistake consensus for centralization. There are of course degrees, but ultimately it is Bitcoin's users who decide which rules to enforce by the software they run. However, as explained, there is a huge incentive for making sure no real disagreement arises. In some cases that may mean discussion will be needed, and an agreement has to be reached, perhaps a compromise. But it doesn't mean one party gets to control others.


Will general non-standard transactions ever be allowed?

The current development direction (January 2013) is to tighten up the IsStandard() checks even more. For example, we would like all signatures to conform to a very strict, canonical encoding to make life more difficult for potential attackers.

Allowing more opcodes or opcode patterns (or all opcodes/patterns) to be considered IsStandard() is certainly possible; before doing that I'd like to see a thorough analysis of the possibility for mischief using the current set of opcodes  and a lot of prototyping on the test network (where the IsStandard() check already allows all enabled opcodes).


What is the best way to share the blockchain and get it verified by the wallet?

You can literally concatenate all the *.dat files and share that. The user downloading can use that as their base download by using the bootstrapping option (-loadblock) in bitcoin core.

Generally, the trust a user puts in the blocks you give them is not really needed since the proof-of-work is verifiable by the new node. New blocks will also reference the previous block so it's easy enough to verify that they're on the chain that new blocks are coming in from.


Expand lightning channel capacity or open new channel?

As explained here How to fund a bidirectional payment channel? there is a difference between capacity and balance of a channel.
Your channel has a capacity of 20000 Satoshi and this number is (as of the current protocol specification) fixed for the lifetime of the channel.
Your local balance seems to be also 20000 as you have opened it. Making payments changes your balance but not your capacity.
Looping is a special case of making / receiving a payment and will only change your balance (remember the balance can never be below 0 or higher than the capacity) so in your case looping will not help you.
If you want to increase the capacity you will have to choose and open a new channel


There have been plenty of dollars spent on lawyers by Mt. Gox, BitInstant and others, but for specific legal issues.

For instance, a decision after Mt. Gox sued its bank in France:

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

There is the CryptoCurrency Legal Advocacy Group:

http://en.bitcoin.it/wiki/Cryptocurrency_Legal_Advocacy_Group
http://www.theclag.org

There is an argument that Bitcoin isn't a security (in the U.S.):

http://www.lextechnologiae.com/2011/06/26/why-bitcoin-isnt-a-security-under-federal-securities-law
http://www.lextechnologiae.com/2011/06/17/extending-real-world-laws-to-virtual-worlds-is-a-terrible-idea

Is Bitcoin a commodity then?

http://blog.bitcointitan.com/post/17789738826/what-u-s-regulations-apply-to-bitcoins-as-commodities

Other links:

Ruben Grinberg's paper:
Bitcoin: An Innovative Alternative Digital Currency

http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1817857

Real legal issues with virtual currencies:

http://www.networkworld.com/newsletters/sec/2010/051010sec2.html

Quora: Is Bitcoin Legal?

http://www.quora.com/Is-Bitcoin-legal

There are even lawyers who accept bitcoin:

http://en.bitcoin.it/wiki/Trade#Legal_Services
http://bitcointalk.org/index.php?topic=65482.0

But that's about the extent of it, thus far -- at least what's publicly known.


It was self-fixed. Frozen Transaction just disappeared.


Check out xchange on github::
https://github.com/timmolter/XChange

It works on multiple exchanges, and is written in Java.


In general, converting between big and little endian values depends on exactly how you're storing those values, so both of your examples could be correct in different implementations. To this end, techniques are likely to vary even within the same application since it's more dependent on how your input data is formatted.

It's also dependent on how your particular use case defines endianness - there's no one-size-fits-all definition - endianness can refer to the order of 8-bit bytes within a 16, 32 or 64 bit word or it could refer to the order of individual bits or even the order of entire words within a larger context. If you're encoding the 16-bit word "07F3" for example and your definition of endian refers to bytes within a word then big-endian would be "07F3" and little-endian would be "F307" - working with a 4-bit byte you would end up with "07F3" and "3F70" and working with individual bits big-endian would be "0111 1111 0011" (07F3) and little-endian would be "1100 1111 1110" (0CFE).

One excellent example, however, is the EncodeBase58() function in Bitcoin's base58.h which uses a char vector and C++'s built-in reverse_copy function to reverse the elements' order in the vector:

// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());

Now I'm not 100% sure but I believe that what's being passed in to the encode functions is a UTF-8 encoded string representation of the value, so in your own words it would seem that Bitcoin's endianness conversion - at least where Base58 conversion is concerned - is a simple string reversal as long as the input is UTF-8 encoded.


Will the size of a Bitcoin Core full node be too big to run on a normal computer?

Bitcoin has to maintain some balance to be able to retain the ability to be decentralized. As you've correctly established, this is partly down to making sure that the resource requirements of fully validating the block chain are not unreasonable. There's a push form the consumer side of things to constantly increase the resource usage of Bitcoin for convenience or lower transaction fees, but this comes at the cost of decentralization. What the limits for this are is debatable to some extent, but there are clearly hard limits to avoid.
Most notably it's difficult to undo mistakes in this area of the system design, going too far with resource usage is effectively a permanent decision so you will find that choices have been made as conservative as reasonable.
We have the following limitations to contend with:

Size of the block chain. It is often advantageous to store previously validated information, even if it is not immediately required for the operation of the system. It makes wallet management easier and allows for easy re-synchronization if required. The limit of this can not be above reasonable cost or the size of volumes available to the mass-market.
Growth of the block chain size on dish currently is bounded by the block size limit. Knowing that 6 blocks happen on average per hour, and they can be a maximum of 4MiB when fully saturated with Segwit transactions, we have a bounded growth of 210 GiB per year.

Nodes can disgard these blocks once validated to avoid storing them, but the entire set must be transmitted to them in some form, typically over the internet but could be done via Bluray, Fedex, or carrier pigeon if this was cheaper or required. This is a limit for the size of the growth, as it must not exceed the ability of users to obtain the data needed to validate.

Size of the UTXO. The Unspent Transaction Outputs database is the storage of units of Bitcoin that have not been spent. This is consensus critical and must be stored by all nodes in the network who are fully validating. This database has looser restrictions on its growth, and is effectively bounded by the block size as well, as it implicitly limits the number of entries which can be added to the database. Unfortunately there is not much to be done to reduce the impact of this 4 GiB storage on disk without much larger economic changes to Bitcoin to allow for entries to be "archived".

Validation complexity. The transactions within the chain have a cost associated with their validation. ECDSA is used in Bitcoin due to it being extremely space efficient and suitable for the task, but it is not particularly fast even with completely optimized implementations. Synchronizing the Bitcoin chain involves billions of individual SHA256 and ECDSA operations which puts a hard limit on the number which can be performed by a consumer processor in a reasonable amount of time. The growth of the chain should not exceed the ability for reasonable, consumer hardware to complete validation.


How does proof of work inspire trust when the work is just guessing?

Forget PoW for a second: lets instead imagine that you have a box, and you've placed a lock on it, in order to secure its contents.

Now, if someone asks you how secure the contents are, then the size and type of lock is fairly important. Tying the box closed with a bit of string isn't very good security, at least compared to a heavy-duty padlock. For an attacker to get into the box and alter its contents, they will need to work much harder to get past the padlock, compared to the string. We can use the word 'work' here in the thermodynamic sense: energy being used to perform an action. In order to break into the box, there is a minimum amount of work we would expect the assailant to have done. The minimum amount of work to break the padlock is obviously higher than the string, so we consider the padlock more secure.

Keep that point in mind: breaking into a more secure box requires more work. You cannot fake the work, you either have the resources to cut the lock, or not.

So let's go back to Bitcoin mining: when a miner is hashing to find a valid PoW, they are doing work by expending energy as computational cycles. The PoW function is devised such that we can expect a certain amount of work to be done (on average), in order for the miner to find a valid block. You can think of this PoW as the 'lock' that has been put on the block: in order for an attacker to alter the history of transactions, they will have to perform (on average) this same amount of work (spending energy, a real resource) in order to find a new, valid PoW and replace the block ('breaking the lock', as in our example from above).

Thus, the history of transactions is secured by miners spending energy to create the PoW that is required for a block to be valid. More energy spent mining creates a 'more secure lock', since a malicious miner would be expected to spend an equal amount of energy in order to break it. Miners are incentivized to continue building upon old blocks, thus piling one lock on top of another lock, on top of another lock... and it is this mechanism which allows the history of Bitcoin transactions to be considered secure.


What happens to Bitcoin wallet / Bitcoins if PC is stolen

Accessing to (your) bitcoin requires a private key.
This is kind a long number password to access the bitcoin on the network called blockchain.

All bitcoin are saved in this (online) network.
A private key looks like this:
5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF

Important thing is you save your private key on different places in case you need it back again. One good practice is print it on a paper with QR code. This is called Cold Storage. This is your backup.

Don't show this private key to anyone else and save a copy somewhere else than your home.

Act like a bank, because with bitcoin you are own bank.
When your PC is gone, you take the private key and setup a new wallet on a device. Amount of the bitcoin will be exactly the same as it was left last time, because it is saved on the blockchain.

Read more here
https://en.bitcoin.it/wiki/Private_key