Recovery from theft - Tracing money to exchanges I created a paper wallet on bitcoinpaperwallet.com and lost all my coins. Only later did I google to realize this is all a scam. The coins were moved on the 22nd Aug. can anything be done? Pls help, I lost my life savings.
Is it possible to determine which exchange were the coins sent to, looking at the transaction ID or wallet ID? Maybe I could write to exchange to block it?

In brief:

You are not going to get your money back
If you try, you will lose more money
The money has by now probably passed through many exchanges and mixers in many corrupt foreign countries. And through the hands of other tricked victims.
As a victim of one crime, you are especially attractive to other confidence tricksters for further crime.  Be on guard.
Report the theft to the police
Ask your police commissioner and/or political representative to act
Accept the loss, move on.

Longer answer:

can anything be done?

No
I would contact local police. Though they won't be able to recover any money.
You will now be contacted by scammers using private messaging. They will tell you they can get your money back. Once they have your trust, they will tell you about a small release fee or a transaction fee or that you need to put money in to meet a refund threshold. In short they will make up lies to trick you into giving more money to criminals. Ignore all messages that are not on a public place, like this website, where many people can read the advice you get and correct any bad advice.

I lost my life savings

I'm sorry to hear that.
In retrospect you made some mistakes which I would suggest anyone else reading this should take care to avoid repeating:

Don't put all your savings into one place.
With volatile high-risk assets like Bitcoin, don't invest money you can't afford to lose completely.
Never use online paper wallet generators (some are relatively safe to use offline, but best advice is avoid all).
Always do as much checking as possible before sending money to online businesses.

Is it possible to determine which exchange were the coins sent to, looking at the transaction ID or wallet ID?

The transaction ID does not identify people or businesses.
There is no  Wallet-ID but there are "addresses" which people sometimes call a wallet ID - although a wallet can have hundred or thousands of different addresses. Nowadays, wallets generate a new address each time they are used to receive money. Bitcoin addresses are not like real-world addresses - they don't identify a person, business or place, Bitcoin addresses are random-looking numbers that are generated from other secret random-looking numbers.
Sometimes you can guess that an address was generated by an exchange because it is subsequently used in a bulk transaction with hundreds of other addresses - either consolidating funds or dispersing them en-masse. This doesn't tell you which exchange was used. A diligent forensic analyst may be able to eventually identify an exchange by use of test transactions and long-term data analysis.

Maybe I could write to exchange to block it?

The problems are:

The money won't stay at an exchange long. The exchange probably no longer has the money.
The exchange won't disrupt their customers business at the say so of a random stranger
The exchange has data-protection responsibilities. The have to protect the identity of their customers. It may take a court order to get them to act.
Criminals don't use their own name and KYC details at an exchange, they trick other victims into opening accounts in the other victim's name and giving the criminal the password (see numerous "sugar daddy" and fake-job scams reported here).
You may be dealing with exchanges, or a trail of different exchanges in far- away places like Russia, China, Nigeria, Switzerland and other tax-havens or countries with corrupt or semi-functional law enforcement. Getting their cooperation will be hard.

You have to involve law enforcement.
Recovering the money may cost tens or hundreds of thousands of dollars and take years. Most likely it will prove impossible. You were duped once, if you go down this path you will almost certainly be duped again. Several times.
I hate giving this sort of advice because making people give up aids the bad guys. But I don't like to think of people throwing good money after bad and making their situation even worse. The best thing you can do is probably work with local law enforcement, try to get your local political representative to appreciate the impact this type of crime has on their electorate - you are not the only one affected.


What is the difference between Gridseed ASIC and Scrypt ASIC If you mine in wemineltc pool you have probably noticed that there are two different stratum server for ASIC miners
here are the urls

So my question is that what is the difference between an gridseed asic and scrypt acis miner ???

And I will be thankful if you explain me that what is gridseed mean exactly

Gridseeds are small dual-mode miners offering SHA256 and Scrypt.

Gridseeds have a very low scrypt hashrate (<400kH/s). The hashrate affects the share difficulty and therefore it's quite a good idea to offer a seperate mining port for low hashrate devices.

It seems there are so many gridseeds still out there that it's worth to mention that on the pools help page.


How does the wallet work, online and offline? I've been reading about bitcoins and I've come across a few questions:

How does the wallet actually work? From what I can gather, I use the wallet as a centralized service to store recieved coins, and to send coins. If recieved coins are stored physically in the .dat file, what are the safeguards that prevent users from duplicating the .dat file and getting more coins?
Do I need to have the wallet client on to receive transactions? In other words, if i don't leave the wallet client active on my computer, will i be able to receive transactions the next time i open the wallet?

Cheers.

Although wallets indeed contain your "coins", the ability to spend them is tracked by the network. Every fully validating node keeps a list of available coins on the network. They do not know who has which, only which (Bitcoin, not IP) address (or addresses) they are associated to. In case you try to spend the same coin twice - for example because you copied your wallet to another computer, and then tried to send a transaction from each - you may temporarily confuse the network. Some nodes may first see the one transactions and some others will see the others first. However, the strength of the system is that this disagreement cannot exist for long and only one of them will be accepted after some time.

The essential thing in your wallet is not the transactions, but the keys. Each address has an associated public and private key. These private keys never leave your wallet file and are necessary to spend the coins assigned to your addresses.

Because the transactions are tracked by the network, you indeed don't need to be online to receive transactions. The next time you connect, your client will ask the network for up-to-date information. During the synchronization that follows, your incoming transaction will be fetched, and the client will detect this as an incoming payment.


How divisible are ripples? How divisible are ripples (XRP)? With 100 billion of the currency units being created at system inception one could assume that they are akin to satoshis, but during the operation of the system I found my balance being charged sub-ripple amounts for some operations. How much can one ripple be divided into?

XRP are internally represented as an integer number of millionths of a ripple. No term has yet been accepted for naming these units, but some people have (I think jokingly) referred to them as "Jeds".

Update: It looks like they will be officially referred to as drops as you suggested. A transaction costs 10 drops. There are a million drops in a ripple.


How can I verify the BTC supply with my own node? With all the supply talk going on I wanted to verify the active supply on my new node I got. What is the best way to "run the numbers" I am running a raspiblitz node.

To verify the supply, you have to compute the theoretical maximum issuance based on the block subsidy schedule. Then you can use the gettxoutsetinfo RPC which will output the total amount of Bitcoin in the UTXO set in a field named total_amount. Lastly you check that the amount in the UTXO set is less than or equal to the theoretical maximum issuance.


What happen if the Bitcoin network is down, or all miners stop keeping records? I am not sure I understand Bitcoin very well. What I understand is that Bitcoin is there because of the network.

What happens if the network is down for any reason?

What happens if the miner that keeps my records of Bitcoin dies or doesn't want to open his computer again?

Nothing happens. The longest chain of blocks in existence, so long as it builds off the latest checkpoint) is always the valid chain, no matter what. So long as at least one node brings it back eventually, there's no problem. (And you can keep it yourself if you're particularly worried about it. If you're running the standard client, you already are.)

Unlike a bank account, your Bitcoin balance doesn't have to exist in any particular place to be valid. The miners create the mathematical relationships that prove it's valid such that anyone at any time can tell that it's valid just by looking at the mined data.

If you connected to any Bitcoin node right now and presented a longer chain of blocks (so long as it included the last checkpoint) than they already had, they would switch over to your chain of blocks and it would become the official chain. It wouldn't matter that prior to introducing it, you had the only copy. It's mathematically valid, so the network would accept it.


