What is happening when a channel is pending? What is happening when a channel is pending when opened? How long does it usually take? To open a channel with a node you're already connected to you don't need to get consensus from all the other connected nodes (as you would if you were sending a transaction on chain) so why the wait?

Opening a channel involves sending an on-chain transaction (with a multisig output controlled by the channel’s participants), so when the channel is ‘pending’ it simply means this transaction is not yet confirmed. How long it takes the transaction to confirm depends on the same factors as any other transaction.

Further, the participants will often wait for a certain number of transaction confirmations before starting to make channel payments. The number of confirmations required is negotiated in the minimum_depth parameter of the accept_channel message. From BOLT 2:

  The funding_locked message indicates that the funding transaction has reached the minimum_depth asked for in accept_channel. Once both nodes have sent this, the channel enters normal operating mode

(thanks to @jnewbery for the added info)


Where does the US Dollar go when you buy a bitcoin? Not From Anyone but from CoinBase ect. Ok, So I see A lot of people say that the bitcoin when purchased from one person to another that money gets sent to that other person in exchange for the BitCoin. Example If Bob has a bitcoin for 10 dollars and sold it to Jim, Jim would Pay 10 dollars to Bob for that Bitcoin. So what happens to the dollar when someone buys a bitcoin from cryptocurrency market. That money doesnt not vanish, so where does it go? It has to go somewhere. Its really confusing question hopefully someone can help me understand. Thank you.

When you buy a book from Amazon (directly, not from its marketplace), who gets the money?  Amazon gets it.  They can use the money to buy more books to sell to other customers, pay their employees, power their servers, etc.

When you buy Bitcoins from Coinbase, who gets the money?  Coinbase gets it.  They can use the money to buy more Bitcoins to sell to other customers, pay their employees, power their servers, etc.


Can Bitcoin.org precalculate bitcoin history and distribute it instead of requiring every new user calculate it for hours? I am trying to set up a desktop client of Bitcoin Core, downloaded from Bitcoin.org. The process requires me to download about 350 GB of data of all bitcoin transactions, but there is an option to prune it to size of user choice like 2 or 4 GB. Since the history is the same for all downloads, why not precalculate these 2 or 4 GB and distribute it to new users? Why it is required that they process all the data by their computer?

Because that would require to trust the person that gave you the data (the utxo set). If you could download just the utxo set and start running your node someone could easily circulate fake data i.e credit his own address with 1000 BTC. In order to know that his address does not actually have 1000 BTC you need to replay all the transactions that ever happened and arrive to the correct balance for each address.
An alternative to running a full node (which requires no trust) is to run an SPV client which does not validate all block data but still does header verification.


Why does the blockchain need blocks? I think I understand the main parts of the Bitcoin blockchain. While I was explaining the concept to my girlfriend she asked me why groups of transactions are actually stored in a block? Every transaction is verified by every node, so why do we need blocks?

I had no answer to her question, so maybe a greater mind than me can explain why the blockchain needs the transactions to be stored in blocks?

A block is just an arbitrary grouping of transactions.  It makes a convenient chunk of data for a proof-of-work to be performed on.  You could hypothetically do the proof-of-work on the transactions themselves, and then chain them one after the other.  This, however, would fail miserably.  Blocks must reference the previous block, so if you just go by single transactions instead of blocks, you'd have wait for the proof of work on each transaction.  It means that you could only have a single transaction on the network per target time for the proof-of-work algorithm.  It's a terrible solution in terms of scaling.  This would also create other problems, particularly having to do with a miner's incentives, and the censorship-resistant nature of the network.  Groups of transactions are better to work with.


If all block chain copies get deleted, what would happen? What would happen if all block chain copies get deleted at one time?

At first, all clients would try to get the block chain from other clients, right? But this would fail. Would the "network" then (but when exactly?) assume that everything just started, and mine the genesis block again?

The only time when the actual block data is needed is when other peers are fetching the blocks from you, or when you need to rescan for new wallet transactions.

However, the blocks you have already verified and processed are no longer needed by you yourself. Your node would not reset its state, as it still has the result of validating those blocks (the set of the remaining unspent transaction outputs). You could even mine new blocks still, and broadcast them, and other peers (who were similarly caught up already) would accept them as if nothing happened.

Of course, there are safety checks, and your client will not start when block files are missing. If those would be disabled, and everyone did this, and everyone deleted their blocks, the only effect would be that new nodes would not be able to synchronize anymore.

A future version of the reference client (possibly 0.10.0) will support "pruning", namely actively delete block files after validation when they're old enough. This will make your node stop advertizing as a full node, but it will keep functioning without lessened security otherwise.


How can transactions be verified without the private key? Trying to get my head around her royal Bitcoin here...

I understand that blocks of transactions are broadcast to the network, and that miners verify that the BC is 'spendable' by trawling the blockchain and following the wallet address's transaction history (or at least I assume that's how it works).

But how does one actually verify that the BC transaction has been signed by it's owner when the miners don't have access to the private key? To put it simpler, how can verification take place without processing both the public and private keys?

I'm probably misunderstanding PKI encryption, but (say) with SSH, the private key would be on a trusted server and verification would take place on that server. How can that possibly work in a distributed network?

Bitcoin transactions are not encrypted, they are cryptographically signed.

You can use a public/private keypair 2 ways:
(massive simplification warning)

Encrypt a message using a public key and then decrypt it with a private key
Sign a message using a private key and validate the signature with the public key

The second method is the one that is used by Bitcoin. A message is placed in the distributed ledger that bitcoins have been sent from X to Y (and typically Z), and signed by the private key of X. X is the source bitcoin address, Y is the destination, and Z is the change address.


BOLT #3: Shouldn't timeout be included in the script of "Offered HTLC Outputs" for the local node? According to the BOLT #3 documentation, the offered HTLC output has the following script that allows the remote node to claim the funds with the payment pre-image and the local node to claim it after a HTLC timeout.

1.  # To remote node with revocation key
2.  OP_DUP OP_HASH160 <RIPEMD160(SHA256(revocationpubkey))> OP_EQUAL
3.  OP_IF
4.      OP_CHECKSIG
5.  OP_ELSE
6.      <remote_htlcpubkey> OP_SWAP OP_SIZE 32 OP_EQUAL
7.      OP_NOTIF
8.          # To local node via HTLC-timeout transaction (timelocked).
9.          OP_DROP 2 OP_SWAP <local_htlcpubkey> 2 OP_CHECKMULTISIG
10.      OP_ELSE
11.         # To remote node with preimage.
12.         OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
13.         OP_CHECKSIG
14.      OP_ENDIF
15. OP_ENDIF

If you see the output that sends the funds to the local node (line 7-9), it is not timelocked in the script. A local node after signing the commitment transaction, which includes the HTLC he offered, can broadcast the commitment transaction that claims the money from the HTLC-timeout (he already has the signatures) and pays to an address with to_self_delay.

Although the delay exists in the 2nd stage (CSV locked with to_self_delay), nothing stops me from offering a htlc to my peer node, sign the updated commitment transaction and a second later broadcast the commitment transaction on mainchain and spend the HTLC to an address locked with CSV. The remote node will still forward the htlc because from its viewpoint it is still within the bounds of the cltv_expiry as specified by BOLTs. Now, when the remote node gets the pre-image it doesn't have any transaction to settle with. Where is the shortcoming in my though process and isn't timelock expiry something that should be included in the script itself?

Pierre answered my question on the lightning-dev list and there is a pull request in order to make it more explicit. So the answer is that although the timeout is not addressed in the script, it is enforced in the HTLC-timeout transaction with an absolute timelock in the nLocktime. When the local node tries to spend the HTLC output, it has to explicitly set the nLocktime to cltv_expiry which prevents it from broadcasting the second-stage HTLC-timeout transaction until that time has reached.


Private Blockchains: Validation I'm a software developer, and I have some questions about private blockchains, I'd like to have technical answers since I'm trying to understand blockchain at a code level. I'm going to write a problem, and it's all for the sake of getting ideas :)

So this is the context:

