If I lost my public keys, could I recover them from the private key?

Relation is one private key generates one public key and it is possible to recreate the public key. You can't recreate the private key though, so if you lose them, you lose all coins associated with that key.

It is not computationally expensive to generate or recover keypairs, but you need specific programs for that support secp256k1 elliptic curve cryptography.


Regtest not paying address in mined block

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


Pool mining website need to be logged in?

You don't need to be logged in all the time. You just need to leave your miner (cudaminer) running.


You can use this field from response json to know if order is filled

QuantityRemaining

And this filed tells if order is open or close

IsOpen

Its pretty self-explanatory. Comment if you wish to know more things.


It isn't clear why your "helper" would have missed 1.3 BTC at a separate address in the same Bitcoin-core wallet. Did you use the "Account" feature that was recently removed from Bitcoin-core?

I would do the following

Prepare a new empty wallet using your choice of hardware wallets or software wallets (1). Make a careful note of the seed-phrase/recovery-phrase or private-keys. Practice restoring this wallet from only that noted secret information.

Download and install the latest Bitcoin-core onto a clean PC and reinstate the old wallet.dat file into it (2), then use the newly found password to open it

Let it synchronise (may take days or weeks)

Immediately any money is visible, transfer any money into the other wallet.

If no money is visible, try to find out the status, in the wallet, of the address you say holds 1.3 BTC. Note that the command line interface(3) may be helpful in listing addresses the wallet is keeping track of.

References

https://bitcoin.org/en/choose-your-wallet
Import wallet.dat into a new Bitcoin-Qt client
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


Your transaction input has no signature, and it's spending an output sent to address 1BitcoinEaterAddressDontSendf59kuE. Spending such an output requires an input that contains a signature created with the corresponding private key for that address.

In contrast, the other transaction you're referring to sends to a P2SH address 3MaB7QVq3k4pQx3BhsvEADgzQonLSBwMdj. This address is a hash of the script "OP_TRUE", which doesn't require any signatures (or anything at all; anyone can spend coins send to that address).


Needing Instant (1-2 minutes) API / IPN for bitcoin payments

I'm guessing that your payment processor (coinpayments.net) is trying to construct bitcoin transactions with with lower fees, and therefore de-prioritizing confirmation times.  Perhaps their API offers the ability for you to prioritize your transactions by paying extra on the fee.  I know blockchain.info allows you to specify a fee if you are using their wallet API.  I'm sure others do as well.

Alternatively, you could run your own wallet/node and construct your transactions yourself with a higher fee.  It's a lot more effort, but depending on what you are trying to accomplish, it might be worth your time.

In any case, keep in mind that the bitcoin network averages a 10-minute block time, but does not guarantee it.  On top of that, the best rule of thumb is to allow for 6 blocks blocks of confirmation before considering a transaction irreversible.  For most payment systems, the values being transferred are so low that it's not necessary to wait for 6 blocks.  There are even plenty of types of purchases where so-called "zero-confirmation transactions" are perfectly acceptable.  This is what you will need to use if you want to send your email in less than 10 minutes.  You will have to judge for yourself how many confirmations you need, and what level of risk you are willing to accept.


I own some bitcoin, but forgot how and where i stored them. How can I find my lost bitcoin?

Without any additional information, it is tough to provide help. Bitcoin is a decentralized network, so there is no central authority that can do something like authenticate your identity and provide access to your coins again. Understand that if you lost your ability to access the coins, they are essentially unrecoverable.

Owning a bitcoin is equivalent to owning the private key that controls that bitcoin, (or in some cases, trusting a custodian to control that key for you). So you'll need to figure out what software or service you used to generate a receiving address (and thus, your private key). It is possible you used an online exchange and left the coins on your account, or that you used some web-wallet (eg blockchain.info), or that you stored the coins locally (eg. a paper wallet). I believe at the time of your purchase, there were very few options available for hardware or mobile wallets, but it may be worth considering these options as well.

I would try searching your hard drives, email inbox, financial history (bank / credit card records for that time), social media, browser history, notes, or anywhere else you may expect to find a trace of the transaction. Use keywords such as "bitcoin, address, blockchain, wallet, wallet.dat, exchange, btc, bit coin, etc", basically anything you can think of that may turn up a clue.

You can also search your physical space, it is possible to store bitcoin using a 'paper wallet' (a bitcoin keypair printed onto paper). You could also have a string of words written down (12, or 24 most likely), called a mnemonic seed phrase (this tech would have just been coming out at the time of your purchase iirc). If you find either of these things, DO NOT share the keypair / words with anyone! If you do, they'll have full access to your bitcoin, and can easily rob you.

Best of luck!


Now that my GPU mining rig will be made obsolete, where to turn?

Vanity mining for example over at my Vanity Pool. Thanks to split-key vanity addresses anyone can request a vanity address without compromising their security, set their own bounty, and anyone with a mining GPU can try solving the work and claiming the bounty.


What's happening with my Bitcoin Core Wallet

1/. Is there anyway of speeding this process up? (I have 60+Mps connection)

Install a more recent version of Bitcoin Core. If you have spare RAM available on your system, you can add dbcache=<n> to your bitcoin.conf file where  is the amount of RAM in MB which you are willing to give to the database cache (note that this is not the only RAM that Bitcoin Core will be using).

  2/. Given my Bitcoin history is it possible what coins I may have, if any, are here?

If you still have the same wallet.dat file (if you did not delete it, it is probably still on your computer), then you will be able to recover your coins. You can go to the Bitcoin Core data directory and see if the wallet.dat file there was created recently or several years ago. If several years ago, it is may contain coins.

  3/. Given the last block time was late 2015, should i just stop the process, upgrade Bitcoin Core (if possible) and start again?

Yes, you should do that. It will sync much faster. No progress will be lost and no data will be lost. If you did not touch Bitcoin since 2015, then your coins should already appear in the wallet. If you don't see them, it is likely that the wallet you are using does not hold your coins.


What happens if funds are sent to the multi-sig address and say the seller is hit by a bus before posting the adorable Hello Kitty™ mug that you bought?
Does the 3rd party simply sign a transaction returning the coins to the buyer?

Yes, if your address has a public key for 3 users, and you have problems receiving your goods, you can ask the arbitrator to sign review the situation and maybe create a transaction which pays you the money in the address. You sign, he signs, you get a refund. It's at the whim of the arbitrator.

What about the general case of an address where n == i? Are the coins lost?

Yes, if anyone loses their key, and the address requires same number of sigs as public keys, you cannot recover the funds.


How do you know how much a product costs in Bitcoins?

Most websites that accept bitcoins for goods or services work with a service that automatically exchanges the bitcoins they receive for dollars. For that reason, they also use the current exchange rate to calculate the price in Bitcoin.

So basically, when you want to buy a 10 CAD item for bitcoins, the website will calculate how much bitcoins that is and ask you to pay that amount of bitcoins.

And yes, when you hold bitcoins, the price you pay in CAD can vary as the CAD/BTC rate changes.


How can a person reasonably prove they're running a full node?

Imagine an interaction/protocol/technique exists you could perform with a node in the network, and at its conclusion, the interaction teaches you whether the other party is a full node.

Now anyone who wants to pretend to be a full node can simply relay all messages related to this interaction to another full node, and relay its responses back to a potential querier.

So this is effectively vulnerable to a man-in-the-middle attack, but you aren't querying for a particular identity, just whether some computation was performed. As there is no secret data involved here, there is no solution to the problem of one entity pretending to be another.

Overall this shouldn't be a problem; you generally don't care whether someone else is performing full validation; if you would, you could be doing so yourself instead and not care about the behavior of other nodes.


Can someone outline the full pros/cons of the various Replace-By-Fee proposals?

All three proposals attempt to solve the same problem, the issue of stuck transactions.

Due to the behavior of Bitcoin Core with respect to double spends (they are silently dropped, and not relayed), it is impossible to spend outputs that you've used in an existing transaction. Typically this is a good thing, but there are a few cases where a user may have created a malformed transaction (for example, accidentally setting 0 fees) that isn't acceptable or mine-able for various reasons, and it's desirable for them to be able to reissue a fixed transaction.

This is exacerbated by the undefined memory pool behavior of nodes with respect to expiring out old transactions, and not having a clear rule as to when it's safe to attempt another spend.

Child-Pays-For-Parent

The Child-Pays-For-Parent approach allows the fees of a transaction's child (the transaction that spends the outputs of the stuck transaction) to also pay for the parent transaction. This allows a merchant to spend the "broken" transaction they received like any other transaction, and the system should return to a consistent state.

The benefit of Child-Pays-For-Parent is that it solves the problem in a way that doesn't fundamentally change the mechanics for how a transaction is selected and kept (most notably, the first-seen memory pool behavior). In my opinion, this makes this solution the most intuitive.

However, the difficulty with Child-Pays-For-Parent is in the implementation. There are some required changes to the propagation of transactions that are required to make this work properly (since just broadcasting a valid child will cause other nodes to consider the transaction as orphaned, without the context of the parent).

Replace-By-Fee

Replace-by-fee attempts to address the problem by changing the fundamental rule for accepting and keeping transactions, the "first-seen" rule.

In this system, a transaction with higher fees can spend already spent inputs (that have not yet been confirmed in a block), and will replace that transaction in the memory pool.

The benefit of this system is that it changes the fundamental transaction selection rule but does not require changes to the way fees are calculated.

The downside is that this represents a significant shift in terms of expected memory pool behavior. In my opinion, this makes transactions less predictable; the first-seen rule is straightforward, predictable, and easy to understand and implement. Additionally, it breaks any functionality that relies on the predictability of unconfirmed transactions by making it trivial to issue double spends. (Double spending a first seen transaction requires a combination of moderate network and computing resources, some decent know-how, and some luck. Double spending in a replace-by-fee world requires none of the above.)

First-Seen-Safe Replace-By-Fee