On a practical level, how exactly is the amount of a Bitcoin transaction fee determined? Yes, I know that you can actually set the transaction fee to anything you want, but I'm of course talking about a transaction which will actually be "processed" in a reasonable timeframe, "reasonable" being "what the average person would accept".
I've been working for a long time now on a service which exclusively supports Bitcoin for payments. I'm afraid that somebody who is supposed to pay me the Bitcoin amount of $5 USD will feel appalled at the very notion of paying another $5 in Bitcoin just to send my service that actual $5.
I've done numerous Bitcoin transactions, but it has varied wildly in the amount. I can't really figure out how Bitcoin Core is deciding on the amount. (I've never changed it in.)
I'm aware of these "side-chains", but I don't understand how I'm supposed to actually use them in practice. Introducing a bunch of requirements and extra complexity seems even worse than having people "bite the bullet" with large fees (compared to the amount sent).
You might say that I should be having them "deposit" Bitcoin and then hold it on my side, but due to the way that this service is constructed technically, as well as the expected usage pattern, such an "account" cannot be made; they have to get an "invoice" for each time they purchase something, with a unique Bitcoin receive address to which they send the amount. Again, the problem is that I fear that the transaction fees will put people off.
In general, how should I handle this?

Bitcoin transaction fees are usually calculated based on the size (in bytes) that the transaction takes up. This is a number known as 'fee rate', usually written as 'satoshis per byte', and the idea is that you are bidding for space within a block, where most miners will select transactions with the highest sat/byte fee to prioritize for confirmation. The average fee rate according to Bitinfocharts is about 97 sat/byte, meaning for each byte the transaction takes up, you add 0.00000097 BTC in fees. You can probably get away with using anywhere from 50-100 sat/byte and have your transaction confirmed within a reasonable amount of time. The value of the transaction in BTC is completely irrelevant.
If you're handling many withdrawals, often, service operators will batch the withdrawals of multiple users together into a single transaction to save on fees, by generating a transaction that has many outputs, one for each user's withdrawal. Alternatively, you could offer deposits and withdrawals through the Lightning Network to minimize fees.


Unspent account and additional wallet in a transaction I just moved some BTC from one wallet to another.  As I investigated the TX ID, I'm confused by why there are other amounts that aren't what I sent.  In my case I sent .25 BTC, and there are 2 transactions showing up (1 for .25, and another for .7).  The other one says "unspent".

I'm wondering what's going on here, and if there is a simple explanation?

Most probably this is your wallet software doing for you. It might be, that your wallet only had one output to spend from, with .95 bitcoin. And you wanted to send only .25. So the wallet had to divide it somehow... it created a transaction with two outputs, one of which is the return address. Probably this address is also in your wallet. Check the addresses in the wallet, to see if it belongs to you. Or check the remaining balance. If there, then all ok. If not, there is a need for further investigation, but this would require more info...


How do I restore a wallet from a backup file in MultiBit HD? If I have a backup file like mbhd-*.zip.aes how do I restore it using only my password? When I click on Restore Wallet, it only asks for the wallet words, not the file path or password.

You can't.

Security of a MultiBit wallet is broken into four parts:

A wallet encrypted by the password but not the wallet words
A wallet backup, kept in the cloud, encrypted by the wallet words.
"Wallet words," kept on a piece of paper
A password, kept in your head.

You have 2 and 4, but not 1 or 3. My understanding is that that's not enough to restore your wallet. If you had your wallet words, or access to the computer that created this wallet, it would be different.


Balance still not available? I just sent bitcoins from one wallet to another to make my life easier. This was the goal, anyway. My balance in my new wallet went up, but it's still not available after 3 hours. Why might this be? I'm using MultiBit on Mac OS X.

When you create a Bitcoin transaction, your client will broadcast that information to peer nodes and generally within seconds every node that is connected will know of that transaction.

That's likely why the recipient wallet's balance rose.

That transaction though must be included in a mined block before the client you are using will allow those funds to be spent.  Though technically the client could let you spend the funds before the transaction gets even one confirmation, that introduces more confusion and problems so the client has this restriction for these "unconfirmed" transaction.

So, the question remaining is why hasn't the transaction confirmed?  Whether or not to include a transaction is at the discretion of Bitcoin miners (solo miners) and mining pools.  If your transaction did not include a fee that is paid to the miners then sometimes it gets ignored for a while.  This delay can range from an hour or two to more than a day.

Knowing the appropriate fee to pay will depend on how much data the transaction consumes.  If you are a miner getting tiny payouts from your pool, your fee to send payment will be more expensive than most because each of those tiny payouts consumes data.  Another egregious violator are the tiny payouts from the losing transactions on SatoshiDICE.   Most everyone else can get by paying the minimum 0.0005 fee in scenarios where a fee is required or no fee at all when none needs to be paid.

So, the reason you can't spend the funds is likely because either no fee was paid or the fee that was paid wasn't large enough.  In the future, if there is the need to spend the funds from a payment quickly, consider including a fee payment that will help ensure it is included in block in a timely manner.


Transactions that cannot be part of block Is it possible to have a "unlucky" transaction that can never be part of block? Meaning grouping it with other transactions never results in a valid block?

[Edit]
By not being in valid block, I meant no valid nonce is found with given target difficulty. It seems mathematically, this is possible and what happens to transaction (if there is no expirey) in this case?

No, if the transaction is valid then it can always be included in a block if a valid nonce/extra nonce is found.


Why don't we have a help for Bitcoin Core CLI options in the same way as we do for CLI commands? There is detailed help for bitcoin-cli commands using for example:
./src/bitcoin-cli getconnectioncount help.
However, there isn't generally detailed help for bitcoin-cli options such as
./src/bitcoin-cli -netinfo help.
(Note the dash in front of netinfo with no such dash before getconnectioncount)
Is there a reason why there isn't the same help for bitcoin-cli options?
Jon Atack added on IRC:

If not is there an already planned way to add to the help doc and
would this be a good idea? For more detailed help than in
./src/bitcoin-cli -h
I was thinking it might be good to have a detailed help doc for
-netinfo either with help -netinfo or expand the existing one at
./src/bitcoin-cli -h | grep -A3 netinfo or add a doc/netinfo.md
file

This simply is a shortcoming that should be fixed.
David Harding added on IRC:

help <command> is for RPCs; -h is for a quick summary of CLI
parameters.  Extended CLI parameter help should probably be in a
manual page.


why scriptpubkey is different I am confused when i see this transaction

Test transaction with one input and two outputs

Since scriptpubkey verifies the hash of the sender's public key and sender's signature, i am wondering why the two scriptpubkeys are different. Shouldn't they be the same? I am saying the XXX part in the following should be identical

OP_DUP OP_HASH160 XXX OP_EQUALVERIFY OP_CHECKSIG

If not, why not?

scriptpubkey is the locking script, it contains the condition to spend this output, so XXX is the hash referent to the address that is receiving, that´s why is different.


How do I move wallet.dat file to a different location? I want to move (not backup, move) the file to a different location. That way bitcoin wallet software open that file up.

If you have already downloaded the data then you will have to move the data to the new folder. If you want to store them in D:\BitcoinData then click on "Properties" of Bitcoin.exe shortcut and add -datadir=d:\BitCoinData at the end as an example:

  "C:\Program Files (x86)\Bitcoin\bitcoin-qt.exe" -datadir=d:\BitCoinData


Unconfirmed Transactions - 4days - Help Needed To Accelerate I need help to confirm the 2 transactions below for me.

ccc57c3f373d74bd20aeac555998ade561f726d6ccd3f85851a2d8ab892eae44

21047d289a7f7fcd19eddbe8504dd1bb9b2e233cb26a2c9a74e0f3529c2a0795

It has been holding for so many days now.

Any help will be appreciated.

Thanks

Have you tried the free ViaBTC Transaction Accelerator service (requires a minimum fee rate of 0.0001 BTC/kB): "https://pool.viabtc.com" under "Tool" ?


Why is data stored in reverse in the blockchain files? I'm parsing the binary data from the bitcoin core blockchain blkxxxxx.dat files.
If I read out the magic number I get this:

\xf9\xbe\xb4\xd9\

Why isn't it stored the other way around, as the magic number is d9b4bef9? Is this just the way bytes are stored in memory?
I'm aware this is a complete noob question, but could anybody help me understand this. Thanks.

See little-endian and big-endian.
The choice made by Bitcoin authors for data transmitted over the network is somewhat arbitrary. I think the reference implementation (Bitcoin core) chooses to store the data on disk verbatim as received from the network.
The standard for the Internet is called network order and is big-endian. The Intel x86 family of processors are little endian. The early software developers of Bitcoin didn't convert native order to network order when constructing packets. At least, not entirely.


bitcoin alternatives for solo mining on an average laptops Bitcoins take a lot of time, what are the alternatives? i've heard of litecoin but there are so many outhere so what would be the best choice for an average pc?

My recommendation is to mine any currency that uses the scrypt hashing algorithm and sell your earnings for BTC.  There are many to choose from and sites like Coinchoose can help you determine which is the most profitable to mine and sell for BTC.

CPU mining isn't going to get you much but you can make some BTC this way.  If you have a GPU in your PC, make sure you run the right mining software that can utilize your GPU as well.


Coinbase wallet address listed as spent without spending I created a coinbase account and a new wallet that only had one address "A" associated with it.

I then gave that address to a friend and had them send me some amount "B" of bitcoin.

Shortly thereafter my coinbase wallet was listed as having the correct amount "B" of funds and the address "A" associated with my coinbase wallet shows up in the blockchain as having the correct amount "B" sent to it. However, my address "A" immediately showed up in the next block spending the funds, and the address "A" is listed as spent (e.g., on blockchain.info shows up as "spent"). There are a large number of subsequent transactions spending the funds to a bunch of addresses that I have never seen before.

Does anyone know why this is happening? Is this some attempt at coinbase to perform some mixing and try to anonymize transactions? Or does coinbase send the funds to a "cold storage" or something and just pretend like they are "in" the address listed in my coinbase wallet... very curious...

You don't have a Coinbase wallet address, you have a Coinbase deposit address that's used to deposit bitcoins into your wallet. Coinbase sweeps funds from deposit addresses into their secure holding accounts.


Can someone explain in detail how p2pool payout works? From reading the wiki on https://en.bitcoin.it/wiki/P2Pool#Donating_to_P2Pool_miners I got the impression that the pool members included each of the share payments directly in the coinbase generation transaction as multiple txouts.  But after spending some time looking at  example p2pool blocks (for example this one:
https://blockchain.info/block/000000000000000007508100b6d96c3e1d1016835db41a32532d53ebd0207039)
I see that the whole output goes to one wallet (starting with 1KFEH7...). (EDIT: My error this was a F2Pool not P2Pool. Actual P2Pool coinbase do pay to multiple txouts.) In some blocks I do see this wallet sending money to many people  (but not in this example one) but this leads to a couple questions:

1) How does the system enforce these payouts?
2) How does the system get it's intitial seed money for the first payouts?

Are you sure the link you gave is for a P2Pool block? I just found this resource which lists the blocks solved by the P2Pool. This was the top block listed, and it has many outputs in the generation transaction, paying to each of the miners in a pool who contributed to the share chain within the last N blocks (N is some pool-specific number).

  1) How does the system enforce these payouts?

As far as I understand it, blocks on the share chain are only accepted by the other members of the P2Pool if they have appropriate payouts. So, while you could make a block that pays all to you, you wouldn't get that block accepted on the share chain, and you wouldn't get credit for your work. To have the appropriate payouts, the block must split up the reward to each of the solvers of the last N blocks. If a miner has multiple shares in the share chain within the last N blocks, their payouts can be grouped into one transaction output.

  2) How does the system get it's initial seed money for the first payouts?

P2Pool works with PPLNS (Pay per last N shares), which is pool hopping resistant. P2Pool also doesn't give any payouts until someone in the pool solves a block. Essentially, all pool payouts are awarded in an actual bitcoin block, so there's no need to have a fund to distribute rewards set up ahead of time.


Can I use Bitcoin mining as a data furnace to heat my home? One of the waste products from Bitcoin mining is the heat that is given off by the GPUs. On cold days could this excess heat be used to warm a home, essentially creating a data furnace? When it gets warmer then the rig can be optionally shut down.

As I understand it, the income generated from mining bitcoins at least pays for the electricity so long as you have a rig that is capable of meeting the difficulty. This would therefore imply that so long as you have already got a suitable rig lying around the house (e.g. for gaming) then running it up during the day would be useful. If the house also had solar panels then that would also benefit the earning potential.