We have a private blockchain where blocks are added by a certain type of node (let's call them validators). The validators are the ones that are allowed to add blocks to the chain: they of course, verify the blocks by making use of some rules.

We also have the regular nodes (they can't add blocks but they can send their chain to other nodes if x node requires it)

Node A modified a block (x), and node B requested Block X to node A, Node A sends its block to Node B but this block that was just sent is an invalid block because it has been modified.

How can Node B certify that block x is an invalid block (since It's valid for Node A, how does node B know that it's an invalid block): we have a 50-50, who holds the truth then?

Would node B need many examples of Block X so Node B can decide if the block is valid?: 10 examples were received by Node B, 9 out of those 10 examples has the same hash (Y) but the hash that is different (block x from Node A) is the minority, so the winning hash (winning block) would be Y

Would we need an election process where the validators nodes decide which block is valid?

How would we solve that issue according to your knowledge?

I think that problem I just wrote is called The byzantine fault problem (I'm not sure but According to what I've read it seems like it is). I'd be glad to hear answers from you and any ideas as well!.

NOTE: THE PROBLEM I just described is not related to any blockchain of any cryptocurrency. The problem i described is only related to the blockchain technology itself and applications based on it.

How can Node B certify that block x is an invalid block

At a very basic level: a blockchain is a hash-linked list. Each block references the hash of the block preceding it, so any modification to a past block will be obvious, because that block's hash will no longer be a part of the longest chain.

The situation is trickier for a new node that is hearing the history for the first time though, or during a time when there are two valid competing chain-tips. Which chain-tip should be considered valid?

Bitcoin uses proof-of-work to decide which chain is valid: the one that has the most work accumulated (often termed 'the longest chain'). You cannot fake work being done, and so the competition amongst miners is what secures the network's history from tampering.

Without an objective measure (ie, energy spent creating a PoW), it can become very difficult to determine the valid chain in the event of a chain-split. You could create a system of voting, but such a system relies on subjective measures, and as such may be more game-able by network participants.


what is the difference between OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY I would like to learn the difference, explained as simple as possible, between OP_CHECKMULTISIG / OP_CHECKMULTISIGVERIFY and OP_CHECKSIG / OP_CHECKSIGVERIFY. The only explanation I found is: Same as OP_CHECKMULTISIG (or same as OP_CHECKSIG) except OP_VERIFY is executed afterward.

For OP_VERIFY: Mark a transaction as invalid if top stack value is not true.

Can this be better explained? How does OP_CHECKMULTISIGVERIFY and OP_CHECKMULTISIG differ in practice and in logic of creating scripts? What are the effects (pros and cons) of OP_VERIFY being executed afterward or before? Examples would be highly appreciated.

OP_CHECKMULTISIG, OP_CHECKSIG, OP_EQUAL all put true or false on the stack. This means you could use them with an OP_IF or similar, it doesn't have to immediately end execution if its false. OP_VERIFY will, as you quoted, mark the transaction as invalid of the top stack element isn't true, but you may not want to, you may want to perform some additional logic before that.


Bitcoin wallet/address balance confusion I'm quite new to bitcoins so apologies if i'm being a noob, but I'm very confused!

My bitcoin-qt wallet balance says I have 2.0113406 BTC (which is what I expect).

Now if you check my transaction history:
http://blockchain.info/address/1HvxJibwAAyVqcNY5GVUWvHSwgYybpRGTp

It says that I only have 0.0123506 BTC?

I think the confusion stems from the transaction I made to satoshidice. It says I sent 2 bitcoins to satoshidice but i only actually sent 0.01. Further inspection yields that I actually sent 0.01 to satoshidice and the remainder to address 1EHYT8dFMcDVnkkE9kEoH5T3PBb3bRZdmP. What is that address? Is that one of my addresses that I don't know about?

What's going on?

Your Bitcoin wallet can have more then 1 address. In fact the Satoshi client (Bitcoin-Qt) creates 100 addresses from the start.
Both 1HvxJibwAAyVqcNY5GVUWvHSwgYybpRGTp and 1EHYT8dFMcDVnkkE9kEoH5T3PBb3bRZdmP belong to your wallet and thus the total balance you see it correct.
Now to why this did happen.
Your wallet received 2 BTC. When you sent 0.01 BTC to Satoshidice "input" the previous mentioned 2 BTC where used as "output" and had to be spent in its entirety. Because the output was bigger then the input the Bitcoin client sent the difference to a new address, which also belongs to you.
In our daily life this is known as change money.
You can read about this in detail on the official wiki: https://en.bitcoin.it/wiki/Change


Where can I get the source code of Bircoin or ANY other cryptocurrency compilable in Visual Studio? I really want to study the source in detail. I'm using windows so can't compile the source on Github. I found one here : http://bitcoinqtmsvc2012.codeplex.com/, but couldn't get it to compile even after downloadinng and installing all dependencies required.

Can anyone please refer me to a compilable version of bitcoin in visual studio format?

The source to bitcoinqt is windows compatible, if it wasnt then there wouldn't be a Windows port of it. I would assume you need to install Cygwin to get the appropriate development tools such as gcc. Since you dont know about Cygwin, I can only assume you dont know how to compile software on *NIX. Change the current directory to that of bitcoinqt, and then type "./configure" and then "make". That usually works, you might need to specify options to configure, which you can find out with "./configure --help".

If you can't get a project to compile then you really should be asking Stack Overflow about the compilation errors instead of posting here. And just saying it doesn't compile doesnt provide anyone with enough information to tell you why it isnt compiling.


Forgot wallet encryption password, are any brute force tools available? I have an idea of what my password should be, but am missing something.

Are there any tools or bash scripts to brute force my wallet passwords?

If a dictionary is required, I can pre seed it as necessary (but if I pre-seed a dictionary with my expected passwords that utility better be FOSS so I can review the source ;)  )

There is a script provided by a forum user Revalin which can be used to attempt variations.  There is a forum user Rix who may be available for hire to provide assistance with this type of problem.

You can also try out this script:
https://bitcointalk.org/index.php?topic=170694.0


What happened to Bitoption.org? BitOption was one of the first sites that traded Bitcoin Options. I was going to put it up as an answer to this question, but then noticed that I'm getting a 502 Bad Gateway error.

Does anybody know what happened to them?

Last I heard, they were down to rewrite their code. Apparently too much was being done manually and they're trying to automate as much of the process as possible. There was a landing page for a time and I've not heard anything new on the subject so I'm assuming they've simply taken their web server offline for some reason.


Recovering the public key from a transaction Is it possible to get the public key of a user, if we have a transaction from that User in my wallet ?

There is no such thing as a public key for a user, but there is such a thing as a public key for an address.  The transaction that has been paid to you probably contains more than one address owned by the sender.  First, the bitcoin in the transaction likely came from multiple unspent transaction outputs (UTXOs), all of which were owned by the sender and probably have different addresses.  Next, the transaction likely had a change output, which would be yet another address owned by the sender.

Any of the UTXO's used as inputs to the transaction would have had the public keys of the addresses revealed in the scriptSig that was used for the input to sign the bitcoin over to you.  You can find these scripts by using a block explorer.  They will each contain a public key and a signature.

If the change output has already been spent by the user, you can find that transaction and look up the public key in the scriptSig there as well.

Keep in mind that none of this information is specific to your wallet, as it is all public information on the blockchain.  The only information you have that I don't have is the specific transaction you are referring to.  Given that transaction ID, anyone and everyone can look up this information.


Provable Solvency Implementations Is there a list of provable solvency implementations? It appears to be that each company is taking their own unique swing at the problem. This strikes me as an area that could benefit from standardization.

I do not know of a definitive list of provable solvency implementations. Some of the current implementations however do show signs of similarity even if you cannot call that standardization.

For example, tether.to ( https://tether.to/ ) backs every tether with a US dollar. That's 100% backing. This is not unlike the discarded gold standard where treasuries formerly backed a currency one to one. This was a provable solvency standard accepted by the international community for decades.

Bitfinex ( https://www.bitfinex.com ) keeps a balance of tether - and publishes exact numbers within its website - in line with its user obligations. Other players similarly strive to exhibit transparency in their financial transactions.

Some altcoins link the value of their coin to a tangible asset, such as marijuana. At the same time most people might agree that even an altcoin backed by a high value tangible asset is still not a provable solvency.

Transparency does not prove solvency. Maintaining a 100% reserve of capital assets versus capital liabilities does not prove solvency. Unless you have unfettered access to a Balance Sheet created with industry recognized fundamental accounting principles, with clear asset, liabilities and equity statements, and that these statements are truthful and complete, then there is no 100% verifiable method to ascertain whether a company is solvent, or not.

With privately held companies it is not likely you will see a publicly available Balance Sheet. So with private companies, as most bitcoin and cryptocurrency companies are, you will ultimately not be capable of proving solvency, notwithstanding capital asset and liability measures, or transparency.

If you cannot see the whole picture, then you cannot verify its authenticity.


Sequence number semantics Reading the following BIPs: 68, 112, 125, I got a few questions about the sematics of sequence numbers. As far as I understood, in version 1 transactions, sequence numbers have the following meaning:

If any input has a sequence less than 0xfffffffe, than the whole transaction is signalling replaceability

On the other hand, in version >=2 transactions, the above rule applies, plus:

If a sequence number has the disable flag (1 << 31) set to 1, then the sequence has no additional meaning (but can still be used to signal replaceability, right?)
If the disable flag is not set, then the sequence number is interpreted as a relative locktime with the format specified in BIP68. This means that transaction will not be included in a block until the output it spends reaches the specified age.

So, putting it all together, if one wants to signal replaceability in a version >=2 transaction, one can just use a sequence number which is less than 0xfffffffe but has an active disable flag (i.e. is greater than 0x80000000), on the other hand, how should one set the sequence number if one wants to both signal replaceability and also spend a relative timelocked output? Would it be ok to use a sequence number according to BIP68 and increase the bits that have no meaning in that format to replace the transaction? (i.e. changing all bits except 1 << 31, 1 << 22 and 0xffff)

If you're creating a version 2 transaction with the disable flag not set, then by definition the whole nSequence value will be less than 0xFFFFFFFE (because it will be at most 0x7FFFFFFF).

This implies that a transaction with an active relative locktime will always be replacable according to BIP125.

This is intentional. Nonreplacable transactions attempt to make use of the existing network policy rules to favor the first broadcasted version of a transaction. A transaction that will only become valid at a future point in time cannot make use of that, as it can't be broadcast until it becomes valid.


Accidentally transferred Bitcoin to Bittrex Bitcoin Cash account I accidentally transferred the money from coinbase BTC account To Bittrex BCH account.  It has yet to show up in either accounts.  Can someone help?

I realise the question is a few months old, and no response from OP, so maybe resolved.

But to answer the question for anyone stumbling across this in future, there's a good chance the coins can be recovered for now, but it depends on the address used.  If it's a "1" address, then the private key can be used by both bitcoin cash and bitcoin.  It's likely a manual task for the support team though, so unlikely they will be too happy about this!

Sending to a "3" address may be different, if it's a plain old multisig it could be recovered (I believe, as that's not been tampered with), but if it's a SegWit address, it may be recoverable - for anyone!  Bitcoin cash has no concept of SegWit, so the coins really are "anyone can spend", and in fact someone did claim them all at one point (not sure on the ethics/legality of that one, but that's another topic).

Immediately after the release of the bitcoin cash fork, all bitcoin addresses were valid on the new chain.  The good news is bitcoin cash is switching to a new address type see this question, so should cut down on the amount of issues this will cause in future.


Can gaming consoles be used as a Bitcoin mining platform? I'm very new to the concept of Bitcoin (having only just read the wikipedia entry and visited bitcoin.org)

My question is this: why is the mining platform limited to PC/ traditional computing devices? It seems that gaming platforms would also work quite well, having better performance specs than the general user would reasonably have on his/her home PC and they have networking capabilities.

When CPU mining was common gaming consoles did provide comparable performance.  There was some development work for xbox360 and PS3.  However roughly a year ago GPU mining hit bitcoin network rendering CPU miners obsolete almost overnight. Using unified shaders in modern GPUs and OpenCL programming language GPU miners could operate in parallel working on many hashes simultaneously.  Even the earliest crudest implementations vastly outperformed any CPU in terms of raw hashing power, hashing power per dollar, and hashing power per watt.  Since then refinement of OpenCL kernels have only widened that performance differential.  Currently there is no economic value in using CPU for mining Bitcoins.

Due to the emergence of GPU mining there are a couple issues that make mining with current gaming consoles futile.

Marketing aside gaming consoles are not that powerful.  Today a $69 AMD graphic card has more computing power than either the Xbox 360 or PS3.  Moore's law is a powerful force and gaming consoles which were start of the art in 2005 are pitifully weak compared to hardware available today.
As already discussed CPU mining is futile and unprofitable
The GPU in both consoles while powerful at one time are rather lackluster by todays standards.  They could provide low end hashing power except they lack unified shaders which makes programming them to do hashing impossible.

Consoles are not upgradable and that is both a benefit and detriment.  Right now we are at the tail end of ther current consoles lifecycle and it works against using consoles for computing power.  Since they can't be upgraded they are essentially $600 computers based on hardware available in 2005.  However at the begining of a console life cycle the hardware is rather powerful for the price point and they are routinely subsidized. At launch a $400 xbox 360 contained about $500 worth of hardware.

So to answer your question there is no benefit to mining on current gen consoles, however it may be possible that "next-gen" console would be viable hasing platforms at least for the first couple years (before their static hardware fall behind due to the continually effect of Moore's law).

However there are some requirements for a future console to be a viable hashing platform:

The Console has a GPU with unified shaders and good integer
performance.
The ability to access those shader either through API (Microsoft
XNA) or hacking/rooting console.
Powerful GPU relative to retail cost of the machine.

It remains to be seen if future consoles could be used for hashing but using current generation consoles for hashing is simply not economical.


Change -mempoolexpiry in BitcoinCore 0.20.1 I have accidentally made a transaction with a very low fee (5 sat/byte) and I doubt that it will be confirmed any time soon.
Replace-By-Fee is not available since my transaction has no change.
Abandon the transaction option is also not available.
How can I change the -mempoolexpiry setting in my BitcoinCore (0.20.1), which I run on Windows 10, so that I don't need to wait for 2 weeks for the transaction to be automatically dropped out of the mempool?

I have accidentally made a transaction with a very low fee (5 sat/byte) and I doubt that it will be confirmed any time

It may get confirmed in few hours/days based on the fee distribution of mempool I see at https://btc.bitaps.com

How can I change the -mempoolexpiry setting in my BitcoinCore (0.20.1), which I run on Windows 10, so that I don't need to wait for 2 weeks for the transaction to be automatically dropped out of the mempool?

It can be changed in bitcoin.conf file however if the transaction is already relayed to other nodes I don't think it will affect anything.


How does Ripple solve the sock-puppet problem during consensus? I'm under the impression that Ripple uses a consensus based system in order to determine which of two payments is the authoritative one, with the other getting rejected due to a lack of proponents. This form of decision making appears to be prone to a sock-puppet attack.

Would it be possible for someone to create a high value spend in one store and then negate it through a carefully timed sock-puppet attack such that the original   spend is outvoted by a lesser value payment that has vastly more (fake) backing?

In short, how are resources consumed during the consensus process?

A key point in Ripple is that the consensus doesn't take everyone's opinions into account. Each user has a list of trusted nodes. It will not do much good for an attacker to create multiple anonymous, untrusted sockpuppet accounts.


Could Bitcoins (or any other blockchain based cryptocurrency) feasibly ever be used for purchases that need to go through fast? Today, one of the problems with cryptocurrencies like Bitcoin is that it takes quite some time for a transfer to go through and enough confirmations to take place. This really isn't a problem when it comes to inherently slow buying procedures, such as for example ordering something online and receiving it a couple of days later by mail. However, other types of purchases requires a much faster process (for example if you're buying a digital good and want it immediately or if you're buying a physical good and want to leave the store with it right away), and as it is now, cryptocurrencies don't seem suitable for these as it simply takes to long time to confirm the payment and defend against double-spending.

Is this a problem that is inherent with the Blockchain technology, or could purchases go through much, much faster (at least so that they can compete with credit card transfers) given enough resources or faster computers in the future?

Blockchain technology, at least without accepting central party that controls access to the chain, inherently has slow blocks, or strong centralization incentives.

The reason is that blocks need to propagate much faster than the block interval time. If they don't, miners who are further away from the majority of the hash power are put at a disadvantage.

To explain this intuitively, notice that when miner A creates a block, he can start working immediately on a successor, while another miner B first needs to wait until A's block reaches him. During that time, B works on an outdated chain, and is unlikely to produce a block that ends up being accepted. The closer A and B are located together, and the more trust they have in eachother about not lying about new blocks they produce, the more they start to behave like a single party.

Thus, the ratio of block interval and propagation speed across the network is a means for keeping the advantages of larger miner groups over smaller ones in check.

This does not mean that the bitcoin currency is inappropriate for fast payments. They just require another mechanism than on-blockchain transactions. For example, look at the proposed Lightning network, which allows many small transaction between parties to occur, while only settling the resulting balance on the blockchain. It requires more trust, but has higher performance and convenience, and lower costs.


Trying to understand the bitcoin chart I'm trying to understant this bitcoin chart, but there's no indication of what's the Y axis. The "200K" means the value in dollars? Or in bitcoins? Or what?

I'm trying to check out the value of a bitcoin in comparision with US Dollars over the year.

The left Y-axis applies to the lighter colored volume bars from the bottom of the chart which denote the trading volume in BTC. Alternatively you have the option to display these volume bars in the respective other currency (USD in this case), if you select the "Volume in Currency" checkbox at the left of the page.

A volume bar shows how many units of the currency were traded within the respective timeframe (days in this case).

To just compare the price of Bitcoin in comparison to the US dollar, you can ignore the volume bars and just look at the price as denoted by the Y-axis on the right of the chart. If you use this link, you see just the daily price over a year without volume bars or candlesticks.


Can a Qubit Miner ASIC device be created and what would its impact be on the mining community? With mining gaining in popularity every day and the raw power of the ASIC devices increasing at a dramatic rate, I wonder what is the next big jump for miners.

Qubits, or quantum bits, have already shown to be extremely fast at calculations.  That makes them seem like a perfect fit for mining bitcoins.

This question is asking if a qubit device can be created for mining bitcoins and, if so, how it would affect the current mining community using standard zeros and ones.  To ask this another way...

How much faster would a qubit device mine bitcoins when compared to an existing ASIC device today?  Let's compare it to ButterflyLab's Mini Rig which runs at 500 GH/s.  Ten, hundreds, thousands, millions times faster?  Could quibit devices destroy the bitcoin network by controlling more than 51% of the network?

The best thing I can imagine is running Grover's algorithm, which speeds up what would be an exhaustive search for a single solution among N input values to take only about the square root of N actual evaluations. Only very special problems, like factoring numbers, have better known quantum algorithms.

If you imagine connecting a hypothetical quantum computer to a mining pool, the impact would be low: The quantum computer can only be run on the share of work it gets, which means finding if any of 2^32 nonce values yield a proof of work. An ASIC miner could probably do that in less than a second using (internally and highly parallelized) something like 2^32 operations, each of which includes several 32-bit additions. The quantum computer could get away with doing about 2^16 equivalent quantum operations, which, after serializing the bit operations of the additions, likely means many thousand times 2^16 consecutive qubit operations. And it will require on the order of a thousand qubits, at least. Sounds to me like in this scheme a quantum computer might, at best, be equivalent to a hundred ASICs or so.

But it might just get interesting if we move more of the mining algorithm onto our hypothetical quantum computer. If the extra nonce can be incorporated into the Grover algorithm, a larger search can be performed, with a correspondingly larger speed-up. Unfortunately, a much larger quantum computer running a much more complicated program would be needed. Or let us say fortunately for whoever might otherwise worry about mining competition!


Electrum hangs when sending bitcoins I am using Electrum and when sending bitcoins I got a small window with a "Please Wait..." message, the problem is that it has been more than 1 hour and nothing happened! The window is still there and I can tell from blockchain.info that the bitcoins is not received at the destination.

Is it normal?
what is the correct behavior expected?
Should i close the "Please wait..." window and re-send the coins?

Try resarting the client, switching servers and make sure that you are connected to a server (green ball in the bottom-right corner) before making a tx


What is needed for Bitcoin to become the reserve currency of the world? Bitcoin's characteristics seem to make it a prime candidate as a reserve currency, given it has fast transactions to anywhere in the world at a low cost with little to no price manipulation or export/import controls.

Imagine a traveller arriving in a foreign country, having bought 100 Bitcoins in his country. Rather than go through a middle-man currency exchange, he finds someone who wants Bitcoins (or even a Bitcoin ATM) and sell his Bitcoins for local currency.  When he is ready to leave, he simply sells back his local cash for Bitcoins without being hit twice by the currency exchange's transaction fees.

What would have to happen to make this a reality?  Is it feasible?

You would be hit twice by the currency exchange anyway if you were to buy Bitcoins for your local currency, and then buy the foreign currency with Bitcoins. If you would perform those transactions at exchanges ran by large companies, there is little difference from a traditional model. If instead you would use exchanges like Mt.Gox, the spread would go back to the people, rather than a company. The spread might be smaller or bigger, it all depends on the market.
Banks and companies like Visa often allow you to withdraw foreign money at a local ATM in the foreign country, sometimes even not charging you anything for the operation asides the money conversion spread. You perform only one conversion for the bulk of your money, and whatever is left over you can sell back at the money exchange. So by bypassing Bitcoins, you can save money (if the banks operated at a comparable margin as the Bitcoin exchanges, be they owned by a single company or not).
Most Bitcoin exchanges offer you money withdrawal to a bank local to the currency. If you were a tourist, this would not be convenient for you, as you wouldn't have an account in any bank like that. An alternative would be a service like OKPAY, but as it is to handle both Bitcoins and other currencies, there is no need for other exchanges.

So all in all, your proposed idea does not seem to be plausible at the moment. Main advantage of using Bitcoins for such a task is lowering the spread, which could also be accomplished without Bitcoins (say, an online community currency exchange). The proposed idea would however be more plausible if a whole country would adopt Bitcoins as its official currency, which is very unlikely to happen in the nearest foreseeable future (governments seem to move away from currencies tied to a limited resource, like gold or silver, to fiat currencies to enable easier growth).


How much can I earn with AntMiner S7 miner I have started to learn about blockchain technologies, BTC and other crypto-currencies and right now interested in mining.
I know that mining of BTC is not very profitable right now, but other currencies can be profitable.

I looked at ETH, DASH and Monero and according to this site I can earn near 150K per day with AntMiner S7, which seems to be unrealistic.

Please help me understand how this stuff works, is it real or have I some misunderstood something?

Well, BTC limitation is not a true. But yes, sha256 world is not quite big.
Mining btc on antpool will give you basic statistic, it's depends on your local costs and power limits more than the your Antminer can do)

Ok, I have custom build S5 with 4 hash boards that can provide ~2Th on freq@275(this is my own limitations).

Okay back to PnL, so I'm able to mine ~0.001/day BTC on antpool.
Then I moved to multipool and started mining alt coins that provided much more profits for me, depends on coin ~ ~0.002-0.004/day BTC
https://www.multipool.us/dashboard/pools/sha256

You may try to find another alt coin pools, but keep in mind your antminer works with SHA-256 algorithm only.

Hope it helps.


Bitcoin core - Listtransactions doesn't show fee of received transactions I'm using bitcoin core full node on ubuntu. When I call listtransactions some transactions coming up with no fee key.

  [8] => Array
    (
        [account] =>
        [address] => 1MTLEprpnQwLHMeYh51CQrCWxSuZPGSZ6T
        [category] => send
        [amount] => -0.0028107
        [vout] => 0
        [fee] => -1.13E-5
        [confirmations] => 0
        [trusted] => 1
        [txid] => 6c74d8ac3b9b57184ed5dff72d48474c5ecf8dac4ec9388cb0ff33bf8e3bfcbc
        [walletconflicts] => Array
            (
            )

        [time] => 1511008107
        [timereceived] => 1511008107
        [bip125-replaceable] => no
        [abandoned] =>
    )

[9] => Array
    (
        [account] =>
        [address] => 12zJ7ZbDW59mmNBPrxBAEjtWf8JzwgLNum
        [category] => receive
        [amount] => 0.00240164
        [label] =>
        [vout] => 0
        [confirmations] => 0
        [trusted] =>
        [txid] => 25d0812c7dcf3c938430dc5c61566b8346b6e6d300b1e3cd3fc7d4031eb93cbe
        [walletconflicts] => Array
            (
            )

        [time] => 1511010977
        [timereceived] => 1511010977
        [bip125-replaceable] => no
    )

)

Transaction on blockchain: https://blockchain.info/tx/25d0812c7dcf3c938430dc5c61566b8346b6e6d300b1e3cd3fc7d4031eb93cbe

I have read that just now on bitcoin.org,

  If sending payment, the fee paid as a negative bitcoins value. May be
  0. Not returned if receiving payment or for move category payments

Which answers my question, but now i'm wondering how to get the fee of received transaction.

To find the fee of the transaction, you need to know the value of the inputs and outputs and find the difference between those two values.

Unfortunately this is much more difficult for receiving transactions, because by default bitcoin core only holds the information for transactions which are related to your wallet, not all transactions (this can be enabled with txindex=1 argument).

What this means is that, to find the fee for a receive transaction, you can call getrawtransaction "txid" true with the txid you obtain from listtransactions. The last argument, true is set to make the output "verbose" so that it includes more information about the transaction than just the hex encoded transaction itself. It will return a JSON object with vin and vout arrays which you can iterate over. You can simply sum the output values. The trouble is finding the input values. Input values are not given in transactions, so you must look them up individually. This is a problem for receiving transactions because the transactions they spend from are usually unrelated to your wallet and thus cannot be looked up without txindex=1.


Can bitcoins be traced by pool workers? A lot of people doing bitcoin mining participate in pooled mining. When participating in pooled mining the workers perform some mathematical calculation (that I have actually not understood) and are rewarded payouts for their contribute to new block generation.

Is it possible that the workers, minining in a pool, can find out which bitcoin they are working on? If yes, I think they would be able to see to whome the bitcoin they worked on was transferred later to?

When a miner in a pool finds a valid block, the pool receives a reward (currently ~50 BTC) in a special generation transaction in the block. The address receiving the generation reward in a given block is known, and pools publish statistics on which blocks they found (and even if not, the miner who found it can in theory know which blocks he himself found if his mining software keeps a record of it), so the generation rewards can be tracked (to the same extent that any other Bitcoin transaction can be tracked).

The mathematical operation done when mining is calculating SHA-256 hashes of variants of a block header. You can learn more about mining for example at What exactly is mining?


Can SPV clients offer "proof of absence" of a transaction? So light SPV clients give the user the ability to obtain merkle proofs (from a full node) that a given transaction is included in a block. Is there some cryptographic mechanism by which an SPV client could obtain proof that a transaction (or type of transaction) is not included in a block, while still being relatively "light" (O(log(n), say)?

Asking for a layer 2 solution ;)

There is no known way to do this with the current consensus rules nor does it seem likely except via computationally expensive general ZKP.

The normal way to make compact proofs of non-membership is to have a hash tree which is ordered by the key you're looking to prove non-membership on.  The proof is just the two neighbors that are greater and lesser than the key in question.

To show non-membership in a block this with a general ZKP (like bulletproofs) you would have to write an arithmetic circuit that computes the hash root of a block, and also scans over transactions looking for the thing-of-interest.  If done using a bulletproof the proofs would be log in the size of the circuit, and take time to prove and verify linear in size... so they'd be somewhat slow but bandwidth efficient.


Can someone explain what exactly is derived address? Let's say my mnemonic words are

  army van defense carry jealous true garbage claim echo media make
  crunch

When I used https://iancoleman.io/bip39/#english, the section, Derived Address, showed me a lot of addresses. Among them, I found an address that my wallet showed, but the address would change time to time?

Why does my address change?

I understand that Derived Address are children of Account Extended Private/Public Keys, but why isn't my wallet showing me all of those addresses that I can use?

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

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?

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

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.


Is it possible to give a public read only access to a Bitcoin account? Is it possible to give a public read only access to a Bitcoin account using the Bitcoin client?

For example if for an non-profit organisation it can be useful to have read only access to it's Bitcoin account.

I know it is possible to make an web-service that is displaying this kind of data, but this requires a third part authority.

If you want the person to see the balance of each address, give them an encrypted wallet used by you. This way they can see any transaction coming in, but they won't be able to spend anything. However, this requires them to run a Bitcoin client themselves, which can be a pain at times.
Use the Block Explorer and search for the single address you will be using. Case in point - all donations made to Wikileaks - http://blockexplorer.com/address/1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v (warning, this page can load for awhile).


What BIP32 derivation path does Electrum use for Multisig? Same question as What BIP32 derivation path does Electrum use?

but for multisig. thanks.

Electrum uses BIP45.

m / purpose' / cosigner_index / change / address_index

Example for non-change of the first cosigner and first address: m / 45' / 0 / 0 / 0

See: https://bitcointalk.org/index.php?topic=1634517.15
and
https://github.com/bitcoin/bips/blob/master/bip-0045.mediawiki


Single-hop Payment vs Multi-hop payments I am beginner of lightning network. When i am looking roughly lightning network whitepaper, i was confused about the types of contracts used in single-hop and multi-hop.

As far as I understand, In single-hop(Bidirectional Payment channel) case, it use revocation key concept, and there is no HTLC. And In multi-hop case, it use HTLC concept.

But When I read the example in chapter 4 of the white paper(Example about Alice and Bob), i was confused fact that 'is single-hop case use HTLC?'

Anyone can explain this?

Thank you!

First of all at this point in time the whitepaper is pretty outdated and should only be considered as a rough conceptual guide. The Lightning Network Protocol itself is better and more accurately described / specified in the lightning rfc

That being said the situation is that even in the single-hop payment case HTLCs are being used. To set up and settle htlcs revokation keys and the revokation system currently play a vital role. The reason is as far as I know to save implementation overhead.

So if Alice wants to pay Bob in a direct channel the process is like that.

Bob creates an invoice with a payment_hash that is the hash of some pre_image
Bob somehow passes this invoice to Alice. (this can happen over any communication channel)
Alice creates an onion package (which basically just contains a 1 hop payment to Bob
Alice sets up an htlc by sending the onion via an update_add_htlc message to Bob. Alice also offers a signature for the next commitment transaction via the commitment_signed message.
Bob decrypts the onion. sees the payment is for himself and he that he can fulfill the onion.
Bob revok's his hold state by sending a revocation key to alice via the revok_and_ack message.
Bob sends signatures for Alice's new commitment transaction via the commitment_signed message.
Alice revokes her old state with the revoke_and_ack message.
the htlc is settled in a similar way as steps 4 through 7. (It starts with an update fulfill_htlc message send from Bob to Alice and then the state is updated for Alice first and then for Bob. Again recokation keys will be exchanged to get rid of the htlc output and create the state in which the payment has arrived at Bob)

A visualization of this process can be found in slides 136 through 144 of this slide deck. The process itself is described in more detail in BOLT 02

I should also note that there are other suggestions to for a payment channel protocol (for example Eltoo) which get rid of the penalty based system and the revokation keys but still use htlc's for actually transfering funds (either in multi or in single-hop payments)

Wellcome to this community I hope this technical and detailed answer is not too overwhelming. Please feel free to ask more question if necessary.


In case of physical wallet theft, quickest way to offload funds in wallet backup? Assume one makes a secure online backup of their wallet and then their laptop or device that has it is stolen. For the sake of argument assume that the thief watched the user type their wallet password in somehow, or the owner kept the password in a text file or something... what is the fastest way to transfer the funds from the online backup into a new wallet?

I would imagine this would be something like a easy online service that imports a wallet so that user is not forced to use the slower default of: find computer, download client, wait forever for the blockchain sync, then transfer.

You do not need to send coin to another wallet, but you surely need them to be sent to another address (since the compromised wallet has compromised addres). What I would is go to http://blockchain.info and open a new wallet. Copy paste the first address you see, it'll be your new secure address since you just genereted it. Then import your old compromised wallet.dat to blockchain.info and then send all your coins to the address you copied (in the bitcoin client it would show as sending to self). Then you are safe if the transaction confirm since you are the only one able to use this address. You can then send those bitcoin to a new wallet.


Why does hashing public keys not actually provide any quantum resistance? In the discussions about taproot, it was mentioned that outputs will include the public key directly instead of hashing them. It is stated that, currently, hashing does not really provide quantum resistance. Why is that?

Although hashing a public key by itself does provide quantum resistance, this is really only when it is considered by itself in a vacuum. Unfortunately, public key hashes do not exist in a vacuum and there are many other things in Bitcoin that need to be considered.

Firstly, if public keys were hashed, the funds are only protected before they are spent. As soon as a P2PKH or P2WPKH output is spent, the public key is exposed. Whilst the transaction is unconfirmed, an attacker with a fast enough quantum computer could compute the private key and create a conflicting transaction which sends the funds to himself instead of the intended recipient.

Furthermore, if that attacker is a miner, they could do this with every single transaction and simply refuse to mine transactions that don't send the coins to himself.

While this is a problem, people often argue that it's better than someone just spending the Bitcoin outright because they have the public key from the blockchain. While that is true, there are an extremely large number of outputs with exposed public keys.

Over 5.5 Million Bitcoin are in outputs with exposed public keys, either because they are P2PK outputs, or because users are reusing addresses and thus public keys are exposed in other transactions. So if a quantum computer existed that could produce the private key for a public key in a reasonable amount of time, the attacker would be able to steal so much Bitcoin that they would decimate the Bitcoin economy and Bitcoin would become worthless.

So while your particular outputs may be protected by hashes, the value of those outputs would be 0 as millions of Bitcoin are stolen. All that the hashes really do is provide a false sense of security.

Then there are issues with tooling and wallet software the simply expose public keys in other ways than just in transactions and in the blockchain. No existing tools treat public keys as private information; there's no reason they should.

Many wallets send the parent extended public keys to a server so that the server can watch for transactions and send that data back to the client. Anyone who uses such a wallet, even temporarily, exposes their parent public key to a service provider. That provider could then compute the private keys to the public keys they have, derive all of the child keys, and steal all of the Bitcoin associated with anyone who has used their wallet.

Additional issues exist with complex scripts and contracts involving public keys. These scripts, such as multisigs, do not hash the public keys. Furthermore, these contracts typically exist because not all parties necessarily trust each other; one of them could be malicious. In such cases, a malicious participant in the contract would know the public keys involved (by virtue of knowing the script) and be able to steal the Bitcoin associated with those outputs. Existing public key hashes do not protect against this.

So overall, there are tons of ways that public keys are already exposed outside of transactions. These all would allow different kinds of attackers to steal millions of Bitcoin thereby causing the value of Bitcoin to go to 0, which renders any Bitcoin protected by public key hashes to be worthless anyways. Furthermore, users are probably exposing their public keys in unintended ways due to the software that they are using. So using public key hashes only serves to provide a false sense of security, while also increasing the size of transactions. In general, it is not worth the extra size.

Lastly, it is possible to do a transition to post quantum cryptography if it is found that a QC exists which can break ECDLP. If detected in time but still too late to do a proper upgrade, all use of signature algorithms relying on ECDLP (i.e. ECDSA and Schnorr) could be soft forked out thereby locking all coins. The coins could then be spent by providing a Zero Knowledge Proof of some non-exposed or quantum resistant information that indicates ownership of the private keys for the public key.

For example, users could provide a proof that they have the BIP 32 seed that was used to derive the private key for the given public key. Since it is a Zero-Knowledge Proof, the seed itself is not exposed (note that the seed is not part of a public-private keypair so there is no public component that is shared). Since most wallets use BIP 32, this should be sufficient. There may be other ways to prove ownership without risking coins that have not been thought of yet.

And of course, this all assumes that a quantum computer capable of computing the private key for a public key appears without the public being aware of the technology being close to existing. What is likely to happen is that the progression of quantum computers will be observed, and, at some point prior to them being powerful enough to break ECDLP, Bitcoin will soft fork in a Quantum resistant signature algorithm. Eventually, signatures relying on ECDLP will be removed. And all of that will occur before quantum computers truly becomes a thread. So in that scenario, hashing public keys provides no help anyways.

Note that all of the above is not just limited to quantum computers. It generally applies to any cryptographic break of ECDSA (or Schnorr).


How to ask donors to send bitcoin if they are not bitcoin enthusiasts? Have idea for wonderful service many would want to donate to see happen. Those who donate though know nothing of bitcoin. Google reveals much trouble with bitcoin<->paypal or bitcoin<->creditcard gateways.

Exists any credible and reliable service that does this?

Bitcoiners too small group to expect enough from them, bitcoin system too difficult for non-bitcoiners to donate. Non bitcoin donations undermine concept.

CoinBase says that they hope to offer a method to purchase bitcoins using credit card.

In the meantime, that's not happening or at least not without going through some method like VirWoX (buy SLLs there and trade those SLLs for BTCs).

There are cash deposit methods.  Depositing cash at a bank or 7-11, Walmart, CVS is going to be the fastest and easiest way.

http://www.BitInstant.com (Deposit at major banks, 7-11, Walmart, CVS, Moneygram, etc., or in Brazil using Boleto or Banco Recomendito, or in Russia, using Qiwi or Cyberplat.)
http://www.CAVirtEx.com (Deposit cash at several banks)
http://www.Spendbitcoins.com (Deposit cash at a bank in Australia)
http://www.MrBitcoins.com (Deposit at a bank in U.S., India, Australia)
http://BitcoinNordic.com (Purchase CashU or UKash in dozens of countries)
http://www.MtGox.com (Deposit cash at any Barclay's in the UK)

There are also individual traders in 70 countries and hundreds of cities:

http://www.localbitcoins.com


Electrum server over http Is it possible to communicate with an electrum server using http? I'm interested in building a browser extension.

I also see this message on the electrum chrome plugin

  Unfortunately, all public Electrum servers have upgraded to a version of the protocol this extension does not support

No, new nodes don't support the HTTP transport. You'll need to use TCP.


What does the Bitcoin Core wallet backup do? I set a password to encrypt my wallet, all good.  But I can't seem to backup my wallet.  I try and nothing happens.
Does the backup function give me keys or the seed words?

It creates a copy of the wallet file.
Bitcoin Core doesn't support recovery from just a key or seed phrase (at least, not yet).


Multibit application won't open The app itself won't open. I recently did a system restore to a previous point in time but I'm pretty sure it was not before the point that I installed the multibit application. All the installation files are still in their original place but I can't get it to open. I've tried opening it from the run dialog and get the error message that "windows cannot find 'multibit.exe'". I've tried opening from both the regular and elevated command prompts and while I can see multibit and its files on the desktop it doesn't show up in the all apps section of windows 8 home screen. I am leaning towards re-installing but I don't know what order to do it (uninstall current one before or after?) or what files (if any) will get over-written. All of my bitcoins were in the desktop application but I did not backup the wallet (I know). All the files for the wallet seem to be available in the appdata\roaming\multibit folder (under Untitled.* since I did not backup or encrypt with password) and my hope is that if I run an actual working version of multibit.exe that I wll be able to access my bitcoins. I don't think that re-installing multibit will affect these files but I thought I should ask first. This situation, that I am entirely in through my own fault, has gotten me very anxious. Any advice/help/suggestions would be greatly appreciated.

See if you have a multibit.exe or java.exe task running in the background using TaskManager. If so kill it and try opening multibit again. There is code in multibit to stop two instances running simultaneously so it might be that


Is it possible to buy or send bitcoins without an intermediary? If I want to buy bitcoins, I can buy them from an online exchange, from an ATM or from another person who has bitcoins. Online exchanges and ATMs charge high premiums because they are intermediaries. If I buy bitcoins from other people, they also charge high premiums. The whole idea behind the blockchain was to get rid of third-parties. Is is possible to connect to the public ledger somehow and acquire bitcoins without a third-party?

I wonder how the first bitcoin transactions were completed when there wasn't any online exchanges, mobile wallets or ATMs. Can programmers somehow connect to the public ledger and do transactions without bitcoin wallets or fees?

Do not mix the fees, and its base. Whenever you transfer amounts of value between two fiat currencies (let's say GBP to Euro), you pay a fee. So if you go from GBP to Bitcoin or from Euro to Bitcoin, you pay a similiar fee to those, who are "in fiat currency" to ramp up.

Now, when you are within the bitcoin ecosystem, and you transfer bitcoins from your account to my account, then you pay a miner fee. Miners make sure, the bitcoin network is working correctly, and this is to be paid.
When you say the whole idea was to get rid of third parties, than you omit the miners. I guess you mean with third parties the "old structures" of the fiat world... They are indeed not required, once you are in bitcoin world.

  connect to the public ledger somehow and acquire bitcoins without a
  third-party?

yes, you can setup your own mining equipment, mine some blocks, and get rewarded for it. Otherwise, if you convert Euro/GBP/Dollars, no (see above).

  Can programmers somehow connect to the public ledger and do
  transactions without bitcoin wallets or fees?

Yes, with a mining node. No in general. Example: I have my own set of script to transfer bitcoins between wallets. In this sense I can be considered a programmer :-) I assemble a tx, and send it into the network (aka "connect to the public ledger", following specific rules). For the miners to bring my tx into a block, I have to pay a fee.

So there is no such thing as free beers :-)

I consider reading the book "Mastering Bitcoin" from Andreas (http://chimera.labs.oreilly.com/books/1234000001802/index.html) for further info.


How can I trade BTC for other crypto currencies? How do I withdraw from BTC and credit to LTC or withdraw from LTC and credit to BTC or any cryptocurrencies?

Use an exchange such as Bittrex, Poloniex, ShapeShift, etc.
There you can create an account, deposit your BTC to your account, trade one cryptocurrency for another, and withdraw your new coins to an external wallet.


It is possible to build a P2P system to trade Bitcoins? It is possible to build a peer-to-peer (similar to BitTorrent) system to trade Bitcoins?

Well, the discussion pointed in the 1st answer is very similar to what I have in mind. But, I have some sub-questions:

Is there any possibility to use blockchains transactions system to have some "cash on demand" to use in trades transactions(maybe with some taxs like fee transactions)? And blockchains can carry more information about what is going on inside this or others sub-systems?
The idea here behind the word "trade" is some system, that allows you to trade your bitcoins for any other currencys or other virtual currencys in any connected market around the world, by simple configuring a new "node" for that market.
ok. More obvius question. How? (1 for me looks like a good idea.)

I think the answer to this question is currently unknown.  There's currently an ongoing discussion about it on the bitcointalk forums.

I'll update this answer if anything comes of it.


Difference between Bitcoin versions 0.1 and 0.2 Does anybody know what the difference is between Bitcoin versions (0.1) and (0.2)?
I need to know this because I am doing a school project about the future of Bitcoin.

If you're interested in a list of changes to Bitcoin, look at these sources:

0.3.21 - current: https://bitcoin.org/en/version-history
0.1.0 - 0.3.20: https://en.bitcoin.it/wiki/Bitcoind#History_of_official_bitcoind_.28and_predecessor.29_releases
(Click on the reference to see the announcment/changelog.)

Good luck with your project!


Is there any evidence that the Litecoin network is significantly affected by botnet mining? Litecoin uses a hashing algorithm that, so far, is best run on CPUs rather than GPUs.

Because most computers are not purchased for gaming and don't have powerful GPUs (which would have been useful for Bitcoin mining, at least until ASICs arrived on the scene), it would probably be far more profitable for a botnet to mine litecoins than bitcoins.

At the current Litecoin/Bitcoin exchange rate, the total litecoin network generates 216BTC worth of litecoins per day in block rewards (the Bitcoin network provides 3600BTC/day), which provides a substantial profit incentive to someone running a botnet.

Is there any evidence that botnets are responsible for a substantial amount of litecoin mining? Could this be detected?

Is there any known malware that mines Litecoin?

I have the privilege of answering your question a year later, where GPUs have taken over Litecoin and all of its derivatives. Currently, botnets would be better off mining a CPU coin like Primecoin.

That said, there is evidence of botnet mining for both Litecoin and Primecoin.


Transaction signature generation When one sets up a transaction, the input of the transaction needs to have a script with a signature to show that you can spend those coins. Which fields of the previous and current transactions need to be concatenated into a message and signed to generate a proper signature? Can someone provide some examples?

Here and in the following articles I explain how to build and sign a Bitcoin transaction from scratch. There are also C code examples attached:
https://davidederosa.com/basic-blockchain-programming/inside-transactions/


BFGMiner vs. CGMiner What is the difference between BFGMiner and CGMiner in Laymen's terms?

Also, the longterm outcome will be exactly the same if mining is done with or without a pool, correct?

bfgminer is a fork of cgminer. bfgminer allows the use of Get Block Template (less trust in the pool), but they're otherwise functionally the same.


Which blocks get to be checkpoints? Which blocks get to be checkpoints, and why is one block chosen to be a checkpoint, rather than another block? And where can I find a list of checkpoint blocks?


How were the secp256k1 base point coordinates decided? 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 seems very random to me. I see how this point is on the curve, but how exactly was this specific point chosen to be the base point? Could other base points have worked?

Since the secp256k1 curve order is prime, every point on the curve except the point at infinity is a generator.

Nothing is known about how the designers of the curve chose this specific generator.

However, there is one tell-tale sign that hints about its construction. When the chosen generator G is multiplied by 1/2 (i.e. multiplied by the multiplicative inverse of 2 modulo the curve order), the resulting X coordinate is an exceptionally low number. This very likely means that G was created by picking that X, finding a corresponding Y on the curve, and then doubling the resulting point.


What makes a Strange Transaction At blockchain.info there is a tool to report strange transactions. It is reported that

  Transactions containing outputs from which we were unable to decode a bitcoin address

According to the above statement"

How does the verification work?
Are there any patterns that strange transactions follow?

Bitcoin has a complex scripting system which can be used to set the conditions under which the money sent by a transaction can be redeemed. For example, it is possible to send bitcoins in such a way that they can be only redeemed by someone who finds a collision for a specific hash function.

Most of the time, however, bitcoins are sent to a script which requires a signature from a single key to redeem. In this case, the address is the encoded hash of that key. In general, however, not every script corresponds to an address.

Strange transactions are transactions which have either input or output scripts not matching any of the predefined patterns for standard scripts. Such transactions must be created manually, but they can contain any script permitted by Bitcoin. So, there are no specific patterns that they follow, but rather there are patterns that they do not follow.


Is there a deterministic private-public keypair generator without the BIP32 private key revealing issue? HD Wallets have a flaw that revealing a private key and its parent master public key will reveal its parent master private key. (Described here[1] and here[2]).

Isn't there a similar concept with master public key and master private key that does not suffer from this issue. (Does not have to be ECDSA. I just want a deterministic private-public keypair generator that can publish its master public key).

[1] https://bitcoinmagazine.com/8396/deterministic-wallets-advantages-flaw/

[2] https://eprint.iacr.org/2014/998.pdf (chapter 3)

This is accounted for within the BIP32 specification, they are called 'hardened' keys. Hardened child private keys are derived from the parents' private keys, and revealing the hardened child private keys does not reveal the parents' private key.

Child indices 0...2^31-1 are reserved for regular keys (that have the problem you describe), and child indices 2^31...2^32-1 are reserved for hardened private keys.

Notation for a standard child:

m/0

Notation for a hardened child:

m/0'
m/0h


What is the difference between a miner and a full node? I have trouble finding the difference between a full node and a miner. It looks like these two names are used interchangeably which I think is not entirely correct. Miners do process blocks and full nodes verify if transactions which has been packed in the block by miners are all valid. Some can run a full node without running the mining software.

I know a lot of people who think that miners and full nodes are one and the same.

Thank you for your help.

A 'full node' is a participant on the network that has independently validated the complete copy of the blockchain, and thus has verified all transactions since the beginning.  This requires about 350GB of drive space (currently).
A pruning node is one that has verified all prior transactions; however, it has deleted all blocks below a certain space requirement, but still has a copy of the UXTO set.  It's less useful to the community, but is useful to the node's owner, and takes less resources on the computer (can be under 1GB of drive space).
A miner on the other hand creates blocks in the blockchain which the nodes keep.  Basically, the miner adds transactions to a block, with the goal of creating a new block with a valid hash that will be accepted by the network.    Miners spend about 10 minutes working on a problem, but nodes keep that result forever after in the database and verify it with others.  Miners don't need to know about prior blocks (except for the prior one) with very few exceptions.
So, a miner is completely different than a full node.  It's not comparing the same like things.  Full vs Light is comparing two like things - fruit (apple and orange).  Miner vs FullNode is comparing two totally different things (apple and fence).


How to distinguish watch-only addresses from spendable addresses when deleting addresses An answer to I have watched addresses in my wallet..how do i use them? says:

"If you do not have the private keys for those addresses, then they are not yours and you cannot do anything with them. Those addresses and their associated Bitcoin do not belong to you, so you cannot use them.
You can delete the watch only addresses if possible; you will not lose any money if you delete just those addresses because there is no money that belongs to you in the first place with those addresses. However be careful of deleting the wallet entirely, it could have addresses and private keys which do belong to you and those you do not want to delete."

Based on the answer above, how do you then establish which addresses belongs to me that I must not delete?

It depends on which wallet you are using, if you are using the Bitcoin core wallet for example, you can see the amounts separated, the watch-only amount will be one, and the spendable amount will be another one.
You can also use the command listunspent into your console to know which addresses contain the spendable amounts.


Advanced math operations in TapScript? Hence BIP 342 proposes to enable opcodes like OP_MOD, OP_DIV, OP_MUL is it possible to perform advanced math operations like EC point addition/multiplication in a script size of up to 10kB?

BIP 342 does not add any of these opcodes, and it is not possible to perform elliptic curve operations in it.
The only new/changed opcode semantics in BIP342 are:

Schnorr signatures instead of ECDSA.
OP_CHECKSIGADD instead of OP_CHECKMULTISIG(VERIFY).
OP_SUCCESSx opcodes for future extensibility
Unknown pubkey types for future extensibility.
Changes in resource accounting/limits.


What are the usability limitations of Core? Some I know are:

No HW wallet support
No SPV mode
Hard to use as an offline wallet

Are there any others?

Are there any others?

No support from mnemonic recovery phrases, also known as seed phrases or backup phrases.


How smart property works on basic bitcoin blockchain? How smart property works on basic bitcoin blockchain? I am not sure that how to make token, that is tied with a particular object, on the bitcoin blockchain. I've already know I can use such kind of token if I use colored coin or master coin.
I've read the following link, but I couldn't understand how it works.
https://en.bitcoin.it/wiki/Smart_Property

The token in the blockchain represents a physical item, the same way that a paper document may represent a contract or ownership of a house.


Is there a max number of tx outputs allowed by consensus? It seems good for preventing an UTXO bloat by restricting max number of outputs of TX(or block) can have.
Is there such a restriction? if there is, which part of source code should I read? If not, why not?

Note: What I am asking is not about block size limit or TX size limit, I know those and how those are (implicitly) limiting the number of total outputs in TX (or block), but I think this is kinda roundabout way which limits the number outputs only loosely. Why not more direct restriction?

There is no direct limit on the number of outputs, but transactions can't have more than an allowed amount of weight and this indirectly limits the number of outputs.


Does bitcoin / blockchain provide any protections similar to credit cards such as chargebacks? I understand that if I make a bitcoin payment my purchase is recorded in the blockchain and cannot be reversed. My bitcoins are gone. But all transactions imply a vendor providing a product. So ...

Does the system record and link the record of my bitcoin spend to the product I'm buying? If so, how?
Does bitcoin/blockchain at least record the total transaction such that I have at least a contractual right to the product I've purchased?
How can I be sure I will receive the product I purchased in a timely fashion (or at all)? Why wouldn't the vendor just keep my bitcoin and tell me to get lost?
Consumers use credit cards BECAUSE they are protected against such ripoffs via chargeback and other rules. I gather bitcoin/blockchain doesn't provide such protections. Are we talking about 'caveat emptor' aka let the buyer beware? If so, that's fine for small purchases but sounds hopeless for any purchase where I can't afford to be ripped off.

Does the system record and link the record of my bitcoin spend to the product I'm buying? If so, how?

No. But entities (like governments, secret services, companies, or individuals) my attempt to do so.

  Does bitcoin/blockchain at least record the total transaction such that I have at least a contractual right to the product I've purchased?

Total transactions: Yes. As in "total number of transactions in the blockchain".

As in "total transactions you ever made": Your wallet records this. Bitcoin does not provide a way for you to prove that you purchased something (Does anything actually provide a way to proof this? I don't think so.) but you can prove that you're in possession of the private keys necessary to have made a certain transaction.

  How can I be sure I will receive the product I purchased in a timely fashion (or at all)? Why wouldn't the vendor just keep my bitcoin and tell me to get lost?

You can only believe in promises or have a contract assuring you that (e.g. a promise by or a contract with the trading platform you're using). The currency you're using doesn't matter at all for this.

  Consumers use credit cards BECAUSE they are protected against such ripoffs via chargeback and other rules. I gather bitcoin/blockchain doesn't provide such protections. Are we talking about 'caveat emptor' aka let the buyer beware? If so, that's fine for small purchases but sounds hopeless for any purchase where I can't afford to be ripped off.

You seem to confuse currencies and payment methods a lot. Have a look at this answer.


Bitcoin QT using the terminal I am trying to compile bitcoin qt and I am getting these errors:

No targets specified and no makefile found.Stop.

user@localhost:~/bitcoin/src$ ./configure --with-qt
bash: ./configure: No such file or directory

user@localhost:~/bitcoin/src$ make -j8
make: *** No targets specified and no makefile found. Stop.

I'm using Mint, not sure if there are different commands specifically for Mint.

Type these commands inside bitcoin source root folder:

1) ./autogen.sh

2) ./configure

3) make

4) make install