FSS RBF attempts to make RBF compatible with first-seen memory pool implementations by requiring that the outputs from the original transaction be maintained by subsequent respends.

The benefits are that in some situations, first-seen behavior can be relied upon. A transaction sending x BTC to a merchant cannot revoke that.

In practice, however, this protection is pretty weak. It trivially breaks transactions that spend other unconfirmed transactions by allowing the first transaction in the chain to be replaced, invalidating future outputs. This means that the burden for double spending an unconfirmed transaction becomes only slightly higher than in standard replace-by-fee.

It does, theoretically, allow one to accept an unconfirmed transaction that spends a confirmed output with similar protections as the typical first-seen behavior.

It is impossible to talk about this without touching on the politics, though. The reason this is so contentious is that it involves a political change that breaks many systems that rely on first-seen memory pool behavior. The proponents of the change believe that since unconfirmed transactions are not subject to the same cryptographic protections as confirmed transactions, they should be pushed out of the ecosystem and tools that facilitate this should be adopted. The people who oppose this change believe that unconfirmed transactions represent an acceptable risk as with everything in Bitcoin (remember, Bitcoin requires a majority of honest miners, for example), and that breaking something many people rely on unnecessarily is a net negative.


Where do i get a good hands-on Bitcoin learning experience as a newbie?

Probably a duplicate question, but I'll try to be as helpful as I can.

First, go download bitcoind: https://bitcoin.org/en/download

Next, run bitcoin in regtest mode (-regtest): https://en.bitcoin.it/wiki/Running_Bitcoin

Try some commands that create transactions: https://bitcoin.org/en/developer-examples#transaction-tutorial

You should have a decent grasp of how bitcoin works from playing with that and can then proceed to read some more heavy-weight documentation: https://bitcoin.org/en/developer-documentation


Active connections and sync-ing my wallet issues

I just synced Bitcoin Core from scratch in about three hours yesterday on my home computer. The active connection count is not likely to be the bottleneck, it's usually rather the Disk R/W or the verification work done on the CPU. External drives exacerbate the Disk R/W delay significantly. If you have a few GB on your main drive, you could try to run a pruned node on your main hard drive, that would at least mitigate some of the Disk R/W delays, especially if your drive is an SSD. Another thing that can speed the process up significantly is to give your Bitcoin Core more RAM.


What are some affordable options for running a full node?

You can reduce storage requirements by running Bitcoin-core in pruning mode

How can I run bitcoind in pruning mode?


How can determine the fundamental theoretical value of the Bitcoin based on steady state daily velocity (BTCDD)?

"Bitcoin days destroyed" seems like a bogus metric. Transactions in the block chain do not always represent an actual economic trade. Wallets routinely resign the remainder of a coin to a new private key and it's very hard to determine what is the transaction and what is the change. You could spend 0.5 BTC from a 50 BTC block mined 10 days ago, and resign 49.5 BTC to yourself - you have "destroyed" 500 bitcoin days as far as the metric is concerned.

You don't have to care about the proportion of currency circulating, just the average velocity. Us dollar M1 velocity is in the 8 - 10 range. That means that on average a dollar changes hands every 1-1.5 months. If we assume a similar dynamic for say 10 million bitcoins (2 years from now?), we get about $4400/BTC for 10% of your quoted Visa volume.

But 10% of that is very, very much. It includes 1500bln in cash/ATM and 1700bln in credit purchases. The online commerce part of that than Bitcoin could target is maybe 200bln dollars and 10% of that brings the price of one bitcoin to 200$.

And all this assuming the deflation does not choke the velocity - which it will, bringing the actual volume down and with it the incentive for businesses to invest in bitcoin support.


How can I transfer all funds to new keys?

Easiest way I can think of:

Use up all of the addresses in the keypool by requesting 100 new addresses. If you're comfortable in the command-line on Mac or Linux:

for i in {1..100}; do bitcoind getnewaddress; done

Then perform a bunch of sends-to-self using MORE freshly-generated addresses. Again, if you're comfortable on the command line and had (say) 10 bitcoins in your wallet you wanted to send in 10 different transactions over the course of an hour you might do:

for i in {1..10}; do bitcoind sendtoaddress $(bitcoind getnewaddress) 1; sleep 360; done

This wallet will still get coins sent to the old addresses, although if somebody at work DID have a copy they could also spend coins that came in to the old addresses.  There's not much you can do about that.


How can I see how many Bitcoins my c-lightning network node has?

Use the RPC-Interface listfunds lightning-cli listfunds which lists all payment channels and UTXO.

If you wish to have a more nicely display you can use this small tool: https://github.com/renepickhardt/lightning-helpers

git clone https://github.com/renepickhardt/lightning-helpers.git

cd lightning-helpers
sudo make install
listfunds

it aggregates everything so that you can see your total funds. Also you can add a parameter to change the unit of display.

If you don't trust a third party tool and don't want to read the source code you can use this little shell script:

utxo values:

lightning-cli listfunds | grep "value" | sed 's/      "value": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'

total channel balance on your side:

lightning-cli listfunds | grep "channel_sat" | sed 's/      "channel_sat": //g' | sed 's/,//g' | awk '{s+=$1} END {print s}'


This is possible. It also may sound good on paper, but the implications are horrible.

Think of it. 100 thousand bitcoin. 0.5% of all coins will be rejected. This is out of 21 million. Out of the current 15 million, maybe 0.65%. That's hugel

If a hacker also wanted, he could move the coins into multiple mixers and deposit them in and out of Exchanges, as they're off-chain. Hacker could even sell a couple.


Can you send amounts that would typically be considered 'dust' through the Lightning Network?

You are correct that small payments would be a liability in the case of uncooperative nodes in a channel.  I also believe you are correct that when the values get small enough, the trust-less nature of a channel breaks down.  Although a 1 satoshi transaction is possible, at some point the cost of the transaction that closes the channel is higher than the value transmitted over the channel.  You couldn't open and close a channel just to send a single satoshi, even if both nodes were cooperative.

What the LN really does is create a network similar to the existing network of correspondent banks in the legacy financial infrastructure.  With every correspondent banking relationship (payment channel, in the LN), there are risks and liabilities involved.  These risks are mitigated by charging fees to use the channels, which is exactly what the Lightning Network will do.

I don't see this as a show stopper for the implementation of the Lightning Network, but it will be a factor in what drives the fees for using a channel.  This dynamic may also play a role in how the nodes split the money that is originally locked to create the channel.  Less established nodes may have to contribute a higher percentage than those nodes that have been deemed trustworthy.  I'm speculating here, but this is one potential way to mitigate risks.

Just like with Bitcoin, the system should work so long as there are more honest nodes than dishonest nodes.  In this case, however, dishonest nodes must attain enough money to disrupt the network as opposed to hashing power.


When does transaction output become usable?

When can I use the output of that transaction: when the transaction will be confirmed at least once or when it'll be in the blockchain?

First, if that transaction is confirmed once, that means it's in the latest block, hence in the blockchain, so the choices you present are essentially the same thing.

Second, you can actually spend the transaction output right away. Miners may include both your original transaction and the dependent transaction in a block, which means you would have the same number of confirmations for both transactions. Whether your wallet software allows you to do that is another matter entirely.


How to make bootstrap.dat work with bitcoin qt

The importing process is not instant, every block from the bootstrap.dat has to be verified first.

You could be looking at this process of verification.


Is there a command I can type into Bitcoin-Qt to see the total number of bitcoins that have been created?

You can calculate the total amount of when you know the last block in the block chain. You can check the number of block by holding your mouse on the icon in the lower right corner of the Bitcoin-Qt client.

Then you will need to use this table to calculate the total amount of bitcoins there exist. This table just lists up the block rewards, which halves every 210,000 blocks and starts at 50 BTC.

Currently you can easily add the 10,500,000 BTC from the first 210,000 blocks with 25 times the current block count minus 210,000.

If you want to have an implementation that you can use forever, it would look like this (I used Python):

def total_bitcoins(current_block_count):
    count = current_block_count
    reward = 5000000000 # satoshi
    total = 0
    while count > 0:
        total += min(count, 210000) * reward
        count -= 210000
        reward /= 2
    return total / 100000000.0

Note that this process limits the total amount of bitcoins that will ever be created to 20,999,999.9769.


If your bitcoins had been stolen (by someone else who acquired the private keys), your client would show transactions sending those coins to the thief's address.  The fact that you see no transactions at all suggests that for some reason the client has not imported the keys correctly, or perhaps that your backup is corrupt.

If you know the addresses from your wallet, you can look them up on a site like http://blockchain.info and see if the coins are still in those addresses, or if they have been transferred out.


Getting all transactions that ever occurred for a bitcoin address

BlockTrail's address API will do what you're looking for.

Calling URL:

https://api.blocktrail.com/v1/btc/address/1NcXPMRaanz43b1kokpPuYDdk6GGDvxT2T?api_key=MY_APIKEY

Result:

{
    "address": "1NcXPMRaanz43b1kokpPuYDdk6GGDvxT2T",
    "hash160": "ED12908714FFD43142BF9832692017E8AD54E9A8",
    "balance": 49497392,
    "received": 115015000,
    "sent": 65517608,
    "unconfirmed_received": 0,
    "unconfirmed_sent": 0,
    "unconfirmed_transactions": 0,
    "total_transactions_in": 4,
    "total_transactions_out": 10,
    "category": "donations",
    "tag": "blocktrail"
}


When the miner needs work, it contacts the pool. So the miner makes the connection.

The only time the pool needs to contact the miner is when a new block is found, to invalidate existing work units so the miner doesn't waste time finishing a work unit when the block wouldn't be accepted anyway. But this case is handled with long polling -- the miner keeps an open outbound connection to the pool manager at all times to receive this notification.

So there is no need to forward the port, and such a forward would never be used anyway. The mining program isn't listening for inbound connections.