Are there any calculations available to support/refute this?

Yes, you can use a Bitcoin mining rig to heat your home.

Whether or not it's worth doing depends on a number of things, such as:

Whether you have a heat pump, or would otherwise install a heat pump (they generally give you 3kW of heat for around 1kW of electricity)
Whether of not you have other heating that is more cost effective than electric heating (eg a wood or gas fire)
Whether it's convenient to have a mining rig in the location you want heated (you lose efficiency if your heat is produce away from where you want it)
The current exchange rate of Bitcoins (and the difficulty of mining them), and how those values change over time for at least the payback period of the mining hardware
The price of electricity
The noise produced by a mining rig. They tend to be quite noisy, so it may be a disturbance to leave it running overnight
Your technical ability to maintain the equipment, and your time available to do so. If it has a problem and you don't have time to fix it, you stop earning mining income.

There's no guarantee that mining earnings will pay for the electricity to run them, let alone pay for the cost of the equipment and the labour incurred maintaining it - this is dependent on the demand for Bitcoins, and your costs. There's always a risk that the exchange rate will drop to the point where it's not worth mining at all, or that new technology (eg ASICs) will make your hardware obsolete before it's paid for itself.

Any web-based profitability calculators that exist won't necessarily take into account all the factors above, and none can predict the Bitcoin exchange rate, so their usefulness will be minimal. I recommend just creating a spreadsheet to do the calculations. To include the value of the heat output in your calculations, consider what you would need to otherwise spend to obtain the same heat output, and include that figure as profit on top of the mining profit (but also of course account for the cost of electricity to run the rig).

To predict the electricity usage of a particular setup, see this hardware comparison - a carefully built rig can run 4 graphics cards which might output 600-800W (or more) of heat. Using a desk fan (or similar) to keep strong air flow on the rig should reduce the potential of a convective flow of air taking the rig's heat straight up to the ceiling, where it won't be felt in cold weather.


Is a distributed version of GLBSE possible? How would you design it? GLBSE is a privately owned bitcoin-based stock exchange website.

Recently there has been talk about creating a distributed, open source version of it, without any single point of failure, possibly utilizing blockchain/Namecoin technology.

Would such a project work, technically? How would you design it?

Step 1 - Representing shares in the company.

This is easy enough and has been discussed. The company sends a small amount of bitcoins to one of its addresses. It releases a digitally signed announcement that any bitcoins which can be traced back to this particular output are tokens representing shares in the company. When dividends are to be paid, they are sent (in normal bitcoins) to addresses which contain tokens in proportion to the amount. Initially the company is in ownership of its shares and can sell them to raise funds.

Step 2 - Enabling OTC trades.

Also easy. People who want to trade can broadcast their offers, perhaps on a dedicated Bitstock p2p network. People who want to execute standing orders can contact their issuers and together construct a Bitcoin transaction that sends X normal bitcoins from A to B and Y tokens from B to A, and both sign it. No trust is needed because the exchange happens simultaneously. There can be a Bitstock client that is a modified Bitcoin client, which is careful to distinguish tokens from normal BTC and can communicate with the Bitstock network.

Step 3 - Committing to offers.

Here's the hard part. With a normal OTC trade, there's nothing stopping a trader from backing out of an issued order if it becomes unprofitable by the time he is taken up on it. A market where orders needn't be honored will be inefficient and subject to manipulation. There needs to be some way to make committing orders.

One could conceive concocting some special Bitcoin transaction where the output can be claimed by reciprocating by sending tokens to a specified address, up to a given time. But I think this has too many moving parts to work. The Bitcoin script will need to verify that the tokens indeed originate in the company's address, and the completed transaction will expire if not included by some time - which is said to be impossible since it will be messed up in chain reorgs.

One way to do this is with a distributed trust model such as my own NodeBank proposal, where the bank nodes act as escrow for the trades.

If you want to do this completely trustless, I think you may have to create a separate Bitstock blockchain with its own rules (shared between all companies, but distinct from Bitcoin). I'm not sure it's possible to make a commitment mechanism for offering bitcoins for token bitstocks, so Bitstock will have to be its own currency which can also be used to create company tokens (just like Namecoin is a currency which can be used to create a DNS record). The Bitstock blockchain will have rapid blocks and a relatively strict timestamp requirement, and will be merge mined with Bitcoin. It will have a mechanism for making offers of Bitstock tokens vs. normal bitstocks, which is enforced by protocol if an execution request is made with its hash included in an early enough block. There should be a way to make special rules to make this survive reorgs - for example, orphan blocks will also be considered when evaluating whether an execution was given early enough, but a confirmation of this validity will also be included in the main branch, and require enough confirmations to make sure a validation can't be added retrospectively.

Step 4 - Continuous trade services.

No matter how clever we make the decentralized stock exchange, some things can still only be offered by a centralized service, in particular in regards to the speed with which orders can be placed, retracted and executed. A centralized service can be built on top of the p2p system to offer such features. It should enable depositing and withdrawing normal coins and token coins, and offer advanced features for trading deposited coins.


How can I find a Bitcoin private key that I saved in a text file? I certainly saved my private key in a text file previously,
but I don't know where now.

Is there any way to recover my private key?

If you're programming savvy you could write a small program that searches for the regular expression of a Bitcoin private key. Bitcoin private keys have a very specific format:

They are 51 keys long, start with a '5' and the second letter is either 'H', 'J', or 'K' and use base58 for the remaining 49 letters which excludes the characters 0IOl.

It seems to me that the following regular expression should work to find an uncompressed private key:
5[HJK][1-9A-HJ-NP-Za-km-z]{49} (inspiration: Stackoverflow).

Later, another format was introduced for compressed keys, which has 52 base58 characters, and starts with a 'K' or 'L'. For that format, you should be able to use the following regular expression:

[KL][1-9A-HJ-NP-Za-km-z]{51}

Note that regular expressions can use slightly varying syntax, so you might need to adapt the expression to the programming language or tool that you use. You can generate a few private keys, e.g. with bitaddress.org for testing material. You should probably be more effective if you include word boundary \b symbols before and after the expression.

If you're on a Unix system, these grep commands would find uncompressed and compressed private keys recursively from the directory you're calling from:

grep -r '\b5[HJK][1-9A-HJ-NP-Za-km-z]\{49\}\b' *
grep -r '\b[KL][1-9A-HJ-NP-Za-km-z]\{51\}\b' *

Or search for both of them with this combined pattern:

grep -r '\b[5KL][1-9A-HJ-NP-Za-km-z]\{50,51\}\b' *

To use grep on Windows, you could perhaps find a solution here: What are good grep tools for Windows?


If I sell something for bitcoin can I then use the bitcoin I receive to buy something else? I hear a lot about double spending of bitcoin. Can a single bitcoin be spend twice, as a dollar can. For example, I give dollars to 7 eleven for gas, they then use that money to pay their suppliers. Can bitcoin be used in the same way?

I think the confusion is around the phrase "a single bitcoin". A dollar bill is a thing, you can move it around and it changes ownership, but it is still the same dollar bill.

You might be imagining a bitcoin as a "virtual thing", like a computer file, which you can also move around. Sending the file to someone is analogous to giving them the dollar bill.

The problem is, computer files don't move; they are copied. Even when you tell a computer to move a file from one disk to another, it is simply making a copy and then deleting the original. When you give someone a dollar bill, you don't have it any more. You can't really give someone a computer file, because you simply both have copies.

If a digital currency were implemented this way, you could simply keep giving copies of the same computer file to everyone you paid, and you would basically have an infinite supply of money. That is what people are talking about when they refer to double-spending. The idea of using the same money twice.

So, bitcoin can't be a simple as a computer file. How does spending work?

Imagine a world where there are no dollar bills and coins. Instead, all transactions are performed by credit and debit cards and similar things. In that case, when you spend $1 at a 7-Eleven, you theoretically give them a dollar, except there is no physical thing to move. In reality, your bank and 7-Eleven's bank simply agree to add a transaction to each of their ledgers, saying you transferred $1 from your account to theirs.

In other words, what's actually being passed around isn't "virtual money", but records of transactions instead.

Spending a bitcoin is very much like this: you create a transaction that says you are transferring X BTC from your account to someone else's. That is published to the network and becomes part of the transaction record and then "everyone" knows your wallet has X fewer BTC and the other person as X more BTC.

There is a lot of complexity in how that publishing process works, how it guards against fraudulent transactions, how it works in a decentralized fashion, etc. There are a lot of places to read about how it all works, including this site.

So, if you have 10 BTC and receive 1 BTC, then you turn around and spend 1 BTC, did you spend the BTC you just received? Or one of the other ten? That's a question for philosophers, to be honest.


How to access Electrum remotely via the rest api? I am able to execute calls on the server from the server. When I say calls, I mean like this. I.e. I can get the latest addresses doing something like this:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:7777");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"id\":\"curltext\",\"method\":\"listaddresses\"}");
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = "Content-Type: application/x-www-form-urlencoded";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
print '<pre>';
print_r($result);

The problem is, I don't want to have to execute this on the server. I was hoping there would be a secure way to execute this remotely.

Can someone please tell me if this is possible? I tried opening port 7777, but still can't access it. Is it perhaps on purpose? As I can imagine this being a security problem.

Thanks!

I got most of my answers here.

  Note that HTTP basic auth sends the username and the password unencrypted as part of the request. While using it on localhost is fine in our opinion, using it across an untrusted LAN or the Internet is not secure. Hence, you should take further measures in such cases, such as wrapping the connection in a secure tunnel. For further details, read this.

So it sounds like i'll have to build a PHP wrapper myself, or use a SSL tunnel. (Not excited at all)


How does BitCoin prevent fraud during confirmation period? I'm trying my best to understand how bitcoin works and while I've grasped the basics, there's a lingering question:

What's to stop me from spending my bitcoin multiple times during a confirmation period?