Then you can call Bitcoin-qt simply typing the command bitcoin-qt from your terminal. If you provide the make install command as suggested in step 4 you can run both Qt and daemon from any path.


Bitcoin, Ethereum and Litecoin value graph look very similar I don't know much about cryptocurrencies, but I was looking at the Coinbase value graphs of bitcoin and ethereum, and noticed that even on one day, every single dip and peak affect all three currencies displayed. Why is that?

Value graph

The prices of basically all altcoins follows that of Bitcoin's. So generally when Bitcoin goes up, so do altcoins', when it drops, so do altcoins'. This is generally because altcoins are primarily used as a way for people to get more Bitcoin.


"private" agreement between two c-lightning nodes on channel closure fee When i was at LNConf, one of the devs of c-lightning (IIRC) told me that there is a custom, manual way to agree between two nodes on channel closing fees.

Can anyone elaborate how this is possible? I am operator of two cln nodes, i would like to close channel between these nodes with minimum possible fee, because i am not in hurry.

Are there some side-effects of doing so?

Just use lightning-cli close id the implementation will first try to do a mutual close. Both lightning nodes will use the fee estimator from Bitcoind to suggest fees. If they don't agree there is a communication protocol defined in the BOLTs that they will eventually find a local agreement between themselves. This protocol is described under the section closing negotiation in BOLT 02 c.f.: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed

Obviously both nodes need to be online and peered before you call the close command otherwise the node will do an expensive force close. Also it makes sense to wait until fees in the mempool are low if you can do that.


Can bitcoin be used for instant payment? As transactions have to be confirmed, does it imply bitcoin cannot used for instant payment?

There are situations where accepting a 0-confirmation transaction is low risk, but that's certainly not generally advisable. Double spending a 0-conf transaction is very easy to do with high success rates. So yes, in general waiting for a few confirmations is required.

But Lightning Network is being developed right now by several parties, which is a layer on top of Bitcoin that will allow instant payments without waiting for confirmations at all. It will also allow much smaller payments (micro payments), fast rate (many payments per minute) and lower fees.

In time, LN should eliminate the need for 0-conf transactions completely.


What do I change in my config to access my local NXT NRS Server/Client from another computer on my local LAN? I just installed and unzipped the NXT server/client from: https://bitbucket.org/JeanLucPicard/nxt/downloads

The run.sh file is running fine now and I can access the NRS (NXT Reference Software) via localhost:7876 on the computer that is running the server.

But now I want to be able to access this server on another computer on the network. I know the IP address of the computer running the server, but I can't seem to get to the NRS. I know I have to make some changes on the config file, but what are the sections I need to make changes to?

Can someone list out what needs to be changed?

