How vulnerable is bitcoin to quantum algorithms? Assuming that quantum computers are implemented some time in the near-ish future, how vulnerable is Bitcoin to decryption via quantum algorithms? For example, Shor's algorithm enables a quantum computer to prime factorize in polynomial time. A variant of it can crack ECDSA.
However, Bitcoin relies on a scripting system, so if quantum computers are created, one probably can just switch to a secure script1
Is Bitcoin vulnerable to attacks from quantum computers? Are these vulnerabilities fixable2?
1.  Then again, there are limits to scripting and quantum computing may make it impossible for any script to work.
2. "Fixable" can both be client-side fixable, where everyone just tweaks the script they use and transfers all their money to a clean set of addresses (thus securing all their bitcoins with the new script), or protocol-side fixable, where the protocol is tweaked and everyone downloads a new client. The latter is nor preferable, since the old bitcoins will probably be lost in the process.

In short, yes, Bitcoin would be vulnerable to some variation of Shor's algorithm and quantum computing, as would basically every kind of crypto we use today. While ECDSA uses the elliptic curve discrete logarithm problem for its security, rather than the prime number factorization problem, you are correct in stating that a variant of Shor's can be used to solve the ECDLP in similar time. I believe there are similar threats with regard to SHA256, which is heavily used in Bitcoin's mining process.

You are also correct in stating that Bitcoin relies on a scripting system and is itself an open-source distributed computing project. Assuming you can arrive at a network consensus it is absolutely possible to change basically any aspect of Bitcoin - you just have to get the whole rest of the network to agree with you. I don't imagine that would be an issue if ECDSA or SHA256 were broken.

It's also entirely possible that the whole project itself could be forked to create an alternate version of Bitcoin similar to others which already exist. There is a variant called Litecoin, for example, which uses scrypt instead of SHA256 for mining - implementing an alternative to ECDSA could be easily done in a similar manner.

This, perhaps, is the true brilliance of Bitcoin: it's a Pandora's box that cannot be un-opened. Bitcoin as it exists today may or may not exist in a decade. Perhaps there is some unforeseen flaw that will soon be discovered, but that flaw will be fixed and the idea will live on. Assuming that there is any reasonable encryption/signing algorithm that is safe from quantum computing, it will be adopted and the cryptocurrency world will move on.


Will "Taproot" replace Lightning Network? Can somebody explain to me if Taproot will fix the issues that Lightning Network solves, without the Lightning Network?
That is, near-zero fees, privacy and fast settlements?
Will Taproot allow me to skip Lightning Network and simply use pure Bitcoin Core?

With respect to the original wording of the question I believe Taproot will actually make the Lightning Network pointfull instead of pointless.
While Taproot allows us to save some space on the bitcoin base layer, it will not make the Lightning Network obsolete. Remember, the main issue with respect to on-chain scaling is that a protocol in which every transaction is broadcasted to every participant is just too inefficient if those transactions should represent a substantial fraction of monetary payments in the world.
With respect to the Lightning Network there are actually many improvements possible for the Lightning Network if Taproot is activated. Most notably, we can have Point Time Lock Contracts (PTLCs) instead of HTLCs which give us way more flexibility in the payment process as the addition of points and secrets is linear whereas the addition of payment hashes and secrets is not linear. E.g.:
H(r1+r2) != H(r1) + H(r2)

The property of linearity allows us to have applications like

stuckless payments
payment decorrelation
escrow services


Coinbase Pro historical data not working I'm trying to pull historic data from the Coinbase Pro api using Python with the cbpro package. For some reason I either hit an error, or can only pull data from the last 350 days.

If I run the following:

import time
import cbpro
import csv
import json
import shutil
import os
start_time = time.time()
end_time = start_time-(86400*300)
public_client = cbpro.PublicClient()
public_client.get_product_historic_rates('ETH-USD')
data = public_client.get_product_historic_rates('ETH-USD', granularity=86400,
                                                start = start_time,
                                                end = end_time)

Then I get an "invalid interval" error. If however I remove either the "start = start_time" or "end = end_time" part of the code I get the last 350 days worth of historic data. No matter ISO 8601 time I list as "start" or "end," I'm always getting back the last 350 days starting with today.

What am I doing wrong?

The reason it was pulling data when I dropped the "start" or "end" part of the code was because the API then ignored that parameter and returned the default result.

the solution was to import the 'datetime' package and format the 'start_time" and "end_time" objects using datetime. for example:

start_time = datetime.datetime(year,month,day)


How does estimated coins calculated on Coinotron? On 'Cointron' their is wallet table after logged in into the site, how they calculate estimated coins per day, estimated rewards, confirmed rewards and unconfirmed rewards?

How does Coinotron derive this value?

Regarding estimated coins per day, with any coin, the golden rule is:

coins per day = kh/s * coins per block / network difficulty / 50

So for example, if you were mining Dogecoin with 800 kh/s, you would have

coins per day = 800 * 250000 / 1000 / 50 = 4000

This 50 is not really a 50 exactly, but rather 2^32 / (3600 * 24 * 1000), where 2^32 is the expected number of hashes required to find a block at difficulty 1 (i.e. the probability of finding a block is 2^-32), 3600 is the number of seconds per hour, 24 is the number of hours per day, and 1000 is the the number of hashes in a kilohash. It works out to be only about 0.5% off, close enough for an estimate.

Estimated current round rewards is an estimate of how many coins you would get, based on your submitted shares, if a block were found right now. As for confirmed and unconfirmed rewards, mined coins require a lot of confirmations before they can be spent. The reason is that if the block gets orphaned, the mined coins disappear. So before the threshold of confirmations (different for each coin) is met, they are considered unconfirmed and cannot yet be paid out. Confirmed rewards, on the other hand, can be safely paid out.


Transaction take too long I did a transaction 4days ago with low fee that was about 0.2 USD and it has been not confirmed yet.
I just wanna know how i can cancel it ?
Or how many days it takes to this transaction to be confirmed.
Would you please help me through

visit
https://blockchair.com/bitcoin/blocks

since transaction fees went up to $35   Fee/kB (USD)

or open
https://blockchair.com/


Can I send bitcoin from paper wallet directly to hardware wallet? Can I send bitcoin from my paper wallet to my hardware Ledger wallet without using blockchain wallet?

Paper wallets give you direct control of your funds and a single private key.
Some wallets have an import private key feature. Check if your Hardware wallet allows importing or sweeping.
What you want to do is sign a transaction for all of the unspent outputs that sends funds to one of the addresses on your Hardware wallet. This is often known as "sweeping", when you take all available funds under an address and send them to a different address.
Most wallets will sweep funds to itself, as opposed to letting you enter any address to sweep to. Creating a sweep transaction on your own is an advanced technique for programmers and command-line junkies. You should be comfortable creating these types of transactions in a test environment before ever attempting to do so with real sums of money.
There are also tools and libraries available that will help you with this, just be very careful to only use a reputable source -- there are many scams that want to steal your private key(s).
Recommendations on this site are strongly discouraged, so here are three (3) external examples that can help you sweep your funds.

Samourai Wallet can sweep funds from private keys and QR codes.

Electrum can sweep keys to any destination address. To sweep private keys, go to the Wallet menu -> Private Keys -> Sweep. Enter the private key in the appropriate field. By default the “Address” field is populated with an address from your existing electrum wallet. Change this to your one of your Hardware wallet addresses.

Sweepkey is an open-source tool I created using the bitcoin-js library for my own usage that sweeps funds from a private key to any specified address (again not a recommendation just an example).

I cannot stress enough, be very careful when interacting with private keys in a hot(online) environment. It is best to never expose them to an online environment, but if you have to, please practice on testnet or with small amounts until you feel comfortable you know what you are doing.


BTC graph of Price vs graph of Market Cap inverted today -- is this normal? I noticed that today the side-by-graph of BTC price vs BTC market cap, first converged and then crossed and has been inverted for most of the day.
This seems counter-intuitive to me.  My simple-minded expectation is that these are strongly-correlated and the gap between them should stay constant and never converge or invert.
Is this connected in some way connected to the "whale-wallet" that was seized by the US government recently?  In other words, are the exchanges discounting the total market cap by the amount seized or similar?
EDIT: perhaps what I am seeing is due to different graph scales for the two values?

EDIT: perhaps what I am seeing is due to different graph scales for the two values?

Yes, these two values are plotted on the same graph, but against different axis. Which line is higher/lower on the graph relative to the other is of no real interest.
Looking at the site in question, I can currently see that the y-axis on the left lists the 'Market cap', while the y-axis on the right lists the 'bitcoin price'. By adjusting the scale on either axis, the relative position of each plotted line will change.


What are the challenges ahead of bitcoin foundation? What are the challenges ahead of bitcoin foundation? What are the issues they currently working on? How to track their activities?

What are the issues they currently working on?

Perhaps I can help. I'm a member of the foundation; however, they haven't broadcast a specific mission or vision to us yet. That said, they are pursuing regulation and continued development of the Bitcoin protocol.

As for challenges, they face the following concerns:

Managing the growth of the ecosystem in a way that promotes mainstream adoption of bitcoin
Resolving issues with miscommunication and misinformation by the media and other entities
Working with businesses to better understand the regulatory and legal implications of bitcoin
Soliciting and integrating new developers and ideas into the protocol as the needs of the ecosystem mandate
Dealing with the consequences of government regulation on the ecosystem

There are far more issues to resolve; however, these to me seem to be the ones the foundation has invested the most work on.

  How to track their activities?

As of now, you can't outside highly public events such as the conference in San Jose. They are not a very transparent organization, which I suspect is a symptom of their age. Over time they will have to become better.

  What are the challenges ahead of bitcoin foundation?

For the moment, survival and relevance. They have yet to court the bitcoin community nor have a dynamic outreach program in the works to the best of my understanding. Longer term the issues of education and business adoption are also major challenges. As more people become aware of bitcoin, they will have a large list of questions and concerns. Depending on how they are addressed, the individual may have a positive or negative opinion of Bitcoin and will spread that opinion to their peers.


Algorithm of checking whether an element is present in a merkle tree I've read and watch about merkle trees but can't figure out how to implement is_present(element) method. Explainations and links are accepted.

I've read and watch about merkle trees but can't figure out how to implement is_present(element) method.