Let's say I have a single address that owns 1 BTC. I go to a cafe and use the coin (assume the whole coin for simplicity) to buy a cup of coffee. The transaction is broadcast across the network. The miners then compete with one another to include my transaction in a verified multi-transaction block that will be submitted to the block chain. That process takes around ten minutes. During that ten minute period, I walk to the gas station and reuse my 1 BTC to buy some gas. How could the gas station know that I had already used my 1 BTC to buy coffee a few minutes earlier and my actual balance is zero, since the coffee transaction isn't yet part of the official block chain?

In the end, one of these two transactions will most certainly get rejected by the Bitcoin network but either the cafe or the gas station will get stiffed, correct? It seems the only solution would be for the cafe to wait ten minutes for the confirmation prior to giving me my coffee -- but that's obviously not a practical approach.

What am I missing?

This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods.

It's not quite as easy as you suggest, though.  When you made your transaction at the cafe, it was, as you say, broadcast across the network.  Barring connectivity problems, every node on the network gets a copy almost immediately.  (They don't need to wait for it to be included in a block.)  In particular, the gas station gets a copy.  So when you try to spend the same coin with them, they know it has already been spent and will reject your transaction.

To make this work, you have to ensure that the victim is not aware of the other transaction.  One approach is that the first transaction, rather than buying some other goods, simply sends the coin back to another address you control.  You don't broadcast it on the network; rather, you give it directly to a miner, with the understanding that they should include it in their next block, rather than the conflicting transaction that sends the coin to the gas station.  In a variant called a Finney attack, the miner (possibly yourself) has already mined a block with the transaction that sends the coin to you, but they wait to submit it to the network until you have bought your gas.


Any non wavecrest issuer euro zone debit cards? After the recent disruption to all debit cards that were using the wavecrest card issuer, it appears they were by far the most common issuer for bitcoin debit card companies. Most of them have stated that they are working on replacements. I notice that bitpay's card uses a different one and is US only.

Is anyone aware of any that are live already with another card issuer in euro zone?

I'm using this one
Low fees, they accept BTC, BCH, ETH, LTC and BTG
Also, they have very cool app for iOS & Android

https://cryptoanteg.com/blogs/reviews/epayments-your-new-crypto-currency-debit-mastercard


Taxation and Cryptocurrencies How can a government make people holding Bitcoin pay capital gains tax on their holdings if everyone is pseudonymous?

If crypto becomes widely adopted, will we have to rely more on sales taxes (e.g. at the point of sale), and less on wealth taxes?

This question seems borderline off-topic, as tax laws are localized to each country, but I think a generalized answer could be of interest nonetheless:

Bitcoin is money that grants the user of it full financial sovereignty. No third party needs to be involved for the user to hold, or use bitcoin. This means that there is the possibility of the user avoiding their tax liabilities.

However, this is not much different from cash, which is used to transact anonymously and without record, all around the world, every single day.

So I suspect that many jurisdictions will approach Bitcoin taxation in the same way that they do other things: voluntary reporting, with stiff penalties for those that make fraudulent claims.


Lost bitcoin on paper wallet so i got a 0.8 btc on my paper wallet..and usually i checked the balance on daily basis on blockchain.info.

And weird thing happened yesterday,my paper wallet sent my btc with total amount of 0.2btc to unknown address..
And i swear i keep my paper wallet safely and never get exposed..after learning that ,i decide to transfer all remaining btc on my wallet on blockchain apps.

Please anybody can answer here is my paper wallet address.
this.https://blockchain.info/address/14w344ohpe2M35BkScgcFdANuei5MPK49Z

And here the transaction.
https://blockchain.info/tx/8d1d918dcd045732c79541662309b9fe83e7faea99e3e0e757e3620167b2bb7a

Only the ones with knowledge of the private key on that paper are able to send money from your address. If it's somebody else who also has your private key, it's weird that he/she didn't sent the entire balance.

Since it's impossible - let me repeat that, impossible - to send the funds without the private key, that leaves yourself as the only likely candidate who sent the 0,2 bitcoin.

Possibly you were performing another action like exchanging bitcoin for an altcoin using Shapeshift and you didn't (yet) correlate that event with the 0,2 transfer.


Why is a chain code needed for entropy in HD wallets? In the documents and articles I have read, it is stated that the "chain code" in HD wallets exists to provide entropy to the derivation of child public/private keys. If I understand the process correctly, it is the following:

MyHash = HMAC-SHA512(Parent_PublicKey + Parent_ChainCode + Index)
Special_Integer = Leftmost256Bits(MyHash)
Child_ChainCode = Rightmost256Bits(MyHash)
Child_PublicKey = Parent_PublicKey + Special_Integer
Child_PrivateKey = Child_PrivateKey + Special_Integer

My question is why exactly the chain code is necessary. Even with just HMAC-SHA512(Parent_PublicKey + Index) the output should "look" very different for different indices, so is the problem that it's still mathematically close?

A couple of related questions:

I assume the goal is to prevent using a key to derive its children or siblings. Is that wrong and/or are there other security assurances that HD wallets seek to provide in their tree structure?
Is the chain code as "public" as the public key, or is it desirable to keep it private to the extent possible?

For reference, the original spec is located here.

A few minor adjustment to your basic equations of how HD wallet child key derivation works. (And also note that these equations only apply for non-hardened indices)

MyHash = HMAC-SHA512(Parent_PublicKey + Parent_ChainCode + Index)
Special_Integer = Leftmost256Bits(MyHash)
Child_ChainCode = Rightmost256Bits(MyHash)
Child_PublicKey = Parent_PublicKey + Special_Integer * G
Child_PrivateKey = Parent_PrivateKey + Special_Integer

I added the * G, and changed Child_PrivateKey to Parent_PrivateKey in the last equation. The * G is because you need to use Elliptic Curve multiplication before you can add to the Parent_PublicKey, which is an Elliptic Curve point.

Now let's look at how these equations would look if the chain code wasn't used.

MyHash = HMAC-SHA512(Parent_PublicKey + Index)
Special_Integer = Leftmost256Bits(MyHash)
Child_PublicKey = Parent_PublicKey + Special_Integer * G
Child_PrivateKey = Parent_PrivateKey + Special_Integer

Now, if you know the Parent_PublicKey (which is public knowledge and may be found on the blockchain for instance), you can try many values for Index and derive all of the child keys

Now assume someone got ahold (somehow) of one of your private keys for somewhere in the tree. Without the presence of a chain code, they can derive all of the private keys down the tree from the node where they have the private key. What's worse, if they can get access to the public keys higher up in the tree, they can derive the private keys as well with a little backwards-engineering of the equations (basically, Parent_PrivateKey = Child_PrivateKey - Special_Integer). This is undesirable, as it would be better if losing a single private key doesn't compromise much/any of the rest of the HD key tree.

All of this is not possible with the chain code present. So there are very good privacy and security reasons for using the chain code.

  Is the chain code as "public" as the public key, or is it desirable to keep it private to the extent possible?

It's definitely desirable to keep it private, because leaking it exposes you to the issues mentioned above.


Wallet no longer shows Bitcoin balance I checked my wallet (Monarch wallet) about a week ago and I had a small amount of bitcoin in  it. I looked at it again a few days ago and it had vanished. I tried recovery, uninstalled wallet and reinstalled, but no luck.

I have been in contact with Monarch support, they say the coin is there, but they have run out of ideas on how to recover. Is there anything I myself can do to recover my wallet, without needing the help of the wallet's support team?

If you are using some wallet software and it ceases to function for you, then you can attempt to recover your wallet using different software. This is of course only possible for wallets which you have complete control over (which means you control the private keys, not custodial accounts where some service provider controls your keys). You can attempt recovery by importing your private keys themselves into new software, or more commonly, you can recover the wallet by using your BIP39 mnemonic seed phrase (usually 12 or 24 words). This seed phrase has become an industry standard, so as long as the wallet you currently use utilizes BIP 39, you should have no problem finding some new wallet software you can perform the recovery with.

Note that the wallet will derive your private keys and bitcoin addresses from the mnemonic seed phrase, and there are many possible derivation paths available. BIP 44/49/84 define standard paths, but there is a possibility the wallet you use will use a non-standard path. In that case, you will need to find out what path was used, and then find some software that will allow you to define a custom derivation path.


Who decides who verifies Alice's transaction? Let's say the transaction got picked up into a block by miner A and into a block by miner B. Both are working on those separate blocks, and each block contains information about Alice's transaction and it is just a matter of luck which miner solves it? Or are transactions picked up as "one bunch" by every miner out there working on the next block, so that Alice's transaction is in "every" block that is currently mined?

Both are working on those separate blocks, and each block contains information about Alice's transaction and it is just a matter of luck which miner solves it?

Mining a block is basically a race, the successful miner is usually the first one to find a valid block and send it to the rest of the network. In one respect, there is some luck involved, because hashing is purely probabilities, it might take you only one attempt to find a valid block or it might take you quadrillions of attempts. But obviously the more attempts you make, the more likely you are to find a valid block, hence why more mining power generally means higher success rates.

Sometimes, two miners find a block at almost the same time and a small fork happens where some nodes see one block first and others see the other, but this is generally resolved as soon as the next block is mined, because the nodes will move to whichever chain becomes longer.


HyperLedger Fabric from IBM is fork of Tangle or Etherium? I read as if HL Fabric was the most interesting thing ever created on the use of blockchain, but when I read the documentation (very short) about Hyperledger Fabric I came across some coincidences.

the install is very common:
https://github.com/hyperledger/hyperledger

but the documentation mentions "tangle":
https://github.com/hyperledger

but the blog documentation:
https://hyperledger-fabric.readthedocs.io/en/latest/
is equal Ether documentation:
https://ethdocs.org/en/latest/ether.html

Does anyone know of any tool that I can compare the code of 3?

No, they are not related at all. The Hyperledger documentation is not short. The Hyperledger Github project does not mention Tangle as far as I can see. The only similarity with the Hyperledger documentation and Etherium documentation is that they are hosted on Read the Docs and look similar, the content is completely different. Hyperledger, Tangle, and Etherium are developed completely independently.