what I did was the following, create a nxt.properties file in the conf/ directory and put this in the file:

This basically makes your NXT NRS server publicly available on your local lan or via the internet if your looking to setup a public server.

# Hosts from which to allow http/json API requests, if enabled. Set to * to allow all.
# Can also specify networks in CIDR notation, e.g. 192.168.1.0/24.
#nxt.allowedBotHosts=127.0.0.1; localhost; [0:0:0:0:0:0:0:1];
nxt.allowedBotHosts=*; localhost; [0:0:0:0:0:0:0:1];

# Host interface on which to listen for http/json API request, default localhost only.
# Set to 0.0.0.0 to allow the API server to accept requests from all network interfaces.
#nxt.apiServerHost=127.0.0.1
nxt.apiServerHost=0.0.0.0

# Hosts from which to allow NRS user interface requests, if enabled. Set to * to allow all.
#nxt.allowedUserHosts=127.0.0.1; localhost; [0:0:0:0:0:0:0:1];
nxt.allowedUserHosts=*; localhost; [0:0:0:0:0:0:0:1];

# Host interface for NRS user interface server, default localhost only.
# Set to 0.0.0.0 to allow the UI to be accessed on all network interfaces.
#nxt.uiServerHost=127.0.0.1
nxt.uiServerHost=0.0.0.0