Is it possible to combine two separate transactions into one transaction by only using their signatures?

The only possibility in Bitcoin today is the one described by kaykurokawa. Every signature specifies which inputs and outputs it signs for, so if you want independently-created signatures, it will be obvious to everyone which input and output were created simultaneously.

The general practice of combining multiple pieces of transactions into one is called CoinJoin. It works well in theory, but it does require the different parties to cooperate (each signs everyone's inputs and outputs).

A potential future development that could change this is, is based on One-Way Aggregatable Signatures (OWAS) (see the paper on https://download.wpsoftware.net/bitcoin/wizardry/horasyuanmouton-owas.pdf originally posted anonymously on https://bitcointalk.org/index.php?topic=290971.0). This mechanism would allow anyone on the network to take two transactions and CoinJoin them, without being able to tell afterwards which inputs and outputs were related. As a side benefit, it also combines all signatures in such transactions into one. Taken to the extreme, it would mean that a block can just be reduced to a single transaction, constructed by miners applying this joining operation on all transactions they want to include.

Unfortunately, OWAS relies on a signature scheme called BLS, which is much newer and not as well studied as ECDSA (which Bitcoin uses now), so its security is less certain. Furthermore it is far slower, and would need very invasive changes to Bitcoin. It is an active area of research, though.

More recently, a system called MimbleWimble has been proposed which supports offline transaction aggregation as well as cut-through transactions while only relying on EC cryptography.


What is differences of bitcoin mempool anchestor and descendant?

Given a transaction, there are inputs to that transaction which are spent to new outputs. The inputs themselves are outputs from a previous transaction. E.g. in tx 1, person A sends BTC to person B. Then, in tx 2, person B uses those outputs to create another transaction to person C.

A -> B
B -> C

Transaction 1 is an ancestor of transaction 2, because without transaction 1, #2 is not valid (the outputs do not exist). Likewise, transaction 2 is a descendant of transaction 1.
The RPC commands let you list ancestors/descendants of any given transaction, which are in the mempool (have not been mined and included in a block yet).

getmempooldescendants "txid" ( verbose )
If txid is in the mempool, returns all in-mempool descendants.

See getmempooldescendants

getmempoolancestors "txid" ( verbose )

If txid is in the mempool, returns all in-mempool ancestors.
See getmempoolancestors


How can people in Indonesia use Bitcoins?

Indonesia is one of the countries where no Bitcoin exchanges have much reach to just quite yet.

Are international wire transfers a possibility?  If so, most exchanges offer international wire transfers.

About the only payment network that any bitcoin exchanges use that have the ability to interact with Indonesian banks domestically is Payza, but theirs is a method for adding funds from a bank account and not the other way around.

OKPay is a network that might be usable for you.  They have an international prepaid debit card which can be loaded with USDs from your bitcoins.

There are also other digital currencies which might help -- though there are a couple of hops between your bitcoins before you end up with rupiah.  Aurum X Change can be used to cash out to Liberty Reserve, HD-Money, CosmicPay, SolidTrustPay, Global Digital Pay, and G-Gold e-currencies.  If none of those are familiar to you, you might use an intermediary such as GoldMediator to eventually get a connection to a bank.

Additionally, there may be a local buyer wondering how to buy bitcoins from within Indonesia.  If there are any hacker spaces, you would probably find someone willing to do a trade with you.

The list of exchanges offering cash out methods can be found here:
 - http://en.bitcoin.it/wiki/Selling_bitcoins


If you had signed it allowing replace by fee you can update it with a higher fee. Another way if you have a change output you can spend the output with a high fee  (called child pays for parent) last but not least you can wait but that does not speed it up. Also you should consider using the lightning network in the future as it improves speed of payments greatly while reducing. Tx fees.


there is command opton in bitcoin core, there you can type "upgradewallet"
check if something happens.


Yes, you can use BIP38 with multisig.

It's not exactly a brand new idea, though. I've spoken with some people from Gem (https://gem.co/), that's exactly what their API lets you do.


can I Re- encryp my wallet with a wallet.dat file from before encryption

No, it will not bring back any of your coins. The encryption process regenerates all of the private keys in your wallet. Furthermore, the private keys generated are not based on your password in anyway; they are random. So re-encrypting an unencrypted backup will not let you get access to your lost Bitcoin.


How Would This Procedure Be Performed? Transfer to Offline wallet

I need to do is a "transaction" from my online wallet to a newly created 'offline' bitcoin address? In 10 years, in order to access these coins, I ONLY need that new bitcoin address and its private key?

Yes.

You can use Blockchain's product or print off an single address page from http://Bitaddress.org. Send a transaction to the public key and safely store that piece of paper until you next need it. Be very careful, though, because if you lose that piece of paper, you will lose the coins associated with that address.


What do the options in Bitcoin Core's wallet creation mean?

Disable Private Keys
the wallet is set in watch-only mode, only public keys can be imported into wallet.
You can use it, for example, to track transactions or generate PSBT transactions to be signed elsewhere.
(if this option is enabled you don't need Encrypt Wallet, because only private keys are encrypted)
Make Blank Wallet
the wallet starts out with nothing in it, but private keys can be added later to the wallet via import or sethdseed.
(this is needed if you set Disable Private Keys)
Descriptor Wallet
A descriptor wallet is one which stores output descriptors and uses them to create addresses and sign transactions.
Wallets that use descriptors internally shouldn't have any noticeable effect to the user, they should only be handled when users want to import their wallet.
(for further info you can see here:  What are output descriptors?)
You can also find other useful info here:
Bitcoin Core 0.21.0 Release Notes
What's Coming To The Bitcoin Core Wallet in 0.21 by Andrew Chow


Is there a hardware wallet project that plans to add multisig capabilities?

This isn't exactly what you want, but it's close:

The Case hardware wallet uses 2-of-3 multisig, where one key is on the device, one is on Case servers, and the third recovery key has two options: Self-storage or Vault storage through Third Key Solutions (invisible to the customer). If you choose the self-storage option, you provide an xpub key during initial setup, and the multisig wallet will use that as the third key.

In that scheme you would have signing control of 2 of the 3 keys. There is still the human trust element where Case servers are necessary to perform the transactions, but they cannot sign any transactions not initiated by the user.

Full disclosure: I work at Case.


How can low latency and high scalability be achieved with increased block size in BTC?

Block time and block size are two separate things. Both of them have their own effect on scalability (if you're considering transactions per second as the key factor of scalability)

If you zoom out a little and look at the scenarios from a 60-minute point of view, a larger block size (let's say we go from 1 MB to 2 MB) allows twice the number of transactions to go through in the same amount of time. The block time for both 1 MB and 2 MB blocks remains 10 minutes, but 2 MB blocks increase the network's transactions per second (or per block, if you want to count that way) to twice the previous amount.

If in this network you also halved the block time to 5 minutes, you've effectively quadrupled the throughput of the network.

Increasing block size is not meant to decrease the minimum time required for a tx to be recorded in the blockchain. It is meant to decrease the average time taken. Since bitcoin currently has full blocks, increasing the block size means that more transactions are confirmed in the same time, thus decreasing the average amount of time it takes for a tx to be confirmed.


How do exchanges use cold bitcoin wallet while still able to automate transfers?

The exchanges that use cold storage keep most of their coins offline, but do have a small percentage of funds that is necessary for normal business in online wallets.


Is there already an existing closed cash flow loop for the currency BTC?

Closed vs open loop isn't a black or white definition.  For example even in the US were you have significant velocity of money companies buy parts in other currencies (from other countries), consumers imports goods manufactured overseas, and investors buy foreign stocks.

So there is no such thing as a completely closed loop.  I think what you are asking is what can be done to keep transactions in BTC either perpetually or for longer (before being cashed into fiat).  Unfortunately that is a slow process.  There is no grand over arching plan rather each individual seller increases the potential to the currency to be recirculated more before being exchanged.

I see three major factors determine how likely acquirers of BTC will keep the BTC over selling for fiat currencies:
1) Availability of goods.  The more goods and services available in BTC the more valuable the currency is relative to fiat currencies and the more likely someone who acquires BTC will keep them.

2) Value of goods.  If goods are sold in BTC at a discount that will increase the value of BTC.  If good are sold in BTC at a premium that discounts the value of BTC.

3) Price stability.  The more volatile the price the more risk of losing purchasing power by holding BTC.  That will reduce the likelihood that an acquirer of BTC keeps those BTC over more stable currencies.

There are no easy answers to the problem of increasing the length of BTC loop as BTC isn't a planned economy.  As an individual the best thing you can do is to offer goods or services in BTC and look for merchants who do the same.


This is an extremely useful site for debugging bitcoin scripts: http://webbtc.com/script.

Bitcoin uses a custom way to serialize integers, shown here. This is confusing, but keeps the number of bytes on the stack small as possible. Let's walk through the basic execution:

exec : 20 OP_NEGATE OP_HASH256
stack:

exec : OP_NEGATE OP_HASH256
stack: 0x14

exec : OP_HASH256
stack: 0x94

exec :
stack: 0xaf462e245a0f463a93e23a54eb0b4d0d8da7a951e4d0b41015782a27e80a2e2c

The confusing step is really the OP_NEGATE. To negate an integer that fits into 1 byte without having the MSB set, you just XOR with 0x80. Hence, 0x14 ^ 0x80 -> 0x94.

The script debugger I linked to above verifies this result. This python code verifies the result as well:

import hashlib
import binascii

def SHA256d(string):
    bin = binascii.unhexlify(string)
    hash = hashlib.sha256(hashlib.sha256(bin).digest()).digest()
    raw = str(binascii.hexlify(hash))[2:-1]
    return raw

print (SHA256d("94"))

Prints:

af462e245a0f463a93e23a54eb0b4d0d8da7a951e4d0b41015782a27e80a2e2c


Try this library by Peter Todd https://github.com/petertodd/python-bitcoinlib

Or pycoin https://github.com/richardkiss/pycoin


I have a physical Bitcoin, how can I exchange it for dollars

There are a handful of people/companies who manufactured physical bitcoins, most notably Casascius.

If you have one of these, a little tamper proof seal should cover a private key. You can then import that private key into a wallet such as electrum, and send the bitcoin to an exchange where you can trade it for fiat, which will vary by your location.

If you do not have a bitcoin which contains a private key, then your physical bitcoin has no bitcoin value.


Searching for the comprehensive guide to creating Crypto Currency

Would this be it? It seems to be what you're asking for.

https://andarazoroflove.org/how-to-create-alt-coin-scrypt-clones-for-fun-and-profit-bitcoin-litecoin-secrets-exposed/


Bitcoin fork! can I gain access to the coins

You can access your coins in blockchain.info only if blockchain.info announces will support the fork.
Remember you should have bitcoin on your account before hardfork.


When downloading the blockchain for the first time using bitcoind, how do I know when it's done?

Run bitcoind getinfo in your shell of choice and compare the block count, listed after "blocks", to the block count listed here. If the two numbers are the same, your client is up to date.


Send bitcoins using just a pub and private key

EDIT: I recalled that Wiki: Sweepprivkey proposal, is actually exactly what you are asking for, bitcointalk.org: Proposed RPC command: sweepprivkey. The latest news about the work in progress from jarpiain, dated October 15.

  This is functional in the sense that I tested it succesfully on the
  real block chain. It's not yet robust enough for serious use. In
  particular, there are race conditions for accessing addrblock.dat.

  I'm going to implement some of the sweepprivkey options and copy the
  transaction fee logic from CWallet::CreateTransaction() this weekend
  (I think it's best to keep the fee setting in one place, the -paytxfee
  option).

MtGox has the option to fund account with private key, and it understands several different formats, not only the standart one, e.g. it accepts mini format used by Casascius physical coins, MtGox adds redeemer for private keys including Casascius Physical Bitcoins

But if you want to send the transaction from your own computer then you need a software that would create a proper transaction using the public and private key, bitcoin or bitcoind can't do that without importing keys into wallet first, importing could be done with Pywallet or hopefully soon-to-be-official wallet export/import bitcoin patch, but make sure to backup your wallet first.


Can Bitcoin incorporate the scripting protocols of Ethereum without a fork?

Bitcoin has a scripting engine already. At this time only a limited number of features in it are used, such as those for standard transactions. Other features are unused but can be developed upon and some, disabled (though could be reintegrated later).

Solutions are already present which build on top of Bitcoin or other such coins to provide smart contracts, m of n transactions, programmable features and more for those who want to use more advanced scripting features which bitcoin would be unable to support.

The currently most fully featured example of this is Open Transactions (http://opentransactions.org/). It is also token-less in the sense there are no "coins" being minted in the use of the application keeping it pure.


Where is the actual data stored and how does that data get stored

If you are running a full node you have the blockchain stored on your HDD/SSD. If it was stored in your memory you would lose the blockchain everytime you restart your computer.

  If data is being stored in file, how does the blockchain create the files, put the data into them, and in what format are the files?

The blockchain doesn't create the data/files, the blockchain is the data. In case of the Bitcoin Core wallet you can see the blockchain data as .DAT files in your AppData directory under:

C:\Users\fihdi\AppData\Roaming\Bitcoin\blocks

In case you use the standard directory.


Error validating transaction using BLOCKCYPHER

When a transaction is orphaned it usually means that it is part of an orphaned block. This happens occasionally so there is no reason to panic :)

According to Anonymous in this answer, orphaned transactions are not lost and are returned to the memory pool where miners can pick it up again and attempt to confirm it.

In short, as long as the transaction has a high enough fee (which it should have considering it was added to a block already) it should confirm eventually.

You can also keep track of it using this service:

https://mempool.observer/


How are change addresses treated differently by Bitcoin Core?

Is the address deleted as soon as the funds it received as change are spent?

No, the change address is not deleted but it is stored as another of your key pairs of your wallet. Bassically when you make a transaction with 1 BTC spending only 0.7 the remaining 0.3 BTC is send to new address that is stored inside the client (current account) waiting for new transaction from operating "main" address to occur.

Try yourself list your addresses (after you spend input on one of your change addreses) with command: listaddressgroupings

The client probably doesn't watch for any further sends to these addresses, right?

No, the client updates the balance on all keys inside the client. The change address can receive and sends BTC. The remaining funds will be updated as part of the main bitcoin address.

For more information see: Change on Bitcoin wiki


I am curious about where the actual hex value of the data that generates that hash with a lot of zeroes is.

It is a composite of values from the block - in brief, it is the concatenated binary (represented here in hex notation) little endian value of each of the fields:

version + previous_block_hash + merkle_root_hash + time + bits + nonce

of the block that is being mined.

These are contained in the "block header".

You have examples of Python code here: https://en.bitcoin.it/wiki/Block_hashing_algorithm , for example for block 125552:

>>> import hashlib
>>> header_hex = ("01000000" +
 "81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000" +
 "e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b" +
 "c7f5d74d" +
 "f2b9441a" +
 "42a14695")
>>> header_bin = header_hex.decode('hex')
>>> hash = hashlib.sha256(hashlib.sha256(header_bin).digest()).digest()
>>> hash.encode('hex_codec')
'1dbd981fe6985776b644b173a4d0385ddc1aa2a829688d1e0000000000000000'
>>> hash[::-1].encode('hex_codec')
'00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d'

Note that the value is reversed at the last step in order to be represented in the big-endian format that we humans are used to.

  So, this is what I want: the 80 byte input that gives a 32 bit output with a lot of zeros from sha256(sha256(x)).

You can check these 6 values for every block mined using any one of the many online block explorers available: for example here for the particular block of the previous example: https://blockexplorer.com/block/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d (you'll only have to convert the human time to unix time being careful with the time zone).

Here is a quick link to download blocks' headers in binary form (until May 2018) and start playing with real values. You can convert it to .csv if needed.


"wallet corrupt salvage failed" Error. Help with pywallet

Install Bitcoin Core and they can do all this work to import your old wallet.

Bitcoin Core's -salvagewallet try to recover a broken wallet database (wallet.dat file).


MultiBit sends BTC to different adress then I wanted

I think you might have put a bitcoin address in the label field in the send screen that is different to the actual address. This would explain the screen shot.

Of course it is the bitcoin address that is used to send to regardless of the label.


ElectrumX method blockchain.address.get_balance removed, how to get the script hash of a public addres and get balance?

Well, it's been a long time, but I've been able to find a way by myself.
The python function for getting script hash is this:
from pycoin.symbols.btc import network
import hashlib
def get_script_hash(addr):
    script = network.parse.address(addr).script()
    return hashlib.sha256(script).digest()[::-1].hex()

And the full code to check the balance of a public address from a local electrum server is:
import socket
import json
from time import sleep
from pycoin.symbols.btc import network
import hashlib

port = 50001
host = '127.0.0.1'

def get_script_hash(addr):
    script = network.parse.address(addr).script()
    return hashlib.sha256(script).digest()[::-1].hex()

def electrumx(host, port, content):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect((host, port))
    sock.sendall(json.dumps(content).encode('utf-8') + b'\n')
    sleep(0.5)
    sock.shutdown(socket.SHUT_WR)
    res = ""
    while True:
        data = sock.recv(1024)
        if not data:
            break
        res += data.decode()
    print(res)
    balance = eval(res)['result']
    print(f'{addr} has {balance["confirmed"] / 100000000} confirmed bitcoins')
    print(f'{addr} has {balance["unconfirmed"] / 100000000} unconfirmed bitcoins')
    sock.close()

if __name__ == "__main__":
    addr = "1x8cQ1gKJ5dwBRr1mjsYfsJbWBHJDnxg9"
    script_hash = get_script_hash(addr)
    content = {
        "method": "blockchain.scripthash.get_balance",
        "params": [script_hash],
        "id": 0}
    electrumx(host, port, content)

Thank you.


tx_hash and tx_hash_big_endian are the little endian and big endian representations of the transactions hash. Bitcoin uses little endian hashes internally, but explorers normally show such information in big endian, you can read more about such topic here.

Regarding tx_index, that field is an internal id for blockchain.info database. It has nothing to do with the Bitcoin blockchain.

tx_output_n is the index of the output in the transaction. utxos are identified by tx_id and tx_index.

Finally, the script is the scriptPubKey or outputScript defined in the utxo. Basically it sets the conditions to be met in order to claim such an output in a new transaction.


Last time I check, Copay has not supported trezor on mobile devices yet. You can only use trezor with Copay on desktop. Just create new wallet with hardware wallet type.


Ok, took some doing but I figured it out!

It seems there a lot of which do not have submitblock in the source. Whether this is intended (mining advantages vs noobs) or just pure incompetence is not sure, but the solution requires minimal changes to the source.

I found this which should help if you're having this issue: https://github.com/earthcoinproject/earthcoin/commit/0b862e499e05386e333563656f84e99bad1b0290

Hope this helps another frustrated developer :)


Need an explanation as to why the exchange of BTC for USD is legal

Right now Bitcoin is the round peg in the regulator's square hole.

If Bitcoin is deemed to be a security, then certain restrictions might apply on how it is bought, sold, and held.  But Bitcoins themselves are not a debt, or a promise, or anything similar so it probably isn't a security.

If Bitcoin is deemed to be a commodity, then certain restrictions might apply on how it is traded, if delivery to the buyer is at some point in the future -- as is the nature of most commodity transactions.

If Bitcoin is deemed to be a foreign currency, then certain restrictions could apply there as well.   FinCEN has explicitly stated that it does not see Bitcoin as a foreign currency.

But almost nowhere is there a restriction about acquiring a good, such as like what Bitcoin exchanges provide.


Why prices are different in different fiat currencies on the same market?

Because they are different markets. Each trading pair is its own market with its own supply and demand. Each has its own set of orders and traders. It is the same reason that different exchanges have Bitcoin at different rates: they are independent of each other.


How can data be accessed/searched for in a blockchain?

You can access blockchain data like the way you access normal data in any  MVC where you fetch data from database ,manipulate it in backend and display the result in front end. Incase of blockchain,what ayou need to understand is it is  nothing but a decentralized database where transactions occor dynamically and the data is distibuted among all the nodes.
So to explain how the data is actually fetched from blockchain, what I do is ,Crawl each block in the blockchain and store the data in your preferred data base like MySql or Mongo
You can use rpc  getblockhash "n", which will return the hash of the block "n", for example:
eee7f58d111ef0b25f7f6e8703d80ab6b51ca957170daea949e93e6467906889
You can retrieve the block's contents by calling  get block "b", where "b" is the hash. Which can look like this:
{
"hash" : "eee7f58d111ef0b25f7f6e8703d80ab6b51ca957170daea949e93e6467906889",
"confirmations" : 176023,
"size" : 261,
"height" : 0,
"version" : 1,
"merkleroot" : "695191c2e8f8fddc75331a38d658ab07672970b09981ad77c29c4b0b17580941",
"tx" : [
"695191c2e8f8fddc75331a38d658ab07672970b09981ad77c29c4b0b17580941"
],
"time" : 1518520240,
"nonce" : 2084635057,
"bits" : "1e0ffff0",
"difficulty" : 0.00024414,
"nextblockhash" : "1bb4a4c35103a363ad63bf59bf7fa45c06babcfa8d848ceeb7e4958f9a9f660e"
}
Now every key value of above output replicates some important concept which cannot be ignored. But for now lets just focus on "tx",
the array of tx are the list of transaction that have been mined in the "n"th block, and now you can crawl each and evry transaction given in tx array using rpc getrawtransaction to know the detail of each transaction.
Personally, I store the details in MongoDB so I can keep track of my applications' users, their addresses and the transactions they have done.
So this is a simple approach by which you can access data from a blockchain.


First step: stop using that harddisk absolutely immediately. Either get a new one and start using that or make a complete image on the byte level (for example with dd in linux). Any write action you do on your current disk may overwrite your private key (assuming it hasn't already).

For further steps you need to provide more info.

Which bitcoin wallet were you using?

Was your wallet encrypted with a password, do you remember?


Why does bitcoind use a fork of LevelDB for key-value storage?

The fork serves two purposes:

Local modifications that are hard to bring upstream:

Windows support (which is partially based on the existing Windows port, but needed changes for building in MinGW)
Removal of compression support, as it doesn't help, and complicates the build.

Strict control over changes. Given the previous experience with the BDB to LevelDB changeover that caused a fork in the network, it is wise to not use system-wide installed versions of the library. Hypothetically, even if a change is a bug fix from the point of view of LevelDB, we may want to maintain the buggy behaviour to prevent a fork in the network, depending on the bug.


Using dumpprivkey to make a paper backup

I recommend to check out “bitaddress.org”.

You can grab the whole page (all the java-script it needs is in it) via GitHub and run the brain wallet tab offline.

Type in a damn good pass-phrase and record it. The pass-phrase. Send your bitcoins to the public key that results and re-create the private key with the same pass phrase when you want them.


What's an efficient model for redistribution of coins between wallets?

Once a day, take the addresses with balances more than some multiple (say, twice) of the average, and create a transaction that sends money to the lowest-value addresses. E.g. let's say the average is 0.5 and call the addresses A-Z:

A: 2.0 BTC
B: 1.5 BTC
C: 1.0 BTC
...[other addresses with under 1 BTC]
X: 0.1 BTC
Y: 0.05 BTC
Z: 0 BTC

Transaction would send from A, B, and C to X, Y, and Z so that each has the same amount (0.775 BTC).


Is it possible (in some way or other) to expire a txout?

Expiring a txout doesn't really make sense, since it would destroy the coins, and there is no way to destroy coins. (Coins not spoken for by any txout are contributed as fees.)

You could create a transaction with a lock_time in the future that sends the coins to another bitcoin address. If you give this transaction to a counterparty, they would then have the option to broadcast the transaction to the network after it becomes due, and it would take effect.

Before that time, you could create another transaction without the lock_time restriction, move the coins, and make the counterparty's transaction useless.


Has a consensus algorithm where temporary authorities are fairly “elected” via PoW been discussed?

I’ve since found several related concepts in research papers or coin protocol proposals:

Bitcoin-NG separates leader election (key block) and the following “election term” (epoch), in which microblocks are freely added by the leader.
Tendermint (and, before it, Hyperledger) uses BFT consensus (but with PoS as the basis for elections).
Building upon the previous, ByzCoin elects leaders via PoW and uses PBFT to agree on the microblocks.

The article The Road to Scalable Blockchain Designs gives a good intro to and context for ByzCoin. Exploring the citation graph of the ByzCoin paper leads to further similar work at ETHZ and Cornell as “hybrid consensus” or a “strongly consistent” blockchain.

None of these use the energy-savings aspect that motivated me; instead they all aim at improving throughput and/or transaction verification time. But the “PoW leader election + BFT consensus” concept seems to be pretty actively researched.


Bitstamp streamline API: how to get all contents of the ordebooks?

I haven't yet used Bitstamp's streaming API but I think it's fairly safe to assume that you will only get real-time changes via those pusher channels. That means you need to make at least one initial call to their official REST API to get the full orderbook, and then keep it updated by applying the changes that you receive from the streaming API.

If you are really stuck with websockets only (care to explain why?), you may need to build your own proxy middleware that can make that initial REST call and feed your client with the full orderbook via websockets.

Either way, be extra careful about relying on an unofficial and unsupported API which Bitstamp can change at any moment without prior warning.


I'm going to give a general answer here and say any off the shelf BTC trading software is not going to be profitable. Why? Because there's absolutely no reason a functional trading bot would be sold when it could be used to generate income.

Profitable bots would be custom made and not advertised.

Any claims made are dubious at best on these websites.


Is it possible for computing power to increase quick enough to break mining retargeting?

The difficulty of the mining algorithm is solely reliant on the time it takes to mine 2016 blocks and the previous difficulty. (See: How is difficulty calculated?).

As the mining algorithm retargets exponentially (up to a factor of 4) every 2016 blocks, it is impossible for technological progress to outpace difficulty increase in the long run. Even if the mining power were to double every day (which is insane!), the block interval would only go down to about every two minutes in average, i.e. approximately five times faster.

On another answer I've provided a sample calculation for an overnight hash power increase by factor 21, which you might find interesting. The difficulty would catch up in 14 days.


Everyone is using it as a countable noun. There's actually a grammatical rule that says this is what should happen. If a new term ends with an existing term and is semantically related to that term, it gets the old term's rules. If not, it does not.

So, a "pop fly" is not a type of fly (the bug). So we don't say "pop flies" but "pop flys".

A "bag lady" is a type of lady. So we don't say "bag ladys" but "bag ladies".

We don't say "two firemans" because while a fireman is not necessarily a man, the origin is directly related.

So, a "bitcoin" is a type of coin, the terms are semantically related. So it should inherit the rules of the word 'coin'. Since we'd say "one coin", "two coins", we would expect the rule to be "one bitcoin", "two bitcoins". This feels natural to people, so it's what they do.


How complex can my bitcoin wallet encryption key be?

The password must be at least 1 character long.  I've not been able to find a maximum length.  I set the passphrase to be a 100,000 character string, and that worked fine.  Missing the last character off the end of the long string didn't work, so the 100,000th character is significant.

When first setting a passphrase the satoshi client requests that your passphrase be at least 10 random characters or 8 random words.  But it doesn't attempt to enforce its request.


Would there be a problem introducing opening-balance transactions in bitcoin?

Is there a reason that prevents us from introducing this?

How will you download and validate the full blockchain if nobody around you has the full blockchain but has only "pruned" version of it started from block #xx0000?


The start of @Saxtheowl's answer is correct, such an attack requires a huge amount of capital and investment to pull off, as the attacker will need to invest in a huge number of ASIC miners, and gain access to a huge amount of energy. Once the attacker is set up, they face the dilemma of just mining honestly and gaining a reward for doing so (block reward + fees), so there is a large opportunity cost in attacking that must be considered as well.

You can take a look at the [majority-attack] tag to learn more.

  I have the impression that it would be easy to patch the nodes on the network to dismiss the forged blockchain, for example by banning the state's public key.

It is not possible to ban a miner from the network, because miners are not required to register with any authority/the network in order to submit blocks. A block does not contain a miner's public key, and in any case there is nothing stopping the miner from just creating a new key for every block.

There is no way to just 'switch to another chain', there is no mechanism in the software to do so, without human intervention. Human intervention requires trust (that you're going to choose the correct new chain), and it provides no clear means of determining which new chain is the correct one. This is the function of the PoW, after all, if people could just agree on which chain is legit without PoW, then we wouldn't need PoW in the first place! To make matters worse, the attacker can just as easily switch to mining on the new chain.

The only 'solution' is for the rest of the network to contribute enough hashpower to bring the attacker below 51%. Perhaps a change to the PoW algorithm could happen, but that is a very messy fix which will cause a lot of collateral damage (loss of confidence, drop in price, etc). A PoW change could also be attacked, so it is unclear if this is a reasonable approach.


Why the total number of bitcoin is limited?

The limitation in the number of bitcoins is by design and determined in the protocol code. It is a desirable feature because it makes the money supply predictable and independent of human decisions like it happens with fiat money.

You are right about the block finder being awarded the reward, but that reward halves every two years. At this moment it is 25 bitcoins per block, but in July it will go down to 12.5 bitcoins per block. And two years after that, it will be 6.25. Then, when the total supply gets to 21 million, there will be no more rewards. Blocks will keep happening, but the fees of the transactions in the block will be only reward the miner will get.

From bitcoin.org FAQ:

  Bitcoins are created at a decreasing and predictable rate. The number of new bitcoins created each year is automatically halved over time until bitcoin issuance halts completely with a total of 21 million bitcoins in existence. At this point, Bitcoin miners will probably be supported exclusively by numerous small transaction fees.
  https://bitcoin.org/en/faq#how-are-bitcoins-created


What's the advantage of using non-truncated mining targets?

You are right, it could happen you are finding a hash that meets the pool target but not the highest possible target. But because the difficulty is way higher than one, and therefore the share wouldnt finish the block anyway, its not in their interest. You have done your work and you will get your share. They just make it a bit easier for you, by passing a higher target than possible.

Another possible reason:
Comparing a hash to the highest possible target would take more time, because you have to check the whole hash (checking the zeros at the end as well). With the non-truncated target you only need to check until the first F occures because than its at least equal or lower.


Can Coinbase Bitcoin network fee really be 50%

Transaction fees are calculated based upon the size of the tx in bytes, not the amount being transferred. Right now the network is very congested, so fees are higher than normal. In this case Coinbase is initiating the tx, so you are at their mercy to dictate the fee (that said, setting a lower fee may mean your tx does not confirm). If you trade within the coinbase exchange (not sending coins to another exchange), you should not be charged network tx fees.

Once the backlog of txs clears out, it will be cheaper to transact again.


Explain how unused addresses in wallet.dat have no balance when mining occurred for many months

Unused addresses are unrelated to mining activity. Even if you were mining, you will still see many unused addresses. The Bitcoin earned from mining would be associated with a used address.
Bitcoin Core by default will generate 1000 (previously 100) unused keys to be used in the "keypool". The keypool is the pool of unused keys and is used as a lookahead. This is useful when you restore a backup. The unused keys you are seeing are this keypool.


How to compile Bitcoin-Qt from GitHub source on Arch Linux?

Since the build system has moved to Autotools, the method for building Bitcoin-Qt is a bit different.

git clone https://github.com/bitcoin/bitcoin.git bitcoin
cd bitcoin
git checkout v0.8.5
./autogen.sh
./configure --with-qt
make -j8


Do any of the Android-based wallets support cold storage?

Its not exactly what you want, http://mycelium.com/ for Android does it the other way around.

You keep your private keys safe in QR-code format on a paper or a offline device, then you scan it when you want to make a transaction. Mycelium signs the transaction and forgets about the key.

I tried to scan with my Android device offline, but it does not work. To be able to select previous outputs to send in the transaction, you need to be online.

I don't know of any Android app that can take a raw transaction (by QR-code, SD-card, OTG, Bluetooth, NFC or Chirp.io) and sign it offline.

I hope this feature will be implemented soon.


How do I convert Public Key x value to y in Python and verify?

First, you need to understand what the two formats actually are. The first is the compressed SEC format and the second is the uncompressed SEC format. The difference between the two is that the compressed format only includes the X value and the parity of the Y value while the uncompressed format includes both the X and Y values.

The 02 at the beginning of the compressed value indicates that the Y value should be even. 03 would indicate the odd value. The 04 at the beginning of the uncompressed value indicates that both the X and Y values follow. This is why 0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9 is the same for both values.

To get the Y value, is actually not that difficult. You do need to know a little bit about Elliptical Curve Cryptography. Specifically, bitcoin uses SECP256K1 whose curve is represented by y^2 = x^3 + 7. This is done modulo P, which in our case is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F. So, plugging in X = 0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9 to the left side of the formula, you get:

(x^3 + 7) mod p = EBD56984BA6A88F5D40BB496D9A7C70AC3D8DDF5F7C287E8AABEC904E3D41DB5

The python code for this is pretty simple:

$ python
>>> p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
>>> x = 0x0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9
>>> "%X" % ((x**3 + 7) % p)
'EBD56984BA6A88F5D40BB496D9A7C70AC3D8DDF5F7C287E8AABEC904E3D41DB5'

Now you have to take the square root in order to get Y, which should yield two values, one even and one odd (due to p being odd). This is a much more involved calculation, which you can read about here: http://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python

This is implemented in a library called pycoin: https://github.com/richardkiss/pycoin

You can compute it like this:

>>> import pycoin
>>> from pycoin.ecdsa.numbertheory import modular_sqrt
$ python
>>> p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
>>> x = 0x0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9
>>> y_squared = (x**3 + 7) % p
>>> modular_sqrt(y_squared, p)
7058650705029786666096901756991264635816989543710944821299269679858359092967
>>> y = modular_sqrt(y_squared, p)
>>> "%X" % y
'F9B0E021B43F82B0B73AEEB97F52E5250A09155E99081B4B7788FB597E46E7'

This happens to be the odd value (it ends in 7), so you need to compute the other possible y value which is simply p - y

>>> "%X" % (p-y)
`F064F1FDE4BC07D4F48C5114680AD1ADAF5F6EAA2166F7E4B4887703A681B548`

This is the even number which is the last 64 characters of the hex that starts with 04.

Note that the address is computed off either of the compressed or uncompressed SEC formats. This computation is a SHA256 hash followed by a RIPEMD160 hash. This is not reversible, so you can't get the SEC format from the address, though you can go the other way.


What advantages do "alt-coins" have over bitcoin?

It depends a lot on the specific altcoin you're talking about. For the most part, there aren't a lot of major differences between Bitcoin and the alts. Sadly many of them exist only as the leftovers of pump-and-dump schemes intended to make their creators rich, though there are a few that are interesting in important ways.

One of the primary benefits of a thriving altcoin economy is that they often represent the testing of a theory that may eventually benefit Bitcoin itself. Many altcoins, for example, use scrypt as their mining algorithm instead of SHA256. If SHA256 is discovered to be compromised some day, having a drop-in replacement for that subsystem available would be a major boon.

You specifically mention faster confirmation times as a potential benefit, but the most often overlooked part of that statement is that transaction finality is a result of computational cost, not of time. This means that if an altcoin has one tenth the confirmation time and an equal amount of hashpower relative to Bitcoin it will take ten times as many confirmations to reach the same level of transaction security. Faster confirmations are a psychological benefit, not a technical one.

The "silver to Bitcoin's gold" theory, largely pushed by Litecoin proponents, is also fallacious in that the entire reason gold requires a baser partner metal is that it is not adequately divisible. Paying for a candy bar with gold would be incredibly difficult for both parties involved since the amount of gold needed would be absurdly small. Bitcoin is not subject to such physical limitations and as such can be divided into such tiny portions relatively easily.

Taking all of the above into account, it should be clear that while a handful noteworthy exceptions do exist, the majority of altcoins are intellectual curiosities at best and scams at worst. A few make meaningful changes, but thus far none of those changes has really been a meaningfully large improvement over the base system.


Reject or refuse to relay a valid transaction

Nodes are just software, at the end of the day.

The Bitcoin Core software will automatically relay standard valid transactions provided they meed the minrelayfee.

It would be fairly trivial to modify the software to relay only if certain other rules are met, however. You could easily do this without impacting the rest of the node functionality.

Usually, the node broadcasting a tx will broadcast it to multiple peers, so even if some peers enforce additional relay rules, the transaction will be broadcasted further by those who don't.


DumpMempool() and LoadMempool() in src/validation.cpp

What exactly is happening in src/validation.cpp and what is saved in mempool.dat, when is this data required, what happens if there is an issue saving or loading data from the file?

The current mempool of a node is kept in RAM during node runtime. As node operators, miners, and users we want transactions that are in our mempool and our own priority for these transactions to be persisted across node restarts. Imagine you are a mining-pool operator and you lose the contents of your mempool. After a restart, you'd be at a big disadvantage compared to other mining-pool operators who can choose from a broader set of transactions to include in their proposed block.
The mempool.dat file is a snapshot of your mempool at a given time. It's read with LoadMempool() on node startup and transactions are added to the node's mempool. On node shutdown or via the RPC savemempool the DumpMempool() function is triggered. This writes a current snapshot of the nodes mempool into the mempool.dat file.

Warning: The file format is internal to Bitcoin Core and can change without deprecation nor prior notice. The following describes the contents of a version 1 mempool.dat file (see the constant MEMPOOL_DUMP_VERSION).

The mempool.dat file contains a header that consists of a uint64 version number and the number of transactions contained in the file stored in a uint64 as well. This is followed by a vector of mempool entries. An entry consists of the raw transaction, the time it entered the nodes mempool as int64, and a fee-delta as uint64 used for manual transaction prioritization for miners. The vector of entries is followed by a serialized map of txid -> amount which stores miner transaction prioritization information as well.
On start-up, the Bitcoin Core node tries to import the transactions in LoadMempool(). Some transactions are ignored during import:

transactions that expired in the meantime (transactions default to expire after two weeks unless the node configuration is changed).
transactions that already confirmed in the meantime
transactions that are already in the mempool (e.g. a peer already send it to us before we could import it)

Usually, something like this can be found in the debug.log file:
Imported mempool transactions from disk: 463 succeeded, 10 failed, 0 expired, 0 already there..

If the file is damaged or does not exist no transactions are loaded to the mempool. If the file can't be written during a shutdown, then the node simply can't load any transactions during its next start-up. This is only a real issue for mining-pool operators, but not normal users.

I've held a presentation on theLoadMempool() and DumpMempool() functions at the 2019 Chaincode Sumer Residency. The slides can be found in Google Slides or as PDF.


Yes. It's save.
The current transaction submitting logic (CommitTransaction) do report the transaction ID after adding the tx to the local database and to the mempool.
On top, it holds the cs_main and the cs_wallet lock which makes sure not other thread can manipulate the relevant data-structured during the time of AddToWallet and AcceptToMempool.
https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L2557

This means, when you call a send* RPC command, you will get response (the txid) after the transaction was submitted to the mempool and added to your local wallet database.

Immediately calling gettransaction is therefore save.


Is there data available on physical goods and services traded in BTC?

There is no way to know this with a 100% accuracy. Because when you look from outside, a trader moving Bitcoins between exchanges is no different from someone paying for a services/goods with Bitcoins. Both are Bitcoin transactions. The same goes for people moving money internationally, sending their parents Bitcoins, a company paying it's employees etc. You really can't separate these from purchases of actual goods and services. Because like I said, they're all transactions.

However, if you want to measure speculative interest in Bitcoin vs. interest in Bitcoin as a currency(i.e for practical things) then you can look at this graph:

http://blockchain.info/charts/tx-trade-ratio

And the discussion about it:

http://codinginmysleep.com/measuring-bitcoin-speculation/

Both the discussion and the data is quite far from conclusive though.


How is the solution hash in a block generated?

The process of mining consists on constantly hashing the block header in order to obtain a hash lower than a specific target. The block header contains (from the bitcoin wiki):

Version
hashPrevBlock
hashMerkleRoot
Time
Bits
Nonce

So when the obtained hash does not meet the required conditions, the nonce value is increased by one, so that the hash of the block header changes. The miner keeps changing the nonce, trying to find a value that makes the hash of the header lower than the current target.


Justification of usage of Blockchain by banks

Blockchains are best used when there are multiple entities that don't necessarily trust each other. So within one bank, a blockchain really isn't useful. However between bank transfers could use the blockchain. Right now, in order to send between banks, banks use centralized systems (ACH, SWIFT, etc) operated by a third party. With federated blockchains, they can remove most of that third party's involvement and thus save on fees and time. That's really the only good use case for banks using blockchains that I have heard of.


Does a new private key is generated at each transaction?

Every private key has exactly one corresponding public key, and every public key has one address. Whenever a new address is generated, internally that means a new private key and public key are generated. Note that with BIP32 and BIP44, private keys can be generated deterministically from a master key or a seed, in which case these new private keys do not necessary need to be saved - they can just be regenerated from the seed or master whenever needed.

A new keypair is used for each change in most wallets, but that's done internally - it won't show you the address for those, as there is no need for anyone else to send you money to that.

Creating addresses is very cheap. A modern CPU can generate 1000s per second. It also does not require any interaction with the network. All that is needed is generating 32 bytes of random data, and computing its corresponding elliptic curve point.


avoid rounding errors in javascript with bigdecimal?

This is not a rounding problem.  The 3.6 EUR is correctly rounded to two decimals from 3.597568 EUR.

Computers don't know when we want to see trailing zeros.  The problem is formatting:

console.log(eur_b.setScale(2,mode).longValue().toFixed(2));

output: 3.60

(fiddle)


How is Merkle path derived or calculated?

Given a merkle tree and a transaction that is in that tree, to find the path from the root to that transaction, first hash the transaction. Then find the leaf node in the merkle tree with that hash. Add that node to a list. Take the parent of that node. Add that node to the list. Take it's parent, add it to the list. So on and so forth until you reach the merkle root (which can be identified as the node with no parent). The list of nodes is the path.

If you also need the other node each node was hashed with so you can construct a merkle proof, for every node, when you go to it's parent node, see which side the node you came from was on and record it. And then record the hash of the node on the other side and the side it was on.


Is it legal to trade bitcoins on coinbase/mtgox in the US?

Commodities exchange, yes.  Stock exchange, no.

Stocks are securities, so it wouldn't be appropriate to trade bitcoin on a stock exchange because they don't have any relation to the assets or liabilities of an underlying company.  Bitcoins are valuable (or not) only intrinsically.  This is closer to a commodities exchange, which is what CEX.io does and previously Mt. Gox did.

This is equivalent to trading gold, wheat, pork bellies, platinum, and so forth.  People on a commodities exchange can buy and sell options and forwards.  Which is economically a perfectly appropriate thing to do for an asset like Bitcoin.

As of right now, the legal situation is still confusing to the government, but this article argues that the CFTC does not regulate bitcoin trading even though it's a commodity.  FinCEN thinks that people who sell BTC for USD will presumptively have to register.  You will have to work out for yourself what rules might apply to BTC traders, if any.  I cannot provide much help on this front.

As a general tax rule, you need to observe Notice 2014-21 treating BTC as non-currency property and will have to report your transactions.  If you are buying and selling as a business, rather than holding BTC for anticipated appreciation, then you will need to file Schedule C and maybe create a business entity.  If your money comes from appreciation and long investment, then you are an investor and can make use of capital gains treatment.  If your money comes from quick trades and the short swings of the market, then you are a trader and if your money comes from charging other people fees to make their trades for them, then you are a dealer - either of which is a business that must be taxed at the less preferential ordinary income rate.  Remember to ignore any tax reporting on "currency gain" or loss from BTC, since the IRS says bitcoins are not currency (but if you trade in other currencies, that's a different issue).

Selling bitcoins is taxed like buying and selling other property.  It will be taxable accordingly as a basic IRC §1001 transaction, where [gain] = [amount realized] - [cost basis].


It looks like it is actually periods of 336 blocks instead of a rolling window. It is like what BIP 9 specifies, but uses 336 blocks as the window and 269 blocks as the threshold. The windows begin when a block's height is a multiple of 336.


This might only be an issue with the terminology, but when a transaction is "mined", it is included in a block. You could do that of course, if you were contributing blocks to the Bitcoin network, but the computing power of the network has grown to levels where it is infeasible to mine at home.

What you can do, is to verify the validity of an incoming transaction. Your Bitcoin wallet software does this automatically when it receives the transaction. It checks that the inputs are available for spending, and the signature matches the source of the funds. However, until a transaction is part of a block in the longest valid chain, it is unconfirmed and may yet be replaced by a competing transaction spending the same funds. Therefore, you cannot "confirm a transaction locally".


What might cause the Bitcoin client to take a long time to see a new, unconfirmed transaction?

Is one of the clients disconnected when you send payment with the other? This often happens to me when I send a transaction to the other OS on a dual-boot system, meaning the receiving client is down when the transaction is broadcast.

I'm guessing this happens because all nodes the client connects to when he comes online have already broadcast the transaction, so they won't send it again to him. He'll only get it as part of a block when it is found.


Where is the public key corresponding to my address stored?

Yes, a transaction includes the public key. So, only when you spend the coins from an address a public key actually becomes public (unless you have shared it with anyone otherwise).

So, as long as you don't reuse addresses, the public key is only known after a transaction, which usually is just a few confirmations away from the address' balance to be 0.


What is impact of the possible nitwit fork on August 1? Will it double the coins I have?

No, all clients will be compatible until the HF and will mine one chain.

If SegWit2x reaches 80% support during a 336 block signaling period, it means that the SegWit softfork locks in and will activate another 336 blocks later on all SegWit2x clients. Those clients will then, upon SegWit activating, automatically turn on bit1 signaling to assist the Core BIP141 clients in reaching the 95% threshold they require for their own SegWit activation.

Then, exactly 12,960 blocks (~3 months) after SegWit activates on the SegWit2x clients, the SegWit2x 2MB hardfork will automatically activate on any/all nodes that are still running SegWit2x at that time.

That hardfork, if it maintains 75+% of the hashpower at the time of its activation, will force every other node in the entire network to update to SegWit2x (or SegWit2x compatibility), or be forked off the network.

As a normal holder, you can just sit back and watch all of the above. You may wish to pay attention to the SegWit2x compatibility of your chosen wallet, and adjust accordingly, but otherwise you're mostly safe throughout this entire ordeal. (You can always import your keys into a SegWit2x-compatible wallet later).

If you run a node, however, you will soon need to decide whether or not to switch it over to SegWit2x before, or immediately after, the hardfork.
The code for the SegWit2x hardfork is actually rather simple.
It involves two fairly straightforward variables that act as activation triggers (~3 months, or 90x144 blocks, after SegWit activates):
BIP102active and fSegwitSeasoned.

As well as two variables that actually enforce the hardfork changes (increase the block weight settings):

MaxBaseBlockSize and MaxBlockWeight.

That's it. There are a few other small changes to other lines of code that are meant to account for the signaling and size changes, as well as a few new tests, but everything else pretty much stays the same as Core's 0.14.1.

So, what does this mean for "blocksize" and throughput in the real world?
With Core 0.14.1 and SegWit2x softfork:

Base Size = 1,000,000 bytes.
Max Block Weight = 4,000,000 bytes.
Real-world block size results = ~2MB.
Transactions: 4,000 - 5,000 per block.

With SegWit2x 2MB hardfork:

Base Size = 2,000,000 bytes.
Max Block Weight = 8,000,000 bytes.
Projected real-world block size results = ~4MB.
Projected Transactions: 8,000 - 10,000 per block.


What is the minimum that has to be backed up on a cryptocurrency wallet (technically)?

technically the minimum you must backup are your private keys.

Is the seed enough? if you used a program which generates a wallet by a passphrase/seed it should be enough to save the passphrase/seed. test it to be sure.

i don't think you must really backup your public key or adress because it can be generated by your wallet with your private key/passphrase/seed.


Can transactions scale sufficiently to compensate the diminishing block reward by fees?

Or a combination of both. It looks like things like the Lightning Network will be there for micro payments and smaller amounts so that only larger transactions will be directly on the blockchain. For larger (and aggregate) transactions a bit more fee shouldn't be a problem (a). Also at some point the block size will likely be raised allowing for more transactions per block as well (b).

Either way your title is wrong: there is no post-mining world.


How to Sync Main Net together with Test3 Net

Start another instance of Bitcoin Core with the -testnet option to run it in testnet mode.


Where is coinbase transaction after a hacker successfully performs >50% attack?

You're not wrong.

A miner with more than 51% of the network's mining power can build the longest chain by himself, thus reaping all block rewards and dictating which transactions make it into the longest blockchain, allowing him to doublespend at will. Also see: What can an attacker with 51% of hash power do?

There can only be one valid block at each height, so when the attacker broadcasts his longer chain, it replaces the blocks of the honest node exclusively up to the common ancestor.
The mining reward from the honest blocks which are now not part of this longest chain will be treated as if they had never been found, as they do not represent valid blocks in the longest chain.

However, the malicious node's contrarian position will slow down the number of blocks found to a respective amount due to the reduced mining power supporting the longest chain (assuming he is trying to catch-up).

By playing selfishly, he will be in control short-term, still get only 51% of the rewards (at least until the difficulty reset), and shake the trust in Bitcoin, thus eroding the value of his bitcoins.

By playing cooperatively, he would gain 51% of the blocks and increase trust in the system, thus making his bitcoins more valuable.


Nothing. Account names don't mean anything. You must have given it that name.

There is no relation between the address and the account name. I assume you accidentally called an RPC passing Dvn2 as name.


Tool to build a relational db from .dat block files

parsing blockchain blk**.dat files - is very simple task. you can traverse all blocks from the begninning and put the data in your sql-database


my unconfirmed transactions hold for over 1 day

Your question will be closed as duplicate which may or may not help you, if you really did those transactions associated with addresses mentioned in the question. Try doing the following in future:

Use RBF (Replace by Fee)
Use fee rate more than others if transaction is urgent. Check multiple websites: https://mempool.space https://btc.bitaps.com https://mempool.observer


Mining Pool Hub: how to understand if it is mining?

From your screenshot, I can see that you are using MultiPoolMiner. When you took the screenshot, MPM was busy running a few benchmarks in order to determine what algorithm is the best to mine with your hardware.

The Nicehash API probably failed due to the hack that they had in December 2017.

The software does not mine Bitcoin. It mines other currencies such as Ethereum, ZCash, Monero and a few others. In Mining Pool Hub, you have the option to setup auto exchange to a specific coin. Just log into MPH and look for "Auto Exchange" on the left hand side menu.

The simplest way to determine if the software is mining, is to have a look for another console window, and then scroll through that window to see if shares were submitted. You can also have a look in MPH at the "Balances" section in the left hand menu to see if you are getting balances in. For a more granular view, you can click on the currency in the balances view, that will take you to the currency pool, where you can view a dashboard with info.

How to understand if the software is mining at its best - it really comes down to how often you cash in and if you have the auto switch on. As the currencies fluctuate, you might get a less favorable exchange rate, so although you mined a coin that was most profitable a while ago, it might not be the case anymore. The best is to do your own research, and to monitor your miner. There are a few websites that can help you with crypto currency related info:

https://whattomine.com/

https://coinmarketcap.com/

You can also check on the Mining Pool Hub home page what currencies are more profitable.


Slow but effective mining as a learning tool

If it's for learning I recommend starting with the simplest options and then moving up to more elaborate settings.

Start with a centralized pool with PPS payments. Then you can move on to any other hopping-proof method such as PPLNS or DGM. Then you can try p2pool.

Having a low hashrate should have no affect on the relative portion of stale shares.


Why was 'extern' used in the noui.h file?

extern before function prototypes does not have any effect. If it were a variable, it’d be needed to specify that the variable was declared somewhere else.

void noui_connect();

void noui_connect() {/*something*/}

^^^The compiler can easily find which is the prototype and which is the implementation of the same function. However,

// main.h
int a;
// main.c
#include "main.h"
int a = 5;
// util.c
#include "main.h"

^^^The compiler might create two symbols. One in main.c, one in util.c. To prevent creation of another variable, the extern keyword is used to leave the variable to the linker, the final step at compiling.

On the contrary, the function prototypes, not the implementations are put in header files, which are always left to the linker. Because that's the way function prototypes are designed, they don't need extern.

If you see extern before function prototypes, that's pure coding style, probably to be consistent with other extern variables.


I d recommend to try bfgminer , a more secure and robust fork of cgminer :

http://bfgminer.org/

https://github.com/luke-jr/bfgminer


What will happen when the time field wraps around

2^32 seconds is 136 years. So, this will become a problem in the year 2106. However, even at that point, there are things that we can do to fix the problem.

While it is technically correct that the block number is not encoded in each block header, the block number can easily be inferred. Each block header has the hash of the previous block header. If you follow this back far enough, you'll get to the genesis block. You don't even need to download the entire transaction history, just the block headers.

Okay, so we've got the block number, and the date field. Now, we make a rule that on block 4786000 and all later blocks (which will land at about 2100) the date field will be interpreted to be 100 years later. Block 4786000 will state a date of 2000, but because we made this rule well in advance (we did make it well in advance, right?) all of the clients will know that the date actually means 2100.

Thus, we have bought ourselves another 100 years. On block 9572000, we can do exactly the same thing.


How do I add two secp256k1 keys together?

Most ecc libraries will have this function, but if you want to program it yourself, here's what you do:

First, compute the slope of the line containing the points A and B. Let A = (X_a, Y_a) and B = (X_b, Y_b). The equation for the slope is:

s = (Y_a - Y_b) / (X_a - X_b)

The resulting point, we'll call C = (X_c, Y_c) = A+B. Doing some math, you get:

X_c = s^2 - X_a - X_b
Y_c = Y_a + s (X_c - X_a) = Y_b + s(X_c - X_b)

If X_a == X_b, then it depends on Y_a and Y_b. If Y_a == Y_b, then A and B are the same, so really, you're just computing a point doubling (2*A). If Y_a == -Y_b (the only other possibility) then A+B = the point at infinity, or the identity. Usually, that's not a very interesting point for cryptography. Computing 2*A is a little trickier, but can be done. You're already doing that when you compute the public key from the private key with G anyway, so I'll assume you have access to something that lets you double a point.

Note all the operations are all field operations, so you have to mod by P for secp256k1 (FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F in hex).


How may I get paid with a free bitcoin website?

One way in which I have seen many such websites monetize their services is to release paid APIs. There would be people willing to pay to use your APIs (for trading, news services, Apps etc) if the data is better than the ones that are freely available.

On top of this you can try the usual stuff, ads and referrals and such things on your website.


How to check if a program is mining crypto in the background

You can try to check suspicious network traffic. Install wireshark and inspect all network traffic.


What is the longest time a transaction has been in limbo for?

This question cannot be answered reliably.

The only part of Bitcoin that is publicly known is the blockchain. The transactions that are confirmed are on the blockchain, that is shared online.

The transaction is "stuck in limbo" - unconfirmed - from the moment it is created to the moment it is in blockchain. However, you cannot tell reliably when it was created.

Each node tracks unconfirmed transactions, and it can track where it saw the transaction first, but it doesn't really mean when it was created.

Blockchain.info shows this as "Received time". You could probably count answer to your question from that, but it wouldn't be reliable.

I can add a personal answer: I run my own node and sometimes look on mempool, what is the oldest transaction there; today, I saw 6 days old transactions in mempool. So, the longest will be surely more than 6 days. But that is just an incomplete, personal observation. :)


The simplest thing for you is to just use sendtoaddress. This will use your bitcoind's wallet to select which coins to use, construct the transaction, sign it, and send it. Everything happens internally to the wallet so all you need is to have some Bitcoin in your wallet, an address to send to, and the amount you want to send.

The syntax for sendtoaddress is

sendtoaddress <address> <amount>

where <address> is the address you are sending to and <amount> is the amount.


How does timejacking enable double spending?

The blog you linked to talks about a fairly sophisticated attack, involving large scale network manipulation.

The basic premise is:

You are able to identify the node that belongs to the person/entity you want to execute a double spend against
You trick that node into thinking that the network time is far behind what it actually is (up to a difference of 70 minutes against the node's own system time)
Optionally, you convince other miners that the network is 70 minutes ahead of the actual time.

This gives us the basic following setup:

The actual time, T (the actual value of this is irrelevant)

The majority miners' network time, T+70.

The victim's network time, T-70.

In Bitcoin, when a node receives a new block, it runs through some validation checks. If any of these checks fails, the block is deemed invalid. One of these checks is to verify the timestamp in the block header.

The node checks to verify that this timestamp is within 70 minutes of the what the node believes the network time to be (the network time is the median of the time the peers a node is connected to have reported).

To execute the attack, the bad actor has created a situation where the victim is 70 minutes behind the actual time, and the rest of the world is mining as if the actual time is 70 minutes ahead of the network time.

Thus, when a valid block is found, when the victim's node receives it, it will be dismissed as invalid, since from the victim's point of view it is around 140 minutes ahead of the network time (T+70 - T-70).

The bad actor then uses his own mining power (it is assumed that the attacker has a sufficient share of mining power to produce a few blocks a week) to mine a block that is within the victim's acceptable time parameters. Note that the rest of the network will either already be on a longer chain, or will find a longer chain soon enough, since the attack does not control the majority hashpower.

By broadcasting this block to the victim, the attacker can convince them that some transaction in that block is confirmed. If required, the attacker can then mine a few more blocks (which may take several days) to trick the victim into believing that the block containing the transaction has been confirmed multiple times.

At the same time, the attacker will make another transaction spending the same inputs on the much longer chain being mined by the rest of the miners. This will also be confirmed, and receive far more confirmations than the chain being created by the attacker specifically for the victim's node.

Finally, once the attacker has convinced the victim of the transaction and reaped whatever benefits, the attacker will let the victim's node connect to more honest peers. This will result in the node recalculating the network time, arriving at a more realistic value.

Once this happens, the victim's node will be able to accept the original, longer, honest chain, which will have more blocks (and more work) since it was being mined by the majority hashpower. This chain contains the double spend of the transaction the victim was tricked into believing was confirmed.

The minor chain on which the victim was convinced of the transaction will then disappear, being replaced by the longer chain, and leaving only the double spend on the blockchain.