How do I tweak the bip340_test_vectors to check that signature verification fails for other test vectors?

Disclaimer: This is an educational exercise. This Python code is for testing and should not be used in production or with mainnet Bitcoin. A private key of 3 is absolutely insecure.
There are two Python files in the BIPs repo reference.py and test_vectors.py which you can view by cloning the BIPs repo.
git clone https://github.com/bitcoin/bips.git

These two files are in /bitcoin/bips/tree/master/bip-0340.
If you run python3 test-vectors.py from within the bip-0340 directory you will get the output and error messages that are in the CSV file test-vectors.csv.
If you open test-vectors.py with your text editor e.g. vim test-vectors.py
you can edit any of the test vectors' secret key (private key), message, auxiliary randomness.
For example vector0 has the secret key 3.
seckey = bytes_from_int(3)

You could change the secret from 3 to 4.
seckey = bytes_from_int(4)

Save and close your text editor and then run python3 test-vectors.py again.
This will generate an AssertionError.
Traceback (most recent call last):
  File "test-vectors.py", line 253, in <module>
    vector0(),
  File "test-vectors.py", line 31, in vector0
    assert(not has_square_y(pubkey_point))
AssertionError

There is an assert that checks that for a particular public key (X,Y) (calculated from the secret (private) key) the Y coordinate isn't square. This is a check implemented due to a previous design decision to use squaredness as the tiebreaker for two Y coordinates. The tiebreaker is now evenness rather than squaredness. This test is included to catch when an implementer is mistakenly using squaredness rather than evenness. In this case the public key has a square Y coordinate.
Every private key (scalar) maps to a single corresponding public key (point). In BIP 340 we restrict ourselves to public keys with an even Y coordinate. This could lead to only half of the public keys being valid and hence only half of the private keys being valid too. Instead we say that every private key has a public key and if d.G has an odd Y coordinate we effectively sign with -d (the negated private key) instead.
Negated means taking the complement with the group order n
-m = n-m (mod n)
With that change you could say that every scalar is a valid private key but there are two private keys that map to the same public key. Only one private key maps to a public key with an even Y coordinate though. (Only one BIP 340 private key maps to a BIP 340 public key.)
Remember when you are finished experimenting you can use this to reset:
git reset --hard HEAD
This will discard the changes you have made and go back to the state of the code before you started experimenting.
Thanks to Pieter Wuille on IRC for some additions.


Unbreakablecoin - Block Height Stopped Moving

Also and all peers seem to have one thing in common: They have some reference to a single IP address of 71.71.215.6

That's unrelated. That should be your IP address.

Either you have become disconnected from the network or all miners have left the network.


How does a BIP70 url look like? I want to send my email to the person I'm sending my coins to.

There isn't any such thing as a "BIP70 URI" as I understand it.  To use BIP70, the client fetches a payment request from somewhere, typically an ordinary https url (which can also be embedded in a bitcoin: uri, see BIP72).  The payment request is passed to their Bitcoin wallet client, which generates the transaction as well as a Payment message which is sent back to the server at a given URL.  There is a memo field in the Payment message which you could use, but filling it in would be up to the user's wallet client.  I don't see any way for your payment request to instruct the software how to fill this in.

So you would have to tell the user how to fill in the memo field of the Payment message using their particular software (assuming their software supports it at all).  And if they should fail to do so, too bad - by the time you receive their Payment message the transaction has already been sent.  Though you could still refund their payment in that case (using the refund_to field of the Payment message).