Since the blockchain is public, how can we see it? The blockchain is a shared public ledger for Bitcoin. What does that mean exactly? Is it possible to see, publicly, all transactions? For every bitcoin a person owns, is he able to see all the historical transactions? If so, there should be privacy issues, no? If he can't, who can?

The blockchain is the decentrally maintained append-only log of all
transactions verified on the Bitcoin network. There are multiple websites, so called blockchain explorers that visualize this data on the web.

Indeed all transactions that ever happened on the blockchain are publicly visible, and looking at transactions on such a blockchain explorer let's you discover what transactions moved the same Bitcoin balance before you received it.

While all the transactional information is in the public, the involved parties remain private as they transact under pseudonyms called Bitcoin addresses. We can see time, volume, and involved addresses, but don't learn the individual's private information.

However, through data mining observers may learn that some addresses are under the control of the same entity and might make some guesses about their usage.


Does v1 Segwit includes v0? My question is whether the version 1 of Segwit script will allow you to use version 0 scripts types inside of it. In other words, is version 1 superset of version 0? Please include reasoning behind the design decision.

If this question is about the recently published bip-taproot proposal, the answer is no, you cannot use a v0 script inside a v1 output.

The general reason for this is that some of the goals the BIP is trying to achieve are incompatible with v0 scripts. That on itself doesn't make it impossible to support v0 scripts, but reasoning about the benefits of the changes is much easier if you know there is no way to bypass them. Furthermore, the changes between (the initial set of) supported features in v1 and v0 is small:

No CHECKMULTISIG The OP_CHECKMULTISIG opcode is unnecessarily inefficient, as it sometimes needs to try multiple combinations of public keys with signatures. Furthermore, it is not compatible with batch validation (the ability to verify all signatures in a block faster than verifying them individually). As multisig constructions are very useful, a replacement opcode is available: OP_CHECKSIGADD, which increments a counter based on whether or not a signature check succeeded.
Schnorr instead of ECDSA All opcodes that take ECDSA signatures in v0 are changed to take Schnorr signatures instead. They're more efficient, but also ECDSA does not support batch validation, conflicting with one of bip-taproot's design goals.
Improved sighashing Some improvements are made to the hash that's signed in signatures to resolve a few long-standing issues. If there was a way to bypass these improvements it would be hard for other participants in a transaction to rely on these fixes being guaranteed.


How do I import private keys en mass from a text file? How do I import private keys en mass from a text file? They are in Wallet Import Format, e.g. 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ.

Would there be any limitations to the number of keys I can import?

Thank you and please forgive me for such a question, I'm quite new to this.

Not sure on this, but you might be able to use the importprivkey RPC call. What I would try is importing one of them with rescan=false and then import another with rescan=true. The rescan=true causes it to go through the whole blockchain and look for any places that the associated address to that private key. After importing two private keys, the first without a rescan and the second with a rescan, then look to see if rescanning on the second private key got you all the transactions for the first private key that you entered.