Flatpak bitcoin-core not generating .cookie file I'm using the version of Bitcoin-Qt 0.18.1 that comes with Flatpak. I've looked in the Bitcoin datadir, which is in ~/.var/app/org.bitcoincore.bitcoin-qt/data/ and there isn't any .cookie file there. This is preventing me from running Electrum Personal Server.

My Linux distro is MX Linux.

My bitcoin.conf is empty.

I ran bitcoind from Flatpak and it outputted the .cookie file


Bitcoin Controlled Supply Satoshi has never really justified or explained many of these constants.

it is someone found out about this constants yet?

link: https://en.bitcoin.it/wiki/Controlled_supply

It is still unclear how Satoshi chose all the constants present in the Bitcoin protocol (10 mins blocks, 21 million coins, 2016 blocks intervals, etc...).

While we'll never know for sure the full justification until Satoshi manifests itself, we can try to come up with reasonable ones ourselves.

For example, it is supposed the total number of satoshis in existence has been chosen to fit in 64 bits (using a number larger than 64 bits would have made the implementation more complex), making the difficulty interval a power of 2 simplified a lot of maths, etc..


Can a transaction have more than one recipient? I am quite new to Bitcoin. I have a doubt.

Let's say I, person A, have 1 bitcoin. I want to send 0.5 BTC to person B and 0.5 BTC to person C in a single transaction. Is it possible to do so within one single transaction?

Later on, if Person C sends the same bitcoin to Person B, will it be possible for person B to recognize that the bitcoin which it now received from person B and the one which it already received from person A, originated from the same source?

Yes, this is possible. Although most consumer wallets will probably not do that, they're simply meant to scan one QR code, send some coins to that address and return the remainder to a change address you own yourself.

I'm fairly sure the Bitcoin-qt GUI wallet can create transactions to multiple destinations. Command line certainly can do everything.

  Later on if Person C sends the same Bitcoin to Person B, will it be possible for person B to verify that, the Bitcoin which it now received from Person B and the one which it already received from Person A, were from the same source ?

This is possible, using a block explorer it's easy to manually trace coins.


Getting a "couldn't connect to server" error on getblockchaininfo When I give the following command I get an error after a LONG lag (maybe 15-20 minutes):

~: bitcoin-cli getblockchaininfo
error: couldn't connect to server

Why?

Are you doing that remotely? if so please make sure that your port is open.

sudo ufw allow 8333

Also can you provide us with the last a few lines of debug.log file.


How do I make a Bitcoin "memory wallet" (or paper wallet without paper)? I'd like to see a video tutorial that explains in detail how to make a paper wallet without paper, AKA, a "memory wallet" -- thx.

step 1 - memorize all the private keys that would otherwise be stored in some sort of wallet file

step 2 - there is no step 2


Sending bitcoins from wallet without downloading the blockchain or giving up control I can generate a bitcoin wallet at bitaddress.org, and I can verify that I have received payments at blockchain.info.

But if I want to send bitcoins from my wallet, I know only of 2 ways:

Use Bitcoin-Qt, which needs the blockchain.
Use an online wallet, which essentially gives control over my wallet to someone else.

Is there a way to send bitcoins from my wallet without the blockchain, but at the same time, without giving access to my wallet to an outside server at any point.

You can use an SPV client such as MultiBit. This does not need the whole blockchain, and does not give up control of your wallet.


Who added the 21 million limit to Bitcoin? After reading the white paper of Satoshi Nakamoto. The white paper does not mention anything about a limit of money supply.
I think I have read somewhere mentioned the name, but unfortunately I cannot remember it.
If I look in the main resources available online (Wikipedia, bitcoin.org, ..) they all mention Satoshi Nakamoto as the one who added this feature.
If Satoshi was not the one to add this feature, I think it is very important that we know who came up with this, and why the bitcoin dev community at the moment decided to adopt it.

This is the announcement of Bitcoin:

http://www.metzdowd.com/pipermail/cryptography/2009-January/014994.html

  Total circulation will be 21,000,000 coins.  It'll be distributed to
  network nodes when they make blocks, with the amount cut in half every
  4 years.

  first 4 years: 10,500,000 coins
  next 4 years: 5,250,000 coins
  next 4 years: 2,625,000 coins
  next 4 years: 1,312,500 coins etc...

It was part of it from the beginning, and it definitely wasn't secret.


How does bitcoin manage the money supply? All currencies are expanded when institutions begin loaning currency. How will bitcoin limit this growth? In economics there are several definitions of money such as M2, M3, etc.

The number of bitcoins in existence is limited to 21 million. This is the equivalent of M0, the monetary base. Whatever institutions do with it, creating M2, M3 etc. is not something that Bitcoin can or will control.

Here is some more info on the Bitcoin wiki: Controlled Currency Supply


How to size in bytes for a transaction using BitcoinJ The calculation of a transaction fee uses fee/kb. So how do I get the size in bytes for a transaction using BitcoinJ?

SendRequest req = SendRequest.to(address, value);

req.feePerKb = Coin.parseCoin("0.0000100");

Wallet.SendResult result = kit.wallet().sendCoins(req);

You cannot know the size in bytes of a transaction without knowing the inputs to the transaction. Just knowing the amount you want to transfer and just the output does not tell you anything.

Using the sendCoins() method and setting feePerKb in your SendRequest should create a transaction that pays the specified fee rate. If you want to get the transaction details after you send, the SendResult that you get has a field named tx which is a Transaction object. You can then get the necessary information from there.

If you want to know the size before you send, then you need to craft the transaction yourself as sendCoins() will automatically create and send the transaction for you.


Why does bitcoin-cli not know about working directory of bitcoind? I have a /ect/systemd/system/bitcoin.service with the following content and I am wondering, why bitcoin-cli getinfo tells me about a configuration file elsewhere:

error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/pi/.bitcoin/bitcoin.conf)

Content of bitcoin.service, especially -conf=/home/bitcoin/.bitcoin/bitcoin.conf:

[Unit]
Description=Bitcoin daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/home/bitcoin/.bitcoin/bitcoind.pid
# Creates /run/bitcoind owned by bitcoin
RuntimeDirectory=bitcoind
User=bitcoin
Type=forking
PIDFile=/home/bitcoin/.bitcoin/bitcoind.pid
Restart=on-failure
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true
# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target

The bitcoin-cli use the bitcoin-rpc, so for used a bitcoin-cli, you must ran the bitcoind with the configuration and when it is OK, you can get command with the bitcoin-cli

A simple file configuration could be it

##
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
# On client-side, you add the normal user/password pair to send commands:
rpcuser=alice
rpcpassword=bob

or you can run the bitcoind with this command bitcoind -rpcuser=alice -rpcpassword=bob


bitcoin cash from fork no longer visible on blockchain.info I had bitcoin before Aug 2017 on Blockchain.info.
After the fork there was a period of time that i could see my BCH balance in Blockhain.info's settings. i can no longer see it. how do i get access to my fork BCH?

I went to 'settings' then 'addresses', clicked on 'archived
  addresses', logged out and in again and there they were.

Possible solution: https://www.reddit.com/r/Bitcoincash/comments/7l2jk2/bch_suddenly_missing_from_blockchaininfo_wallet/


Trying to create a bitcoin based webapp in python which takes BTC deposits. How would I use pybitcointools to implement this? Trying to create a bitcoin based webapp in python which takes BTC deposits (New to Bitcoin in general, but want to get involved).

Although I would preferably want to use a different address for each deposit, (I read the docs and found out how this could be done, but still slightly confused), I would want to allow for users to deposit back into their own wallets. Though I think I got withdrawals figured out.

I tried to understand the (Now unsupported docs) but decided to come here for help because I was still confused. How would I use pybitcointools to

Generate an BTC Address. (New address for each user). I believe I could do the below for each user. So this would generate a unique address upon the creation of each user for them to deposit to.

my_private_key = sha256('I guess whatever I please')
my_public_key = privtopub(my_private_key)
my_address = pubtoaddr(my_public_key)

Accept a Deposit into this Address.
Return the BTC value of this address.
When the time comes, send the balance of this address to the users own address.

You're mostly on the right track.

The ideal way to build a user deposit system is to simply have a one to many user->address mapping.

By default, when a user deposits BTC to an address, you automatically generate a new address for them. However, you don't delete the previous address, or the fact that it is linked to that user.

This way, even if a user sends BTC to an older address, you are able to receive it for them.

Additionally, how you process withdrawals depends on what kind of system you are building. If it is simply a straightforward wallet system, then the process you described of sending the BTC out when the user asks from the user's address will be fine.

If you are building a platform where the user exchanges BTC for goods, services, or other coins, and then makes withdrawals based on their remaining balance, you may want to consider a hot/cold wallet system.

In such a system, when users deposit coins, you provide no guarantee that the same coins will be used to process their withdrawals. You either use all users' coins to process each others withdrawals, or you move them into a handful of addresses, and process all withdrawals from their.


Payment not received I received an email from a company about a payment,but my wallet has not received it.my wallet does not show any transactions,even unconfirmed transactions.what should I do?Thank you.

Were you supposed to receive a payment from that company prior to have receiving the email? If so, contact their support and ask them. If not, then the email was probably a scam or phishing attempt.


SegWit 2x what is it really? SegWit 2x anounced not so long time ago.

Is it true, that SegWit2x take more network traffic and disk space?

So what are the advantages of it's integration?

Segwit2x will have a larger block size. This means that the amount of data in a block will be larger, which implies that more data is being transferred and stored for each block. So yes, it will require more bandwidth and disk space.


End to end bitcoin transaction flow My understanding on bitcoin blockchain technology after going through some articles in past few days. I'm not sure that my understanding is 100% correct. I'm writing so that someone can correct me which will also be helpful for other newcomers.
Case: A wants to send 10 BTC to B

A created an address which is a hash (SHA 256) of several words. Similar for B. This is the private key; ownership validator of Bitcoin amount. Using private key, public key is generated. Wallet applications offer seed words which generates private address by hashing with SHA256 so that even private key is lost it can be relieved from the secret seed words. This public key is known to everyone but private key is secret and must not be shared. It is not possible to get the private key from the public key. Private key is the mathematical proof that A has right to spent certain amount of BTC. This is proving the ownership of money. Let, somehow A has more than 10 BTC right now.