Put the entire contents of the merkle tree in an array.
Check that the result of hashing all of the elements equals the root of the merkle tree. (If not, this is not the correct merkle tree.)
Check if the element is in the array.

This takes O(n) time and space, where n is the number of elements in the merkle tree.
Proving that to another node
You can create a proof that a particular element is in a tree. This proof takes O(log n) space to store, and O(log n) time to verify, but still takes O(n) time to construct.
Construction:

Run through steps 1-3 above.
Start with the element you want to prove the presence of. Add it to the result list.
Find its buddy. In other words, find the hash that it would be hashed with to form the merkle branch containing both. Add it to the result list.
Repeat 2 through 3 until you get to the merkle root, which has no buddy.
The resulting list is your proof.

Verification:

Start with the first item in the list. Verify that it's the one you're trying to prove the presence of. Set A to this.
Hash it with the second item, with it either first or second depending on where the original item is in the merkle tree. Set A to this hash.
Repeat 2 with the next item until you run out of items.
Verify that A equals the merkle root.

If the merkle tree is in sorted order, you can also create a proof that an element is not in the merkle tree. It works in a similar way, except that you find the two elements that would have been the neighboring elements. Then, you prove that both are in the tree, and that they are next to each other.


Mining for nil-transaction blocks only - gaming the incentive scheme by rogue miners / consortium? I understand that there is incentive to include transactions where the output is less than the input so that the block creator can pocket the difference. But I'm wondering if that is really worthwhile in terms of hashing rate?

I know that overall having transactions is a good thing for the currency, but what if a particular miner only cares about their block finder's reward?

This is my understanding of the hashing process:

SHA256 process (image from Coursera Bitcoin course)

The hash input is split into 512-bit input-blocks, and then the compression function (in yellow) is run once for each input-block (including the output of the previous result).