Then if that works, you could write a command line script to execute that RPC call with each line of the file as the private key.

That's a high level description of what I would try. If you need more help on the importprivkey, open the Bitcoin-QT GUI, go to Help >> Debug Window >> Console and type "help importprivkey". If you need help writing that script, you'll probably have to do some googling around to learn about your OS-dependent scripting language.


Portability of Bitcoin Wallets: What If The Power Or Network Is Out? My understanding is that the blockchain is public and contains balances (or the monetary value) and that a private key, or a wallet, enables one to control or spend bitcoin.

If my wallet (private key) is stored on a small USB stick, can I purchase anything using bitcoin if there is no power/network near me?

If my wallet (private key) is stored on a small USB stick, can I purchase anything using bitcoin if there is no power/network near me?

By this, I’m assuming you mean you have no connection to the network. There is infrastructure built to relay transactions through SMS and satellite services, but let’s pretend you don’t have access to those either.

In that case, you could trade your USB stick for whatever goods/services you’re trying to purchase, but your counterparty will be taking on significant risks:

If there is no way to connect to the network and check the balance on the address you claim to have the private key for, the counterparty will have to believe that the appropriate amount of funds are indeed held at your address
Your counterparty will have to trust that you do not have a backup of your private keys, otherwise you could make the trade, and then use the backup of your keys to spend the coins back to yourself, before the counterparty can sweep the address.

You may be interested to look up OpenDime, it is a product that allows you to give someone a private key that is provably not backed up.


Add bitcoin payments to java app using BitcoinJ I need to add Bitcoin payment to my application using the BitcoinJ library, but I'm new to using Bitcoin. I have one thought To create a new address for each new user, but I don't know if this is the right approach or not. Please tell me how to implement it correctly.
(I need to determine from which user the payment was received and in what amount)

Not really for BitcoinJ, but a general approach.
You generate new address for every user you register. Store it in your DB with the userID for future reference.
Create a getAPI taking a String input. use your API endpoint and open the Bitcoin.conf file.
walletnotify=curl <your API>

If you want to have confirmation logic as well, you may need one more getAPI, and get the endpoint. then update your bitcoin.conf file again with following:
blocknotify=curl <your Block API>

Now when user makes the deposit to the address you generated, Bitcoin node will notify your app by calling the wallet notify API. You get the transaction hash. Use that txHash and make a Post call to your daemon with RPc command:
getTransaction <txHash>

Now you'll have entire transaction object to find which user has made the deposit.
Free tip: Bitcoin node calls walletnotify two times:

When a transaction is added to the chain.
When that transaction receives first confirmation.

If you don't want more than one confirmation, then blockNotify is not needed.
If you want a practical example, you can check my Github repo, where I have done it. It's not based on BitcoinJ but the logic remains the same:
https://github.com/kunalbarchha/generic-wrapper-for-bitcoinforks


What does a bitcoin transaction contain? I'm learning about basic transactions and know that a transaction should contain:

i) Signature of the sender using some operator: sign(private key,message)

ii) Receivers Public key (wallet address)

iii) Hash Pointer pointing to the originating transaction / previous owner (i.e. A hash of the previous transaction's hash, signatures, etc)

I'm not sure if this is all that a transaction should contain, and also whether my understanding of point i) and especially iii) is correct. Hash pointers are a bit confusing; I understand the 'direction' of the arrow to mean we are pointing to what we are hashing, as opposed to the direction of flow of information.

Interested to hear your thoughts to help my understanding!

Transactions consist of a version number, a list of inputs, a list of outputs, and a lock time.

Each input contains a reference to the output it is spending. This reference is the hash of the transaction containing the output followed by the 0-based index of the output's position in list of outputs. Then there is the input script which contains whatever data is necessary to satisfy the conditions of the output script. Lastly there is a sequence number.

Each output contains the amount of Bitcoin in satoshis and an output script that defines the conditions necessary to spend that output.

It is important to note that addresses are not included anywhere; rather they encode data that is then used to construct the output script. It is also important to note that output scripts are not just public keys (although a public key can be included in the output script) and input scripts are not just signatures (although signatures can be included in the input script).

A description of the actual transaction format can be found on bitcoin.org.


How can I verify the authenticity of a ledger Nano s hardware wallet? If I buy a Ledger Nano s hardware wallet online from Taobao in China is there any way I can verify it's authenticity? Is there a way to test the firmware etc to make sure it hasn't been tampered with?

Found this just after asking the question.

https://blog.ledger.co/how-to-protect-hardware-wallets-against-tampering-cad35cb72c1


What is the context in libsecp256k1? I am experimenting with making a wallet for educational purposes, and would like to use libsecp256k1 directly. Aside from creating a context, and using it in calls, all I have perhaps learned so far is that you should generally only create one context, but I am not even entirely certain this is true.

Not knowing why, or anything really about the context, I was wondering exactly what it is, how it is used, and how one should use it?

The code comments that serve as the library's documentation explain what it does:

/** Opaque data structure that holds context information (precomputed tables etc.).
 *
 *  The purpose of context structures is to cache large precomputed data tables
 *  that are expensive to construct, and also to maintain the randomization data
 *  for blinding.
 *
 *  Do not create a new context object for each operation, as construction is
 *  far slower than all other API calls (~100 times slower than an ECDSA
 *  verification).
 *
 *  A constructed context can safely be used from multiple threads
 *  simultaneously, but API call that take a non-const pointer to a context
 *  need exclusive access to it. In particular this is the case for
 *  secp256k1_context_destroy and secp256k1_context_randomize.
 *
 *  Regarding randomization, either do it once at creation time (in which case
 *  you do not need any locking for the other calls), or use a read-write lock.
 */
typedef struct secp256k1_context_struct secp256k1_context;

libsecp256k1 is not an object oriented library nor is it able to store various useful states. So the context object allows the useful states to be kept.

You should generally only create one because the stuff it generates and stores is relatively expensive to compute. To use the context, just create a new context that supports the operations you want to do using the secp256k1_context_create function. You pass in the bitwise OR'ing of the SECP256K1_CONTEXT_VERIFY, SECP256K1_CONTEXT_SIGN, SECP256K1_CONTEXT_NONE flags which represent the type of things you want to do.

E.g. if you wanted to create a context that will be used in signing functions, you would create a context with:

secp256k1_context* secp256k1_context_create(SECP256K1_CONTEXT_SIGN);

If you wanted one that can be used with both signing and verifying, you do:

secp256k1_context* secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);

The resulting context you just use as the context argument for any function that needs one.


How to calculate the transaction size from the signed hex encoded? Suppose I have a signed hex encoded transaction (as returned by RPC call  signrawtransaction), how to get the size, in bytes, for purpuses of calculating if included transaction fee is acceptable by the official client? Can I simply get the size in bytes of the hexadecimal decoded to binary?

Can I simply get the size in bytes of the hexadecimal decoded to binary?

Yes. The hex encodes the raw bytes of the transaction that will be broadcasted throughout the network. Assuming the transaction is fully signed and ready to be broadcasted, the size is the number of bytes, or the length of the string divided by 2.


bitcoin donations tax deductible? I work as a volunteer for a tax exempt organization in the US.  We are currently accepting donations in bitcoin but not issuing receipts for those donations.  I would like to start issuing receipts.  Is there any legal guidance available online about this?  I haven't been able to find anything.

You can issue gift-in-kind receipts, the same sort you would issue for any other non-cash donation.

(e.g. Thank you for your generous gift of 7 Bitcoins which we received on _(Date)_. Your generous contribution will help to further the important work of our organization.)