A sends 10 BTC to B's public key. Public key is the 'to address' of the transaction. The message (A sends 10 BTC to B) is signed using A's private key. This is digital signature for the transaction. This transaction message is broadcasted to everyone (the entire blockchain network nodes). Digital signature confirms that the real owner has created the transaction.

The miners will pick this transaction along with other pending transactions and try to create next block of the blockchain. All the transactions are open to everyone. For the example transaction case, miners will validate the transaction whether A really has more than 10 BTC by checking the complete blockchain database (all the completed blocks of the chain). If not, the transaction will be rejected and won't be added to the block he will try to solve the puzzle.

The miners will validate number of transaction from the pending transactions (the transactions which are not added to any block in the blockchain yet).

Different Miner can take different number of valid transactions to form a block. But the miner who wins the mathematical puzzle, his created block will be added as next block to the blockchain. This puzzle is to get hash (SHA 256) as per current difficulty (19 leading zeros of the hash in hex format). This is a trial and error basis process to get the desired hash having 19 zeros. Hash output function looks like below -

SHA256(timestamp + previous block's hash + MarkleRootHash(all valid transactions taken in this block) + nonce)
Miners change nonce (integer number) value every time he tries to get the desired hash according to above mentioned hash generation format. It requires enormous amount of tries hence huge compute power to solve the puzzle. Suppose, a miner has just got hash having 19 zeros. Note that the transaction "A sends 10 BTC to B" is valid and exists in this example block whose hash has just found with 19 leading zeros.

The miner has got the desired hash with a lucky nonce value. Using this nonce value anyone can validate the output 19 zeros hash; hence it is the successful block. This nonce value is actually the proof-of-work. When majority of miners will validate the nonce and get prof-of-work successful, it is gaining to the consensus. Then, the block gets added the blockchain database.

As this block contains transaction "A sends 10 BTC to B". This transaction is also completed successfully. B gets 10 BTC. Ownership of this 10 BTC is with B as B has the private key of the public key used as 'to address' of the example transaction.

Broadly correct.  A few minor details aren't right.
#1. Private keys are simply 256 bit numbers.  They can be created by a random process or, in modern wallets, as part of a Hierarchical Deterministic sequence in which each key is generated in a repeatable way from a seed.  See https://learnmeabitcoin.com/technical/hd-wallets.  Also, the wallet address is not the public key itself - though it is derived from it.  The site linked above explains this too.
#3. A transaction explicitly refers to previous transactions - and it is these which are checked for sufficient funds (not "the whole blockchain").  The new transaction will also deal with any excess funds.


How do big sites/markets handle the intrinsic "transaction fees"? For example, on the late SilkRoad market, or in bitcoin mixing services.
They supposedly have a "pool" account (or escrow acct, etc) where all the coins go in to, and from which withdrawals are made.

Wouldn't such a setup be a nightmare regarding how large the transaction fees would be during a withdrawal, due to the large amount of input addresses? At least, from what I understand from fee calculation (honestly, a lot of bitcoin concepts go over my head, no matter how much I reread related articles).

Take a look at the Bitcoin wiki page on Transaction Fees.

First of all, a transaction fee is not always required. Miners decide whether to accept transactions without a fee and most miners follow the same decision protocol for that.

  A transaction may be safely sent without fees if these conditions are met:

  It is smaller than 10,000 bytes.
  All outputs are 0.01 BTC or larger.
  Its priority is large enough (see the Technical Info section below)

The priority basically adds the notion of age. Outputs that are created some time ago can mostly be sent for free. Very young outputs cannot be spent free. This is to prevent someone from spamming the blockchain with consecutive transactions.

  Otherwise, the reference implementation will round up the transaction size to the next thousand bytes and add a fee of 0.1 mBTC (0.0001 BTC) per thousand bytes. As an example, a fee of 0.1 mBTC (0.0001 BTC) would be added to a 746 byte transaction, and a fee of 0.2 mBTC (0.0002 BTC) would be added to a 1001 byte transaction. Users may increase the default 0.0001 BTC/kB fee setting, but cannot control transaction fees for each transaction. Bitcoin-Qt does prompt the user to accept the fee before the transaction is sent (they may cancel the transaction if they are not willing to pay the fee).

So this basically means that the fee increases as the transaction size increases. Considering this, it is not a good solution to add thousands of inputs and outputs to a transaction.

I believe the best solution for a service like a market is to try to make as much as possible free transactions. A typical single-input-single-output transaction is 500 bytes. When you always use the oldest outputs available in your hot wallet pool, you can try to always create 10KB transactions that are free.


How to broadcast a transaction anonymously Is it possible to broadcast a transaction to the network without revealing my personal IP address? My first guess is to connect bitcoind over Tor with proxy=127.0.0.1:9050. Is it the good way to do it or do I have other options?

Thanks.

Here is the solution I found to broadcast transaction on the bitcoin network without revealing your IP: connect bitcoind over the Tor network. Here is my guide.

Edit your torrc file to add .onion bitcoin nodes:

mapaddress 192.0.2.2 ijzt2eeizty3p5xe.onion
mapaddress 192.0.2.3 j43z65b6r2usg3vk.onion
mapaddress 192.0.2.4 pvuif6nonbhj3o3r.onion

Start Tor

Edit .bitcoin/bitcoin.conf to connect bitcoind over the Tor network. Add:

proxy=127.0.0.1:9050
connect=192.0.2.2
connect=192.0.2.3
connect=192.0.2.4

When Tor is started (green onion) you can launch bitcoind.

More infos
https://en.bitcoin.it/wiki/Fallback_Nodes
https://bitcointalk.org/index.php?topic=50547.0;all


Is Vertcoin really ASIC resistant? Vertcoin comes with Adaptive-N-factor, which means the scrypt algorithm PBKDF parameter N will be changed according to the announced time table. Litecoin has N=10, while Vertcoin starts with N=11. And they claim the adaptive-N will resist the ASIC miner.

To produce an ASIC produce, it will need a huge amount of initial cost because of the prototyping (FPGA), HDL design, emulation, synthesis and layout, wafer fabrication, packing, and testing.

However, scrypt ASIC is now a real product (no matter how much it costs now). So re-target it to another new parameter should be not too difficult. I mean the whole architecture does not change (PBKDF is the same; only some parameters change, such as memory size and N), so the new ASIC development won't need to be started from the scratch up, such that cost is relative smaller than the initial product started from ground zero. Moreover, at the time of N adjustment at Jan 2016, the transistor size will be smaller and memory speed will be much higher, new technology will also enable the realization of the new ASIC miners for the new N factors.

If CPU/GPU can do the scrypt adaptive-N-factor algorithm at that time, I can say ASIC can also do that if there is a market and lots of demands. My idea is that, if vertcoin is very profitable (like or surpass BTC), Those ASIC company would also love to produce their ASIC miners with new N-factor. They could produce scrypt N=12 miner ready for the N-factor changes at Jan 2016, and announce for the pre-sale 3 or 6 months ago.

To me, adaptive-N-factor is just like one of BTC difficulty things. No one is mining BTC with miners whose hashrate is MHs or 10GHs or below, although all BTC miners are using the same proof-of-work algorithm SHA.

The primary limiting factor is memory. As N increases, memory starts to become the most expensive component, whether's it's in a GPU or an ASIC. For example, let's say the memory needed to achieve a certain level of parallelization costs $800. Now a GPU chip costs $400, while an ASIC chip costs $100. So the GPU costs $1,200 overall while the ASIC costs $900. This represents only 25% cost savings, making people hesitant to buy a device which is useful for only one task and thus may be worthless in a few years (if GPU mining becomes unprofitable, they could always offload the GPU at half price or more to gamers).

  To me, adaptive-N-factor is just like one of BTC difficulty things. No one is mining BTC with miners whose hashrate is MHs or 10GHs or below, although all BTC miners are using the same proof-of-work algorithm SHA.

Not true. Difficulty is a very simple parameter that does not affect the computations done; it merely is a threshold for determining which hashes are in and which are out. The N-factor actually affects the running of the Scrypt-N algorithm.


Is Block Finalization a valid development to remove the threat of 51% attacks? https://www.reddit.com/r/btc/comments/bq8cqo/btctop_currently_has_51_hashing_power/eo2p4md?utm_source=share&utm_medium=web2x

A recent comment from a Reddit user in response to BTC.top acquiring 54 of the Bitcoin Cash has hate noted that a Block Finalization development removes the threat of a 51% attack.

I have never heard of block finalization before but my understanding is that it results in nodes reject the altering of blocks once they have reached a certain amount of confirmation in the blockchain. At the moment, I believe it stands at ten confirmations in the Bitcoin Cash blockchain.

Is this a valid development? Are there limitations to it?

If ‘block finalization’ is needed, then your chain is broken. I say this because PoW is the method by which the Bitcoin network maintains consensus, and so the only reason we may introduce a ‘block finalization’ is if we worry that PoW will not be able to accomplish it’s job. If PoW cannot accomplish its job, then the system is already broken. It really is quite simple.

Consider: if 51% attacks are happening, and malicious miners are reorging the chain every few blocks, what good is ‘block finality’? The system is already seemingly broken.

Adding any sort of ‘block finalization’ can also introduce new issues and attacks:

Consider: if some nodes on the network somehow have a different history that goes back more than ten blocks, then the network will never be able to reach consensus without manual intervention.

So if a node is Sybil/eclipse attacked and fed a fake history by its peers, it will now never be able to get back onto the longest valid chain, because it will not follow a reorg of more than 10 blocks depth. In the face of a network at risk of 51% attacks, why should we assume that this would not happen? Rewinding 10 blocks could be quite easy for an attacker with a majority of hashpower, and so ‘block finalization’ just means the dangers associated with eclipse and Sybil attacks are far greater than before. Without block finalization, a node only needs one honest peer at any point in time, but with block finalization, a node needs one honest peer every ten blocks. A small but extremely important distinction.

Further, there are even situations in which this could cause issue without any malicious actors involved. If some part of the internet’s backbone infrastructure went down and isolated some portion of nodes and miners temporarily, then how would they ever get back in sync with the wider network? They wouldn’t be able to, without manual intervention.

So ‘block finality’ is not a technically sound idea. It is a bandaid for an already broken network.


Is there a way to create decentralised rating system akin to #bitcoin-otc? I'm wondering if there is a way to create a ranking system similar to #bitcoin-otc, but making it decentralised?

Shouldn't be too hard. Let the identities be coupled with a private/public keypair, ratings for one another are signed. As long as you do not blindly trust identities with high ratings but instead go through the web of trust (either you directly trust someone or trust him because he's trusted by some of your trustees) then you should be able to recreate the #bitcoin-otc web of trust faithfully.