If the user has already given you the address (e.g. entered it in a web form) then you could generate the payment request in such a way that the payment_url embeds their address (https://my.server.com/pay?email=buytickets@gmail.com).  Then when they send their Payment message to that url, an appropriate application on your site can record that address as being associated with the transaction.

Note that in all cases the user needs a lot more than just your Bitcoin address; you have to run a publicly available secure web server to negotiate the payment protocol, and the user will need its web address.


How to store Bitcoin values in a MySQL database? floats are bad.... right?

What you want is a MySQL Decimal field.

Specifically you want a DECIMAL(16,8)

That will give you 8 digits before the decimal and 8 after the decimal

See http://dev.mysql.com/doc/refman/5.1/en/precision-math-decimal-changes.html for details.


Why is the transaction priority removed?

Firstly, the priority mechanism was not a consensus rule. Originally it was just a few hundred kilobytes of space reserved in a block (100 kb IIRC) for transactions that had a high priority. But this was not a consensus rule; it does not have to exist. After blocks started getting full, many miners, out of the interest of getting as much income as possible, chose to stop reserving this space for priority. There is more money to be made by choosing a few hundred transactions that paid more fees than it was to choose a few hundred transactions that didn't but had priority. Since no one miner was actually using priority, Bitcoin Core removed priority from its fee and confirmation estimations so that the given values would be more realistic and the code would be simpler.

The following pull requests and the issues linked within them contain some of the discussions that the Core devs had when removing priority: https://github.com/bitcoin/bitcoin/pull/9602, https://github.com/bitcoin/bitcoin/pull/7022, https://github.com/bitcoin/bitcoin/pull/7008.


Why was giving someone else my 12 word backup a bad idea?

someone on blockchain support ask me to tell him my back up fund 12 word in order to reverse my bitcoin which was unconfirmed in my transaction

Sorry to say, you were definitely scammed.

You cannot reverse a bitcoin transaction in that way, the scammer only told you that so that you would give them the 12 word phrase. With that phrase, the scammer could recreate your wallet on another device and steal your coins.

Do not ever give someone your private keys, seed phrase, PIN code, password, etc. Any legit customer service will not ask you for this.


I don't know about any client that removed standardness checks altogether. However there exists some alternate clients with different default policy settings, such as Bitcoin Knots.


There absolutely are. As a matter of fact, Casascius already offers a 10 BTC silver round in addition to his better-known 1 BTC brass coins and 25 BTC gold-plated brass coins. While not coins per se, the same principal allows for bitbills and other physical Bitcoins.


I am reinstall my btc but balance and address not oldone?

With the Bitcoin.org client, the balance is calculated based on data in the blockchain data files.  If those files haven't finished updating, the calculation will not be current.

The way to check on this depends on which version of the Bitcoin.org client you are using.  The most recent versions (v0.6.x) will show the status at the bottom.  If is says "Synchronizing with network ..." then your balance may not show correctly until it has completed successfully.  When it is completed then a green check-mark will show in the bottom right-hand corner of the client.


Upper and lower bounds of the amount of bitcoins?

Yes, there are 21 million whole bitcoins, each divisible up to 10^-8.
Yes, transactions for fractions of bitcoins are quite common, just as transactions for fractions of dollars are common.  I could send you 0.00000001 BTC if I were so inclined.
I can give you 1 dollar or 100 pennies, but the existence of pennies doesn't really influence the exchange rate of the dollar.


As a miner, why would I forward transaction with high transaction fees to other miners?

Sure, they might. But the person who made the transaction wants to get it to as many miners as possible. And if it's a high fee transaction, all the miners want to get it. The nature of the Internet is that if Alice wants to get a message to Bill, and Bill wants to get that message from Alice, Charley can't easily stop them.


Bitcoin full clients checks all the blockchain every time they receive bloom filter?

They will not do so automatically. When a peer sets a bloom filter, the node will not do any additional work except note that there is a bloom filter set for a given peer and begin matching things against the filter. It will not go back in history to match historical data against the filter and then relaying everything that matches. Doing so would be computationally expensive and a way to effectively DoS a node.

Instead of giving a node the historical data, the peer that set the filter must ask for it. They do so by sending getdata messages for historical blocks and the full node will pull up those blocks, match them against the filter, and then send a merkleblock message. This way it's easier to avoid being DoS'd and the receiving peer can specify where the full node should start and stop so that it can get the data it wants as quickly as possible.


According to MultiBit's Getting Started, the wallet file of MultiBit seems to be named multibit.wallet, not wallet.dat. You might want to try searching for that instead.

Sorry to break the bad news, but the addresses aren't sufficient to regain control of the bitcoins. If that were the case, anyone that knew your address could grab your coins, and addresses are public information which would make for a very insecure system.

Therefore, you need your private keys in order to transfer your bitcoins.


A few others on top of my head, in addition to variations of PoS (DPoS, LPoS, etc)

Proof of Importance (PoI): kinda like PoS, but stake here is the total transaction amount (greater than some vested amount of coin)
Proof of Authority (PoA): transactions are validated by selected validators
Proof of Burn (PoB): please refer to this SE question: How does Proof of Burn work?


How to dump peers.dat file to a plain text file?

To my knowledge, there is currently no way to do this, so I wrote one.

The details of decoding peers.dat are described in my blog post Demystifying Bitcoin's peers.dat.

The result of that is an open source tool written in go that can read all peer info from peers.dat. As always, one should review the code before running this on any machine that hold a wallet. The tool should be able to work with any Bitcoin-based altcoin as well. I have tested it against Bitcoin, Litecoin, and Dogecoin peers.dats.

Installing bitpeers is quite simple, provided you have go installed, and your GOPATH set up. If not, go has a handy getting started guide which you can use to fix that.

Once go is set up, simply run

go get -u github.com/RaghavSood/bitpeers/cmd/bitpeers

If your go environment is set up properly, you should now have a bitpeers command available. If not, try finding your GOBIN (GOPATH/bin) and adding it to your PATH.

bitpeers to easily dump peers.dat addresses as either human-readable plaintext or JSON. It accepts three flags:

Usage of bitpeers:
      --addressonly       outputs only addresses if specified
      --filepath string   the path to peers.dat
      --format string     the output format {json|text} (default "json")

Running bitpeers --filepath /mnt/doge/.dogecoin/peers.dat --addressonly will produce a JSON array of all the IPs and ports in peers.dat. You can also pass the --format text option to produce a list of all IPs and ports, one IP:port per line.

Running without the --addressonly option will produce the full JSON/text output, which contains the following:

$ bitpeers --filepath ./peers.dat --format text
SerializationVersion: 34fc0100
Time: 1526192792
ServiceFlags: 0x000000000000000d
IP: 42.5.143.180:8333
Source: 8.8.8.8
LastSuccess: 1526746622
Attempts: 0

If you happen to find any inconsistencies or issues with the parser or output, please open an issue on the GitHub repo.


SHA1 was never commonly used in Bitcoin, but it there is at least one notable use of it, a P2SH script created by Peter Todd to allow anyone to pay to an address that could be spent by anyone proving they had found a SHA1 collision.  This bounty was claimed using the published results of several security researchers who generated such a collision.  Additional bounties remain open for other hash functions supported by Bitcoin: SHA256, RIPEMD160, SHA256d, and RIPEMD(SHA256()).

There may be other users of OP_SHA1.  Because of the way P2SH works (as well as segwit witness script hashes), we can't see what opcodes people have paid to until they've spent from those scripts, so we can't be sure whether or not any particular opcode is currently in use.

Outside of the Bitcoin Protocol, software commonly used in relationship to Bitcoin (such as Git and BitTorrent) continue to use SHA1.  Some projects (such as Bitcoin Core) have taken steps to protect their work with more secure hash functions in situations vulnerable to hash collisions.


Is BItcoin the only truly decentralized cryptocurrency?

There are many decentralized currencies, you can take a look here:

http://coinmarketcap.com/

Not all coins are connected to a company, the main big ones that are connected to a company are Ripple and Factom. Other coins might just have foundations that is responsible for marketing and other related matters, but they do not control the coin itself as the miners and coin holders do.


What if some group of people start sending small transactions from wallet to wallet just to make the blockchain bigger?

The current maximum size of a block is 1 MB.  Current block sizes are about half that, so the absolute worse case scenario is that the block chain grows in size twice as fast as it does now.  That's not particularly scary.
It's easy to create more than 1 MB of transactions every 10 minutes.  If anyone does that, some transactions can't be included in blocks.  However, at present, there are almost always more transactions available than miners are willing to include in blocks, so we're already at the point where miners need to choose what transactions get included.

For the most part, miners choose based on fee per kilobyte of transaction data, so transactions that pay more fee/kB get included in blocks sooner.  If someone wanted to, they could create large transactions that paid large fees in order to raise the transaction fee the rest of us would need to pay.  Since that would cost the attacker money every block without actually preventing us from using the system (if we were willing to pay the higher fees), it's also not particularly scary.


Why do bigger blocks make it more expensive to run a full node?

Short answer: For big players the cost is mostly negligible.

Longer answer (independent of the current block size debate):

Hard Drive Cost:
A bigger block will take up more disk space. Right now the block size is limited to 1 MB. If the block size is increased to 2 MB and assuming all blocks are always being filled to the max size then you will need about twice the hard drive space to store the same amount of 2 MB blocks as you needed for 1MB blocks.

Network Bandwidth Cost:
If block size is increased, a full node has to relay a bigger size block. Sending and receiving more data will have an impact on cost as well.

Real Time Computational Cost:
A full node has to hash a block and verify that the hash has n amount of leading zeros. Increasing the block size will result in hashing a larger amount of data which increases verification time.

Big O Complexity:
Big O would depend on whatever the Big O is for sha256.


Can Bitcoin be recovered from a child key alone?

Under the covers, my understanding is that a master private/public key will be created from the seed phrase. Then, a child key is created under the parent key for the address.

That's correct.

Now, suppose this user completely loses their seed phrase / master keys, BUT they somehow have a copy of the child key pair that contains their Bitcoin.
Is it possible to recover their Bitcoin from that child key alone? If so, what is the process? Are individual child keys just the same as normal (non BIP-32) key/pairs?

Key derivation is not part of the protocol. It is simply an approach wallets use to avoid the need to store backups of every separate key generated. Old wallet software (2009-2013 era) didn't use BIP32 at all.
BIP32 is just used to turn parent keys into child keys, and then those child keys are used for signing. As far as the protocol is concern, the parents don't exist.
So the process is exactly the same with or without: you sign directly with the child key. If you have that child you, you can sign, regardless of where it came from.


How does bitcoind choose its data directory?

Unless explicitly told otherwise, the datadir is always placed in /home/$USER/.bitcoin, there is no logic for automatically using any location other than this. The configuration file is always in the data directory as bitcoin.conf.


Given only a private key, is it possible to see if it has unspent bitcoin?

A Bitcoin private key always have exactly one corresponding public key from which the Bitcoin address can be derived. The derivation paths looks as this:
Private key -> public key -> Bitcoin address. If you e.g. only have the public key you can determine the bitcoin address, but not the private key. Given only the Bitcoin address you can in fact not even determine the underlying public key.

Therefore all you actually need to save is the private key, from which you can find the public key/address and check if there are any unspent outputs for it.

On top of that deterministic Bitcoin wallets have a clever way to derive determanisticly a nearly infinite amount of private keys, so all you then would need to keep safe is the seed for this derivation.


Migration from Bitcoin wallet (Schildbach) to bitcoin core

Just get an address from Bitcoin Core and make a transaction which sends all of your Bitcoin from the Schildbach wallet to the address from Bitcoin Core.


Do you own the address specified by the seller (as in, did you provide them the address)? If so, the seller probably wants you to confirm "yes, the address is correct" or something like that. If you don't own the address, I think you should ask the seller what exactly does he mean by that.

Generally, you don't verify a wallet. All the Bitcoin addresses verify their integrity by themselves (they have a checksum). Someone might ask you to verify that you are an owner of an address by making you sign some message with it, but that is quite rare.

I did a bit of search on the address you provided in part. Generally, unless you want to really hide that you own the address, there is no need to obscure any information about the addresses. In that case you wouldn't give any information. As it stands, I think you meant this address: 1Nf9iWh318w45Q1BY6cebPFp6YnYx4cPKB. From what I can see, you received a donation of 0.103BTC, so I'm guessing the seller sent you a bit of Bitcoins so you can check if the transaction went through and you received it correctly before sending you the full amount. If you can see the transaction in your wallet, you should go ahead and tell the seller that the address is correct and they can send the full amount.


use old offline phone as a hardware wallet?

electrum android app can do this! check it out, it's perfect!
also seems like a nice wallet with a lot of features.

your watch-only online electrum can create an unsigned transaction with QR code.
your offline electron can scan then sign it & generate a QR code for you to broadcast with online electrum!


Is there a way to import bitcoin wallet into BitcoinJ?

You need to pass DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS if you want to use it as a normal BIP 32 wallet. The sample code that you have should do the rest.


Why is not possible for a hacker to intercept the hashes calculated by a miner, and send it all himself as if he was a miner?

Miners don't send hashes, they send blocks. Blocks are public information to be broadcast to the entire network. When a miner completes a block, he sends it to nodes that he is connected to. Those nodes verify the block, and if they find it to be valid, they will send the block to the nodes that they are connected to. This peer to peer gossip is how blocks and transactions reach every node in the Bitcoin network.
An attacker an intercept a block, but that won't do anything for him. He would just become another thing relaying the block to nodes on the network.
Miners aren't paid by submitting aa block to something specific. They are paid by including a special transaction in the block which pays them Bitcoin by essentially creating them from nothing. There are rules about what amount this can be, so if it doesn't fit those rules, the block is invalid. The miner essentially pays himself and the rest of the network agrees on whether he is entitled to that payment. An attacker intercepting this cannot change the miner's payment without having to completely redo the proof of work, i.e. mining the block themselves.


It would probably be easiest and fastest to simply request addition testnet coin from a faucet. I'd suggest TP's TestNet Faucet which at the time of this writing is giving out 0.94 tbtc per request.

If this also doesn't work, it's possible that Coinbase's testnet node is down, in which case you'd have to contact their support team.

Please remember to return your tbtc to TP's Faucet once your done with it!


To create a blockchain using MySQL database

I believe you are over complicating your life.

Having a BlockChain (a Linked Ledger) in SQL can be prototyped in the following manner

Create a table, such as:

CREATE TABLE IF NOT EXISTS
MyBlockChain (
    LedgerID int(10) NOT NULL auto_increment,
    block varchar(255),
    datetimestamp datetime,
    guid varchar(255),   --Have a Default GUID Generated
    PRIMARY KEY( `LedgerID` )
);

Having an AutoGenerated Sequence Number (as a primary key) - This creates the sequence in your ledger.
Assign Proper Security to only allow INSERTS to happen over a Public API.
Only the GUID is used to access a Record (block) via ReadOnly permissions.
When users can only INSERT Data (No DELETE or UPDATE) you, in essence, created a Ledger.
And since the Sequence Number will be used to determine ordering of actions.

The biggest challenge to distributing the MySQL database over multiple instances an having an API interface and ensuring ReadOnly and Insert Only security.

That by default is a simple implementation of a BlockChain


The order must be causal. Most blocks today have outputs that were created earlier in the block.


what is blockchain.info testnet api url?

Have you checked https://testnet.blockchain.info/api?

For instance, to get a raw tx:

https://testnet.blockchain.info/rawtx/tx_id


How can I sign a bitcoin address that is on a paper wallet?

Import private key of bitcoin address (paper wallet) in Electrum


When a miner has found a block, he does not broadcast it publicly immediately, but waits until someone else is publishing a solution. He then makes surethat his solution is spreading faster on the network (by using several nodes spread around the globe). That way he selfishly prevents the other miner from getting his reward, gaining a competitive advantage in the long run.


the protocol allows a miner when he creates a block to send himself 25 BTC which do not have a proper source (input).

that's how those 25 BTC are created, they're bitcoins that come from nowhere.


Do transactions with null data take longer to confirm?

Not all miners accept transactions with null-data (OP_RETURN)
outputs
Not all nodes relay such transactions
Are you sure that your null-data transaction is standard (for clients 0.9.x+) ?

UPD: your output is 6a74686973206973206120746573740d0a and decoded to:

OP_RETURN // 6a
OP_DEPTH  // 74
OP_ENDIF  // 68 ... oups!

This is non-standard output. Because null-data output should contain only one OP_PUSH operation, not an arbitrary bytes


How can create individual wallet for each user

I would suggest using the bitcoind Account feature to track the different user 'wallets', this way a single 'wallet' or account can have as many address's as required which can all be be accounted for to that named account.  However I would also suggest not having this on your actual server, use a database to mirror what the bitcoin client shows, and hand actual withdrawals manually, (at least the larger ones) you may want to have a bitcoin daemon linked directly with a small amount of float to handle incidental day to day transactions.


Bitcoin 0.17 No public key shown (validateaddress)

validateaddress has changed to be separate from the wallet, so it cannot look up the public key information for an address. Use getaddressinfo instead in order to get all of the wallet information for an address, including the public key.


Bitcoin uses a gossip protocol to transmit blocks and transactions. When you connect to the Bitcoin network, your wallet becomes a node on that network. It maintains one or more connections to other nodes. When you send a transaction, you send it to all of the nodes that you are connected to. Then they check the transaction against their node policy rules (which also typically include consensus rules). If it passes all of the checks, the node will store it locally and then broadcast the transaction to all of the nodes it is connected to. And so on and so forth until all nodes have heard the transaction.

The same happens with blocks except that they are only verified against the consensus rules, there are no local policy rules for blocks.

There are things done to prevent nodes from receiving the same transaction multiple times. Most nodes, when broadcasting a transaction, actually first announce to all of the nodes it is connected to that it has a transaction. Then those nodes must ask for that transaction before it is actually transmitted. This way nodes won't receive a transaction multiple times since they are asking for the transaction, not actually being sent it right away.


Which Bitcoin mixer has the largest pool of customers?

you can always send coins to silkroad and withdraw them. i would think that they have a large pool since basically all coins that go through there get washed


How can I test and verify a vanity key before I send coins to it?

If you don't want to do it online, you can try to import the private key into Bitcoin-Qt then see if the matching public key is the one you expected.


Is there a way to get the address of associated with a transaction input with bitcoinj?

Yes, but be aware that there is no concept of a "from address" in Bitcoin. So you should always be prepared for unknown script types. For example, the sender could also be using P2PK, the oldest standardized form of payment in Bitcoin.


How can I access a bitcoind instance from another device with wallet functionality?

I have seen selfmade PHP frontends. May check google, forums, github or other sources. (want to avoid to post links there).

To answer the question properly: You can access the bitcoind instance through the RPC and do all kind of things. This indeed allows to use existing or selfmade frontends.

For reference on bitocin RPC check the popular forums or google up "bitcoin rpc commands"

If you intend a connection between a private server and you home server you could secure the copnnection additionally with a VPN for example.


Why does Steem fail to peg Steam Dollar to the U.S dollar?

The price of the Steem Dollar is completely dependent on market conditions, so it's hard to know for sure. However, you are most likely correct about higher demand from an external exchange, outside of the Steemit ecosystem. Even though SBD cannot be redeemed for actual USD dollars, there is still interoperability between coins (SBD to Steem for withdrawls) that allows for a Korean Steemit user to exchange through Upbit.

Steem Dollars is also listed on Poloniex, but there has never really been a high demand for it, because the IOU-backed Tether is also listed there. If you look at the price of Bitcoin and Bitcoin Cash for November 12, you will see that there was a very quick exodus out of cryptocurrency by Korean exchanges at the time. Seeking a safe haven, traders purchased large amounts of Steem Dollars at that time, causing the price to quickly lose its dollar peg to the north.


Are there any signatures where the recid (v) is equal to 29,30 (or 33,34 compressed)?

For random signatures, it is an extremely low probability event. Around 1 in 2128, so it will likely never ever actually happen.

However, you can easily construct a valid signature that has one of those, and the recovery algorithm will give you an actual public key for it. It just won't be a public key anyone actually knows the secret key for.


An authoritative resource for the history of Bitcoin

The official Bitcoin Wiki has a page about the History of Bitcoin. Also, the original Bitcoin homepage has a page with a brief history of Bitcoin.

This wiki is primarily maintained by the original creators and developers of Bitcoin.

I especially like

  May 21 2010 - laszlo first to buy pizza with Bitcoins agreeing upon
  paying 10,000 BTC for ~$25 worth of pizza courtesy of jercos

If you want authority, you can either visit the Bitcointalk forums and contact some of the oldest forum members. Or take a look at the official Bitcoin GitHub project were the lead developers are listed. (They are also listed on the Bitcoin homepage.)


What are the chances bitcoin big mining pools to unite and do 51% attack?

It won't happen if the bosses of the pools are all ideal.

In the real word, they may be lunatics or terrorists, they may be cheated or threatened. As long as they have the ability, the world is in danger.

The traditional security is based on economics, or on rational persons. That is not enough. The goal of cryptocurrencies is to upgrade the security to be based on cryptography.

To consider security like "they can but they won't" is no more than the traditional system, cannot reflect the superiority of cryptocurrencies.


how do I figure out the hash rate of my computer?

Bitminter has a Java test that, among other things, can give you an idea of your hash rate.


Where can I find records of blockchain branches?

There may be websites that index them, however, as blocks only get propagated once they get accepted as new best chain, such branches don't get relayed universally, and every node on the network can get a different view.

Bitcoin Core can be queried for known branches through the getchaintips RPC command.

For example, the output on my node is currently:

  {
    "height": 405040,
    "hash": "0000000000000000030014f0c61351fe2f9e744d4d1c111cca03c94b7dc831f0",
    "branchlen": 0,
    "status": "active"
  },
  {
    "height": 404812,
    "hash": "0000000000000000010f42545dadcf1262ceebcade6629b16282eb59265c937d",
    "branchlen": 1,
    "status": "valid-fork"
  },
  {
    "height": 404548,
    "hash": "0000000000000000010edc4bee21e25e976eb0515da5740d54d060d1579479fa",
    "branchlen": 1,
    "status": "valid-fork"
  },
  {
    "height": 404145,
    "hash": "0000000000000000014fc67e896071d9cc5345fea4d04795ff6ee8f9ae142268",
    "branchlen": 1,
    "status": "valid-fork"
  },
  {
    "height": 404120,
    "hash": "000000000000000002119743ab5f8bb12f5008373d3fb7dda9be82295cfa12d3",
    "branchlen": 1,
    "status": "valid-headers"
  },

This means the the currently active branch has 405040 blocks, but there are 1-long branches forking off at heights 404811, 404547, 404144, and 404119, so my node did observe 4 such forks in the past week. valid-fork means that my node discovered the branch was abandoned after fully downloading and verifying it. valid-headers means that it received the header, but was aware of a better branch beforehand.


Is there any way to buy bitcoins online without a fee?

Of course you may trade bitcoins with just anyone without having to pay fees to a centralized exchange.

I think Bisq (formerly BitSquare) may be the best answer to the question; decentralized, free for some definitions of "free", and very low risk due to the escrow system - but not completely without fees, indeed as of 2017 one may end up paying quite much higher fees on Bisq than on some of the centralized exchanges.  Well, let's walk through this ...

Fees and costs

You probably won't get away completely without fees:

There is the bitcoin transaction fee, a fee for getting the transaction included in the network.  Basically, you can't withdraw your funds from the exchange or move it from one wallet to another without paying a network fee (though internal transfers i.e. on an exchange may be for free).  As of 2017 it has become significant (i.e. 0.001 BTC, but can vary a lot), though not that bad if you want to turn over significant amounts of money (i.e. 1 BTC).  According to the protocol the fee is not mandatory, but a regular transaction without a fee paid is very unlikely to be included in the blockchain.
With many exchanges, one pays the exchange a withdrawal fee instead of paying the network fee.  The withdrawal fee is usually constant, and usually higher than the average network fee paid by the exchange.
Fees to the exchange ... any commercial centralized market place do eventually have costs and hopes to get investments recovered; I would be vary of a site claiming to be for free - though, some exchanges takes in most of the profits on margin traders.  Sometimes market makers pays less fee than market takers - sometimes it's opposite (on Localbitcoins market makers pay the full fee).
Arbitrator fee - on peer-to-peer-platforms (Bisq) where arbitration may be needed, one may have to pay a fee for that.
Spread - on any exchange there will be a difference between the bid and the offer.  If you need to buy bitcoins instantly, you will have to cover the spread.  If you have the time, then place a bid/offer just marginally better than the competition and wait for the other party to take your offer and cover the spread.  On the exchanges with highest volume, the spread will anyway be insignificant compared to the volatility.
Banking fees, for converting fiat to/from exchanges and/or other peers selling bitcoins.
Currency converting costs.  YMMV, but for me this is a relatively significant and a somewhat hidden cost of sending fiat to an exchange.  The exchange typically don't do trades in my local currency, and my bank gives me a pretty bad exchange rate when I send money to the exchange.
Even meeting up with other people to trade cash may be costly wrg of transportation costs and time taken.
Time is money - spend hours searching for the cheapest offers, and how many dimes did you save on it? (And how much did the bitcoin market value rise while you were searching for it?)

Risks

No method are without risks.

Bankruptcy - as for the centralized exchanges this is probably the biggest risk - one day you send money to the exchange, the next day the exchange is gone.  It does happen from time to time.
Funds on a centralized exchange being frozen for other reasons.  Your funds may be frozen for a variety of reasons - it does happen from time to time.
Bitcoin transactions getting stuck.  Not so much an issue when transferring from the bigger exchanges, but due to the block size issue a transaction may stay pending for arbitrary long if it appears the transaction fee was too low.  I have personally experienced twice that a transaction from an honest seller using "wrong" wallet software was timing out after 72 hours.  This became less of an issue in late 2017, as the default timeout has been increased to two weeks and because there is more often periods with idle capacity in the blockchain.
Money lost or stalled due to other technical issues - seldom an issue, but if using a "shitty" exchange it may happen.
Simple scams (mostly an issue if buying or selling bitcoins to random strangers without a proper escrow system in place).  Some payment methods are also reversible (particularly credit card payments and paypal payments) or easy to fraud.
Fake exchange scams (mostly an issue when selling btc); there exists several sites looking like legit exchanges, except they will just eat up your bitcoin if you transfer btc there.  It has also happened that an attacker has managed to highjack the DNS entry and get a valid SSL certificate for the exchange (openledger.info).
Money laundring; lots of the money in circulation comes from criminal sources, and you may become suspected of money laundry.  This may cause your funds to get frozen on centralized exchanges.  This may cause troubles with law enforcement if trading peer-to-peer.  Laws may vary between different jurisdictions, unless it ought to be obvious that the money comes from criminal sources you generally should be on the right side of the law, but having to spend time answering questions from the police is still within my definition of "trouble".  Some banks may even decide to freeze your account just because you're sending money to the exchanges.
Third party scams; mostly an issue when selling bitcoins (anonymous money) for bank deposits (trackable money), not so much when buying bitcoins - a fraudster tricks a victim (or gains unauthorized access to the bank) into sending money to the bitcoin seller, and tricks the bitcoin seller into sending bitcoins to the fraudster.  The victim gets angry with the bitcoin seller i.e. because he's expecting the bitcoin seller to send him an iPhone.
Outright robbery - may be a risk if doing cash trades (I've encountered some attempts on robbery myself when doing cash trades), especially when appointing meetings with random strangers in dark alleys, or if counting bigger amounts of cash on a public place with the wrong person watching.  If you expose that you have a lot of bitcoins i.e. through Localbitcoins and your identity and address can be found out, you may also receive threats ("pay one bitcoin to address 1... or else something bad may happen to your family" - I've experienced that, too).
Software bugs and malicious software; can you trust the wallet software, etc?  How to tell that i.e. Bisq does it's job, without any severe bugs causing bitcoins to be lost?

Other answers here are focusing on the best or cheapest exchanges.  I'll skip that and try to make an overview of alternative market places:

Bisq (formerly Bitsquare)

Bitsquare is a free and decentralized market place, it comes with a good escrow protection.  It does have some drawbacks though:

I managed to buy bitcoins through a "same bank"-offer, using my local domestic bank account.  However, I did need to know the SWIFT-code for my bank, and I did need to know how to convert an IBAN to a local account number.  YMMV, but I think this is a bit too difficult for quite a lot of people wanting to buy bitcoins.
It's an application, not a web site - meaning you need to install special software to access it.  Also, it's a graphical monolithic application that is supposed to be running 24/7, difficult to use on/from laptops and mobile devices.
You can't buy bitcoins without already owning bitcoins - you will need to seed the application wallet with enough bitcoins to cover transaction fees and escrow deposit
As far as I can see, there is no way to do free-text communication with the seller there.
There is a max limit for how much can be transferred in a single trade
Beware of the potential chain split in November - the maintainer has promised to follow the 1X-chain, so if SegWit2X should be successful, one may end up at the wrong side of a chain split.

Bisq supports bank payments (including local currencies and local banks) and convertions to/from altcoins, as far as I can see cash is not an option there.

You will eventually need to cover banking fees, and the bitcoin transaction fees will be higher than normal due to the complexity of the escrow transactions.

(Note: the author haven't tried Bisq for quite some time, the information above may be out-of-date).

IRC

The IRC channel #bitcoin-otc on freenode is also place where it's possible to trade coins with no middleman taking commissions.  I've never tried it though.

Mycellium

The mycellium wallet (android) has a cash-transaction built-in marketplace which is (as for now) without any fees - but if it ever becomes popular, the Mycellium team may decide to slap a fee on it.  During the last year, I've gotten close to 0 trades through the Mycellium platform, so I've given it up.

LocalBitcoins

With a 1% fee (paid by the advertiser), LocalBitcoins.Com (LBC) is an unlikely candidate on this list - but still, the fee is not mandatory to pay, one can "sneak" away from it, without violating the ToS.

If you search for offers on LBC, you will most likely find that there is a relatively big gap between the offers and bids.  If you don't need to buy bitcoins immediately, you can "turn the table" and put out your own "i buy bitcoin"-ad.

Telegram

On the telegram chat service there is a bot BTC_CHANGE_BOT.  I haven't tested it though, don't even know if it has fee structures.


Can I reuse blockchain/index files with multiple wallets?

You can swap wallets around and synchronise them up with the same block chain data files - you would just need to replace the wallet.dat files in the Bitcoin's data directory. The client would only synchronise once with the network and later be able to synchronise your wallet files independently. Keeping up with which wallet is synchronised and which isn't might be a bit of a hassle though. I don't know of a client that can operate multiple wallet.dat files simultaneously.


The Nonce is not difficulty based, the hash of the block is difficulty based. First, the miner hashes the block and checks if the block is solved. If it is not then the Nonce is incremented. If the Nonce overflows (which it does frequently) then the extraNonce portion of the transaction is incremented changing the Merkle Root and the block hash again, so the miner continues and again cycle the Nonce value.

There is some information here.

There is nothing stopping a miner changing locally the difficulty of the block it's mining, but such block simply won't be accepted by the other Bitcoin nodes.


Antminer S9 13.5Th/s is giving 9.5Th/s only

First of all - check your logs on the miner and then the status via the buildt in GUI on the 9S.

From what i can guess, one of your hashboards arent running.
And there can be several reasons for this.

Reboot the miner,
Update Firmware,
Check PSU,
Check Netcable,
and Check Fans

IF non of this helped you need to look into the logs more closely,.
a board might be defective.


How would one go about selling a large amount of Bitcoin?

Open an account at a suitable exchange that services people in your area. In the United States, Gemini (now called Coinbase Pro) would be a good choice. You should not be paying fees more than 1% of the prices you see on bitcoin pricing sites like coinmarketcap.

By my math, that would be about 320,000 bitcoins with a current value of approximately $900 million. (You'd have 320K BCH and BSV too, worth about another $80 million.) But it's hard to imagine that this story is accurate because it would have been very difficult to buy so many bitcoins in a single transaction back when the supply was so small.


Can I recreate the xpub key if I have multiple public addresses with their corresponding private keys?

No, it is not possible. BIP 32 uses a combination of a hash function and Elliptic Curve Point Multiplication in order to derive the child keys (both public and private). Since both hashing and EC point multiplication are one way functions, you cannot find the inputs to those functions given just the outputs (i.e. child public or private keys). Thus you cannot derive the parent extended public key or extended private key given just many child public or private keys.


How to convert script hash to base58 address?

Take your choice using bitcoin explorer (bx):

echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx sha256 | bx ripemd160 | bx base58check-encode -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc

% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx bitcoin160 | bx base58check-encode -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc

% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx ec-to-address -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc


After mining a block and getting a hash. What do i do next?

As a miner you first pick a set of transactions that you want to include in a block. Then you calculate the block header fields, add some randomness, and check whether that block candidate passes the difficulty requirement. If it does not, you create a new block candidate and try again.
When a block candidate fulfills the difficulty requirement, you have found a valid block. Your node then announces the block to its peers.
As the transaction set is picked as an input to the mining process, the block's content is already known. The block reward is paid out by the miner to themselves: the first transaction in the block, called the coinbase-transaction, pays the transaction fees and block subsidy to the miner. Each miner includes their own address in their block candidate's coinbase transaction, so whoever finds a valid block gets paid. Outputs of coinbase transactions can only be spent 100 blocks later, so only blocks that become part of the best-chain get paid.


This depends on the country you are in. In Brazil there is a company that does accept bitcoin. http://www.tecnisa.com.br/bitcoin


Given that you have the necessary computing power, how does a tampered blockchain get accepted by the network?

It does not matter how a miner broadcasts his blocks if he is performing a 51% attack. The blocks can be kept privately and broadcast later, or they can be broadcast as they are being mined. Either way, once his branch of the blockchain has more work (aka "longer") than the current blockchain, when that most recent block is broadcast, all other nodes on the network will switch to that blockchain.

Keep in mind that "the network" is not one entity that thinks together. It is a collection of independent nodes that make their own decisions; it just so happens that everyone's decisions are exactly the same so it appears as if "the network" is one entity. There is no way for "the network" to decide "everyone but this one node has a shorter blockchain" as it is not one entity but rather thousands of individual nodes. Verifying that this statement is true requires every node to connect to every other node on the network which is practically impossible to do.

And then of course, why shouldn't everyone switch to the blockchain that the attacker made? It has more cumulative work and is thus more secure. It is valid; the attacker cannot insert invalid transactions otherwise his blockchain would be invalid. The only reason to reject this is for human subjective reasons, not the objective reasons that a computer will switch for. In the end, it would come down to human decisions as many technical people would notice such a fork and humans may decide to switch back to the other chain by directly instructing their software to do so. The software itself will follow the valid chain with the most cumulative work.


What is the relationship of ckeypool and ckeystore?

CKeyStore is a class for storing keys. It provides the functions for storing and retrieving keys.

CKeyPool is a class for a key that is in the keypool. It is specifically a database object for storing a public key and its location inside of the keypool.

CKeyStore and CKeyPool are two different things and are largely unrelated.

The keypool is the set of keys that are unused. It is separate from CKeyStore and has an entirely different purpose. CKeyPool objects are specific to a CWallet which is a subclass of CKeyStore.


Bitcoin HD wallet forwarder without depending on a 3rd party?

I don't know of a solution that works out-of-the-box with the requirements you've set. However, you can do some of what you need using some command-line tools available on github.

Pycoin has a key utility which can be used to derive bip0032 addresses given a root. Here's a quick primer on how to use it:

$ git clone http://github.com/richardkiss/pycoin
$ cd pycoin
$ sudo make
$ ku <your xpub or xprv key> -s 0/1/2/3/4

This will show you the data on the bip0032 key at the path m/0/1/2/3/4. If you add the -a argument, you can get the address at this path. If you add the -W argument instead (using an xprv key), you get the WIF format. This WIF format can be imported to bitcoind and that in turn can be used to notify you and do what you need afterwards. You can delete that key after payment, which should generally leave the number of addresses being watched lower than it might be (though you'll want to purge every once in a while). This could work, but I would NOT recommend it as it's horrible security. Of course, that's probably why you're forwarding funds to another address right away, so that makes sense.

You're going to have to write some code regardless. bitcore is a fine library for doing HD wallet stuff, but the notification is always the tricky bit.


How are blockchain addresses pre-existent?

An address is an encoding of a 20 byte value. This value is just a number, from 0 to 2^160 (there are 8 bits in a byte, so a 20 byte value has 160 bits and a bit can be 2 values). Because we know what all of those numbers are, all possible addresses are known beforehand and already exist; they are just a number.


2048^12 = 2^132 << 2^256

It doesn't need to be able to describe every private key. You always start with the mnemonic, never calculating a mnemonic from a private key.


What was the timeline of the Bitcoin Unlimited Hack as of 2017-March and where was it in the code?

The commit implementing the fix was issued Mar 14, 2017, 3:16 PM GMT. A Github release was made at 7:39 PM GMT. It was announced on Reddit at 7:59 PM GMT. The vulnerability was discovered sometime before the git commit, but it's unclear how long before.

According to nodecounter, things were fine at about 6 PM GMT, when there were 776 nodes. That rapidly dropped, with 696 nodes at 7 PM GMT. It bottomed out at 11 PM, with 182 nodes. At 9 AM GMT the following day, things were mostly back to normal, with 626 nodes. I don't think it's very accurate to say that BU reacted abnormally quickly, or that 100% of nodes came back.

  Where was the hack in the code exactly?

There were two unrelated issues. Both issues were in how Bitcoin Unlimited responds to network packets asking for thinblocks.

Reachable assert.

BU had this code:

void SendXThinBlock(CBlock &block, CNode* pfrom, const CInv &inv)
{
    if (inv.type == MSG_XTHINBLOCK)
    {
        // code
    }
    else if (inv.type == MSG_THINBLOCK)
    {
        // code code code
    }
    else
    {
        assert(0);
    }
    // more code
}

(I've removed irrelevant parts to make it issue easier to see.)

This means,

If the request is a thinblock, reply in this way,
if the request is an xthinblock, reply in that way,
if it's neither, crash.

Why does it do that? I assume that the person who wrote this code assumed that this function would only be called for one of those two types of requests. This function is called in two places. In the first place where this function is called, that assumption is correct. In the second place, it is wrong. This bug was introduced May 2016 in this commit.

The fix is to DoS ban the node that sent the request, rather than crashing.
Unchecked return value

BU had this code:

BlockMap::iterator mi = mapBlockIndex.find(inv.hash);
// code code
if (!ReadBlockFromDisk(block, (*mi).second, consensusParams))
    assert(!"cannot load block from disk");

The problem here is that if inv.hash does not exist in mapBlockIndex, the first line will return mapBlockIndex.end(). The next line will then pass a null pointer to ReadBlockFromDisk. Then, the node will crash. This bug was introduced Jan 2016 in this commit.


Is the `addmultisignature` API call dependent on order of public keys in the array? Or is it lexicographically sorted?

Is the addmultisignature API call dependent on order of public keys in the array? Or is it lexicographically sorted?

Yes. It is not sorted according to BIP67 automatically.
How did I confirm?
I used the below command in bitcoin core:

addmultisigaddress 2 "[\"0318370919cfceb3d260081eeca3cae19f941eec321f597c48a64839178ea1e3e0\",\"03e783b8cf0474f732cc5d89cc893c25ab8a487785eb541a3ba0b26cfdd38c5c19\",\"02667b6e09a4a82b12cc8e5611373f28673f2cdd2e42b2f7e89825ec82b7f9b054\"]"

to get the multisig address details:

{
  "address": "tb1qlfu3fy8apmm4j73kzlxh9s09rtu6vzeru3l0asfd5ylwfqs7e0zs3hfdpt",
  "redeemScript": "52210318370919cfceb3d260081eeca3cae19f941eec321f597c48a64839178ea1e3e02103e783b8cf0474f732cc5d89cc893c25ab8a487785eb541a3ba0b26cfdd38c5c192102667b6e09a4a82b12cc8e5611373f28673f2cdd2e42b2f7e89825ec82b7f9b05453ae",
  "descriptor": "wsh(multi(2,[85ac4db2]0318370919cfceb3d260081eeca3cae19f941eec321f597c48a64839178ea1e3e0,[90060439]03e783b8cf0474f732cc5d89cc893c25ab8a487785eb541a3ba0b26cfdd38c5c19,[98725f4c]02667b6e09a4a82b12cc8e5611373f28673f2cdd2e42b2f7e89825ec82b7f9b054))#qmw7suql"
}

Tried using the same public keys and the order to create a multisig address in caravan and got the warning that keys are not ordered.

Multisig address and Witness script returned are same for both. It changes when I order the keys in caravan:
Address:  tb1q6xnkaa3sej2x580yjc5j20pcy6x0ddxxc8a9ajlvvn2de2htvvpsnp95vd
Witness Script: 522102667b6e09a4a82b12cc8e5611373f28673f2cdd2e42b2f7e89825ec82b7f9b054210318370919cfceb3d260081eeca3cae19f941eec321f597c48a64839178ea1e3e02103e783b8cf0474f732cc5d89cc893c25ab8a487785eb541a3ba0b26cfdd38c5c1953ae


I somehow sent a transaction to my own wallet address

Welcome to Bitcoin. The "balances" in Bitcoin are actually explicitly tracked bits and pieces. You can think of it akin to the coins and bills of cash: when someone sends bitcoins, the transaction explicitly states which coins or bills get spent, and describes which new ones to create. We call these bits of bitcoin unspent transaction outputs (UTXOs). In most Bitcoin transactions, the UTXOs you have in your wallet will not perfectly fit the amount you are trying to pay. In that case, your wallet software will automatically create a new UTXO that sends the remainder back to yourself. Imagine if you go to the pub and pay for a £3 pint with a £10 note. The bartender gives you £7 change. In Bitcoin, the equivalent to the £10 note would be you spending a UTXO from a previous transaction as an input to your new transaction. The transaction input consumes the £10 note and the transaction then creates two new UTXOs, one worth £3 for the bartender and one worth £7 for yourself.
What I'm trying to get at is, that in most transactions you will pay the receiver and yourself: in order to return the remainder as change to yourself. I am wondering whether that's what you are seeing in this transaction.
If you in fact only paid yourself, you're fine as well. You may have split your bitcoin funds into two UTXOs now, but your wallet is capable of using multiple of them in a transaction together.


Should fractional reserve banking be prohibited through the bitcoin protocol or otherwise, and how could such a change be implemented?

No, you can't prevent fractional reserve banking technically. For example, IOUs can circulate just like Bitcoins and there's no technical means to stop it. Essentially, anything worth X Bitcoins (once risk and the like are factored in) can act just like X Bitcoins, even if it's not X Bitcoins. And since it's not Bitcoins, nothing Bitcoins can do can stop it.

Unless you foresee some massively powerful central coercive authority that prohibits it, you will always have fractional reserve banking. It just makes too much sense. It will happen absent the use of massive amounts of force.

There are trivial technical fixes to the "run on the banks" problem. However, there is still the very real "the bank is a crook" problem and the "the bank goes broke due to fundamentally unsound loans" problem.


Fine tunning a Rapsberri Pi 2 B+ full 0.12 node

You do need to store data on an external SSD disk (USB).

If your data and swap are on SSD media, you can use all those options (they won't matter much).

I don't recommend to use Pi 2 (any version), it's a waste of time. It can barely keep up, it becomes useless for anything else and each time you restart the OS or bitcoind you need to wait several hours for it to catch up.


How the hell was I able to receive BTCs via an address I do not own?

As Murch says one possibility is that this address is in your keypool. Another is that this is a change address the client created. If you're willing to share the relevant transaction we may have more to say.

Owning an address means "being in unique possession of a corresponding private key". It's difficult to know if you're the only owner, but verifying you have a key is easy - ask bitcoin-qt to sign a message with this address.


Dynamic coinbase as incentive to fill blocks

This adds an incentive to fill blocks with ANYTHING that will take up space in the block. There are many different ways to incentivize including transactions, but they can typically be gamed because miners can create transactions themselves, and they gain all the fees from those transactions right back into their coinbase transaction.

Your suggestion, which has good intent, would likely cause miners to be incentivized to fill their blocks with meaningless transactions, and increase the already ever-increasing size of the blockchain, making it harder to run a full node.


See the balance without load the transaction history

Sure, if you know the addresses of your wallet, you can look it up in a Bitcoin block explorer, and find the current balance of each address. There are also wallets, like Electrum, that will use third party nodes to track your balance, but cryptographically verify everything to ensure the third party node cannot lie to you.


Can someone recognize any two addresses (generated by hardware wallet) come from the same hardware wallet/mnemonic seed?

Although there is no link between your addresses alone (someone would need your seed, xprv, or xpub for that) you do leave some residual identity once you start spending.
For example if your wallet builds a transaction where two or more of your previously unassociated addresses are used as inputs in the same transaction, then it may suggest that the spender owns both (or more) of those addresses.
Wallet technologies exist that attempt to muddy the waters of those trying to surveil by combining multiple unrelated coin owners to sign a single transaction together with multiple inputs. Basically disproving the assumption that multiple addresses as inputs in the same transactions means one owner owns all the inputs.


This was a learning experience for me too! I wasn't sure how to extract keys on Windows, and had to work my way through it. This is what I did on Windows 7.

Before you do anything: backup your wallet!

Bitcoin-Qt does not have these as commands in it's GUI, so you need to use bitcoind.

Close Bitcoin-Qt
Open Command Prompt
Enter the command:

"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" -server

or if that doesn't work, try
"C:\Program Files\Bitcoin\daemon\bitcoind" -server

(The -server switch tells bitcoind to accept commands.)

That CMD session should freeze and become unresponsive--just minimise it; that's Window's way of telling you it's working.
Open another Command Prompt and type:

"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey [ADDRESS]

Where address is the full public address.

So, I might enter "C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey 18gcVuGVgJSPswQML7LbxQBFEmBgrEwtuW

Do this for every address you have bitcoin(s) in or want to keep.
Write down all of your private keys.
Close both CMD's, delete your wallet (not the backup), and redo steps 2 and 3. (This will create a new wallet for you to use.)
Enter "C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey [PRIVATE KEY] [LABEL] into the 2nd CMD instance.

So for example "C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ OldWallet


Are you asking how to decode the JSON? Unless I'm missing something, that would just be json_decode($response)['data']['forwarding_address']


what are the implications for how the double-spend problem is addressed?

The solution to the double spend problem does not change.  Participants of the lighting network hold valid transactions for actual bitcoin.  Because bitcoin cannot be double spent, the lightning network doesn't have to solve this problem.

  This is presumably handled in the software layer, under the knowledge that people must firstly stake a quantity of bitcoin in order to support the electronic IOU's.

Despite the fact that the transactions haven't been broadcast, I wouldn't consider money on the lightning network to be just an IOU.  While it is still unsettled, it's more complete of a transaction than what we typically think of as an IOU.  The smart contacts, themselves, make the exchange on the lightning network effectively irreversible.

  doesn't LN essentially become almost in a sense a 'Bitcoin backed' new cryptocurrency?

No.  If that was true, then credit card transactions would be a separate dollar-backed currency.  Lightning is a method of exchanging bitcoin.  That doesn't mean it's a new currency, just a means of moving money.


Does hardware specialization provide security against 51% attack via on-demand computing?

It depends on what hardware the on-demand computing is offering. Hardware specialization might make a cryptocurrency less vulnerable to attack from inefficient on-demand hardware, like a botnet. But as hardware becomes more specialized, the on-demand hardware leasors tends to upgrade their hardware to stay competitive.

Keep in mind that the effectiveness of one's mining is relative to the total hash power of the network. If everyone on the network doubles their hashing power, everyone will continue earning the same # of coins after the difficulty adjusts.


Can anyone explain these bandwidth download spikes that are linked to bitcoind?

The green in your graph indicates outgoing traffic. More than likely, those spikes indicate transfer of blockchain or unconfirmed transactions to newly-initialized nodes in the Bitcoin network.


Your Bitcoin-core wallet will need to finish syncing with the network before it will display your balance.


According to yesterday's article about this in The Guardian, the Australian Federal Police released the following statement about the raid, stating that the raid was not related to any involvement that wright may (or may not) have had in inventing bitcoin:

“The AFP can confirm it has conducted search warrants to assist the Australian Taxation Office at a residence in Gordon and a business premises in Ryde, Sydney. This matter is unrelated to recent media reporting regarding the digital currency bitcoin.”

The article goes on to reference the Australian Tax Office's involvement in the raid, and a recent interview between the ATO and Wright which focused on Wright's bitcoin holdings.  Capital gains on the sales of appreciated bitcoins are subject to tax in Australia, so some are speculating the raid could be about back taxes that Wright may be subject to from his bitcoin holdings.


So were these 'premature' halvings due to the positive rate of change of hash rate?

Bitcoin is designed to keep the block time at 10 minutes. The difficulty increases/decreases as the mining hash rate increases/decreases. At this 10 minute rate the the halving event comes every 4 years. As miners started using ASIC chips to mine blocks, the average time came down and that led to slightly lower halving time.

  could a hash rate collapse lead to a delayed halving event (i.e. adding the current 210,000 blocks takes longer than 4 years)?

If hash rate declines continuously so that even after difficulty gets adjusted to account for lower hash rates, miners continue to lower their hash powers, then it could take longer than 4 years.


Algorithmic efficiency for transaction lookup in blockchain

No, you can't. The block chain is a linked list of blocks, and each block contains an array of transactions. Block headers commit to a Merkle tree of the transactions in them, but they are sorted chronologically, not by txid, so you need a linear search. If you want to find a transaction in a block quickly, you'll need an external index data structure.

There is however also no need for that in normal operation of a Bitcoin node or wallet.

For verification, a set (which is internal to the operations of a node, and not part of the block chain) of unspent transaction outputs is maintained, indexed by txid (the so-called UTXO set). This set represents the 'state' of the ledger at a given point in the block chain, and blocks can be seen as 'patches' to the UTXO set: transaction inputs remove ("spend") entries from the UTXO set, and transaction outputs create new ones.

Wallets maintain their own set of transactions relevant to the user's balances. These are typically indexed, but much smaller than the set of all transactions in the blockchain, and often just kept in memory.


why is bitcoin leveldb separated in so many small pieces?

At the moment I try out creating my own leveldb I understand.. The chainstate folder itself is the entry point of the database; all the files within it are just the data.

This is what the data looks like after I put some dummy data


What are the "Know Your Customer" challenges that Bitcoin faces?

TL;DR

Businesses in the Bitcoin space face no special challenges to implement KYC regulation, except the privacy oriented mindset special to some bitcoin users. However, it is impractical to enforce KYC regulation on the entirety of the bitcoin network itself.

Long version below

Know Your Customer (KYC) regulation applies to financial institutions and other regulated companies such as for example money transmitters and currency exchanges. It's stated goal is to make such companies report potential money laundering and to protect against identity theft.

The core component of KYC forms around following a Customer Identification Program, which means that the above introduced institutions have to form a reasonable belief that they know the true identity of each customer. This means that in order to comply with regulation they will require their customers to validate their accounts. The companies don't face any special difficulties whatsoever, except that there might be a slightly bigger number of Bitcoin users that will be adverse to their services due to KYC requirements.

On the other hand, companies that offer comparable money transmission services as the bitcoin network itself would be required to implement KYC regulation. It is possible that at some point in the future a country might require by law Bitcoin users to disclose their bitcoin addresses. However, that would be impractical – if not impossible – to enforce, as, due to the decentralized nature of the Bitcoin network there is no central entity that could be forced to disclose such information about other users and there would be any number of participants that would have to be monitored and brought into compliance in order to collect such address information about their business partners. Additionally, even if associated to certain addresses through business partners informing on them, in most cases users would be able to plausible deny control over said addresses.


How to generate btc addresses from XPUB?

You can use https://github.com/denpamusic/php-bitcoinrpc to call methods defined in Bitcoin Core API Documentation.
Getting addresses from xpub: https://bitcoincore.org/en/doc/0.20.0/rpc/util/deriveaddresses/


What is the schema of the data stores used by the reference client?

There are the bitcoin-tools by Gavin Andresen but they will only work up to version 0.7 of Bitcoin-QT. If your goal is to simply check whether the blocks are version 1 or 2 I suggest you do something like this:

MAX_HEIGHT=`bitcoind getinfo | grep blocks | grep -oE '[0-9]+'`
MIN_HEIGHT=210000
for HEIGHT in `seq $MAX_HEIGHT -1 $MIN_HEIGHT`; do
  HASH=`bitcoind getblockhash $HEIGHT`
  VERSION=`bitcoind getblock $HASH | grep version | grep -oE '[0-9]+'`
  echo $HEIGHT,$HASH,$VERSION
done >> block-versions.csv

This will get you a Comma-Separated file with the block's height,its hash and version.


BitFinex API call returns 400 bad request - "Could not find a key matching the given X-BFX-APIKEY"

You see the API key once, when it's generated.

You have to generate another one.

It's sorta mystifying that they would show the API secret whenever you look at that page, but only show the API key once. I dunno why they did that.


Unable to remotely access lightning-charge

After a lot of research I found the solution to my problem.

I didn't know this, but in nodejs there's a huge difference if your server runs on 127.0.0.1 and on 0.0.0.0.

It isn't said in the lightning-charge docs, but except the --port attribute you also have --host which you can set.

Starting lightning-charge with this line charged --api-token mySecretToken --host 0.0.0.0 fixed all of my problems. Gosh was that an unpleasant journey!


create HD wallets?

No, but this is something being worked on.

  import HD wallets from other wallet software?

No, HD wallets being transportable between software like this is unlikely due to the wide range of implementations. An Electrum seed is unlike an Armory seed is unlike a Bread wallet seed.

  watch HD wallet? (watch transaction or notify changes)

Only if you importaddress for a large number of future addresses which is cumbersome.


Source: https://btc.bitaps.com/blocks
blockchain.com mentioned unknown for block 649390
Whereas btc.bitaps.com shows "Huobi" as mining pool for the same block: https://btc.bitaps.com/649390
Coinbase text: =h_HZ/HuoBi/mmwta@F,Cn3ǐIK(


Try caps-lock ?

If you do not know your password it is very difficult. If you search there are other questions like this one discussing software to possibly recover the password.


I LOST MY FUND EVEN ALREADY IMPORT WALLET

Check the wallet version, was it copay the wallet you initiated the seed from? If not, the derivation path for your coins may be different, please check: https://walletsrecovery.org/
They've changed multisig derivation few times, I think there is a link to recovery tool for older versions.
Be aware that your mnemonic is dependant on the arrangement of the words, they have to be imported in the direction from 1st to 12th.


Bitcoin sent, recipient claiming not received

The address received 0.07014343 BTC in 3d727e3f4565e011c0348f813c2d5480210b6bae2003a0f7abaa949d1a7c599a. These coins have already been spent, so at the very least the recipient's wallet provider is aware of the transaction. Depending on the type of wallet, the recipient's account may not have been credited due to internal system issues.

Alternatively, the recipient has received the funds and is trying to scam you for an additional payment.

In either case, your initial transaction is successful, and the recipient needs to work with their wallet provider. You should not send them any more funds.

Checking if a transaction is complete

Due to the attention this question is receiving, I'll go through some of the best practices when checking the finality/completion/status of a transaction.

For a Bitcoin transaction to be complete and irreversible, it must be mined into a block.

To check if a transaction has been mined, you can check a block explorer. Block explorers are websites that read information from the blockchain and make it accessible to people who are not running their own node. Some commonly used explorers for Bitcoin are blockchain.com, blockchair.com, blockstream.info, and btc.com (no affiliation to any of these).

When you look up the transaction, such as with the link above, you're presented either with a page detailing the transaction, or some form of a not found error.

If a transaction is not found, it has almost certainly not been mined - in this case, you should aim to rebroadcast the transaction instead of sending a new one. It is possible that the transaction has actually been broadcast and just not picked up by the explorer yet, so sending a second one may result in a double payment.

If a transaction is found, it may be listed as unconfirmed. In this case, just wait until it is confirmed. If a transaction is already confirmed, you should see some indication of the block it was mined into (either in the form of a block number, or a block hash starting with a bunch of 0s). If a transaction is confirmed, then it is complete and irreversible.

The recipient says they didn't receive the coins

There are a handful of scenarios in which the recipient may not see the coins even after the transaction is complete:

The recipient's wallet is out of sync/not updating correctly - this is a more common scenario when using exchange or other hosted wallets, or using a regular wallet with a spotty or weak internet connection. In this case, the recipient must check with their wallet provider to locate and credit the coins.
The address is incorrect - Either you made an error while copying the address, or the recipient provided an incorrect address. In this case, you should work with the recipient to figure out who needs to absorb the loss as the coins are most likely irrecoverable.
The recipient is attempting to scam you - once a transaction is complete, only the recipient can access, locate, or otherwise try to work with the coins. If they insist they haven't received them, it is not due to an issue on your side, and you may be getting scammed.

Things to note

Do not use an explorer recommended to you by the recipient - it is trivial to build an explorer that hides certain transactions and makes you believe they are not complete when they are. Always use multiple third party explorers if you must. Ideally, you should run your own instance of Bitcoin Core with -txindex enabled and check the transaction yourself, but that is not feasible for many users on short notice.
If you really do need to resend the coins, first make a transaction to your own wallet that sends the entire balance to yourself and wait for that to confirm. This prevents you from accidentally paying twice if the initial transaction was simply not broadcast properly.
Be patient - transactions with low fees can take a couple of days to confirm during high network activity periods - if you see an unconfirmed transaction, just wait.


Ripple doesn't support anything like this directly. You could get the effect if you really needed it though. Simply create a new account and extend the amount of total trust you want to that new account. Then have the new account extend the individual trust to each of the other accounts.

This will mean that people paying you with IOUs from any of the accounts in the group will have to ripple their payments through the new account you created because you won't accept those IOUs directly. You will wind up with IOUs from the new account regardless of which IOUs from the group they try to pay you with and your new account will hold the real IOUs. So the credit you extend to the new account will limit the total amount of IOUs from that group you can hold.

When you make an outbound payment, you'll go through the new account and reverse the process, trading in the IOUs from the new account for the "real" IOUs.


How does the mathematical problem get harder for bitcoin mining over time?

The Bitcoin blockchain has a property called the "difficulty" or "target", which is expressed as a 32-byte number. For a new block to be valid (among many other things) it's hash (another 32-byte number) must be arithmetically less than the target. This target value is adjusted after every 2,016 block period by a deterministic algorithm performed by all full nodes on the network.

Imagine if I asked you to flip a coin and if you got 3 "heads" in a row you win. How many attempts would you need to win? Once you win, I change the difficulty: now you must get 4 "heads" in a row... that will be harder for you and require more "computation" (attempts).

In Bitcoin, the difficulty adjustment algorithm looks at the time stamp of the block at the start and end of the 2,016-block period. If that time is greater than two weeks, the new difficulty target becomes "easier". If the blocks are being mined too fast, the difficulty becomes "harder".

further reading: Where exactly is the "off-by-one" difficulty bug?


In what way does Spectre have "weak" liveness?

The paper explains this:

  The  “weakness”  of  the  Liveness  property  corresponds  to  the
  fact  that  we  do  not  guarantee (though  it  is  still  hard  for
  an  attacker  to  prevent)  a  resolution  in  case  conflicting
  transactions were published soon one after the other. Contrast this to
  traditional consensus protocols, where all conflicts are required to be
  decided in finite time, a property usually referred to as
  Liveness. Observe, however, that an honest user of the system will
  never publish conflicting transactions,and will transfer money only
  after he robustly accepted the original funds (the inputs)
  himself; payments of honest users are thus guaranteed to meet the
  conditions formalized in Weak Liveness, and  to  be  robustly
  accepted.  On  the  other  hand,  an  attacker  trying  to  defraud
  must  keep  his attack secret before publishing the conflict, until the
  victim robustly accepts; but then the victim is  guaranteed  that
  w.h.p.  his  transaction  will  not  be  reversed.  Therefore,  these
  two  properties together  ensure  that  payments  of  honest  users
  will  be  robustly  accepted  in  constant  expected time, and that
  they remain robustly accepted forever, w.h.p.


Can a transaction be created by 2 different wallets?

Yes. There's a project called Lighthouse that does something very similar. Bitcoin transactions either completely succeed or completely fail. We can use this by starting with a transaction that has the outputs we want.

--> TX -- 0.5 BTC --> Charlie

This is invalid, because it doesn't have any inputs.

We add Alice's input.

Alice --> 0.25 BTC --+
                     +--> TX -- 0.5 BTC --> Charlie

This is invalid, because the transaction creates more in outputs than it takes in inputs. It can't be partially spent, either. It's all or nothing.

We add Bob's input.

Alice --> 0.25 BTC --+
                     +--> TX -- 0.5 BTC --> Charlie
Bob   --> 0.25 BTC --+

Now the transaction is valid, and can be pushed to the Bitcoin blockchain. Modifying it will require Alice and Bob to re-sign it. If we want Bob to have some Bitcoins at the end, the procedure is the same, except we start with outputs that pay both Charlie and Bob.


Is there some website that aggregates all the Bitcoin exchange prices so small businesses can find out the current market rate and react accordingly?

bitcoincharts.com is one of the more popular ones:

http://bitcoincharts.com/


Signatures are how all bitcoins are proven to be able to be spent by the owner of an address. If you receive bitcoins to an address, that address will generally correspond to at least one (maybe more in a multi-signature address) ECDSA private key, which is used when you spend those bitcoins later. But for other nodes to verify signatures to make sure all transactions are valid, that takes work, so there is a limit of how many of these signature operations a block can contain. That makes sure a block doesn't put too much workload on nodes verifying it. That limit is the MAX_SIGOPS.


Could someone provide an example of a tx spending from an input with a relative LockTime?

If you look at https://blockstream.info/address/bc1qdv0fk4c73fem89s708pzdny8q25d7k5nrckckp87c8alwaw803fq3mqrpz you will see that there are two transactions.

The first one  https://blockstream.info/tx/943f18e17aa2ba716f2d13785268a1bd6b25c39d2718f3b4785559a5eeaba883 is the funding TX to open the payment channel included in block 587093 (at least according to what was send over gossip)

The second one https://blockstream.info/tx/a175425ee2f3c01acc97ef32ab1082db14eaa94e5af4c54f02f3b01dec72558e is the force closed timelocked commitment tx included to block 587314

The output 0 of the commitment tx has a relative timelock and was self spend / sweeped with this transaction https://blockstream.info/tx/0be2b9a3a6a9dc99443d6ce7bd3beaf33c713a4938af3bf0fec1e918257bbd32 which was included in block 588801

If you decode the transaction you see nothing special

304402204a54d94068512c22847cc07fa85f2b93feaf758411920a9b20ce9b85831e8aa5022005924cb82c331c5173e21477a4d8298eb25c0d967ace065b883455f2537c3d0a01 <empty> 632103f96d73ffe138690f032e97408af933a71782ad27a28df66a750b48c56b2d7fa96702cf05b275210304f332f50363cd01b679d9fb50fb8691fb0fb638737867bd02f06850c6191a2268ac

p2wsh witness script
OP_IF OP_PUSHBYTES_33 03f96d73ffe138690f032e97408af933a71782ad27a28df66a750b48c56b2d7fa9 OP_ELSE OP_PUSHBYTES_2 cf05 OP_CSV OP_DROP OP_PUSHBYTES_33 0304f332f50363cd01b679d9fb50fb8691fb0fb638737867bd02f06850c6191a22 OP_ENDIF OP_CHECKSIG

nsequence
0x05cf

previous output script
OP_0 OP_PUSHBYTES_32 c9452fef6bd1c72c8648d6ac78ce552543a1e5bf80a470fb259ff670aa5ced26 (v0_p2wsh)

However you can observe the nSequance = 0x05cf which encoded in decimal is 5*256 + c*16 + f = 5*256 + 12*16 + 15 = 1487

As the commitment tx was included in block 587314 the timelocked spend from it would have been rejected any block earlier than 587314 + 1487 = 588801 which was exactly the block height of the third tx.


Linux Mint: root running bitcoind on startup?

There are a couple of options where this could be loaded on startup, check the root crontab file (crontab -e) also look for files in the /etc/init.d/ folder it could be included in rc.local or another startup script.


Is it possible to "unmine" particular coins?

Technically, yes it's possible to do this.  Practically, doing this would probably break everyone's trust in Bitcoin.

One of Bitcoin's principle guarantees is that nobody can confiscate anyone else's bitcoins through the Bitcoin protocol.  This protects all of us, but it also means that we're each responsible for keeping our private keys secure.  If we fail to do that and someone---like a hacker or government agent---steals our private keys, then they also get the benefit of Bitcoin's confiscation resistance.

If we weaken this guarantee even once to confiscate bitcoins from the person or group we like the least, then it becomes clear that Bitcoins aren't secured by math, they're secured (or not) by the same sort of social guarantees that secure bank deposits.

If you or anyone else personally wants to prevent your bitcoins from falling into the wrong hands, you can use simple encryption software or Bitcoin multisig to try to prevent anyone from getting your private keys.  Doing this in a way that is secure against rubber-hose cryptanalysis is hard, but better tools for it may become available over time.

Using locktime transactions or the upcoming OP_CLTV opcode, you can even voluntarily choose to give your bitcoins to future miners if you have to delete your keys to prevent an attacker from seizing them.


What should I do if I change my BitCoin wallet?

When switching wallet providers/programs, the safest option is to usually just send the BTC to the addresses provided by the new system (after you have made a backup of the mnemonic phrase/keys for the new wallet).

Although standards compliant wallets should be able to accept each other's seed phrases, a wallet restoration process is an inherent weak point of the system, leaving you susceptible to attacks such as keyloggers and phishing. Thus, it is better to set up a new wallet.

Note that you should be aware of basic security practices regardless of which method you use, such as ensuring you are on the correct website, using a trusted/ clean device, and making sure that no one is looking over your shoulder.


For lnd, it's at https://api.lightning.community

Note that there are additional resources at https://dev.lightning.community


Help! Transaction unconfirmed after 1 day!

At this point, AFAIK, no one can help you speed things up. There has been a record number of transactions over the last few days and the queue is really backed up.


It allows the pool to avoid making new work for every single request. Instead, it just increments the time by a second and gives that to the next miner. Under heavy load (longpolls), Eligius might use the same work for up to 7,200 miners, meaning the last miner gets a work timestamped 2 hours into the future. This helps reduce stale shares significantly.


It appears that the database schema update was not successful. Meaning the database is not in a known good state. I'd suggest closing any open channels, withdrawing all funds from this node into an external wallet, moving the database (or the entire .lightning directory) and then restarting the client to create a fresh database.

This version is also really old, so the issue has most likely been addressed in the meantime.


What level of mathematical understanding do I need in order to contribute or to understand the crypto behind bitcoin?

I'm no expert, but hopefully this answer helps a bit. In my opinion you only need about year 11 calculus and algebra to understand the basics of elliptic curves and modular arithmetic. You can learn everything you need to know by googling and watching youtube videos. Here are some resources:

a layman's guide to elliptic curves
a visual guide to secp256k1 i started (incomplete but still useful)
an introduction to modular math by the khan academy

and if you are familiar with python or keen to learn then pybitcointools has a native implementation of all elliptic curve functions used by bitcoin. once you are familiar with the math then this code will be very useful for verifying your results.


Which method is preferable: sender to send Bitcoins to eWallet/mixer first or to wallet on the PC?

Depends on which link you want to hide. If you do not want observers to be able to tell that you and your friend traded then take option 1. If you want to later hide what you are doing with the coins, but do not care whether people find out that you and your friend traded then go for option 2.

You could of course do both but then you'd pay the mixer twice or at least pay the transaction fees twice.


force each miner node to 'compute' (or 'pick') his own range of nonces?

You don't need to force them. They will obviously do so on their own - doing anything else would be ridiculous, as the fastest miner would always win if they all try to run the same race.

In practice this is automatic, as every miner pays out to himself. As their payout addresses are different, their coinbase transactions will be different, which means their transaction hashes will be different, which means their Merkle tree will be different, which means their Merkle root hashes will be different, and as a result block header will be different too. In fact, it's impossible for them to be working on the same block template without forgetting to pay themselves!


Can i trace a hacker by collecting data from Bitcoin api?

To begin with, the Blockchain.info API is probably not the place to look for detecting anomalous activity on the Bitcoin network.  By consuming the API rather than running your own node(s) on the network, you will only receive pre-processed data.  It's like having someone chew your food for you.  It's best you run your own node.

Furthermore, hacking in general is not something that can be easily detected.  What you can do is search for occurrences of a particular exploit, once you know that a vulnerability exists.  For example, let's pretend you know about a vulnerability that can cause a double spend attack.  You know that in order to exploit this vulnerability, an attacker would need to broadcast 2 transactions simultaneously from opposite sides of the network, each spending the same UTXOs.  In order to detect this, you would need to have multiple nodes on the network that could detect the broadcast of each transaction (remember that nodes that already heard of one, won't broadcast the second because of the double spend).  Your nodes would have to communicate back to you, where the double spend attempt could be detected.

Keep in mind that the above example is an extremely naive double spend attack, that the Bitcoin network easily handles, but it exemplifies the complexity of your problem.  The MtGox exploit you mention used transaction malleability to trick a recipient into thinking they would get paid, when in fact they wouldn't.  It works because only one of two broadcast transactions will ever get into the blockchain.  Simply looking at the historical data in the blockchain will reveal only that a valid transaction went through...nothing suspicious.  You need to monitor an attack in real time to be able to detect it.

One more thing that you may have a problem with is reporting any activity to the "respective authority".  I think in your sample, you mean MtGox.  In order to do that, you would have to be able to identify who the victim of the malicious activity is.  That is not something easily done in Bitcoin, since users are pseudonymous.  You would need some way of mapping addresses to this "respective authority" in order to be able to do proper reporting.

To sum up, you need to:

Identify an exploit you want to track, not just general suspicious activity
Learn what needs to be detected for that particular exploit
Monitor the network directly, rather than consuming an API
Identify the victim so that reporting can be done (would be easiest if you are just monitoring cases where you are the victim)

Best of luck


Why has BCH not received a 51% attack yet?

Because of the cost, specifically the opportunity cost.

If a miner has 10% of the BTC hashrate, then if they pointed all of that mining power to BCH, they would still be losing money. With 50% of the hashrate on BCH, they would mine roughly 50% of the blocks in a day, which is 72 blocks. At 12.5 BCH per block,72 * 12.5 = 900 BCH. Convert that to BTC at the current exchange rate (0.135 BTC/BCH) 900 * 0.135 = 121.5 BTC.

However if the miner keeps mining BTC, at 10% of the network hash rate, they would mine ~14 blocks per day. With at least 12.5 BTC per block, a miner would be making 14 * 12.5 = 175 BTC per day, much more than if they were mining BCH.

Thus a miner will earn more money from mining BTC rather than mining BCH. Performing a 51% attack on BCH isn't really worth it; all you can get is possibly some double spends, and less value in BTC.


Instawire fees over Bitcoin Central fees and their respective KYC policies?

You got the answer in the question : the fees are higher on Instawire because it is a service, not an exchange.

The fact is also that (until Bitcoin is legally considered a currency) sales of Bitcoins are subjected to European VAT which instantly adds 19.6% to the price. (If Paymium buys a Bitcoin at 10 EUR, it must sell it at 11.96 EUR to start breaking even).

There is no legal requirement to do KYC on Instawire as no funds are held on behalf of users, sometimes documents might be requested, but when they are it is for fraud-prevention purposes, not KYC. The 100€ limit is also a fraud-prevention measure.


What is the best way to generate bitcoin wallet?

What is the safest way to generate bitcoin wallet? From the existing software such as bitcoin-core? electrum?

Ensure you are using open source hardware and nothing is backdoored. I am not an expert but Luke Dashjr might help you with this considering some interesting tweets in past.

Ensure there are no malwares on system you use for bitcoin wallet. You can also use virtual machines or Qubes OS to keep things separate. Example: One virtual machine for bitcoin cold storage, One for hot wallet, One for social networking, One for office related work etc.

Don't use VM images from random sources, it can be backdoored: https://www.reddit.com/r/Bitcoin/comments/jrxgj8/bitcoin_core_node_hacked/

Use open source bitcoin wallet with more usage and active development, compile it yourself after reviewing the code for important things atleast: https://bitcoin.stackexchange.com/a/99480/

Create multiple backups for your wallet, test those backups and keep them safe.

Do not enter seed or anything on any website that helps other people get access to your bitcoin. Avoid entering seed on any online device.

Use hardware wallets like Coldcard if you find them safer compared to other things.

I also read that bitcoin-core is not using BIP39 because it is not sure, but why BIP39 is still used in many wallets?

https://bitcoin.stackexchange.com/a/88244/


different multisig address from the same public keys

you run bitcoinjs-lib in main-net mode and it generates the human-readable address for main-net

bitcoin-cli you execute with -testnet parameter and got address for test-net

you can check that these hashes are the same:

https://testnet.smartbit.com.au/tx/8c67e4d3264696d222d5a72c70c8806eb3f12b9a02d1bc80554ab00803be86c0

https://blockchain.info/address/38tjRCFaQWQ269oGDpEkdxh5iPgxh7kvtB

both are 4f0017ef9291b625bec1d7efacc246a37b293682


Does Satoshi Dice owe its customers money? How come?

SatoshiDice pays most bets instantly, but for whatever reason sometimes bets get 'stuck'.

The issue you're referring to in your question happened during an exceptionally high volume period for SatoshiDice.  They received over 70,000 BTC worth of bets in a 24 hour period, which is much higher than usual.  The high turnover apparently causes issues with paying out in a timely fashion.  This was compounded by a bug which caused too much of SatoshiDice's BTC holdings to be transferred into cold storage.

As of this morning there is only one bet that hasn't been paid out.  It was a bet for 0.35 BTC, and it lost.  So to answer your question "No, they don't currently owe their customers money.  But sometimes they do fall behind for a few days".


The merkle root of a block is the hash of all of the transactions. If there is one transaction, then the hash of all of the transactions is the hash of that one transaction. So the merkle root and the txid of the only transaction in a one transaction block will be the same.


Get a programmatical notification when an address receives a transaction

Polling bitcoind is superior to any other alternatives as there is zero lag, your operations don't depend on a 3rd party SPOF service, etc.

A fresh incoming payment is also an outspent output, so calling bitcoin-cli listunspent 6 9999999 "[\"localAddressInQuestion\"]" will provide you with the exact unspent amount for this address only. Replace 6 with any number you wish to set as the confirmation threshold or make it 0 to get the unconfirmed payments as well.


miners who are in between

No, miners aren't in between. Miners around of block-chain, they are builders of the chain. *

* As Pieter Wuille says in the comment, anyone can be a miner, but in nowadays that's too hard to be a miner without special hardware.

  And isn't the traditional method of payment, including PayPal etc.,
  peer to peer?

No, that's also false, peer-to-peer doesnt have a centralized management.

Here is peer to peer (computer  to computer for e.g.).

And here is centralized service like PayPal or whatever:

The PayPal has centralized management.

  But for the end user, he just scans the paypal's code of the receiver
  and payment is done. Sender to receiver. So isn't this peer to peer?

You're simplifying things too much. For example the telephone call, you just speaks with a friend of yours directly, looks like peer-to-peer(friend-to-friend), but under the hood the phone provider in between you and your friend.