Assuming that the smallest possible bitcoin-block is < 1024 bits (please correct me if I'm off), then hashing for no transactions will take 4 compressions.

AFAIK, the largest block size is 1MiB, or 8,000,000 bits, requiring 15,625 compression functions, more than 3,900 times longer than for a nil-transactions block.

Will it will take about 3,900 times as long to hash a 1MiB block as to hash a nil-transaction block?
If this is correct within an order of magnitude, then wouldn't it be better to increase the probability of finding a block approx. 3,000 times rather than collecting one block's worth of transaction processing reward?
What is the average transaction fee collection per block?
What if a small consortium of miners took up this strategy for personal profit, riding on the backs of the miners who cared about the ecosystem as a whole and kept it afloat?

(I'm certain this has been asked before, but I can't find the previous question.)

That would be true, except for the presence of the nonce and extraNonce fields. The point of these fields is that you can rehash the block without actually hashing the whole thing. On 2^32-1 out of 2^32 times, that just means hashing the last 16 bytes of block header, which can be done in 3 compressions. (That's one for the block header, and two for the following SHA256 hash. Remember, Bitcoin uses SHA256d.)

A single mining attempt takes (3 + ((log(2, number_of_transactions) + 1) * 2 / 2**32)) SHA256 compressions, on average. Having a thousand transactions in the block takes an extra 0.000000004 compressions per hash over having no transactions in the block.

The effect of all of that is that you mine at essentially the same speed no matter how many transactions you include.


Moving the Bitcoin folder from AppData Bitcoin's taking a lot of space on my C drive, and I would like to move it to another drive. I've figured out to do it using symbolic links, but the problem is that my Bitcoin client is currently synchronizing with the network. Is there a way to pause it, so I can move the data and then go back to synchronizing?

My C drive's almost running out of space.

You can create a directory junction (as i did to move the BitCoin data folder), or you can specify a different data folder location:

BitCoin-qt.exe -datadir=d:\BitCoinData

Which will be the long-term solution.


Why the PUSHDATA is 65 in the first transaction in blk00000.dat? https://www.blockchain.com/btc/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b?show_adv=true

The raw script is in the first transaction is:
  4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac

0x41 -> 65 (PUSHDATA) # Why ?????
0xac -> 175 (OP_CHECKSIG)

The list of OP can be found here
https://github.com/bitcoin/bitcoin/blob/bffb35f876572737b175aa3620bbf3e62c20f444/test/functional/test_framework/script.py

There is no 0x41 OP at all~~~~

Opcodes between OP_0 (0x00) and OP_PUSHDATA1 (0x4c, 76) (exclusive range) are push opcodes.

To push data smaller than 76 bytes, data's length, which is an opcode within that range should be used.

For example, to push 0x01020304, which has four bytes, 0x04 should be used: 0x0401020304.

To push 0x12, which has one byte, prepend with 0x01: 0x0112


Is it possible to build bitcoin source code into a windows .exe file, using Ubuntu? I am using an ubuntu machine and have compiled the bitcoin source code a few times without issue. I am able to use bitcoin-qt just fine in the terminal to load the interface, but I'm wondering if I can make the code into a .exe file and put that file onto windows and run the client there without dependencies.

Is it possible to do that? Or will I have to install the dependencies on windows and compile in windows into a binary that requires no dependencies?

Yep you sure can instructions can be found at https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md.

And the provided build scripts all use static linking so you end up with one big executable that does not require installing any dependencies on your Windows machine.


Uniquely identify two wallet.dat files I have two encrypted wallet.dat files and I'm looking for a way to uniquely identify them from each other. I started using a md5 hash but then I quickly realized that this hash changed each time the bitcoind client was started and recognized the wallet. Is there a way to uniquely identify two unencrypted wallets?

Unless you're using HD wallets (only if you created the wallets using Bitcoin Core 0.13 or later), two wallets are never the same as soon as they've done a transaction.

Every time an address is generated or a transaction is sent, a new address is added to the key pool of the wallet (a queue of unused future addresses). If you have two copies of a wallet file, and use generate a new address in one, it is instantly different from the older copy, and it will diverge over time (generate different addresses in the future). So the answer is probably: there is no way to compare two wallets because you shouldn't be relying on the ability to compare them. If you do, you may end up with balance surprises or even monetary loss.

If you're using an HD wallet, you can compare whether the key chains are identical by looking at the hdmasterkeyid in the output of the getwalletinfo RPC call (using bitcoin-cli or the debug console in Bitcoin-Qt).


Retrieve money back from wrong prefix address Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00.

What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes a p2sh address.

And unfortunately some btc already sends to the 3 prefixed address, would I am able to spent the balance provided that I own the private key?

The very bad thing here is that I created a too special type pay to script:
to be specific, <OP_HASH160> <ScriptHash> <OP_EQUAL> the ScriptHash is hash160(public key). Is there a way to sign this kind of script?

What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes a p2sh address.

Then coins sent to that address would be lost forever.

  would I am able to spent the balance provided that I own the private key?

No because the semantics for verifying a spend of a P2SH output are different from those for P2PKH outputs. The private key that you have is unrelated to the P2SH output.

  Is there a way to sign this kind of script?

No. The public key would be interpreted as a script itself, not as a public key. So the private key you have for that would be useless. You would have to satisfy whatever script the bytes of the public key represents. This is likely to just be garbage and be a script that cannot actually execute.


How to begin FPGA mining Since I own two FPGA:s I want to get started mining. It doesn't matter which currency I am mining, only that it works. I would prefer to do mining of Bitcoin, Ether, Dash or LItecoin but anything that works with my FPGA will do.

My FPGAs are Altera DE2 and Altera DE2-115. I already checked out one project that was too old (it used the getwork call which has been deprecated.

Any suggestions what I should do? I know C programming and some electronics and VHDL so I can find my way around a complicated installation or building it.

I'm a total newbie but so far the problem appears to be solvable. This is what I did with my Altera DE2-115 hooked-up to a Windows 7 machine:

got fpgaminer's open source FPGA bitcoin miner on Github
got mining proxy on bitcoin.cz
set up an account with slushpool.com (had to use VPN because my ISP apparently blocks connections to slushpool over http :((( )
registered an online BTC wallet with blockchain.info
updated config.tcl to connect to localhost:8332 port and reflect my slushpool-related credentials
downloaded miner's bitstream into DE2-115
launched mining proxy
and finally ran mine.bat

Illustration: FPGA miner accepting jobs via Stratum rather than thru getwork protocol

The hashrate was indeed around 50 Mh/sec but after ~10 seconds the Cyclon IV chip got rather hot, so I decided to play it safe and stopped mining. As the next step I'm planning to install an active cooling system to continue experiments such as switching from my Windows rig to Raspi, mining altcoins, etc.


`walletcreatefundedpsbt` with unconfirmed inputs I would like to create a psbt using walletcreatefundedpsbt spending unconfirmed ouptputs. Is this possible?

When I call that RPC command with 0 confirmed balance but with sufficient unconfirmed outputs, I get an Insufficient funds error.

Thanks in advance!

Bitcoin Core will never select unconfirmed incoming outputs. These are always considered to be untrusted and not safe for coin selection. This applies to any transactions that Bitcoin Core creates, including those created by using walletcreatefundedpsbt or fundrawtransaction.

For a code reference, the AvailableCoins function is used to fetch and filter the coins available for coin selection which calls the IsTrusted function for every available output (well really transaction stored in the wallet which include incoming and outgoing transactions). If the transaction was not created by that wallet, it is considered not trusted, so IsTrusted returns false which results in AvailableCoins excluding all of that transaction's outputs from the set of outputs used for coin selection.


Electric power efficiency - why is increases so fast How were the Antminer hardware made to decrease electric power consumption by half with each new product, like at the current generation of S9?

What are the projections to future efficiency that can make current hardware obsolete?

Why can't Intel do the same with their Core i7, and why do smartphones not last much longer on a battery charge than several years ago?

The mining hardware industry started very recently and their chip fabrication technology was way behind that of traditional chip manufacturers (ie Intel, AMD).

Chip energy efficiency depends on the distance between the transistors of a chip. The closer the transistors are the better. Intel produced their first 14nm (distance between transistors) in 2014. Mining hardware manufacturers resently produced their 16nm ones. They started with 28nm (or worse) ~4years ago.

Still mining hardware almost reached the chip density of Intel which is remarkable for only 4 years of development. It would be very interesting to see, if mining incentives remain high, whether it reaches or surpasses the big players in chip manufacturing.

Note that mining hardware is now very close to the best available chip so we can expect that the energy efficiency of mining would follow Moore's Law from now on (just as Intel hardware does).


What if two people want to spend same input at the same time Lets say me and my friend both have access to same private key which can sign some new transaction. What would happen if me and my friend broadcast transaction with same input at the same time to a different nodes ?

Also what would happend if i broadcast it 1 minute after him and pay much larger fee and his transaction is still unconfirmed? Would miner take my transaction than because it includes higher fee or would the stick with his transction because he broadcasted it first.

Thanks

Eventually all messages are put in a sequence. The key word is "eventually".

Let's say there are two users A and B trying to spend a transaction at the same time.

A's transaction reaches Node1 and B's transaction reaches Node2.

Both nodes include the two different transactions in a block and are able to mine the block using those transactions.

Further, when Node1 receives B's transaction it is rejected as a double spend and when Node2 received A's transaction, it is rejected as a double spend as well.

At this point Node1 and Node2 are working on different chains. This needs to be resolved, and the following explains how.

Now, when Node1 and Node2 broadcast their mined blocks to the network, there will be two competing chains. Depending on the which chain other nodes are using you will get 1 confirmation for the transaction from different nodes. That is why spending transactions with 1 confirmation is not too clever an idea.

Eventually, both nodes will reorganise as more blocks are mined top either Node1 or Node2's block. The issue will be resolved when one chain outputs 2 or more blocks more than the other. The losing chain will be discarded by all nodes (who must accept the longest chain as the most valid). At that point the double-spent transaction that did not make it into the valid chain will be invalid forever.

Hope this helps.


CPFP: Child Pays For Parent Clarification Needed With the Child Pays for Parent (CPFP) Do I sent more bitcoin to the SAME address the stuck transaction was sent to? The second transaction (with fees high enough to cover both transactions) will push the first transaction through? Or will they both get stuck? Or will the latter bypass the lesser?

For example.

1- I sent 5 BTC to address flsdjlfksdjfli3w320r89we2182eq78e9r7239
and it gets stuck

2 - so I sent ANOTHER transaction to flsdjlfksdjfli3w320r89we2182eq78e9r723 (+ fees for both transactions),

3 - and then both transactions go through?

Thanks in advance for the answers.

No, it's not a matter of sending to the same address multiple times, rather, CPFP works by spending the output of a previous transaction in a second transaction with a higher fee.

Example:

An unconfirmed transaction A with 500B size paid 20000 satoshis fee which corresponds to a fee rate of 40 satoshis per byte. The transaction has two outputs:

A:0 is signing over funds to the recipient
A:1 is signing the remainder back over to the sender

Let's say that the transaction is stuck because it would have needed a fee rate of 100 satoshis per byte to get selected into a block.

As the sender, you now create a second transaction B that uses the unconfirmed transaction A's change output A:1 as one of its inputs. Let's say that this second transaction B has 250B. To pay a fee rate of 100 sat/B for the second transaction, you'd specify a fee of 25,000 satoshis. But you also wanted to speed up the unconfirmed parent transaction! To do so, you add another 30000 satoshis, which brings the child transaction's fee up to 55000 satoshis.

This leaves the parent transaction A with a fee rate of 40 satoshis/byte, and the child transaction B with a fee rate of 220 satoshis/byte, but the two transactions in sum with 75,000 satoshis for 750 bytes of transactions, or a fee rate of 100 satoshis per byte. In order to get the juicy fee from the child transaction B, a miner has to also confirm transaction A as B is invalid if A is unconfirmed. They are thusly incentivized to include both A and B by the child paying for the parent.

Note that the recipient has the same option by creating an analogous CPFP transaction via spending A:0. (H/T Thalis K. for pointing this out in the comments)


Can I use Bitcoin to recieve funds from Egypt I am owed about £7000 from a friend in Egypt but we are having a very difficult time transferring the money to my UK bank account, as the money is in UKP (sterling) WU and moneygram only accept USD, the banks want a government signed contract between us, and paypal is new in Egypt and will not accept debit cards or his new visa card so he cannot sign up to these services, so my question is, is bitcoin a way that we could transfer the funds directly to me and will I be able to convert the bitcoins to Sterling, and how much will this cost? many thanks to all that reply
Tony

Yes it is possible.

Steps.

1) Find a bitcoin seller in Egypt.

2) Buy Bitcoins in Egypt. Your Friend must provide a bitcoin address to receive the bitcoins.

3) You provide a bitcoin address to your friend where he sends the bitcoins.

4) You find someone willing to buy bitcoins with sterling in your location.

5) Sell your bitcoins and receive Sterling.

You both will need a bitcoin wallet. And a way to contact with a bitcoin seller/exchange.

You can do the exchange in person (ie, LocalBitcoins) or directly to your UK bank account using a service like Coinbase.


How can I identify the coin type from its address? I know Bitcoin addresses start with 1, and it seems that testnet addresses start with m or n, and Namecoin addresses start with N, but is there a more complete list that would allow me to identify the coin type from an address?  I hope this isn't offtopic, asking about other block chains.

I specifically want to know what these addresses are for (they're embedded in the executable linked to in this question):

3Q9yidc7Sqwj4fkFmomzC4fqyFzNGTA21x
3Nw1sp46VjHyVDDAaQhDHZSX4xvoqNzrBs
3NjPgjfMAAbamPE5PcgvXHSkCzq4kqijpH

but a complete list associating address prefixes with coin types would be more useful.

There is a list here, and a more detailed one here. 3 is indeed for a Bitcoin script hash.


How a block is defined (size, number of transactions)? While exploring the Blockchain.info charts, I learned that:

The average size of blocks is increasing (max=1MB).
The number of transactions in one block is also increasing.

After reading some related articles, is it right to say that

One block is defined (solved) by mining. If I have a super powerful computer, I can mine so quickly that one block will only contain one transaction. (I'm trying to understand if there is a link between the number of transaction and the mining speed.)
The transactions in the same block are not linked between each other. So miners do solve one transaction, but one block.

A block must satisfy the following conditions for it to be valid:

The total size of the block must be 1MB or less.
At least 1 transaction called the coinbase transaction must exist.
Block must satisfy proof-of-work.
Block must reference a valid block as the previous block.

There are some miscellaneous restrictions, but these are the main ones. What you called "solved by mining" is what's called satisfying the proof-of-work. What you called having at least one transaction is the restriction that the coinbase transaction must be present. I encourage you to read the specification to find out more.


Is it safe to run bitcoind on another server I'm making first, rough concepts of some ideas for bitcoin-enabled services I have in mind.

One thing that I wonder is, is there a best-practise approach on running bitcoind on another server that acts as backend for a particular other server?

I thought of something like that:

I have a vServer A and a plain and simple PHP-Webspace at another host B.

A runs my bitcoind-deamon and only allows RPC-calls from Bs IP.

B makes its RPC-calls to A in a server-proccess which was not triggered by a client/website-visitor.

How safe would you ensure such a scenario? Is it possible that nodes, connected to my vServer A, identify the servers purpose from the transactions and try to attack him?

Even if they do, they would have to use a MiM-attack, because A only accepts Bs IP.

What else can I do to make the communication more secure? HTTP-Auth, SSL?

If you have SSH access on both machines you can simply create an SSH tunnel from machine B to A and forward port 8332 through it. That way the behavior is just like it would be if bitcoind were installed on both machines, the traffic between the two machines is encrypted with SSH and bitcoind does only have to listen to the loopback interface and would not be accessible from the network.


Can there be 100% change transactions? Is it possible to send 100% of the funds from one account to the exact same account?

Essentially, such an operation would be a NOP, but could be used as "proof of ownership" (e.g. by adding a comment with the transaction in reply to a proof-of-ownership challenge).

Yes, the output address can be chosen entirely independantly from the input address. So you can send all the money from one address to itself if you don't pay transaction fees.

"Proof of ownership" can be done easier and faster though, without performing a transaction at all. You can just use the private connected to the address to encrypt a random message from the other person. She can then decrypt it with your public key and assert that the result is the original message (and that the public key corresponds to your address). This process is called digital signing and actually happens when bitcoins are transacted.


How much bitcoin debit card really cost? Just read this article about Bitcoin debit cards. Two interesting statements I noticed:

customers are not required to complete ID verification provided if they are happy to stay within the lower debit card limits
there is also no loading fee

Guess when using in a supermarket, coins are sold on the fly on an online bitcoin stock exchange. Can not believe there is no service fee for transaction. Is it any hidden cost above 15 something dollar?

What if I register myself as "Mickey Mouse"? Will they approve it?

Well, Xapo is one of the cards that enable you to convert BTC in fiat currency, in the format of a credit card, this is their fee list:

https://support.xapo.com/what-fees-are-associated-with-the-xapo-debit-card

Hope it helps!

Cheers


API calls - "not yet implemented"? I tried sending some commands to my Bitcoin-QT running on Mac, and when I called "encryptwallet", I got this response:

Not Yet Implemented: use GUI to encrypt wallet, not RPC command

What API calls listed on wiki are not available in the GUI client, and which are not available in any client?

Exactly two RPC calls can't be called when Bitcoin-Qt is running:

encryptwallet
stop

stop isn't yet implemented because there is work to be done to get the GUI and all of bitcoin's internal threads to shutdown in the right order (get the order wrong and we get crashes during shutdown).

encryptwallet isn't yet implemented because stop isn't yet implemented, and properly encrypting the wallet means re-writing wallet.dat and then shutting down cleanly so any database files are cleaned up properly (and any unencrypted private keys don't get left on the disk).

I'm not sure what you mean by "not available in any client" -- as far as I know, the original "Satoshi" client is the only one that supports the JSON-RPC interface at all.


Bitcoind and Bitcoin-cli on LAN I am attempting to run  bitcoind on a computer in my local area network (LAN) and then have bitcoin-cli access/communicate with that computer in lieu of running Bitcoin-QT on the same machine alongside bitcoind.

Is that possible?

Thus far I've tried to modify the bitcoin.conf but without success.

You can run bitcoind on one machine, and communicate with another over your LAN using bitcoind's JSON-RPC API.

Once bitcoind is running just hit your host machine's local network IP on port 8332 with your API calls. You can find out your local network IP of your host machine by typing ipconfig in your command prompt.

You didn't mention how you were trying to communicate so let's say for example if you're using Python-BitcoinRPC

from bitcoinrpc.authproxy import AuthServiceProxy

access = ServiceProxy("http://USERNAME:PASSWORD@192.168.2.1:8332")
access.getinfo()

Make sure you update the ServicProxy() function with the host's local IP, and your username and password from your bitcoin.conf.


Recovering the last few digits of a Litecoin private key Is it possible to recover the last few lost digits (10) of my Litecoin wallet private key? Are there any recovery tools available? Or will I have to try and roll my own? Crucially, what crypto function will I be working against?

I understand that a upper/lower alphanumeric 10char keyspace is effectively uncrackable, but this key was in wallet import format, which I understand incorporates some redundancy/error detection à la MOD10 credit card number verification. I'm wondering if 10 characters of lost private key is therefore recoverable in a reasonable time frame.

Back story:
When I hurriedly 'saved' my liteaddress.org keypair as a PDF using Chrome, 10 chars of the private key were clipped. It actually appeared to be 15 or so missing characters that were clipped, but a PDF recovery tool revealed some of the hidden characters. I did not notice this at the time, and paid into the wallet.

My lost wallet contains the proceeds of most of my mining to date. It's not a huge amount of money, but it would be a shame to waste it.

I'm aware that this all sounds extremely dodgy. As a testament to the fact I am seeking to recover my own key and not someone else's, I am happy to use my real name / main Stack Exchange profile to ask this question.

First off: I don't know of any recovery tools (but didn't google for them either). What I'll explain is the difficulty to guess the correct address.

The wallet import format has 4 byte of checksum data. That's 8 characters. So losing the last 4 byte or part of them only loses / diminishes your ability to check for typing errors in the important part of the wallet import format instance.

8 characters in base58 (which is what the wallet import format uses) is log_2(58^8) bit = 46.86 bit. Subtract the 4 byte of redundant data from this and you know that you have to guess 14.86 bit (idealized (won't work out)). So after 2^14.86 = 29'738 guesses you have it for sure and stochastically the expectation is 14'869 guesses. That's entirely feasible (even non-idealized).

Everything you have after guessing is the so-called extended key. That's enough to derive your private key (which is what you need to send money) from it (just drop the first byte).

If you need it in wallet import format, after your guess you have to hash the extended key using sha256, take the first 4 byte (8 characters in hexadecimal notation, again), and add them to the extended key.

But there are classes which give you the public key if you enter the private key. And you almost got it. You probably also got the corresponding public key. So you need the write a script which tries all the possible private keys, calculates the public keys for them, and checks them against the public key you feed into the script. That's probably way faster than figuring out if there are funds in the wallet.


Is it safe to send to my own address from my wallet? I have a wallet.dat which has so many addresses in it. Like 1, 2, 3, 4, ....., 1234324234 addresses. (Each number is address)

I backed up original wallet.dat, and I want to use this light wallet.dat from now on.
This light wallet.dat has only 1, 2, 3, .... 100 addresses in it I think.
(keypool size was 100)

Both wallet.dat has same address "1", so is it okay to sending all coins to address "1" and use light wallet.dat after that?

It may cause sending to address "1" from "1". Is it okay?

I think you need to understand a lot more about public and private key cryptography first. It sounds like you have no idea what the address actually is or how it's used in Bitcoin.

Yes, the standard client does generate addresses in advance, and these are used by the client when you request the "creation" of a new address. But if you (or rather your client) does not know the private key associated with the address, you will lose your bitcoins forever.

Therefore you need to know both the address that you are sending to and the private key, to be safe.

Can I recommend that you learn about your wallet and how it works by using your bitcoin client in testnet mode first.


double spending problem Why is double spending a problem.
Suppose I have 1 bitcoin and I intend to send 1 btc to Alice and 1 btc to Bob.

Once I send 1 btc to Alice, UTXO of 1btc will be unlocked,transferred to Alice.No change is returned.Since Now when I try to send 1 btc to Bob, I have no UTXO to send it from. So the question of double spending is out of the question.

The double spending can be a problem when multiple transactions occur at the same time. If that is the case, why allow multiple transactions to occur at the same time?

Double spending commonly refers to the situation where you send 1 BTC to Alice but you privately create a fork and on that fork you send the 1 BTC to bob. If your privatefork mines enough blocks to surpass the main fork (i.e you have the majority of hashpower or you are really lucky) you publish it and all the nodes consider it valid since it is the longer chain. As a result Alice loses her 1 BTC.


How Can I Ensure Private Key is Valid on my Paper Wallet? I have recently created a paper wallet using the tool at bitaddress.org.

Now I will soon be transferring a large sum of money to the paper wallet, however before I do so I would like to be sure that the private key that has been generated is in fact valid for my bitcoin address.

I have been told that once some money is transferred away from a paper wallet, the paper wallet is no longer true "cold storage" and thus transfers from paper wallets should be "all or nothing".  This prevents me from doing a test transfer to ensure the private key is valid.

How else may I test the compatibility of my private key with the bitcoin address to ensure that I will be able to access my coins at a later point in time.

Checking the validity of a private key is a really compute-intensive task to do by yourself, but you can do this without actually using the private key to send coins (so no need to do it using pen and paper).

On the bitaddress.org website the Wallet Details tab lets you enter the private key and after clicking View details your bitcoin address should be showed in either Bitcoin Address Compressed or Bitcoin Address field.

But of course, you should not give away your private key, especially not online.

The site is actually an all-in-one HTML page, that is it can be downloaded as one file and it will work offline as it does every calculation in your browser window (no data you entered will be sent to the server). You can save to your computer (Ctrl-S in your browser) and open it in your browser without Internet connection.

I'd suggest to do the check at least in a private browsing window, or a live system (keep reading).

If you would like to do an independent check, use a Bitcoin Core client and create a new empty wallet (if you have it running, shut it down, move the wallet.dat somewhere else and start it again), go offline (disconnect your machine from the Internet, you will not need synchronization anyways) and try to import the key as it is described in this question. The client will check the private key, if that's invalid then an error will be reported (I changed a character, it reported Invalid private key encoding (code -5)). After this you can close the debug window and check your Bitcoin addresses in File >> Receiving addresses. After this, shut down your client and delete the wallet.dat. If you have moved the wallet.dat move it back now and keep using that.

Of course using this method writes your private key to the HDD/SSD of your machine, therefore even after deleting the wallet it is likely to be recovered using forensic/data recovery tools. If you'd like to avoid this you will need to use a disposable system, like a live OS that retains no data.

You can for example download Ubuntu and put it on a pendrive then boot from it, by default it will not save anything you do. You can also download the client from the Bitcoin Core download page (choose "Linux (tgz) 64 bit"), save it to the pendrive using your regular OS and then when you boot the Ubuntu you can simply extract it to the Desktop and run from there, all offline.

If you'd want to be even more careful then before booting the Ubuntu you should disconnect all other drives from your machine, leaving only the pendrive connected. Also, after using the Ubuntu and returning to your regular OS search for a method to securely wipe your pendrive and do that.

And another step would be a computer dedicated solely for this purpose, for example a Raspberry PI. Download a base image, put it on an SD card, copy the saved bitaddress webpage beside then connect a display, a mouse and a keyboard and power it on. The Bitcoin Core client has no official binary release for this platform but you can build it from source if you're adventurous enough.


Negative balance after sendfrom bitcoind Any one can explain me why I get a negative balance after execute a sendfrom ?

"sendfrom myaccount btcaddress amount"
and right after
"getbalance myaccount" return  a negative balance

I don't really understand why the balance is negative ...

After 1confirmation, the balance come back to his real value.

Read this issue:
https://github.com/bitcoin/bitcoin/issues/2079

As  gavinandresen commented December 06, 2012

  Yes, that is a 'WONTFIX'.

  A sendall account  command that took the account to exactly
  zero might be a good solution, although you can still run into edge
  cases like "what if the account contains 0.000001 BTC" (fee to sendall
  might be greater than that).


How do mining rewards get verified? I understand that a miner who adds a new block can pay the reward to their address per the coinbase transaction, but who verifies that claim? Say, for example, I add a block, but instead of claiming 6.25 bitcoins, I claim 50 bitcoins. Who is going to verify that my claim is wrong? Thanks.

I add a block, but instead of claiming 6.25 bitcoins, I claim 50 bitcoins. Who is going to verify that my claim is wrong?

Every full node will validate every block and enforce that it adheres to the consensus rules. Such a block would be rejected, because it is invalid.
For example, the network rejected an invalid block in July 2019 when Antpool mined a block that claimed transaction fees but forgot to include the corresponding transactions.


How do I transfer BTC in cold storage? I understand how to send BTC to cold storage or offline wallets, but I can't seem to find information on how to send BTC from cold storage to, let's say, a wallet on my computer, or a website, or a friend's online or offline wallet.

I have successfully used Electrum wallet with cold storage. I found this one of the most novice friendly options, though getting money out from the cold storage is still quite a complex task.

Specifically, here is a tutorial how to create a two wallet: online and offline. Then you can transfer bitcoins from online wallet to offline wallet.

http://docs.electrum.org/en/latest/coldstorage.html

When you transfer bitcoins back to online wallet, you create a raw transaction on online wallet, then go to the offline wallet to sign it, bring the transaction file back to online wallet on USB stick and broadcast it to bitcoin network.


After generating my own private key, what's the proper way to add it to official wallet software? I've got some Go code that successfully generates private keys and vanity addresses as described by the wiki.

So I have all the parameters around the private key but I'm not sure what to do with that info to make it usable by the bitcoin core application.

Should I build a wallet.dat file to point the wallet software at? What's the format for that file? Is there an alternative format so I can import my new key alongside my old keys instead of replacing the existing file so that the software has more control of what the structure of the wallet.dat is?

I could layout the key in the same format that paper wallet QR codes use but I'm not sure what I'd do with that string for a desktop computer to accept it.

What format should I put the raw private key into and where should I put it for wallet software to use it?

In Core, go to "Help" and "Debug Window". Go to the console and type importprivkey [key]. This might also interest you: How do I import a private key into Bitcoin-Qt?


In-channel messages via Lightning network Is it possible to send messages to a receiver address via lightning channels. For example Alice send 25000 Satoshi to Bob with the message 'thank you for the coffee'.

I'm trying to find information about this feature: https://github.com/lightningnetwork/lightning-rfc

As far as I know, the sender cannot include a message with the payment. However, if you're looking to attach a payment purpose to a transaction such can be specified by the recipient:

In order to send a payment on the Lightning Network, the recipient must provide an invoice to the sender. The sender then uses the invoice to construct their payment.

The format of the invoice is specified in BOLT #11: Invoice Protocol for Lightning Payments. The invoice may include optional tagged fields. The field tagged with d may be used to include a short description of the purpose of the payment.


What are the Differences Between an Antminer S9 and an Antminer S9i On the Bitmain Website they now list the Antminer S9i how is this different than the S9?

S9i is an upgraded version of s9, shares almost the same hashrate 13TH/s+-10% and power consumption at 1300w+-10%, S9i is cheaper than S9.


OP_HASH160 pops the public key from stack after hashing it? This guide https://bitcoin.org/en/developer-guide#p2pkh-script-validation mentions
"The operation executed next, OP_HASH160, pushes onto the stack a hash of the data currently on top of it—in this case, Bob’s public key. This creates a hash of Bob’s public key."

Does the HASH160 operation pops the duplicated public key? If not, why keeping a duplication on the stack? what's the point?

Thanks.

OP_HASH160 pops an item from the stack (it can be a public key or any arbitrary array of bytes), hashes it and pushes the result to the stack


How come some algorithms are better for GPU mining vs CPU mining? How come some algorithms are better for GPU mining vs CPU mining?
From what I know (that may be wrong) most Ethereum miners use GPUs?
And bitcoin miners use CPU and ASIC mining?
What are the different algorithms out there Sha256, Scrypt, what others are being used?
And why some are better to mine with GPUs other's with CPU?
If one is to create a new PoW coin isn't there the danger that someone with a lot of ASIC mining power currently for bitcoin can just switch to your network and easily do a 51% attack and bring down your project?
How can one defend against that? Are there any algorithms that are not good to mine on ASICs?
Should a new Proof-of-Work coin use a new algorithm that most popular coins don't use?

Both are computational units. Algorithms are typically written without making assumptions about underlying chips that are going to run those algorithms, but certain type of tasks can benefit from massive parallel processing that GPUs, which increases GPUs appeal in mining, machine learning, etc.
https://blogs.nvidia.com/blog/2009/12/16/whats-the-difference-between-a-cpu-and-a-gpu/
Specific explanations about ML and mining can be found here:
https://www.quora.com/Why-do-people-use-expensive-GPUs-for-Bitcoin-mining-and-not-multiple-CPUs-like-Quad-Xeon
https://www.quora.com/Why-are-GPUs-well-suited-to-deep-learning


Why are the mining rewards set to reduce in such dramatic steps? The mining rewards are scheduled to drop from 50btc to 25btc. The next drop again will be from 25 to 12.5btc. In each of the steps into a new "era" the mining reward is reduced by 50%.

This seems like a very dramatic pay cut at each juncture, Is there a reason why the amount isn't being decreased more gradually by smaller and more frequent amounts?

It`s a geometric series with the base 1/2. After half of the remaining coins are mined, rate is decreased until half of remaining coins since the drop are mined.

The rate is convergent, that is, it approaches a finite number and doesn't go on until infinity (like say, 1, 1/2, 1/3... 1/n would). This makes it so that there will never be more than certain amount of Bitcoins created.

As for why it is so dramatic, probably for the ease of calculating whether the block is correct. If you would have some complicated way of calculating the reward some of the coins might be lost due to rounding error (below 1 Satoshi), and different (non-official) clients might have issues with calculating the result effectively. Moreover, these sudden decreases in amount of coins generated probably will increase the worth of Bitcoins.


Error compiling litecoin clone, boost error I am trying to clone litecoin for practice and for some reason this time around my build system isn't working right.

Here is the error I am having after trying to compile my clone AND litecoin 8.7.4 source

bitcoinrpc.cpp:984:52:   required from here
/usr/include/boost/thread/once.hpp:38:18: error: no matching function for     call to ‘call_once(boost::once_flag&, void (*&)())’
     call_once(flag,func);
              ^
In file included from /usr/include/boost/thread/once.hpp:20:0,
             from /usr/include/boost/thread.hpp:17,
             from util.h:24,
             from bignum.h:12,
             from main.h:8,
             from wallet.h:13,
             from init.h:8,
             from bitcoinrpc.cpp:6:
/usr/include/boost/thread/pthread/once_atomic.hpp:121:15: note: candidate: template<class Function, class ... ArgTypes> void boost::call_once(boost::once_flag&, boost::detail::thread_move_t<T>, boost::detail::thread_move_t<Args>...)
   inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args)
           ^
/usr/include/boost/thread/pthread/once_atomic.hpp:121:15: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/thread.hpp:17:0,
             from util.h:24,
             from bignum.h:12,
             from main.h:8,
             from wallet.h:13,
             from init.h:8,
             from bitcoinrpc.cpp:6:
/usr/include/boost/thread/once.hpp:38:18: note:   mismatched types ‘boost::detail::thread_move_t<T>’ and ‘void (*)()’
     call_once(flag,func);
              ^
/usr/include/boost/thread/once.hpp:35:13: note: candidate: template<class         Function> void boost::call_once(Function, boost::once_flag&)
inline void call_once(Function func,once_flag& flag)
         ^
/usr/include/boost/thread/once.hpp:35:13: note:   template argument deduction/substitution failed:
/usr/include/boost/thread/once.hpp:38:18: note:   cannot convert ‘func’   (type ‘void (*)()’) to type ‘boost::once_flag&’
     call_once(flag,func);
              ^
make: *** [obj/bitcoinrpc.o] Error 1

Could someone please let me know what this is? I tried an issue and change a line in rpcrawtransaction.cpp

<const CScriptID &>

to

<CScriptID>

and also tried code snippet from feathercoin, both unsuccussful.

Would be greatly appreciated if someone could help get my system buildable again.

Nevermind, sorry, I got past that part. I had clang as the compiler from update-alternatives, had to switch back to gcc. Currently compiling right now hopefully no more errors.


How To Buy Bitcoins On BTC-e (USA) BTC-e doesn't appear to allow USA wires from banks, and it has other options like MoneyPolo or OKPAY, neither of which allow USA customers either.  I've seen bitcoin traders arbitrage trade using US Dollars with BTC-e and they are Americans, so I'm curious how Americans use BTC-e outside of transferring bitcoin from one site to BTC-e?

BTC-E shut down by government and it won't come back. So there's no way to do that.

(source: btc-e.com)


How to generate Hash160 from a private key with the Bitcoin module I want to fix the script code. The script generates from a random private key Bitcoin Address by function (pubtoaddr) and works
on the Bitcoin module:
https://github.com/primal100/pybitcointools/blob/master/cryptos/main.py
from bitcoin import *
import os

    priv = random_key ()
    pub = privtopub (priv)
    addr = pubtoaddr (pub)

....
....

But I need to get from a Random Private Key in Hash160
For some reason I could not find such a function in main.py
I searched and found an article
>>> import pybitcointools
>>> privkey = pybitcointools.random_key ()
>>> privkey
'34030ce14e32ac982419b3683af3b59d64a29cc93798cf479d610af49d425d13'
>>> pubkey = pybitcointools.privtopub (privkey)
>>> pubkey
'04ce0ed35340803b0c21f2f7f5d5ab9d687e5fa95a79471c9b5c9d97a0bb170eac1045230cc51d13b85a5f64feb80f8fc19358a396797926e3f89d49066b1abc07'
>>> h160 = pybitcointools.hash160 (pubkey.decode ('hex'))
>>> h160
'1558c7cd9825447a31990ff964f347bb2dbfe9be'
>>> addr = pybitcointools.hex_to_b58check (h160)
>>> addr
'12wsYc4B9c9JeREqstLZXNWa3n4i42M5jg'

Unfortunately I could not get from
 priv = random_key ()  --- > Hash160

How to do it?

I am using a different bitcoin library. This prints address and hash160 from a private key:

from bitcoinutils.setup import setup
from bitcoinutils.keys import P2pkhAddress, PrivateKey, PublicKey

def main():
    # setup the network
    setup('testnet')

    # provide a private WIF key
    priv = PrivateKey.from_wif('cMahea7zqjxrtgAbB7LSGbcQUr1uX1ojuat9jZodMN87K7XCyj5v')

    # get the public key
    pub = priv.get_public_key()

    # get address from public key
    address = pub.get_address()

    # print address and hash160
    print("Address:", address.to_string())
    print("Hash160:", address.to_hash160())

    print("\n--------------------------------------\n")

if __name__ == "__main__":
    main()

For segwit addresses you can refer to this example: https://github.com/karask/python-bitcoin-utils/blob/master/examples/keys_segwit_addresses.py


How do I access the Bitshares that I received from my Protoshares "snapshot" I have had some Protoshares for a while.  At some point (according to my fuzzy memory) there was a "snapshot" which gave me the right to Bitshares.

I still have access to my Protoshares wallet but haven't installed a Bitshares wallet.  How do I access the Bitshares that I received from the "snapshot"?

Install the BitShares wallet. Create an account and go to that account page. Select the "Keys" tab and import the wallet.dat file.


How does Bitcoin verifies signature if addresses are one way hashed I'm stuck at understanding Bitcoin's transactions. So, the owner must sign the transaction with his private key, then miners can verify whether this signature matches his public key. However the public key is hashed with three functions (RIPEMD160, SHA256 and Base58) and it's impossible to get the original ECDSA public key from the address. So how does the transaction verification actually work?

The ECDSA public key is "included" in the new transaction (part of the scriptSig).
Details
This is an example output of a transaction (only hash of the pubkey is available):
"scriptPubKey": {
    "asm": "OP_DUP OP_HASH160 059be22aadc3bef6b673cb7a16247a0b7403d943 OP_EQUALVERIFY OP_CHECKSIG",
    "hex": "76a914059be22aadc3bef6b673cb7a16247a0b7403d94388ac",
    "reqSigs": 1,
    "type": "pubkeyhash",
    "addresses": [
      "mg2cQz9Y3ugyjfq8b2wTcW4veemgTBKxkX"
    ]
  }

The pubkey from the address above is
03788e5414ebec4a38032be706ae0c13870e320d916bb087ab7258fcf8c0111cbf
(but it's not visible in the blockchain until the output gets spent. Only the recipient of the output above knows it.)
Using that output as an input in a later transaction will result in:
"scriptSig": {
            "asm": "304402203b47249bfe6528dcf297c5888ad608a5c7227ea9f878df09a265c3318c1482e202204e8a8f17da505a6d20ceb4eb63fba2d8e2c5d0a792a0e280dcb18adeec68a05d[ALL]03788e5414ebec4a38032be706ae0c13870e320d916bb087ab7258fcf8c0111cbf",
            "hex": "47304402203b47249bfe6528dcf297c5888ad608a5c7227ea9f878df09a265c3318c1482e202204e8a8f17da505a6d20ceb4eb63fba2d8e2c5d0a792a0e280dcb18adeec68a05d012103788e5414ebec4a38032be706ae0c13870e320d916bb087ab7258fcf8c0111cbf"
          },

(3044... is the DER encoded ECDSA signature)
(03788... is the pubkey)


OP_CHECKLOCKTIMEVERIFY . Include / reject or will not included in block? What happened if I translate to network transaction with the folowing redeem script:

[now + 3 months] CHECKLOCKTIMEVERIFY DROP
DUP HASH160 [Bob's Public Key Hash] EQUALVERIFY CHECKSIG

This tx will be accepted (included in block) and after 3 month Bob can spend bitcoins?
Transaction will be rejected, and can only be accepted by the network when 3 month is reached?
Transaction will be accepted immediatly, but can be confirmed (included in block) after 3 month ?

Does it depends to input script (scriptsig)?
If yes, can you provide an example pls?
According to wiki, I just need to push some value to stack?

A transaction with a CLTV output can be created at any time, and can be accepted and confirmed immediately.

Spending such an output requires a transaction whose nLocktime field is at least the CLTV-specified time. That transaction will only be accepted and confirmed when its nLocktime field matches the real time.


Blockchain Receive API - custom Parameters I am trying to get variables back from the callback URL, but I can't figure out how to add custom parameters correctly. This is how I have them written right now:

$newAddy = json_decode(file_get_contents("https://blockchain.info/merchant/$ID/new_address?password=$PW&funding_id=$funding_id"),true);
$parseAddy = $newAddy[address];

$funding_id is the extra one that I want to add. Any suggestions?

You appear to be confusing two different blockchain's API services into one. The code snippet you provided is for their old deprecated wallet API, but your title mentioning the receive payments API is another.

Wallet API: https://blockchain.info/api/blockchain_wallet_api
(The new version requires a local service installed via NPM)

Receive Payments API: https://blockchain.info/api/api_receive

You can add any custom parameter you would like when using the Receive Payments API just by including it as a GET within your callback URL.

$callback_url = "yourwebsite.com/callback.php?parameter1=".$var1."&parameter2=".$var2;


How to run bitcoind (command line client) without connecting to other nodes? I'm running Abe to create a blockchain SQL database, so I don't want the Bitcoin client to touch my copy of the blockchain at the moment. But I would like to query the blockchain with the bitcoind client. Is there a way to run bitcoind without connecting to other nodes?

I see two approaches:

Use --connect <hostname> with the hostname set to something that doesn't exist.
Unplug from the network.


Bitcoin conversion with comingled funds If hackers convert stolen money into bitcoin and then deposit the money into a regular commercial bank assuming that they stole like 100 million dollars or more, would it be possible for them little by little to wire the clean money into a regular commercial bank in the United States or for that matter into some other rich developed first world nation like Canada, Australia or New Zealand??? Thank you.

What you're describing is called structuring, and it's illegal in the United States. It is probably illegal in other countries, too.


Why does Avast and other antivirus' detect gpu miners as viruses? For example I was downloading the latest cgminer and Avast blocked the download saying it was a virus. Is this true or is it a false positive? I've had other antimalware (I think Malwarebytes) detect cgminer as a virus.

This is probably because hackers install these miners on peoples computers without their knowledge or make a botnet of miners.

Solution to this is placing your miner to ignore-list or get another antivirus like Avira, Avg, or just switch to linux and no need for antivirus anymore.


How to integrate bitcoin payment in ASP.Net? I am new to Bitcoin. How to integrate Bitcoin payment into my one of website which is designed using ASP.Net.

Also how to test it using Sandbox mode as provided by other gateways like PayPal?

Regards

If you don't want to integrate with a 3rd party bitcoin payment provider you can implement your own payment module for Bitcoin (but also for Litecoin and every Bitcoin-derived altcoin) very easily with BitcoinLib that is written in C#.

Some of BitcoinLib's features:

Fully compatible and up-to-date with Bitcoin 0.9.1 RPC API.
Design-by-contract, service-oriented architecture.
Strongly-typed structures for complex RPC requests and responses.
Implicit JSON casting for all RPC messages.
Extended methods for every-day scenarios where the built-in methods fall short.
Exposure of all RPC API's functionality as well as the extended methods through a single interface.
Fallback mechanism for timed-out RPC requests.
Custom RPC exceptions.
Supports all Bitcoin clones.
Can operate on unlimited daemons with a single library reference.
Litecoin integration included.
Each coin instance can be fully parametrized at run-time and implement its own constants.
Console test client with demo methods implemented in it.
Disconnected raw RPC connector included for quick'n'dirty debugging.
Testnet ready.
Fully configurable.


bitcoind and onion listening I would like to get Bitcoind to advertise that it is listening on an onion address.  However, I do not want to have Bitcoind use a tor socks proxy to connect.  I have a special router for tor connections and the Bitcoind server uses that as its network gateway.  How do I get bitcoind to advertise an onion address without setting a socks proxy?

You need a way for an onion service to be created, connected to and advertised. Usually, with Tor running on the same machine, just start bitcoind with the following option should do it depending if your installed versions of Tor and Bitcoin Core are new enough:

>bitcoind -listenonion

You may also need to override -bind=, -discover=, listen= and -externalip= after that to suit your exact configuration.

Of course, the setup in your question is a little different to standard. What you will need to do is:

Bind your bitcoind to the network IP of the machine it is running on. It probably is already but, you can use -bind= if necessary.
Ensure the firewall on your bitcoind machine will allow incoming connections to the bitcoind service from your Tor router. With firewall configuration, it is always best to be specific.
Setup the onion service on your Tor router and point it to your bitcoind machine. Make a note of your onion service name.

Ordinarily, you should be able to add the following lines to the /etc/tor/torrc file:

HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 8333 {machine IP of bitcoind}:{mainnet port}
HiddenServicePort 18333 {machine IP of bitcoind}:{testnet port}

*Note that I have not tested this setup and presume Tor will allow you to specify the IP of your network machine running bitcoind

You may consider adding 8333 to the LongLivedPorts parameter in your permanent Tor config and restart Tor unless you have a live configuration editor like nyx to also change it on the hop.
Configure bitcoind to use and advertise the onion address for incoming connections. You can use -externalip={onion}. I am not sure if you can or if you need to specify this multiple times, for any standard IPv4/IPv6 external incoming addresses also.
You may also consider using -discover=1 since you are not trying to hide your standard external IP addresses I presume.

In bitcoin-qt, you can see the command line options and their descriptions in the help menu.


Is it fraud? Would banks ask for fees through bitcoin? So a man came to me on Instagram saying that he wanted to buy old money specifically from Hong Kong for a museum in Philadelphia, and that he would pay me good money for my old coins and bills, then he said he transferred the money through Bank of America but the money would only transfer into my Hong Kong bank account if I pay a verification fee to his bank through bitcoin atm with a QR code he gave me, he said the QR code belonged to the bank but I couldn’t check, it was very fishy so I started agitating him to test him and he sent this CERTIFICATION that he claims is from Bank of America. He also kept rushing the process And his English was strange and he never really answered my questions directly, he called the fees clearance fees, activation fees and verification fee on different occasions and now I’m so confused. I don’t use Bitcoin so I have no idea is this fraud or not. Please help!

This is definitely a scam.

Even if an activation fee was a legitimate thing, they would just charge that amount out of the amount you were going to receive - if you were to receive $1000 and the fee was $5, they'd just give you $995. Beyond that, no bank I'm aware of charges fees in cryptocurrencies.

Don't send any money to these people.


Bitcoin usage charts There is a lot of data out there about BTC prices, but are there any simple charts which show how much is Bitcoin really used? Something like number of Bitcoin transactions per day/week, or daily amount of bitcoins transferred, from the beginning to present?

The data should be available in blockchain, but did anyone make pretty charts?

Blockchain.info is an alternative to blockexplorer that has additional statistics regarding market prices, mining costs and bitcoins in general. There is some information there about transactions that might interest you.

Here is a chart with data from last year:

A chart with Bitcoin Days Destroyed is also available at the website. This might be a better way to represent Bitcoin's usage. See this question and the wiki for more information about Bitcoin Days Destroyed.


Explanation of probability of forks in the Bitcoin blockchain I am reading this paper on how information is propagated on the Bitcoin network. The authors present a model to predict the rate at which forks occur in the blockchain which is given as below

Here, F is the number of conflicting blocks in the network, Pb is the probability of the network finding a block b in a given second (ideally, 1/600 since a block is expected every 10 mins = 600 secs) and f(t) represents the ratio of nodes that hear about the block b in t secs. However, what I cannot understand is how this entire expression is derived. I understand that the term in the exponent represents the mean amount of time it takes for the network to learn about a block (and this value can be derived from a graph given in the paper). I assume 1 - Pb represents the probability of the network finding more blocks in the remaining 599 seconds in the 10-minute interval. Why is this probability raised to the mean amount of time it takes for the network to learn about a block?

Any explanation would be appreciated.

I haven't read the paper, and I think the expression is only an approximation, but the basic idea is that this is an inhomogeneous Poisson process.

In order for a fork to occur, some unaware node needs to find a block. This is 1 minus the probability that no unaware node will ever find a block. Which itself means that no unaware node finds a block in 1st second, no unaware node find a block in 2nd second, etc. This probability is the product of the probabilities of the individual seconds (since they are all independent).

Each individual probability is roughly (1-P_b)^(1-f(t)) (if f(t)=0 then all nodes are unaware and the probability is the same as no block being found at all a block at all, if f(t)=1 then all nodes are aware and certainly no block will be found by an unaware node, and in between it interpolates. If it's not clear why the interpolation is via a power, keep in mind that for small P_b, the power is irrelevant since the expression is roughly 1-P_b*(1-f(t)).

The combined probability, as mentioned, is the product of probabilities, which is like (1-P_b) to the power of a sum of (1-f(t)), which is like (1-P_b) to the power of an integral.

If it was up to me I would have written the expression differently, but these are the general ideas.


what is the motivation behind one-cpu-one-vote rule? Original paper published by Satoshi Nakamoto, compares between one-cpu-one-vote and one-ip-address-one-vote, then chooses former because of the reason that someone would be able to allocate more than one IP.

This statement also sounds against anyone with huge hash power.

With this, it seems that, GPU / FPGA / ASIC hashing was not predicted at the time of publishing this paper.

Is this an important change, or just a design decision for the growth of Bitcoin ecosystem? What's the motivation behind one-cpu-one-vote rule? And, will it still applies to Bitcoin ecosystem?

The motivation for this rule is simple - there is a requirement to have some voting mechanism , and this 1-CPU-1-vote mechanism is fair, in the sense that everyone can buy more CPU (or GPUs or ASICs) and mine. The rewards are proportional to the invested effort - better harder costs more, it doesn't matter if it's CPUs, GPUs or ASICs.

So, the protocol rewards miners in proportion to the amount of money they invest in buying mining gear. It's certainly better than rewarding per IP address, which is controlled by various organizations and ultimately centrally managed.

Also, I believe satoshi did foresee the evolution in mining gear, although it seems that it's not mentioned in the original whitepaper.


Always the same deposit address for a user? I'm wondering if it is possible to at creation of a user account also save a deposit address(blockchain.info receive payments API) which the user will always use when he/she wants to deposit coins.

Ofcourse I know it's possible to save the deposit address with the user but will it work to always have the users always deposit to a specific address?

will it cause any problems like take the total received balance of the address all the time when the user deposits? eg: balance = balance + (total received coins + just deposited coins)

Tried to explain my concerns and questions to the best of my ability hopefully I can get some answers because google doesn't have any in this case.

The bc.info receive paments API will NOT work if you reuse addresses. The funds will still be yours since the addresses are hierarchical deterministic, but the callback notification will not fire. Your site will not know when a new deposit has been made unless you check manually. I suppose you could create a "refresh my balance" button for your users, but you'd need to put some restrictions on how often they can click so you don't exceed API request limits.


Where can I find more information about Litecoin ASIC miners? I know Bitcoin can use ASICs but from what I can see some ASIC based hardware can work with Litecoin as well. However google search wise there isn't much to go off of, just that it is possible.

Any guides or suggestions?

Just search for "scrypt asic miner" and you should find some.
https://www.google.ca/?gfe_rd=cr&ei=VFzxWJPGCuHs8wek4pPIBg#q=scrypt+asic+miner


Bitcoin mining on headless Ubuntu 12.04 server I've googled a lot and also read threads here but I'm still struggling.
Background:
I'm a eager but novice Linux user
I've an Ubuntu 12.04 webserver sitting pretty and is not doing much.
I would like to use the free processing power to mine Bitcoins - makes cents (sense).

Thus, I have Ubuntu 12.04. I have installed bitcoind and made a bitcoind.conf file as per Ubuntu Linux -- How do I start bitcoind as a service to run automatically?
(Basically, copy and paste)

I've installed bfgminer and I've register an account with Eclipse Mining Consortium (eclipsemc).

Now my questions:

I've read the bitcoin needs to download a large data file (+- 6Gb).
I can't find any log files to tail.  How do I know bitcoind is
working properly?

$ ps aux | grep bitcoind
1000     30080  0.0  0.0   9364   368 pts/1    D+   21:21   0:00 grep --color=auto bitcoind

When I run bfgminer (bfgminer -o http://eu.eclipsemc.com:8337 -u [MyUserName_worker] -p [password] -L bfgminer.log), I have to press "M", then "+" and enter "auto" before it will pick CPU 7 as the device.  How can I ensure that it will pick CPU 7 as the default device? How can I run this as a background process?
I still need a bitcoin wallet?  I'm using Armory on my Windows box, what is a compatible one for Ubuntu webserver?
How do I ensure that bitcoind and bfgminer doesn't kill my server?

Thank you very much!

André

It seems that CPU based mining is not viable any more.  Even going to other cryptocurrency, which difficulty level should rise quicker as people mining bitcoin using hardware will mine these too.

Ah well, missed the bus :)


How can I use a vanity address as my main address I obtained a vanity bitcoin address (1MonkeyQWbMzny7BNTA66W9wv6KaCFFAB7) along with its private key. I would like to be able to use this as my main address.

Sites like BlockChain.info allow you to import the bitcoins with a private key, but is there something where I can enter the address and private key and be able to view how many bitcoins I have, and send them from THAT address (not import them to another one, like BlockChain.info does)?

I'll show you how to do this with the reference client.

First you need to import your newly obtained private key for your vanity address into your wallet. There is a great tutorial on how to achieve this here: https://en.bitcoin.it/wiki/How_to_import_private_keys_v7%2B. Once you do this, bitcoin-core will keep track of the balance for your newly obtained vanity address, so you don't have to do it manually.

Reusing addresses without a good reason behind that is not recommended.
If you still insist on doing so, first you will need to get familiar with raw transactions and then take some time to read the answer to this question: https://stackoverflow.com/questions/23324442/is-there-a-way-to-send-funds-from-a-specific-bitcoin-address-in-a-wallet that explains how you can send funds from a specific address.

On top of that, you should be very careful when generating vanity addresses. These links will give you an idea: https://bitcointalk.org/index.php?topic=795023.0 and http://www.reddit.com/r/Bitcoin/comments/21foj9/funds_currently_being_stolen_from_vanity/. A reliable way to do this is by an unmodified version of a vanity address generator that would run in an offline computer that will never get online before it is low formatted.


When/How did Eligius "indirectly cost MTGOX many thousands of bitcoins"? From the forum:

Eligius already will accept any transaction, "standard" or not,
without bias.
...
Indeed, and Eligius' willingness to do so indirectly cost MTGOX many
thousands of bitcoins when a software bug caused them to send some
weird transactions that Eligius mined.

Can anyone provide a reference that explain this incident? When did it occur?

It refers to an occurrence in October 2011 when someone sent a lot of bitcoins to an incorrect public address: someone fucked up and lost ALOT of money . Casascius stated that he thinks it was done by Luke-Jr's Eligius mining pool: Re: someone fucked up and lost ALOT of money

  The way I understand it, these transactions were nonstandard enough
  that normal miners and clients would already refuse to relay or
  process them (but will accept them in a mined block). And that the
  only way these got into a block was that he teamed up with Luke-Jr's
  Eligius mining pool which has been modified to explicitly allow these
  nonstandard transactions for a fee (or other negotiated arrangement).

Earlier from the same thread, Re: someone fucked up and lost ALOT of money:

  Maybe this helps. It seems MtGox made a mistake somewhere.

    MagicalTux: that's a problem, but not the worst problem we ever faced

    MagicalTux: all the broken withdraws have been re-issued

    MagicalTux: just spent one week of BTC-only income


How do I determine the balance of an address I don't own? (WebAPI or local API) I have an arbitrary address.  How can I get the current balance of the account through a Web API? ... how do I get it for a local API?

I'm also interested in all transaction history for that address.  Let me know if the API can offer that as well.

You can query the unspent outputs of an address with this:

 http://blockchain.info/unspent?active=$bitcoin_address

You can get the transaction history for an address with this:

 http://blockchain.info/address/$bitcoin_address?format=json

For more information see http://blockchain.info/api/blockchain_api


Do relay nodes need to have money in order to relay transactions? Imagine Alice wants to send 0.5 btc to Bob. They both open channels with Carol, a relay node that has no money. They create single funded channels each of 1 btc.

Now Alice updates her channel to be 0.5 to her and 0.5 to Carol (nevermind LN fees for now).

To relay this 0.5 to Bob, Carol (the relay node) needs to update her channel with Bob to be also be 0.5 her and 0.5 Bob. But she doesn't have any money on her side to do this. All the money is on Bob's side -- as I said earlier, Carol doesn't have any money.

What's the workaround for this? Do relay nodes need to have money to relay transactions?

No, there is no work around for this. If a channel's balance is completely allocated to one side, the channel can only be used to move funds in one direction. Additionally, a channel whose balance is shifted completely to one side is vulnerable to the broadcast of a previous channel state as there are no funds to be lost for the attacker. This does not apply to channels that are unilaterally funded, since no previous channel state exists in that case.

It is therefore not recommended to exhaust a channel completely in one direction. To maintain liquidity in both directions, proposed approaches are to charge increased fees as channels get further out of balance, and to charge lower fees, possibly even negative fees, in the direction that moves a channel back towards equilibrium.

Routing algorithms that minimize the fee for a route would thus be incentivized to help rebalance routes along the path. Additionally, this means that cycles can exist in the graph that actually incur in sum a negative fee, which any member of that cycle could collect by initiating a payment to themselves along the cycle to the collective benefit.

Update: It follows an example for using a cycle to rebalance channels.

Take the three payment channels

Alice 0.8 : 0.2 Bob
  Bob 0.7 : 0.3 Carol
Carol 0.9 : 0.1 Alice

Alice notices the cycle, and creates a three hop payment that pays 0.3 BTC to herself by route of Bob and Carol. She crafts the HTLC, and sends it to Bob, Bob accepts and forwards to Carol, Carol accepts and forwards to Alice. Alice executes the last hop, Carol the middle and Bob pulls in the locked funds from Alice resulting in more balanced channels for everyone.

Alice 0.5 : 0.5 Bob
  Bob 0.4 : 0.6 Carol
Carol 0.6 : 0.4 Alice

Note that Bob and Carol do not know that Alice paid to herself as they can each only see the next hop and previous hop in the contract chain.


Connect to Bitcoin Node behind tor network I configured my full bitcoin node behind tor (nowadays there aren't much bitcoin nodes behind tor network, this website: https://bitnodes.21.co/nodes/?q=Tor%20network tell us that there are just 323 nodes), for the moment I hadn't any problem configuring it behind tor. But the problem comes when I want to connect through a rpc client to my bitcoin node. I am using this project as code base: https://github.com/aceat64/EasyBitcoin-PHP and I modify the function __call in the following way:

$options = array(
            CURLOPT_HTTPAUTH       => CURLAUTH_BASIC,
            CURLOPT_USERPWD        => $this->username . ':' . $this->password,
            CURLOPT_PROXY          => '127.0.0.1:9050',
            CURLOPT_PROXYTYPE      => 7,
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_FOLLOWLOCATION => TRUE,
            CURLOPT_MAXREDIRS      => 10,
            CURLOPT_HTTPHEADER     => array('Content-type: application/json'),
            CURLOPT_POST           => TRUE,
            CURLOPT_POSTFIELDS     => $request
        );

I am very stuck with this issue, due to that I am getting all time Can't complete SOCKS5 connection to 0.0.0.0:0., I have the tor service running and I didn't find any tutorial about how to connect and authenticate to a bitcoin node using php and curl.

Best regards and thanks in advance

The RPC interface is not exposed over Tor. The only thing that goes over Tor is the P2P connection. To access the RPC server, you need to connect directly to the node's IP address, not connect to it over Tor. Note that the RPC interface and the P2P interface are two different things; the RPC interface is private facing while the P2P interface is public facing.


How is the "N" in PPLNS chosen? 2xDiff appears to make no sense - OR - Why are Scrypt share difficulties off by a factor of 65536? while my example in the following question is using the altcoin "Bitconnect", I believe it is actually a general question which fits here - if not, let me know.

I am struggling to understand PPLNS (I need to implement it in a pool). I know in general how the system works, but what is a mystery to me is where the N comes from.

I read on many places on the Internet that N = 2 * difficulty is a good value, and that this would mean that on average a miner will earn rewards from two blocks for the same shares.

However, it simply does not add up for me.

Practical example: BitConnect pool. Let's say BitConnect's difficulty is currently ~900,000.

An AntMiner L3+ submits a share at difficulty ~150,000 (which counts as a share value of 150,000 then) every ~15 seconds, so in 3 minutes, that one AntMiner has already filled the whole "N" of 900,000x2=1,800,000. That would, in reverse, mean that I would expect to mine a BitConnect block every 90 seconds on average, with one AntMiner, which is of course not true.

100 AntMiners running on our pool gave a share value of 230,000,000 in the last 5 minutes, which would have been more than 100 times the whole "N" already!

So something can't be right here, and I don't understand what. Should I not multiply the submitted share with the work difficulty? But then a small miner would get the same reward as a large one which makes no sense. Or is the whole Internet wrong about the 2*diff for "N", and that it's based on the assumption that it takes on average a value of shares equal to the difficulty to find a block? Doesn't sound likely.

On average, it takes 2^32 hashes to find a valid share at difficulty 1, right? And on average, it takes X shares to find a share at difficulty X, hence why you increase the difficulty at the pool for your miner if the miner is powerful (it will then less often submit a share), right...? But the last point starts to make less sense already, together with the fact that you need a share at difficulty Y to find a block if the currently coin block difficutly is Y... And the pool software counts a share with difficulty X the same as X shares with difficulty 1. At the end I'm left confused how it all works together and how I can arrive at a value for "N" which actually results in a miner getting on average two rewards for the same share...!

Please help me understand what is wrong.

EDIT: I found that all calculations differ from reality by a factor of 2^16. Then I found this: https://bitcoin.stackexchange.com/a/11816/62320
This would suggest that for Scrypt, pools use a scaled "share difficulty" value by exactly that factor, but the reported block difficulty would not be scaled. This would explain everything but it's the only place I found this on the Internet (and it would mean that I need different calculations depending on the algorithm I'm handling) - can anyone confirm this?

An AntMiner L3+ submits a share at difficulty ~150,000 (which counts as a share value of 150,000 then) every ~15 seconds, so in 3 minutes, that one AntMiner has already filled the whole "N" of 900,000x2=1,800,000. That would, in reverse, mean that I would expect to mine a BitConnect block every 90 seconds on average, with one AntMiner, which is of course not true.

I don't think that is how shares are counted. According to this Bitcointalk post,

  When a share is submitted, assign to it a score of 1/D, where D is the difficulty at the time the share is submitted.

So in your scenario, when your AntMiner L3+ submits a share, that share is assigned a score of 1/900000, so its "share value" is 2, not 150000.


If I buy Bitcoins at Coinbase.com, should I leave them on Coinbase.com, or should I move them into a Bitcoin Wallet? Why? If I buy Bitcoins at Coinbase.com, should I leave them in my account at Coinbase.com, or should I move them into a Bitcoin Wallet? Why?

This depends solely on trust and ease of use.

Trust

Who do you trust more? Coinbase's security setup or your own? Some things to consider:

Coinbase makes profit from it's website and so wants people to use it. For this reason they benefit from taking security serious. They probably have a dedicated team thinking about how to improve the security of their system.
You own computer, let's say running Windows, is likely very much less secure. Any virus or malware can steal your coins. Also, without a backup, a disk failure will make you lose all your coins.
While Coinbase's security might be much stronger than yours, it is very more likely to be targeted by hacking attempts. They store a very large amount of coins, while you only store your own.

Ease of use

Running a Bitcoin wallet yourself can sometimes be some hassle, while e-wallets can offer you extended functionality and features.

You will need to download and sync the complete block chain, which takes around 9 GiB or storage. There are also clients that don't require you to do this, but still they have to sync all the time and use network bandwidth.
You will need to worry about backups. You can trust Coinbase for taking backups regularly. If you want your own wallet to be safe, however, you will have to backup them yourself.
Much e-wallets like Coinbase offer extra functionality, like links to information on blocks, transactions and addresses. Also many of them have a Mobile App that you can use to access your wallet with.


Are the capabilities of Namecoin a strict superset of Bitcoin? I have read that "while Bitcoin is a currency, Namecoin is not".

Isn't the capabilities offered by Namecoin a superset of Bitcoin's capabilities? If everyone in the world agreed to jointly migrate all Bitcoin to Namecoin at some instant, would we lose anything from this migration?

The amount of NMC required in order to register a domain name is fixed by the protocol.

Having NMC and BTC be separate currencies ensures that the number of BTC needed to register a domain name is set by market pricing mechanisms, not by the hardwired protocol.

If we used NMC for buying and selling things other than BTC, it would be like denominating all of our economic activities in terms of domain name registrations ("this pizza will cost you 0.012 domain name registrations").  This is a bad idea because the demand for domain names would indirectly influence the price of everything else in the economy.  It's the same reason why the precious metal with the fewest industrial uses is the best one to use as money.

This is why I think that any non-Nakamoto-blockchain currency with a significant use other than currency doesn't detract from the value or usefulness of the Nakamoto chain.  The fact that they can be used as something other than a currency makes them really poor currencies.  The fact that it's easier to exchange them for BTC than for fiat actually slightly increases the usefulness of the Nakamoto chain.  But of course all of this applies only if the alternate chain has a credible non-currency use.  So far I don't know of any other than NMC.


How to actually handle the xPub gap limit when receiving Bitcoin deposits? I've read the other questions involving this, including How to solve Blockchain 20 address gap-limit problem? and Blockchain gap limit which don't actually remedy the issue in a practical sense, only further explain why it exists.
I understand why the gap exists, how it works, and how Blockchain.info handles it. (Both with callbacks, checkgap API requests, returning an error when the gap reaches over 20, etc)
My question is, what can I, as a developer, do to prevent exhausting this gap? Is this even a valid method for handling a larger website's Bitcoin deposits from users? Do I just have to hope that 20 users don't generate an address for fun, sending operations into a standstill?

Any website that is handling user funds should be running a node to ensure they have an accurate view of the network. Depending on an API introduces trust of a third party into the situation, which is an unnecessary risk.
As a developer, you can then simply customize the gap limit to suit your business’ needs. In many cases this likely just means increasing the gap limit to a larger number.


Segwit Bitcoin Transaction Signing As I could understand, we can recover the R and the S values from any transaction following the ScriptSig where we have DER serialization.

Segwit transactions, where the signature will be in the witness section, recovering R and S follow the same steps?
If I use the compressed public key (starting with 0x02 or 0x03) how can I verify the signature, since I don't have the Y coordinate of the public key?
For multi-sig transactions using P2SH as I understand we need to sign with the first key, then get the output transaction with the first signature and sign it with the other key, but using the signature math we use the hash of the message which is the txId, but on segwit the txid will not change after signing since the witness is not counting as part of the hash for txid?

Any other thing that I should look when signing a transaction?

Yes
Most of crypto-libraries have the verify method. You can pass the compressed public key as an input. BTW, it is possible to recover Y part from compressed public key
No. For multisig P2SH (and any other type) we (a)calculate the digest, (b)sign this digest with private keys and (c)create the final transaction from all parts. We do not need to use any signatures on step (b) as a source for calculations

  Any other thing that I should look when signing a transaction?

How to redeem a basic Tx?


Read wallet.dat error? I use BitcoinSharp with C#.net. I try to reading my wallet.dat (dont encrpyt). And some error : "The input stream is not a valid binary format. The starting contents (in bytes) are: 00-00-00-00-01-00-00-00-00-00-00-00-62-31-05-00-09 .."

Have any Idea ?

Thanks..

BitcoinSharp does not use the same format that the standard Bitcoin client uses for its wallet file.

BitcoinSharp simply serializes the Wallet object into Binary and writes it to a file whereas the standard Bitcoin client writes its wallet.dat file in a BerkeleyDB format, so the two are not compatible.

You could use something like pywallet to export the keys from wallet.dat and then manually add them to BitcoinSharp's Wallet object, but you won't be able to directly read a wallet.dat.


See How Many Bitcoins Existed Is there any way I can find out how many Bitcoins existed at a certain point in time?  Are there charts where I could, for example, see how many Bitcoins were in existence in 2011, so I could compare to the quantity existing today or something as such?

Yes. This chart from blockchain.info is one. There are probably many more.


Adding a note or message to payment? I want to pay for something using bitcoin, using Bitcoin-Qt, and the seller has asked:

  Please use the order number as the note/message to receiver info.

Where do I add this info? Presumably they can't see the 'label', so where do I put this note/message?

That doesn't make any sense to me. There is no receiver info in Bitcoin.

Was this requested additionally to providing a recipient address? Otherwise perhaps they meant that you should use the order number as the recipient address? Perhaps the seller is just using the same email template as for wire transfer payments. – In Bitcoin sellers usually use unique addresses for each sale, so they can identify the payment through the address that they receive the money on.