The Bitcoin scripting system is purposefully not Turing-complete - why? Can somebody explain to me why the Bitcoin scripting system is purposefully not Turing-complete? To make malicious programs difficult to develop (I guess)? Or because it was difficult to make it Turing-complete?

  Bitcoin uses a scripting system for transactions. Forth-like, Script
  is simple, stack-based, and processed from left to right. It is
  purposefully not Turing-complete, with no loops.

Retrieved from: https://en.bitcoin.it/wiki/Script.

As others have said, there is no real need for Bitcoin scripting to be more complex than it is, as its complexity is more than enough for its intended applications; but the main reason is that not allowing some features (such as loops) in a language makes it completely deterministic: you can know for sure when and how a given program will end; you can't f.e. have infinite loops if you don't have loops in the first place, thus you don't have to worry about programs getting stuck and blocking/crashing the interpreter which is running them (in this case, the main Bitcoin software).

Not having to deal with the halting problem is definitely a plus for a tiny, embedded, purpose-specific language such as the one used for Bitcoin scripts.


Install bitcoin core on debian jessie error I have to install bitcoin core to use op_return library.
But I have difficulties to install correctly bitcoin core.

First I run the command sudo apt-add-repository ppa:bitcoin/bitcoin

Second I enter this command: apt-get update

But I have error :

 Err http://ppa.launchpad.net jessie/main amd64 Packages
 Err http://ppa.launchpad.net jessie/main amd64 Packages
 Err http://ppa.launchpad.net jessie/main amd64 Packages
 Err http://ppa.launchpad.net jessie/main amd64 Packages
 Err http://ppa.launchpad.net jessie/main amd64 Packages
404  Not Found

 W: Failed to fetch http:/ppa.launchpad.net/bitcoin/bitcoin/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found

 E: Some index files failed to download. They have been ignored, or old ones used instead.

So when I want to do this : apt-get install bitcoin-qt
I have : E: Unable to locate package bitcoin-qt

What can I do?

The repository is for ubuntu and you're on debian.
So it doesn't have packages for jessie.
Use this instead: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
Hope this helps! :)


Why Block Chain not Block Tree? Why is the Blockchain intended to be a chain and not a tree? Why do orphaned blocks get trimmed off?
Would you please provide a detailed answer.

I am not sure that I can rule out that something useful could be achieved with a tree of blocks, but let me walk you through a few thoughts and you can then tell me whether they answer your question.

When we're talking about Bitcoin, we should make clear what we're actually interested in achieving. We're talking about a decentralized system to track value, so to put it crudely, the main goal is to agree on who owns what. Additionally, we need a way to update ownership, or people wouldn't be able to transfer value.

In accounting systems, these two functions are generally fulfilled by a journal and a ledger. The ledger contains the current balances and the journal is a log of all changes.

You should think of transactions as updates to the ledger. But, since the network doesn't have a central party, what happens if some malicious party attempted to tell different parts of the network conflicting updates? How would network participants know which version of the update to apply?

To that end, Bitcoin has a lottery to elect temporary authors for the journal. To enter the lottery, participants pay with computing power, and when they win, they get to write one page of updates to the journal, i.e. author one block. Of course everyone else is watching the journal as well, so they have to stick to the rules and pick a valid set of updates. Regarding the "doublespending problem", this means that when there are multiple conflicting transactions, they can only chose a single one. Voilá, we now have a mechanism how to pick a ground truth in the network without a central figurehead!

You might have noticed that the ownership of value is not actually tracked in the blockchain! Rather, it's the Unspent Transaction Output Set (UTXO Set) that tells us who owns what. Where the blockchain corresponds to the journal, you can think of the UTXO Set as the ledger. While the ledger is the thing we're interested in, you need to apply the whole journal to compile the current ledger. So, in the end, the blockchain is basically a waste product of our desire to converge on a single shared UTXO Set.

Now, given our goals, it may seem a little more obvious, why we only want one single last page in the journal instead of multiple in parallel: otherwise, there would be multiple possible versions of the ledger and we wouldn't agree who owns which money!


How to read the asset quantity list of open asset protocol? I'm studying open asset protocol, however I have no idea how to read asset quantity list.

The Open Assets Protocol documentation tells that data in marker output

0xac 0x02 0x00 0xe5 0x8e 0x26

means

The asset quantity list:
                                   - '0xac 0x02' means output 0 has an asset quantity of 300.
                                   - Output 1 is skipped and has an asset quantity of 0
                                     because it is the marker output.
                                   - '0x00' means output 2 has an asset quantity of 0.
                                   - '0xe5 0x8e 0x26' means output 3 has an asset quantity of 624,485.
                                   - Outputs after output 3 (if any) have an asset quantity of 0."

Could you tell me how they calculate quantity of assets by the marker output?
I thought that 0xac is 13(c)*16^0 + 10(a)*16^1 = 173, but it seems the idea is not correct.

According to the Open Assets Protocol Spec, the amounts are encoded in something called the unsigned LEB128 encoding. So for 300 the binary looks like:

100101100

You have to pad to a multiple of 7 (we have 9 bits, so this becomes 14):

00000100101100

Now split into groups of 7:

0000010 0101100

Add in a 0 bit for the very first one, and 1 for every other group of 7:

00000010 10101100

In hex, this is:

0x02 0xac

Put this in Little Endian order:

0xac 0x02

You can do the same for the 624,485 number and get the 0xe5 0x8e 0x26.


Raspberry Pi 3 / Bitcoin Node / No space left on device / Link Database to External Hard drive / I was following @meeDamian Bitcoin node guide on a Raspberry Pi 3 and could get almost everything to work except that it stores the Blockchain on my USB Harddrive. Its mounted and I have disk space but it puts everything in my root folder.

Where and how can I specify that it gets stored on my USB Drive and can I just the delete the files in folder "blocks"

Thanks for your help

IMG: Node Logfile + Filesystem

You can tell the Raspberry Pi to use your usb drive as your root file system (rootfs). That would fix the problem.

I am also running a full node on RPi 4 and a 1TB SSD, and what I did was to flash Rasbian in the SSD as well as in the SD card. Then, after booting for the first time the RPi with the SD card and with the SSD unplugged, I told the RPi to boot from the SSD like this:

Connect your USB Hard drive to the RPi.
Change the id of the drive to something different so the RPi can differentiate the SD card from the drive. Let's set the id to 0xd34db33f by doing this:

sudo fdisk /dev/sda

Enter the next values to the options that are going to pop up next:

Command (m for help): p
Command (m for help): x
Expert command (m for help): i
Enter the new disk identifier: 0xd34db33f
Expert command (m for help): r
Command (m for help): w

Check that the PARTUUID of the SD card and the drive are different now by using the following command:

sudo blkid

the "/dev/mmcblk0p1" and "/dev/mmcblk0p1" are referencing the SD card, and the "/dev/sda1" and "/dev/sda2" are referencing the drive. So the PARTUUID of the sda1 and sda2 must be the one that we just setup (d34db33f) followed by a dash and the number of the partition.

Modify the cmdline.txt file to tell the RPi to boot from your drive like this:

sudo cp /boot/cmdline.txt /boot/cmdline.txt.bak
sudo nano /boot/cmdline.txt

Once in the file, find the variable root=PARTUUID=#######-02 and change it to the one that we just set. The line should look like this:

 console=serial0,115200 console=tty1 root=PARTUUID=d34db33f-02 rootfstype=ext4....

Exit by pressing CTRL + X, Then "Y" to save changes, and then ENTER to confirm.

Reboot the RPi:

sudo reboot

Make sure the RPi is booting from the drive:

findmnt -n -o SOURCE /

if it shows dev/sda2 then your good. If not, just recover your cmdline.txt file by using the backup we saved, and start over.

Finally, we will tell the RPi to mount automatically the drive and use it as the file system by modifying the fstab file:

sudo nano /etc/fstab

Once in the file editor, modify the second PARTUUID to the id we setup earlier. The file should look like this after modification:

proc            /proc           proc    defaults          0       0
PARTUUID=########-01  /boot           vfat    defaults          0       2
PARTUUID=d34db33f-02  /               ext4    defaults,noatime  0       1

CTRL + X, Y, and ENTER to save changes.

Reboot the RPi again, and That's it!

I had to resize my SSD after this, but I am not sure if you will have to. If you do, or if you need more details, this is the tutorial I followed:

https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/

All credits for the guy of the tutorial.


Where can I find early posts about Bitcoin where trolls are arguing over distribution? I'm doing research on Bitcoin and looking for early posts about Bitcoin regarding unfair distribution. I'm sure there were posts arguing the fact that most of the Bitcoins were in the hands of only a handful of early adopters. And how many?

Try searching BitCoinTalk.org, it has messages from Satoshi going back to late 2009, so I would assume if these messages existed they would be there.


Is it possible for the government to censor bitcoin by blocking ports? I am not very clear about the detailed aspect of the ports.

My concern is, is it possible for the ISPs to block these ports of bitcoin clients and therefore censor bitcoin, even if the internet is available. If they can, how bitcoin solve it. If not, please give me an understandable explanation.

Is it possible for the ISPs to block these ports of bitcoin clients?

Yes, it is. It is fairly trivial for most ISP's to control ports.

  And, therefore censor bitcoin?

Not easily. It is possible to configure Bitcoin Core to operate over the Tor network. Tor itself can be configured to run even behind a fascist firewall (it has settings labelled such), although, I encourage all to only act in a lawful manner.

Similarly, it is possible to configure Electrum wallet to operate over Tor.


Bitcoin Gold Fork - Replay Protection I was reading on replay vulnerabilities introduced by forks which only implement opt-in replay protection. Let 'X' be the 'legacy chain' (BTC) and let 'Y' be the forked chain (BTG). Now, if I understand correctly, in practical terms, an attack implies that a transaction 'G' on chain 'Y', can be replayed on chain 'X' (say transaction 'H'), hence the transacted amount will be deduced from coin stored on both chains.

I understand that if I move all (or part?) coin from chain 'X' to 3rd chain, say 'Z' (BCH for example, and let's call the transaction 'I'), prior to transacting on chain 'Y', the potential hypothetical 'attack' transaction 'H' cannot occur since the blocks on chain 'X' were already transacted to chain 'Z'. Do I stand correct?

Afaik segwit2x implements a similar way of opt-in protection, just that transaction 'I' has to be done to a specific address '3Bit....'. Is there a difference between the segwit 2x and my propesed protection mechanism, other than sending an amount of coin to an address which is not mine?

Bitcoin Gold was announced to have strong replay protection, a unique address format and a proof-of-work change. You will not need to do anything special to make sure that you're protected against replay attacks.

You may be interested in Jimmy Song's analysis here: Bitcoin Gold: What you need to know


Is mnemonic words -> mnemonic sentence standardized? I was reading the BIP 39, and noticed that it does not refer to how the mnemonic sentence, used for seed calculation, is composed from mnemonic words.  This is actually troublesome because in case of Japanese, the bip39 npm package joins the mnemonics with IDEOGRAPHIC SPACE(U+3000), the space character typically used as space for Japanese.  It seems that copay is using this library and thus follow this rule.  Some other implementation may decide to use (more machine-friendly) space(U+20), or something else, which makes remembering just the mnemonic words in sufficient for wallet recovery (in other wallet).

Question:

Is there any standard of how mnemonic sentence is composed from mnemonic words?

From bip39:

  To create a binary seed from the mnemonic, we use the PBKDF2 function
  with a mnemonic sentence (in UTF-8 NFKD) used as the password and the
  string "mnemonic" + passphrase (again in UTF-8 NFKD) used as the salt.
  The iteration count is set to 2048 and HMAC-SHA512 is used as the
  pseudo-random function. The length of the derived key is 512 bits (=
  64 bytes).

When normalizing unicode in NFKD form, characters that look the same become the same, so U+3000 becomes U+20. This may also cause length to change as composite characters are broken down into their constituent parts.


My passphrase doesn't work and I can't send any bitcoins from my wallet When I encrypted my wallet, I created a passphrase and wrote it down very carefully. Now, when I try to make a payment to an address, I received the following message:
"Wallet unlock failed: The passphrase entered for the wallet was incorrect".

I copied and pasted the passphrase so I know it's correct, and yet I'm receiving the above message. Does this mean I lost all the bitcoin in my wallet? Any help appreciated.

Does this mean I lost all the bitcoin in my wallet?

Possibly.

Try typing your passphrase into a text editor (notepad, vim, emacs, whatever) - If your caps-lock or keyboard settings are wrong you will see it.

If you are typing your wallet passphrase correctly and it is not accepted by your wallet then you almost certainly wrote it down wrong. You might be invoking the wrong wallet I suppose - maybe you tried out several wallets? Maybe on several devices?

In that case you should recreate your wallet on a different (but secure) computer using one of

your earlier backups of the wallet.dat or equivalent file
your safely written down private key
your safely written down wallet recovery phrase (not applicable to bitcoin core)


This will happen because you are upgrading from a non-segwit node to a segwit node. This behavior happens because Bitcoin Core will rewind the blockchain to the point where segwit was activated so that it can download the missing segwit data and verify that the blocks are valid.


Where can I find a survey on different fee estimation algorithms? I am looking for a comparison or summary of different fee estimation algorithms. Does anyone know of one? I would like to see what the best starting point is in order to see where optimization can be done.
From a cursory search, there is documentation for Bitcoin Core's fee estimation, but there are many other providers including APIs like Earn/Blockstream/Bitgo. They all provide estimates which are different from Bitcoin Core's estimation. I am assuming that their mempool is similar but their algorithm is different.
For reference, so far I have found
John Newbery's  outline on Core's fee estimation, a gist by Alex Morcos with a High level description Bitcoin Core's fee estimation algorithm, and of course the Bitcoin Core code itself.

TLDR: You can find some OLD 2019 DATA comparing their accuracy for one-hour estimations here: https://bitpost.co/evaluations
I asked myself this question about two years ago and wasn't able to find an answer. I then set out to build an app that measured how accurate fee estimations from various sources were. Below are the design choices and some OUTDATED results.
The first challenge I found was that fee estimations come under many different formats, some recommend in time horizon, others in a block horizon. I made the simplification of converting all time horizon estimations to block horizon estimations. This is questionable because some estimators might be more accurate because they take into account that certain epochs are faster than others (hash rate changes). However, this resolves ambiguous situations where a block comes around the estimation horizon: suppose you make a fee estimation for 20min from now, and the second block arrives at 20min 1 seconds, do you include that block or not?
Another important consideration is "What does it mean to estimate a fee of, say, 8 sat/B for a one-hour horizon?". Does it mean that in 80% of the cases that will be enough? Or 50% of the cases? Bitcoin core estimator has for example two modes of estimation "ECONOMICAL" and "CONSERVATIVE". So, the first time in measuring the accuracy of a fee estimator should be to assign a statistical meaning to the fee estimation. I call this, finding the implicit probability of a fee estimator: the probability for which, the fee estimator achieves its highest accuracy.
Below I paste from https://bitpost.co/evaluations/help an outline of the procedure I used:

First, the application 'observes' a type of recommendation and assigns a probabilistic meaning to each recommendation type. For example, bitcoin core's 'economical' fee recommendations could mean 40% probability of being a transaction with the recommended feerate (sat/byte) be mined while bitcoin core's 'conservative' fee recommendations could mean 70% probability.

The application gathers a recommendation and hundreds of transactions that arrive at the bitcoin mempool during this period (new pending transactions).

According to the target of the recommendation (2,3,4,etc. blocks), it waits until that target is reached.

The application, by analyzing what transactions were mined and which ones weren't, derives a range of correct recommendations. If the recommendation given is out of this range, the error of the recommendation is given by subtracting from it the correct recommendation.

In https://bitpost.co/evaluations I show some of the results that I got in 2019. One evaluation means corresponds to one observation that is considered valid for one-minute. The measured fee estimators were:

WhatTheFee: https://whatthefee.io
Bitcoin core (RPC command etimatesmartfee)
Earn: https://bitcoinfees.earn.com/api/v1/fees/recommended
BitGo: https://www.bitgo.com/api/v2/btc/tx/fee
Blockcypher: https://api.blockcypher.com/v1/btc/main
BTC congestion manager: https://fees.truelevel.io/api/v1/btc/deals
Mempool.space: https://mempool.space/api/v1/fees/recommended


Does a Node connect to all the peers? Does a Node connect to all the peers in the network? Or just a few?

If its just a few, how many?
If its just a few, what about if all of those nodes in the list are malicious?

A node is only called a peer if you're connected to it. So by definition you are always connected to all your peers.

I assume you're asking whether you're connected to every node in the network. The answer is no; most Bitcoin node software implementations only connected to around 8 others.

What happens if one is malicious? Bitcoin is trust-minimized by design. This means that it verifies to the extent possible whether incoming data is correct. Where this isn't possible, it uses a objective and unforgeable metric (proof of work) to select the winner in case there are multiple acceptable possibilities (blocks).

For most types of attacks, the assumption is that at least one of your peers is honest. If that's the case, you'll eventually learn the best valid version of history the rest of the network learns too. If all your peers are malicious, they may prevent you from seeing actual history - though it is very hard even in this case to forge and invalid version of history and convince your node of that.


Transaction inclusion into block What are reliable and good sources for understanding the procedure of transaction inclusion into a block?

Problem outline:
Given, there are multiple peers - let's say 5 - in a test network, where 3 nodes exchange transactions - let's say 100 - and 2 nodes include all transactions into blocks.
Which node decides how to include which transaction into which block?

Every node maintains a memory pool of transactions that are not yet accepted into the block chain, but they consider acceptable. The rules for this acceptability are complicated (they must be valid, they must not spend any coins already spent in the chain or by anything already in the mempool, various limitations to prevent denial of service attacks, fee and priority limitations, rate limits, ...). Any time a miner creates a new block, they generally use all available transactions from their mempool, constrained by block size limitations (so some transactions may not make it into one block, but could make it into the next one).


publicly available json-rpc node for bitcoin-cli connection There is a service provided by blockchain.info described on json_rpc_api page.
More or less it describes the API that user can use to access their blockchain similar way as using bitcoin-cli to own daemon.
It usage is currently demonstrated as:

$ ./bitcoin-cli -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo

It looks nice but there is an information on the site which states:

  From the 1st December 2014, in order to use this API, access must be explicitly enabled, and all client ip addresses whitelisted by the wallet owner. Manage access in [Account Settings] -> [IP Restrictions]

And that's the problem, because I'm interested just into fetching some block or transaction details. I don't need any RPC which would require authorization. I don't even want to create an account.
So the question is:
Are there any free services (or maybe it is still available on blockchain.info somehow?) which allows to use JSON-RPC against their bitcoin daemon?
I don't care about the speed or waiting 10 seconds between each call etc.

There is a free bitcoin-cli sandbox at bitcoindev.network:

  Here is a simple sandbox environment for trying out the bitcoin command line interface! Select Start Scenario to bootstrap your own private instance!

You can check out the on-line sandbox here:

https://bitcoindev.network/bitcoin-cli-sandbox/

Simultaneously they provide a docker container for it, so your students can go up & running with their own daemon in a blink of an eye.