Limitations in P2WSH custom script I did a stupid custom validation script in P2SH where after check signature, check if OP_3 is equal of OP_3. Now I want to move the same logic in P2WSH multisignatue 1-3.

it's my script

$ bitcoin-cli decodescript 512103dee28d1db5d8b92181ac5baa04c28c01d2b14d19a3c6adaf7bd3430d0c6c8146210343a6f95f841b48ba2b97822a546976aea951e5a1f1c0a10078fdbbded165dbe32103f2f0a25413bb97af3b2ef21694fab820146e2e1bed41b6528a9ce6dd218d9bd353AE755387
    {
      "asm": "1 03dee28d1db5d8b92181ac5baa04c28c01d2b14d19a3c6adaf7bd3430d0c6c8146 0343a6f95f841b48ba2b97822a546976aea951e5a1f1c0a10078fdbbded165dbe3 03f2f0a25413bb97af3b2ef21694fab820146e2e1bed41b6528a9ce6dd218d9bd3 3 OP_CHECKMULTISIG OP_DROP 3 OP_EQUAL",
      "type": "nonstandard",
      "p2sh": "2N6SWbfkKVhPhYXx9idgDG5AVTPSAMNG5tY",
      "segwit": {
        "asm": "0 e976e1bb7c72f7f82132c706b3e8f2ee5673b9fa7172035aab9be62e8877d37c",
        "hex": "0020e976e1bb7c72f7f82132c706b3e8f2ee5673b9fa7172035aab9be62e8877d37c",
        "reqSigs": 1,
        "type": "witness_v0_scripthash",
        "addresses": [
          "bcrt1qa9mwrwmuwtmlsgfjcurt868jaet88w06w9eqxk4tn0nzazrh6d7qm9wxcj"
        ],
        "p2sh-segwit": "2NCLN7WkLL7dt56XyMVWH3QxDv2ytJGEw6d"
      }
    }

then create the transaction, manually sign it and add 3 in my Witness field, Then I have

"5300"<signatures><witness script>

But I get an error during send transaction TX decode failed
The I change 0x5300 with 0x010300 and it works.

The Question is, are there some limitation on custom script in P2WSH? I didn't find in BIP.
In P2SH I able to add 0x53 in scriptSig and send transaction without problems

There is no restriction due to segwit, but witnesses are serialized differently than scriptSigs.

A scriptSig is a script on itself, which gets executed, and its resulting stack is then fed to the scriptPubKey (or redeemScript in case of P2SH). This is not the case for the witness: it is an encoding of the stack directly, without script involved.

That means that scriptSig can use opcodes like OP_3 (which pushes the byte array 0x03 onto the stack). In the witness, you'd need to serialize that byte array directly as 0x0103. The 0x01 there is not an opcode; it is just the length of the stack element.


How to create a Blockchain for new alt coin after genesis block has been created? I am creating a new alt coin and I want to know how to generate a Blockchain for that coin. I have already created the genesis block for my new alt coin.

you can try the following steps:

 bitcoind -daemon # Start bitcoin core
 bitcoin-cli setgenerate true 1 # You've started a new miner!!
 tail -f ~/.bitcoin/debug.log # Track your log

After a while (it depends on the difficulty of your altcoin), a new block will be generated by your miner.

Check it by typing "bitcoin-cli getblockcount". Every time a new block is genereated, the value increases by one.


Share a common wallet.dat file between two servers Note this is not duplicate of Is there a way to change the wallet.dat location without changing the entire data directory?

I want to change wallet.dat file location. From the above link it seems to be impossible. But is there any way i can update wallet file location in bitcoin source code https://github.com/bitcoin/bitcoin and run make command to make it executable. Here is the reason why i want to do this:
https://serverfault.com/questions/888293/share-a-file-between-aws-servers

I want to share a common wallet.dat file between two server.

Just wait for the next Bitcoin Core release. They've already implemented -walletdir: https://github.com/bitcoin/bitcoin/commit/0530ba0eae147563921b162ed05347234d8b53c0

https://github.com/bitcoin/bitcoin/pull/11466


Can we determine which one of the referenced outputs corresponds to a cashback transaction in BTC transaction scripts? let me quickly elaborate the question. The structure of a BTC transaction script looks somewhat like the following example

"01000000018190374a5a1feb54fab4417fac1a3d9185de06fd8dcac34822c7cd00083638b1000000006a4730440220237ef9d9a3908f163ee37cc65de642ba1d45e399cde840285cd1658292ee71f902201a2fa3959cf19e64308d64a052526b755e22f2efb941675bc35684de1d90e7dd012103c13dca192f1ba64265d8efca97d43b822ff24db357c13b0e6e0395cf91e9efaeffffffff0248ac0b00000000001976a9140964c6feb963ade6836e722670abbc0147ca5cec88ac08100b00000000001976a914977ae6e32349b99b72196cb62b5ef37329ed81b488ac00000000"

... where the part

"48ac0b00000000001976a9140964c6feb963ade6836e722670abbc0147ca5cec88ac08100b00000000001976a914977ae6e32349b99b72196cb62b5ef37329ed81b488ac"

... specifies the two output addresses that the money from the UTXO(s) is split and sent to.
Often, as the sum of one or several UTXO's does not perfectly equal the amount that the sender wants to transfer, as last (?) output address he references his own address, in order to receive back his remaining cash.

My question is, is it somehow ONLY from the transaction script structure as above determinable which of the referenced output addresses correspond to the(se) "cashback address(es)"?

I have a few thoughts on this myself:

Of course, the sender might have several addresses / accounts, anyways, then, we have no chance at figuring out whether he is sending money back to himself or not.

Furthermore, I suspect the answer to my question is no, as otherwise, it could be possible to identify one input address of the regarded transaction as the output address that corresponds to the cashback part. This, I guess is exactly intended not to happen, as we want to keep the anonymity of the sender.

Lastly, I am aware that it is possible to identify cashback transactions when you look at the entire history of the blockchain and keep track of which address "holds" what amount of BTC / UTXO's right now. However, in order to do so, you would need to store all the addresses named in previous transactions throughout time, which is quite computationally costly, as you proceed through time in the blockchain.
Thus, I am asking for a way to quickly identify such cashback transactions. (We can for instance always easily identify the coinbase transaction in a block from the structure of the code.)

That's about it. I am looking forward to your comments, hopefully someone can shed light on this :)
Thanks!

Best,
Jen

First, the common lingo for these "cashback transactions" is "change outputs", and "chain analysis" is a thing whole businesses have sprung up around. There are a few indicators that allow making educated guesses on which outputs may be change, e.g.

round numbers (e.g. three outputs with round amounts and one not)
wallet fingerprinting (e.g. all inputs are multisig, only one output is multisig)
address reuse (some wallets send change back to an address previously used by the wallet)
unnecessary input heuristic
probabilistic graph search
…

The Bitcoin wiki has a whole section in its article on privacy describing approaches for change address detection.


What are the costs of cryptocurrency fraud? I have heard many claims that transaction volumes can be "faked" for cryptocurrencies, but I am skeptical about how this is possible. I want someone to walk me through the math describing what you need to believe in order to make money by boosting transaction volumes.

1) First, assume a constant velocity of money but a positive transaction cost t. Suppose t is relatively high. Is it possible to make money as a market manipulator? What would these profits be? Is there a point where t prevents you from making money as a manipulator?

2) Second, assume it is possible that coin velocity declines because momentum-driven speculators enter on news that prices rose due to "fake" transaction volumes from the market manipulator. What is the required velocity change as a function of the transaction cost t?

I am not sure whether I understand the math here, but I suspect that coin manipulation is possible. However, there is a point where t exceeds the possible change in coin velocity, which creates a limit to market manipulation.

For exchanges with no fees, users colluding can sell each other coin backwards and forwards all day to manipulate prices at no cost to themselves. Or you could do it with one user but two accounts. If you are buying and selling at the same time, at the same price, the price doesn't matter.


How do you make a Genesis block? What is involved in creating a genesis block? What makes it different from the other blocks in the chain.

There is only one (Bitcoin) chain, and the Genesis Block is the first block in that chain.

This block was created by Satoshi Nakamoto as the first link in the blockchain. It is hard-coded into the refernce Bitcoin client. To create it, it was "mined" like every other block, except it was at the minimum difficulty level, and contained arbitrary data.

The following quote from The Financial Times is embedded in the block's binary data

  The Times 03/Jan/2009 Chancellor on brink of second bailout for banks

This serves to prove it was generated on or after January 3rd 2009, as well as a political statement regarding the global economy.


Is it possible to make PoW ASIC-resistant through dynamically generated hash chains? Bitcoin's static proof-of-work function SHA256(SHA256(data)) was apparently easy enough to be implement as ASIC which lead to the re-centralization we see today.

But what if the PoW function changes for every new block based on the hash of the last block mined? One could generate a new hash chain by seeding a commonly known PRNG with the hash of the last block and use it to generate a chain of hash functions from a (large) pool of commonly known hash functions.

Steps:

RIPEMD(SHA2(SHA3(MD5(RIPEMD(SHA2(data)))))) => digest (i.e. old block header hash)
PRNG(digest) => SHA2(MD5(SHA3(SHA3(RIPEMD(RIPEMD(data))))))
digest (i.e. new block header hash)

This way every miner would know how to generate the new chain of hash functions which has to be used to generate a digest with certain criteria (leading zeros) for the next block but nobody could calculate the subsequently hash chains and nobody could implement static hash chain circuits but has to use FPGAs which have to be reprogrammed every block and have to be able to host every possible hash chain constellation. If the hash chains are complex enough it might even lead to a decrease in FPGA efficiency which would favour general computing hardware and reinstate the "one-CPU-one-vote" principle.

What do you think of this approach? Why might it be flawed?

There cannot be such a thing as an “ASIC-resistant” algorithm. ASICs are designed specifically to implement an algorithm and will always be faster than any CPU.

On the other hand, it might not even be a good idea to have ASIC resistance, because ironically, the ASICs would be the ones optimized for this and the general-purpose computers would be left behind, while also being way worse for energy consumption (something which seems to bother many people).

Source: https://download.wpsoftware.net/bitcoin/asic-faq.pdf


When was MyBitcoin created? MyBitcoin used to be an online Bitcoin shared eWallet. It was the go-to place for easily handling bitcoins. The site eventually shut down with a major loss of coins, widely suspected to be perpetrated by the service operator.

Its time of closing down is well known (July 2011) but I could not find a reference for when it was opened.

(Potentially relevant reading: What is the story behind MyBitcoin?, How much Bitcoin was lost in the Jul. 2011 MyBitcoin site shutdown incident?)

The mybitcoin.com domain existed no earlier than 2010-04-25, according to the domain name registration record (whois).

According to the mybitcoin.com history at archive.org, the domain first appears to have useful content sometime in early February 2011.

In case the above archive.org url doesn't work (seems to have a problem for me), copy and paste it from here:

https://web.archive.org/web/20110315000000*/http://www.mybitcoin.com


In order to "pay someone back", must I ask them for a return address? I want to write code that accepts a transaction, and afterwards "pays back" some amount to the origin of the transaction.

Assume users will be using the standard client. Will transactions have a single input, or must I handle the situation where a transaction have multiple inputs?

Can I just choose one of these inputs and pay back to that input? I want to avoid having to request users from entering a payout Bitcoin address - it's so much neater to just pay back to the same address they used.

Assuming that the user uses the standard client, or in fact any client, is a very strong assumption. If the user is using an eWallet service such as Instawallet, in all likelihood the user will not get the funds back, they will be held by the operator and possibly credited to one of his other clients.

Even if the input addresses are controlled in some way by the user, paying back to one of them can cause confusion regarding the payment's source - it will look as if the payment was for whatever the address was originally associated with. If there is a change address controlled by the user, it is associated uniquely with the payment to you so the information exists to identify it, though the client may not display it properly.


Why can't exchanges share their bid/ask contract pool? I'm checking up different exchanges and about to make my first purchase. Then I noticed there are so many different exchanges, and each has quite different liquidity and bid/ask spread. Why is it so? Why is there no arbitrager to trade between exchanges?

There are several reasons, but one key one is simply that the assets traded are not perfectly equivalent. For example, a dollar at Bitstamp is not precisely equal to a dollar to Bitfinex. They have different banking connections, different withdrawal and deposit fees, and different risks of failing to permit a withdrawal due to insolvency, theft, regulatory pressure, or the like.

Another reason is that exchanges tend to permit fairly fast trading and having to synchronize with other exchanges would be slow and unreliable. This would be solvable if two exchanges want to perform such a thing, but rapidly become untenable if you tried to scale it. You can't reserve liquidity without freezing an order book or offers can execute out of order, angering traders.


How fast does a processor have to be to mine bitcoins I have a MacBook Air running 10.7(Lion) with an Intel Core i5 processor

I want to try to mine bitcoins for fun. I understand that I alone will probably not be able to get any bitcoins from mining so I registered for some mining pools (Slush's pool, BTC Guild) and tried various applications to try to mine (MacMiner, guiminer, and cgminer)

For all of these, I am able to connect to the mining url with my credentials. guiminer shows that I have a speed of about 2 MH/s. However, nothing else seems to happen even after running these programs for about half an hour. I don't seem to be contributing to any of these pools.

Can someone tell me what is going on wrong?

After the creation of specialized hardware, created ex-professo for mining bitcoins, difficulty has climbed so high that it's not profitable to mine them in anything but an ASIC (if you can afford it). Anything else and you'll lose money or barely pay the electricity consumption.

Plus, it's definitely NOT recommended to do mining on a laptop - having either the GPU or the CPU running at 100% the whole day long produces a lot of heat and will significantly reduce the life-span of components.

Having said that, if just for fun, you could try mining Primecoin, Protoshares or Quarkcoin some hours a day - they're minable only with CPU (for now). Or better yet: mine a scrypt-based with your graphic card (it's usually much more profitable). Maybe mine dogecoins for 3-4 hours a day - Dogecoin and the dog meme are fun :)

Just don't expect you'll get a lot of any coin mining partial-time.


How can you create a transaction with multiple inputs from the Blockcypher API? For example, I have two addresses and each of them has received 1 BTC. Now, I want to transfer 1.5 BTC to another address. How can I achieve this using the Blockcypher create transaction API?

Blockcypher API shows only the example of how to compose a transaction with a single input, therefore, it might look like the array of addresses will do the job, but no. If you'll do this by passing addresses into one array of inputs:
curl -d '{"inputs":[{"addresses":["addr1", "addr2"]}],"outputs":[{"addresses":["addr3"],"value":100000000}]}' https://api.blockcypher.com/v1/btc/test3/txs/new

You'll have only zero element grabbed from the addresses array from the inputs:
"tx": {
    "block_height": -1,
    "block_index": -1,
    "hash": "002407bd35a6d0026cf0f5a018bd27311702560c03f1f64478105a547c91d895",
    "addresses": [
      "addr1", (inputs.addresses[0])
      "addr3" (outputs.addresses[0])
    ] ...

(Please note that I haven't included the whole tx blocks, only the ones containing the addresses.)
API will consider that you're using only one input, and may throw you an error if the value will be too big than the input's wallet balance.
"Not enough funds in 1 inputs to pay for 1 outputs, missing -X"

To create the tx with several inputs,  you'll have to pass arrays of addresses separately:
curl -d '{"inputs":[{"addresses":["addr1"]}, {"addresses":["addr2"]}],"outputs":[{"addresses":["addr3"],"value":100000000}]}' https://api.blockcypher.com/v1/btc/test3/txs/new

This will give you the correct response, and the correct amount of inputs:
"tx": {
    "block_height": -1,
    "block_index": -1,
    "hash": "ebcc8132c33a672cdd695a8953db503954abefa18bfd4727ea44f67b92c5ab6c",
    "addresses": [
      "addr1",
      "addr2",
      "addr3"
    ] ...

In conclusion, it seems that the API itself is designed that way, at least at the moment of writing this answer.


How to update my RaspNode? no GUI only CLI I would like to know the best way to update my RaspNode (rPi 2 B+) to the 0.12.1 bitcoind version.

I did

  sudo apt-get install bitcoind

I also did this:

Erased /bin/bitcoin folder

then into /bin/

git clone https://github.com/bitcoin/bitcoin.git
./autogen.sh
./configure --enable-upnp-default --disable-wallet
make -j2

but it's still the same version 0.11.2

You should uninstall the installed version first completely with sudo apt-get remove bitcoind before manually building the binaries from source. Make sure that you backup your wallet (and eventually Blockchain) first (so Keep your data-directory).

Don't run the build in teh bin folder! The sudo make install command will install more than just the binary on your machine! Use e.g. /home/git/bitcoin/ to clone the repository and run your configure and make commands there.

Then instlall bitcoin like described on github. after your make -j2 command you should run sudo make install to install bitcoind on your computer. (Binaries are intalled under /usr/local/bin/).

I have installed it on my raspberry Pi a week ago. Works fine :-)

Blockchain-sync lasts almost forever ....

If didn't use the --disable-wallet flag. You could use the wallet with bitcoin-cli


How to merge two wallet.dat files I know about pywallet, about this modification for bitcoind, but what is a simple way to merge two wallets, or export a list of private keys and addresses of all of wallets from litecoin, dogecoin, bitcoin, quark, et cetera?

Thank you!

Latest versions of the reference Bitcoin implementation have the 'dumpwallet' RPC command, which dumps a human-readable list of all of your private keys.

The format is simple: just comment-lines (starting with #) or lines that are the private key (plus metadata about the key). So to combine keys from several wallets you would:

Re-run bitcoind/Bitcoin-Qt, giving the -wallet=/path/to/wallet option
dumpwallet the private keys to a file (walletpassphrase first if the wallet has a passphrase)
Shutdown
concatenate the files together
Re-run and importwallet the combined file

The last step will take a while as the blockchain is scanned for transactions to/from the imported private keys (concatenating several wallet keys together in step 3 saves time over repeatedly dumping/importing).

A php or python or bash script that did all of the starting/stopping/concatenating either using the JSON/RPC interface or bitcoin-cli would be spiffy. Extra credit if it noticed which wallets were locked and prompted for passphrases....


What happens on my computer when I mine in a pool? When I mine in a pool, I see the number of shares and stale ones. What does this mean? What is a share? What the guiminer (the mining program) receives and what it sends? It sends it to whom? How the other end actually trusts that my computer has indeed done so many hashes per second?

Regular mining is repeatedly inserting different nonces into the block then hashing it until you find a nonce that makes a hash that is smaller than the difficulty.

Pooled mining is just like this except you don't use the full difficulty, you just have to be good enough for a much easier difficulty that the pool assigns to you. When you find a nonce that is good enough for the pool difficulty, then you tell the pool that nonce. That is a share. The pool verifies that the the nonce is good enough so the pool knows that you did the work. So the number of shares that you send tell the pool that you had to do so much work to find them.

You receive in the first place a block to mine with that you put the nonces into. You also receive a difficulty that the pool wants you to use.

You send the nonce that was good enough for the difficulty. You send this to the pool. You never interact with the network at large.

A stale share is a share that you mined on a block that isn't valid anymore. If the pool sends you a block to mine on, then someone else finds a new block, then you find a share on the old block, your share is worthless now, so it is stale.


Can I receive BTG to my BTC address after BTG hardfork? I read that on 25. oct. 2017. the BTG hardfork will happen and every one holding BTC on their address will receive BTG for their BTC in 1:1 ratio.
What happens if I have X amount of BTC on my address A, and after the hardfork happens I still receive BTC to that address.

Can I change that BTC to BTG in 1:1 ratio even some time after the hardfork happened?

For example if I have 1BTC on my address, then at the time of the hardfork it will be converted to 1BTG. Then let say, weeks later I receive 1BTC to the same address.
Can I spend 2BTGs then?

No

Bitcoin Gold has replay protection.  After the fork, all further transactions on the BTC chain will not transfer BTG, nor vice versa.

In your example, when someone sends you 1 BTC after the fork, the corresponding 1 BTG will still belong to the sender, not to you.  You will not gain any BTG from the transaction.  (Of course, they could send it to you separately if they wanted.)

It will also not be possible to spend BTC as BTG or vice versa.  To exchange one for the other, you will have to find someone to make a trade with, and agree on an exchange rate, which will probably not be 1:1. (You can use an organized exchange to make this efficient, but it's the same thing in principle.)


What will bitcoin prices do in the next months as ASIC miners become more widespread? The next months will finally see ASIC miners come into play, which will increase the global network hashrate by an amount never seen before. Of course, mining difficulty will then increase accordingly, but there will be a (how small?) timeframe where those new devices will be generating lots and lots of new coins. Then, as difficulty increases, mining new bitcoins will become increasingly harder.

How is this going to affect bitcoin prices (apart from market speculation which has been quite wild lately)?

My guess is that prices will drop when ASIC devices start mining, and then they will steadily rise because mining botcoins will never be so easy anymore. But then, of course, I'm not the only one guessing this... thus, lots of people will probably think "now it's a good time to buy bitcoins" and this will keep the prices high.

What do you think about this?

Difficulty adjusts every 2016 blocks, which is meant to average out to about 2 weeks.

But if you look at MtGox's average trading volume over the past few weeks it has been somewhere between 50K and 100K.  If difficulty remains constant you would expect there to be about 3,600 bitcoins minted per day, or 3-7% of average daily volume.

Also bear in mind that the bitcoins which are minted will be scattered across all the people in all the mining pools that are generating them, so without some concerted action you are very unlikely to see that many coins hitting the market at the same time.

I think that the reality is that the ramp-up of the ASIC manufacturers is such that we're unlikely to see some sort of cliff, either in bitcoin generation rates or in resultant prices.  The only way in which I could see the generation rates being tweaked is if someone built a very powerful ASIC farm and turned it on and off to bring the difficulty up and down at advantageous times.  But then I'd imagine that the developers would step in to tweak the difficulty calculation process to avoid such gaming of the system.


Is Mining Bitcoin While The Price is Low or High better? I have a few questions:

Does the reward for Bitcoin increase/decrease when the price goes up and down?
Is it more profitable to mine when Bitcoin is down, or when it is up?

Thank you!

Does the reward for Bitcoin increase/decrease when the price goes up and down?

The reward for mining a bitcoin block is:
(the current block subsidy) + (the fees from the included transations) = (the block reward)
The block was originally 50 BTC, and this amount is cut in half every 210,000 blocks. At the time of writing, it is 6.25 BTC.
The price is an extrinsic property, it has no affect on the number of BTC included in the block reward (though obviously the dollar value of the block reward will change, as the price changes).

Is it more profitable to mine when Bitcoin is down, or when it is up?

Profitability entirely depends on the miner's costs, and revenue. It is a highly competitive free market.
When the price drops, some less efficient miners may become unprofitable, since costs are usually payable in fiat currency, and the block reward is realized in BTC.
When the price increases, miners will see a larger profit in fiat currency terms, but this also means that less efficient miners may join the network (as they are now able to operate profitably), thus netting the already-operating miners a smaller portion of the total rewards over time.
It is a constant push-and-pull. A higher fiat price per bitcoin will mean more revenue (denoted in fiat), but also more competition. We might expect this effect to roughly cancel out, so that profits trend towards zero on average (if they were higher than zero, we would expect more miners to join the network, to take a piece of this profit).


How to manually disconnect a peer from peergroup? Here is my code.

    params = TestNet3Params.get();
    blockStore = new MemoryBlockStore(params);

    chain = new BlockChain(params, blockStore);
    chain.addWallet(newwallet);

    final PeerGroup peerGroup = new PeerGroup(params, chain);
    peerGroup.setUserAgent("PeerMonitor", "1.0");
    peerGroup.setMaxConnections(1);
    peerGroup.addAddress(new PeerAddress(InetAddresses.forString("192.168.1.253"), 18333));

    peerGroup.addEventListener(new AbstractPeerEventListener() {
        @Override
        public void onPeerDisconnected(Peer peer, int peerCount) {
            System.out.println("hello "+peer.getAddress().getAddr().getHostAddress());
            peerGroup.addPeerDiscovery(new DnsDiscovery(params));
            System.out.println("DNS Added...!!");

        }
    });

    peerGroup.startAsync();

    peerGroup.downloadBlockChain();
    System.out.println("Full Downloaded...!!");

    List<Peer> peers=peerGroup.getConnectedPeers();

    System.out.println(peers);
    for (Peer peer : peers) {
        if(peer.getAddress().getAddr().getHostName().equals("192.168.1.253"))
        {
            System.out.println("checking peers...!!");
            break;
        }
    }
    System.out.println("going to stop...!!");

I want to stop the local peer and switch to the DNS when the downloading gets completed.

Simply:

peer.close();

Peer.java extends PeerSocketHandler.java, which is the class that defines the close() method, so maybe that's why you weren't seeing it. It would also probably be easier to find if it were called disconnect().


What's the minimum transaction with bitcoin? What's the minimum transaction with bitcoin - local wallet to local wallet. Can I send for example $20 in bitcoins to another person?

You can send any number of bitcoins to anyone, even 1 satoshi (see exceptions below), which is 0.00000001 BTC (about 0.00001031 USD)

However for such small amounts you may not want to include a transaction fee.

There is no minimum transaction fee. However if you send a transaction without any fee you can expect a significant delay in it getting into the blockchain and therefore getting it confirmed. I have tried this recently and it took around 18 hours to get the first confirmation for my transaction. Others have mentioned even higher delays (up to 2 days) in some cases.

It is currently the norm to include a fee of 0.0001 to 0.0005 (approximately 10 to 50 US cents at current exchange rates), resulting in a fairly speedy entry into the blockchain (meaning on average 10 to 20 minutes wait for the first confirmation).

Please note it doesn't make a difference if the transaction happens on the same LAN or even between 2 of your own addresses in the same wallet. If it needs to go on the blockchain the fee should be included unless you are prepared to wait.

So in practice, the smallest amount you want to send is one that makes sense taking into account that fee.

In some circumstances, some bitcoin clients will not even allow you to send a transaction without a fee. This is when your transaction size (in bytes, not the BTC amount being transferred) is over a certain limit. In those cases the client will notify you and ask you to confirm the sending of the fee or cancel the transaction. You can bypass this limit with other clients, but for the same reasons explained above is not something I would recommend.

Finally, to take your example of $20 USD, at current BTC/USD exchange rate of $1034.52 you would simply send 0.01933264 BTC + 0.0001 fee.

Exceptions: As @CoinEnablers mentioned in the comments below, in order to fight transaction spam, some measures have been recently introduced to limit very small transactions (so called "dust" transactions). As far as I'm aware these are not changes to the protocol, but simply new default configurations on both clients and miners' software, that makes it fairly hard to get very small amounts accepted. Currently I believe the minimum value accepted by default is set at 5460 satoshi.


What is a mechanism of providing Merkle Path? In the Bitcoin, SPV node can query that its transaction is included specific block to full node that provides merkle path which has super fast calculation.

In terms of full nodes, they have full-ledger and merkle tree that is consist of transaction tree. so they can find some transaction queried by SPV node(light node) but my question is that how they can efficiently find it?

They may dislike compute to find transaction if they have to sequence search because they are busy to find hash value of block to earn block reward.

Sorry for my English.

They may dislike compute to find transaction if they have to sequence search because they are busy to find hash value of block to earn block reward

You are confusing mining with node operation.

It is a full node on the network that will return info about the relevant merkle path to the SPV wallet.

Mining is done separately, by specialized hardware that is built to only be extremely efficient at hashing to find a new block. The mining hardware will be connected to a full node, so that it can obtain the relevant info to build new block templates. But the two computations are done on separate hardware, in parallel.

So even if a miner’s node was the one to serve the merkle path info, it would not take away from their mining time.


Can a transfer be done over postal mail? Suppose I'm stuck in the middle of nowhere with no internet access and I want to make a payment to a certain Bitcoin address.

Is it possible to do a transfer via postal mail, and if so what information would I need to send?

Assume the following:

I have both the recipient's Bitcoin address and my (the sender's) own private key(s) memorized or written down on a piece of paper.
The person who receives the mail (my agent) has access to the Bitcoin network and will act on my behalf.
The mail is delivered securely (i.e. no chance of theft)

What information would I need to send in the mail?

Consider the following possibilities:

A)  Trust

I trust my agent to do the transfer to the given address (e.g. the agent is the recipient), but I can't trust my agent with my private key(s)
I trust my agent with all my information (private keys and all)
I do not trust my agent at all

B)  Access to a computer

I have access to a computer, so I can run any program/scripts that may be required for generating any signatures
I don't have access to a computer (and I'm not Rain Man)

A1B1: Assuming you've prepared in advance, there are some nice offline wallet options.
A1B2: This one's tricky. I'm going to assume that you have access to a computer before running off into the woods, or what have you. I'm also going to assume that you know exactly the amount and address in advance.

Generate the transaction and sign it, but don't broadcast it (can be done with Bitcoin Armory)
Print out the transaction
When you want to make the transaction, mail the transaction to your agent.

A2B?: Easiest one. Just write down your private key and describe the transaction.
A3B?: Well, you're screwed, because the agent could just never make the transaction.


Is there an open source bot I can get for BTC-E? I'm interested in automatic trading but I don't know how to get started.

You can write your own bot in any modern programming language using the BTC-e API. Also MtGox, Bitstamp, Bitcoin-24 and probably more popular exchanges support this.

These API's mostly give you the possibility to track the price, the market depth and place orders, making easy for you to implement your own trading bot.


Testnet for bitcoin - are there multiple operating? I have been tinkering around on testnet with three portals:

Biteasy
Block Explorer
blockr

I observed that when I posted testnet coins using tpfaucet to a wallet created using testnetwallet, the transaction showed up in blockr and blockexplorer but not in biteasy. When I sent testnet coins using the same testnetwallet to a paper wallet address, the txn and balance showed up correctly in blockexplorer but not in biteasy or blockr.

I am a bit confused about what is happening here - I thought these are all services to look up the same testnet and hence I should be able to confirm same blocks, txns, addresses one each of these. Is that not the case? Are there private testnets operating on these portals? I can't see any information saying so anywhere.

Another observation: Blockexplorer is showing the transaction as confirmed with 74 confirmations and balance showing up correctly as confirmed balance in recipient account. But testnetwallet (sender account) is showing the txn amount under "unconfirmed" balance while the txn itself is showing up in history. Confirmed balance is unchanged at the moment in sender wallet. Blockr is not showing the transaction or the amount under the recipient address.

Day 2: testnetwallet.com now shows correct confirmed balance as the sender wallet. I can see the transaction, block and both receiver and sender accounts correctly using blocktrail.com and blockexplorer.com. Blockr and Biteasy still don't show anything - even when I search by block number. Will keep digging.

Day 3: today blockr is also showing the txn, block number and correct balances in both sender and receiver accounts. Until today, blockr wasn't showing any of these. Perhaps blockr service was slow/down? not sure. Biteasy is still not showing anything. I checked blockcypher also today and it's showing everything as well. I am going to use blockcypher's API to post a txn and check all five services to see which one is giving me results and by when. Will edit back with results.

There is no such thing as a private testnet, you can obviously create one, but then it won't be of much use to provide data regarding a private blockchain to the public.
The testing network (testnet3 presently) is the same for every user/developer.
BitEasy's block explorer for the testnet doesn't seem to be working. They don't have data even for dates a month prior to the date you asked this question.
As far as exploring the blockchain the data is concerned, you can do it yourself by accessing the block-chain on your machine after running the testnet bitcoind. The approach may be vary, but then the point being you can do it yourself if you know basic programming.


Bitcoin Transaction from MtGox hasn't shown up after several hours I have withdrawn bitcoins from my account in MtGox to my Multibit installed in my computer. Several hours after BTC are not in MtGox and neither in my account. I have verified the address and it is right. I can see the direction of the address in blockchain but it appears "transactions:0". Is this normal?

I think MtGox usually gives you a transaction hash immediately. You can use it to track it, for example on the blockchain or blockexplorer websites.

Even without the transaction hash, you can still use these websites to try and find it by looking for the Bitcoin address you have withdrawn to. You may wish to check your MtGox account history to see which Bitcoin address they sent your Bitcoin.

If you do not see the transaction, don't panic. Especially if you have not included a transaction fee, miners may be slow to incorporate it into any block, in which case these websites will not find the transaction in any block, and might indeed not have seen the transaction at all.


Is the SPV client model scalable? SPV clients typically connect to full node peers and set filters on what information they download. How many SPV peers can a single full node support, typically?

Is it reasonable to expect millions of SPV node users connecting to ~6,000 full nodes?

Generally speaking, BIP37 bloom filtering SPV has atrocious scaling though it is hard to say exactly how poor it is in the real works.

Every peer must sync the entire block chain from the last they had contact with the network, in the worst case this is approximately 50GB. The node must load every single block from disk, filter it to the clients specifications and return the result. The amount will grow until the end of Bitcoin or time, whichever comes first. Without some protocol changes pruning is incompatible with BIP37 SPV as it expects all blocks to be available at all hosts.
For every wallet which is synchronized, each incoming block and transaction must be individually filtered. This involves a non negligible amount of CPU time, and must be done for each peer in turn for every inventory item.

It is unclear exactly how much CPU power an average node has, but at least some portion of nodes are running on bottom of the barrel hardware like a Raspberry Pi which is very unlikely to be able to happily serve more than a couple of peers at a time.

Similarly a large portion of listening nodes are hosted on budget VPS providers which offer a single shared core and extremely poor performance. OVH has 300, Hetzner has 300 Digital Ocean has 124, CloudAtCost is truly at the bottom of the pile with 6.

BIP37 is vulnerable to trivial denial of service attacks, demonstration code is available that is able to cripple nodes by fast inventory requests through filters causing continuous disk seek and high CPU usage.  It is tempting to say that clients could use proof of work (but this is impossible on a battery powered device like a phone) or micropayments (impossible if a node doesn't know it has received money yet) but neither really offers a clear solution.
There's also likely a lot less than 6000 listening nodes, some are pruned which is fairly useless for a SPV client to sync with, many are listening on both IPv4 and IPV6 and are duplicated in that number as a result. The real number of actual nodes is probably more along the lines of 5000, and the number of them not on dialup speed uplinks is substantially lower.

  Is it reasonable to expect millions of SPV node users connecting to ~6,000 full nodes?

Absolutely not, even just for the reason that the code defaults to a maximum of 117 incoming connections which would be around half a million total available sockets in the network (the majority of which are already consumed today).


Can a live feed of blockchain transactions be obtained from using bitcoin core wallet? I am interested in both obtaining the entire blockchain transaction history data (for bitcoin) and a live feed of transactions for a data science project. BlockChain.com has a very useful websocket API for the latter and I have been downloading Bitcoin core to obtain the former. Given that bitcoin core clearly receives new transactions in real time - is there a way I could get a live feed of transactions directly from bitcoin core (cutting out the need for the BlockChain.com websocket API). Thanks.

is there a way I could get a live feed of transactions directly from bitcoin core (cutting out the need for the BlockChain.com websocket API)

Certainly. Bitcoin Core supports the ZeroMQ messaging protocol. It publishes a stream of blocks, block hashes, transactions, and transaction hashes to whatever port you specify. You can specify which of those you want to, they have to be explicitly enabled. This stream is always a reflection of what it is currently receiving over the network. Once it has validated a block or transaction, it will then push that out to the ZMQ stream.

You can then connect to the ZMQ stream with whatever software and parse the messages into their respective types.


Bitcoin node synchronization speed up I'm running a docker image with a bitcoin node (version v0.16.3.0-g49e34e288) and it's taking more than week to synchronize, having only synchronized 54% of the blockchain. I'm running it with the "prune=550" and "disablewallet" options. I there any way to speed up the synchronization process?

Thank you

The pruning works after full node synchronized only !!!!
You can set it prune=550 only after that you have full node.
Full node, then type prune=550 in conf file, then shutdown, then restart.
Hi.


Why am I unable to post two transactions (the second from the change address of the first) in the same block? I'm attempting to make a transaction on the testnet with an OP_RETURN and a
change address in it, and then make a second OP_RETURN transaction from first transaction's change address in the same block. The way my code is currently written the second transaction shouldn't rely on the first transaction being processed (it gets coins from a faucet).

Here is a simplified version of my code that maintains the problem (my "write" function is a modified version of this bitcoinjs-lib example):

var assert = require('assert'),
    bitcoin = require('bitcoinjs-lib'),
    blockchain = new (require('cb-helloblock'))('testnet'),
    dynamicKey,
    dynamicChangeKey;

connect = function (callback) {
    dynamicKey = bitcoin.ECKey.makeRandom();
    dynamicChangeKey = bitcoin.ECKey.makeRandom();

    write("Connecting to blockchain!", callback);
};

message = function (callback) {
    dynamicKey = dynamicChangeKey;
    dynamicChangeKey = bitcoin.ECKey.makeRandom();

    write("Posting to blockchain!", callback);
};

write = function (arbitraryData, callback) {
    var address = dynamicKey.pub.getAddress(bitcoin.networks.testnet).
            toString();

    blockchain.addresses.__faucetWithdraw(address, 2e4, function (err) {

        if (err) return callback(err);

        blockchain.addresses.unspents(address, function (err, unspents) {
            var tx,
                data,
                dataScript,
                unspent,
                txBuilt;

            if (err) return callback(err);

            tx = new bitcoin.TransactionBuilder();
            data = new Buffer(arbitraryData.toString());
            dataScript = bitcoin.scripts.nullDataOutput(data);
            unspent = unspents.pop();

            tx.addInput(unspent.txId, unspent.vout);
            tx.addOutput(dataScript, 1000);
            tx.addOutput(dynamicChangeKey.pub.getAddress(bitcoin.networks.
                    testnet).toString(), 1000);
            tx.sign(0, dynamicKey);
            txBuilt = tx.build();

            blockchain.transactions.propagate(txBuilt.toHex(), function (err) {

                if (err) return callback(err);

                // check that the message was propagated
                blockchain.transactions.get(txBuilt.getId(), function (err,
                        transaction) {
                    var actual,
                        dataScript2,
                        data2;

                    if (err) return callback(err);

                    actual = bitcoin.Transaction.fromHex(transaction.txHex);
                    dataScript2 = actual.outs[0].script;
                    data2 = dataScript2.chunks[1];

                    assert.deepEqual(dataScript, dataScript2);
                    assert.deepEqual(data, data2);

                    callback();
                });
            });
        });
    });
};

log = function (value) {
    console.log(value);
};

connect(message.bind(undefined, log));

When running this code the first transaction processes correctly, but the second one returns this error:

{ [AssertionError: Invalid JSend Response {"status":"fail","message":"Propagation unsuccessful","details":"TX rejected"}]
  name: 'AssertionError',
  actual: false,
  expected: true,
  operator: '==',
  message: 'Invalid JSend Response {"status":"fail","message":"Propagation unsuccessful","details":"TX rejected"}' }

If I change line 15 to read

    dynamicKey = bitcoin.ECKey.makeRandom();

instead of

    dynamicKey = dynamicChangeKey;

both transactions process correctly, so the problem is definitely in my use of the change key as the next transaction key.

Does anybody know where I'm messing up?

I think my issue was that I was accidentally trying to spend the output from my first transaction (which had insufficient funds for both the given fee and the given amount of change) instead of the output I was getting from the faucet, which I meant to spend. I haven't written a good solution to this problem yet, but I got around it in this simplified instance by building both transactions before propagating either.

Here is one of the transactions, and here is the other.

Here is the horrible code that made them:

var assert = require('assert'),
    bitcoin = require('bitcoinjs-lib'),
    blockchain = new (require('cb-helloblock'))('testnet'),
    dynamicKey,
    dynamicChangeKey,
    transactions = [],
    dataPoints = [],
    dataScripts = [];

connect = function (callback) {
    dynamicKey = bitcoin.ECKey.makeRandom();
    dynamicChangeKey = bitcoin.ECKey.makeRandom();

    buildTransaction(dynamicKey, dynamicChangeKey,
            "Connecting to blockchain...", callback);
};

message = function (callback) {
    dynamicKey = dynamicChangeKey; //bitcoin.ECKey.makeRandom();
    dynamicChangeKey = bitcoin.ECKey.makeRandom();

    buildTransaction(dynamicKey, dynamicChangeKey, "Posted to blockchain.",
            callback);
};

buildTransaction = function (key, changeKey, arbitraryData, callback) {
    var address = key.pub.getAddress(bitcoin.networks.testnet).
            toString();

    blockchain.addresses.__faucetWithdraw(address, 2e4, function (err) {

        if (err) return callback(err);

        blockchain.addresses.unspents(address, function (err, unspents) {
            var tx,
                data,
                dataScript,
                unspent,
                txBuilt;

            if (err) return callback(err);

            tx = new bitcoin.TransactionBuilder();
            data = new Buffer(arbitraryData.toString());
            dataScript = bitcoin.scripts.nullDataOutput(data);
            unspent = unspents.pop();

            tx.addInput(unspent.txId, unspent.vout);
            tx.addOutput(dataScript, 1000);
            tx.addOutput(changeKey.pub.getAddress(bitcoin.networks.
                    testnet).toString(), 1000);
            tx.sign(0, key);
            txBuilt = tx.build();

            dataPoints.push(data);
            dataScripts.push(dataScript);
            transactions.push(txBuilt);

            callback();
        });
    });
};

propogateTransaction = function (data, dataScript, txBuilt, callback) {

    blockchain.transactions.propagate(txBuilt.toHex(), function (err) {

        if (err) return callback(err);

        // check that the message was propagated
        blockchain.transactions.get(txBuilt.getId(), function (err,
               transaction) {
            var actual,
                dataScript2,
                data2;

            if (err) return callback(err);

            actual = bitcoin.Transaction.fromHex(transaction.txHex);
            dataScript2 = actual.outs[0].script;
            data2 = dataScript2.chunks[1];

            assert.deepEqual(dataScript, dataScript2);
            assert.deepEqual(data, data2);

            callback();
        });
    });
};

propogateBothTransactions = function () {
    propogateTransaction(dataPoints[0], dataScripts[0], transactions[0],
            propogateTransaction.bind(undefined, dataPoints[1], dataScripts[1],
            transactions[1], log));
};

log = function (value) {
    console.log(value);
};

connect(message.bind(undefined, propogateBothTransactions));


What does this mean? RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected I'm building a service which does some automatic Bitcoin transactions and balance checking. In the system I now created some logging, which told me that my bitcoind daemon (running on Ubuntu 14.04 server) gave an error code -9 when running the following command bitcoind getbalance. In the bitcoind source I found error code 9 described as:

RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected

About this I have 3 simple questions:

First: what does this mean? I'm running the command on the same machine where the daemon is running, so no remote connection needed.
Secondly; how can this happen? Why does a stable running bitcoind daemon suddenly gets disconnected?
And most importantly; how can I prevent this from happening?

All tips are welcome!

What does this mean? I'm running the command on the same machine where the daemon is running, so no remote connection needed.

It's not talking about the connection between your command line and the Bitcoin daemon, it's talking about the connection between your Bitcoin daemon and other Bitcoin daemons.

  How can this happen? Why does a stable running bitcoind daemon suddenly gets disconnected?

You might be running a very old version of Bitcoin that is incompatible with other clients. Your ISP might be filtering Bitcoin traffic. Your OS might be out of file descriptors. There are a huge number of possible reasons.

To narrow it down, have you tried looking at the debug.log of your Bitcoin client? You could also try looking at TCP traffic on port 8333 using Wireshark.


Can I change a transaction description in Electrum while the transaction is still unconfirmed? I inserted a wrong description into a transaction made with Electrum per mistake, so I double clicked the description in and changed it to another value, while it was unconfirmed. My question is, will this last (final) value be visible once it is confirmed?

Descriptions are a feature of the electrum wallet, and do not appear on the Bitcoin chain - someone using another wallet (or even you restoring the keys into another electrum wallet) will not see the description.


When mining with 2 computers, do I need to use 2 separate wallets addresses? I understand that each miner is working on a different block. Correct me if I'm wrong but this is because the first transaction in a block basically contains my wallet address so I can receive the bonus of solving the block. Obviously everyone wants to receive the bonus so that first transaction will be pointing to everyone's separate wallet addresses.

Assume that I have two computers solo mining with both pointing to my wallet address, wouldn't this mean my computers are solving the same block? Continuing with this train of thought, wouldn't that mean that my slower computer is basically useless because it would be generating the same hashes as my faster computer?

Now how does this apply to pooled mining? In a pooled community, is everyone solving the same block which has the first transaction pointing to the pool owner who then distributes the coins?

Regarding pools: when working for a pool, the computer who solves the block doesn't credit its owner directly - it rather credits the pool's bitcoin address. The pool manager then tallies how much work each of the pooled miners delivered for the block, and proceeds to pay them proportionally to it - minus the fee the pool takes, of course.

The only exception is a P2Pool, which work with no centralized pool manager. In these type of pools, each of the peers in the pool ensure they're appropriately credited for their work when a candidate block solution arises.

As far as I know, you can configure your 2 solo-mining computers to either use each their own address or one for both. And no: even if both were using their own addresses and working independently, the processing power of the slower one is not completely wasted. Solving a block is highly random, there's not much chance both would be trying the exact same nonces in sequence. Rather, they'd each try a different set of nonces to solve the block. Obviously, in the long run the faster one will find answers more frequently than the slower one.


What is a Bitcoin node? There’s a lot of reference of "bitcoin node" in official FAQ or elsewhere.

But, what is exactly a bitcoin node ?

Is it a client like Bitcoin-qt or is it only a miner ? Or both ?

Bitcoin node refers to a "full" client. A "full" client is a client that owns the block chain and that is sharing blocks and transaction across the network. In opposite a Lightweight client can not be considered as a node because he doesn't share the block chain with the network.

Bitcoin network uses a client to client network infrastructure so there is no difference between a mining client and a non-mining client, they don't have any privileges.


Where is the actual data stored and how does that data get stored How does data get stored for bitcoin?

Does data in the blocks get stored in files or a database and then get referenced by the blockchain?

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

If none of that is true and the blockchain data exists in memory, if all of the nodes went down, how do you bring the blockchain back up?

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

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

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

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

In case you use the standard directory.


How much more energy efficient is PoS (proof of stake) than PoW (proof of work)? Are there any figures on this? I've been trying to look for some evidence showing that PoS is more energy-efficient than PoW. In theory, it's true, but if there are any figures or stats you can share on this, I'd be very grateful.

Thanks!

When providing an equivalent amount of security, I don't believe PoS can be more efficient than PoW. I do understand how it may appear this way on the surface, but I think deeper consideration shows that this is a fallacy.

The security of Bitcoin (PoW) is dependant on the economic incentives built into mining: it is the cost of attacking the system vs. the expected return that matters, not the total amount of energy spent on mining. Of course, energy has a cost, but it is important to note that it is the cost, not the energy, that is important when considering the security of the network.

Therefore, we can define a system's security relative to the cost of attacking it successfully. Less cost to attack = less secure, and vice versa.

Mining is a permission-less activity, anyone is free to join, and so the result is expected to reach a free market equilibrium: the cost of mining $1 worth of Bitcoin is expected to trend towards $1. If there is profit to be made, we would expect more miners to join the market. If costs outweigh returns, we would expect miners to leave the market.

In PoS systems, we should expect a similar result: participants will be willing to incur costs of up to ~$1, for every $1 worth of rewards they receive in return. Anything that deviates from this will result in lowered security- you wouldn't want to pay someone $1 to provide only $0.50 worth of security!

In PoW, a very large portion of a miner's cost is the energy used to perform computational cycles. There are additional costs to consider (hardware, overhead, employees, maintenance, etc), but the most efficient miners will be expected to minimize these costs, and spend as large a portion of their budget on energy as possible (thus maximizing their expected return).

PoS seems to be more efficient, due to an apparently minimal number of computational cycles (compared to PoW), but when considering the above, we can arrive at a more nuanced understanding:

If a PoW network and a PoS network had the same amount of security (denominated in your favourite currency), we should expect each network's participants to spend the same amount of money to create and maintain this security.

With this in mind I think it is interesting to reflect back upon the question at hand: does energy efficiency really matter? Shouldn't we really just be striving to maximize the security provided per dollar spent? In terms of creating a more efficient network, that is what will ultimately matter.

In that regard, I believe PoW is more efficient, as a PoW miner's costs come from an external free market mechanism, instead of an internal staking system. There is a cost to security, and so having as much of that cost tied to something universally accessible (energy) as possible seems like the most logical decision. If it is more difficult to participate in the 'validation market' (ie, act as a miner/staker), then we will expect more opportunity for validators to make profit, and thus the security of the network will be lower. This sort of 'red tape friction' creates a less efficiently secured network, dollar for dollar.

As humanity has progressed, there has been an undeniable trend of an increased capture and utilization of energy, to power our advancements. And yet still, we utilize such an incredibly tiny fraction of the sun's output, that we are nowhere near being about to 'run out of energy'. The variable that is obviously limited is our capital, and so we should strive to use that as efficiently as possible, in order to maximize our capabilities as a technological species.


What is the average size of a bitcoin transaction? I'm curious, since the inception of bitcoin, what is the average size (in bytes) of a bitcoin transaction?

To be clear, the easiest way to find this is not to take the size of the block-chain and divide it by the total number of transactions.  This is because there is a little overhead associated with block headers.  Transactions need to be accounted for one at a time for this averaging operation.

Has anyone taken the time to analyze this information and, if so, what were the results?  To be clear, I am interested in this answer as the data is stored in uncompressed-bytes.  I'm not interested in any textual (i.e. JSON) variation which might be used for network communication.

Just to give a few exact numbers, the current average transaction size (of all existing transactions until block height 498920) is 522.45 bytes.

If we take into account just the first 100000 blocks, then the average transaction size was indeed 238.51 bytes.

This is a plot of the average transaction size (aggregated monthly):

The peak on mid 2015 is produced by this 999657-bytes transaction.

These values can be computed using BlockSci.


Can a bitcoin wallet be restored from the files on a drive? Hard drive crashed and requires professional recovery (likely needs newly built heads by professionals in a clean room).  I don't recall what windows desktop bitcoin wallet software I installed and used about 8 years ago.

If I can recover the data files from the bad drive, can those recovered files be used to recover the bitcoin wallet by installing the bitcoin software on a new computer and then somehow copy some data files over from the recovered drive?  If so, how would I figure out which wallet software I had and installed / used when I look at all of the professionally recovered files?

Unfortunately,  I can't find my backup seed : (

If you used a wallet 8 years ago, you wouldn't have a backup seed phrase (BIP39/44 weren't created until 2013/14). So I have a feeling your timeline is off, or you never had a seed phrase in the first place. But anyways

Without additional info about what wallet you were using:

Generally, you'll want to find a 'wallet.dat' file (or similar), as it will contain the private keys to spend your coins. You will need to either find software that can read the wallet file, or find a way to extract the private keys from the file, and then import them into some wallet software. Private keys are not wallet-specific, but perhaps the wallet file could be. Without more info, it is hard to give specific advice.

Note: Considering the access to your device that the specialists performing the data recovery will have, you may want to consider the possibility of them finding the wallet files themselves. I don't have specific recommendations on how to approach that situation, but it is something to keep in mind.


How exactly does BIP11 work, and how can it be used, particularly with/without P2SH? I'm trying to write a BIP11-compliant C# client that creates a 2 of 2 or 2 of 3 transaction.

I'm also trying to understand if a 3 of 3 transaction is supported as well.

This example says they are creating a PS2H address, but I'm unsure of exactly what script is being signed, and the meaning of the parameters "2" in addmultisigaddress, and what happens when addmultisigaddress is called.

I have researched the BIP, the RPC documentation, and the forums.  I'm getting confused where if and when the P2SH is needed.

I think the reason you might be getting confused is that there are really two types of multisig, raw multisig and P2SH (pay-to-script-hash) multisig. P2SH multisig is basically just hashing the actual scriptPubKey desired and putting the scriptPubKey in the scriptSig. This stack exchange questions explains them in more detail: What are the limits of m and n in m-of-n multisig addresses?.

  I'm also trying to understand if a 3 of 3 transaction is supported as well.

Yes, you can do m-of-3 multisig transactions with both raw multisig and P2SH multisig.

  the meaning of the parameters "2" in addmultisigaddress

The number provided is the m in the m-of-n. So if you want a 1-of-2, you do:

addmultisigaddress 1 '["1xy..", "1Jm..."]'

The BIP11 (accepted) proposal you mentioned just made raw multisig a standard type of transaction that is recognized and forwarded on by standard clients. BIP16 (https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki) proposes the P2SH addresses, which allow for much shorter scriptPubKeys and support more types of multisig (e.g. 5-of-9, which you can't easily do with raw multisig because m-of-n multisigs with n > 3 are considered non-standard, as shown in the link in the first paragraph).


How do you create a merkle tree that lets you insert and delete elements without recomputing the whole thing? I have a merkle tree. The elements of this tree are in sorted order, so that anyone can create a proof that something isn't in the tree. So far, so good.

However, I also want to be able to add and remove elements from the tree. If I use a normal merkle tree, I have to recompute most of the tree. For example, I have the following merkle tree:

                    395
          /                     \
        85                       310
    /        \               /        \
  23          62          137          172
 /  \        /  \        /   \        /   \
1    22    23    39    60     77    82     91

(I'm using addition for the hash function, as an example.)

I insert 50 to the middle of the merkle tree.

                               445
                       /                  \
                    354                    91
          /                     \           \
        85                       269         91
    /        \               /        \       \
  23          62          110          159     91
 /  \        /  \        /   \        /   \     \
1    22    23    39    50     60    77     82    91

Every merkle branch after the 50 changed. I had to run the hash function 5 times. This would get pretty unwieldy for very big merkle trees.

I'm looking for a merkle tree with these properties:

Fast. I shouldn't need to recompute the entire thing (or half of the entire thing) to insert or remove something from the middle.
Authentic. If I have a merkle root, there should be only one tree that corresponds to that merkle root. Changing any part of the tree
should cause the validation to fail.
Deterministic. (Optional) This is essentially the opposite of the previous statement. If I take the elements out of a merkle tree, and
build a new merkle tree from those elements, I should get the same
root hash.
Proof of existence. Someone with enough of the tree should be able to make a proof that an element is in the tree, if that element is in the tree. This proof should be reasonably small.
Proof of non-existence. Someone with enough of the tree should be able to make a proof that an element is not in the tree, if that element is not in the tree. This proof should be reasonably small.

You can use a Merkleized binary trie.

You first hash all the elements of your set individually. In this example, I use a 3-bit hash function rather than 256-bit.

Let's say you have 5 elements in your set, and they hash to:
A: 011
B: 101
C: 111
D: 001
E: 010

Now you arrange them in a tree, by using the bits of the key hash as split conditions:

root

0

0

1: D

1

0: E
1: A

1

0

1: B

1

1: C

Now you associate every leaf node with the full key hash, and every internal node with the hash of its concatenated children.

The resulting root is:

Fast to update: the number of hash operations for an add or delete is proportional to the number of bits in the hash function (and does not depend on the number of elements in the tree).
Authentic: the root commits to the entire tree structure, so indirectly to all its leaves.
Deterministic: the order of insert/delete operations does not affect the tree structure.

A possible optimization is to compact branches constructed from internal nodes with 1 child. This leads to the following structure:

root

0

0: D
1

0: E
1: A

1

0: B
1: C

Now operations are on average logarithmic in the number of elements, and all other properties remain.


Blockchain implementation in banks Implementation of Blockchain in banks is said to be the new trend now. My question is: Would the private blockchain be kept private in a bank or will it be shared among a group of banks (or even possibly among all the banks)?

In the later case, is there no confidentiality issue, since a bank can know the transactions which are done by its competitors or its competitor's clients?

Think of a blockchain-based implementation of the financial backbone as the modern-day equivalent of Automated Clearing House (ACH), the national standard for processing checks.

Based on banking documents and blockchain organizations focusing on blockchain-based solutions for the commercial banking sector the solution will be a permission-ed, national-level blockchain with each participating bank being allowed access to the network. In this affect each bank would also be a miner with no reward, just confirming the transactions are valid.

The matter of confidentiality will be determined by the customers, and will pick their method of banking accordingly.


What are all the payment channels implementations? I know the Lightning Network (which Electrum wallet experimentally supports) is an implementation of a payment channel, but Mastering Bitcoin (2nd ed.) ch. 12, § "Routed Payment Channels (Lightning Network)" says:

The Lightning Network was first described by Joseph Poon and Thadeus Dryja in February 2015, building on the concept of payment channels as proposed and elaborated upon by many others.

What are the "many others"? Is the Elements Project's "pegged sidechains" "building on the concept of payment channels" too?

The Lightning Network is much more than an implementation of a payment channel. It is a peer-to-peer network whose core purpose is to route payment through a set of multiple payment channels.
Then, i think you are confused with regard to the quote: "many others" here refers to
persons not projects. See this wiki page for mentions of some of them.
Finally, as you mention Elements is defining sidechains (a peer-to-peer network whose core purpose is to update a block chain that is somehow pegged to Bitcoin) which are not "building on the concept of payment channels".
However, payment channels may (not yet deployed) be a good abstraction for interconnecting sidechains with Bitcoin or in-between them.


You cannot convert json string to hex representation. Transactions have their own binary format (you can read in wiki: https://en.bitcoin.it/wiki/Transactions). To create transaction in hex format, you can use bitcoin-qt (or bitcoind) function createrawtransaction. Example of using:

createrawtransaction
'[
    { "txid": "10d5b7f61be2fa2e5979043a7071d3dbd371bc72cefea22e43b2dd54a6e27a99", "vout": 1 }
]'
'{
    "14rbFswzZfkPGkbFZ7Ffj2qhQA1omvgiUx": 0.099
}'

This call will return raw transaction in hex:

0100000001997ae2a654ddb2432ea2fece72bc71d3dbd371703a0479592efae21bf6b7d5100100000000ffffffff01e00f9700000000001976a9142a495afa8b8147ec2f01713b18693cb0a85743b288ac00000000

After that, you must call signrawtransaction:

signrawtransaction 0100000001997ae2a654ddb2432ea2fece72bc71d3dbd371703a0479592efae21bf6b7d5100100000000ffffffff01e00f9700000000001976a9142a495afa8b8147ec2f01713b18693cb0a85743b288ac00000000

This call will return raw transaction in hex, which you can send to network using sendrawtransaction.

Note: be very careful, you can make mistake in amount, and lose your bitcoins.


Elliptic Curve Point at Infinity Let's take into account the Bitcoin curve. My questions are:

What exactly is the "point at infinity"?
Is there more than one "point at infinity"
How can I identify if my EC generated x and y are the "point of infinity"?
Is there a way to calculate the "point of infinity"?

What exactly is the "point at infinity"?

It's a point that is added to the points on the curve. Together they form a group. It has the following properties:

(x,y) + (x,-y) = infinity
(x,y) + infinity = (x,y)
infinity + (x,y) = (x y)

In other words, the point at infinity is the identity element of the addition in the group. Therefore some people write the point at infinity as "0".

  Is there more than one "point at infinity"

Just one.

  How can I identify if my EC generated x and y are the "point of infinity"?

The point at infinity is not on the curve, so it does not have x or y coordinates. It appears whenever a point is added to its own negation (for which the normal addition rule has no answer).

  Is there a way to calculate the "point of infinity"?

It simply is "the point at infinity", there is nothing to be calculated about it.


Bitcoin QT wallet doesn't sync Possible Duplicate:
  Bitcoin client won’t connect to the network

I'm using an iMac with OSX 10.8. Bitcoin-Qt which never seems to sync. I have withdrawn coins from Mt.Gox to an address generated by Bitcoin-Qt. While the transaction has registered with Mt.Gox, there is nothing in my wallet. Do I just leave it open until it syncs, start agin or what?

Did you include the transaction fee? If you don't, most miners won't accept it. The same thing happened to me.

Also, you need to wait until it syncs. You can check if it's been included by going to blockchain.info/address/*the address to which you sent it*. If it worked, the transaction should be listed there.


How to tell whether an address is local or remote? For example, I have a BTC address. Can I (using RPC) get information is this address my local or remote?

The validateaddress RPC will do precisely that.  Here's sample output from a testnet address with Bitcoin Core 0.10.0:

{
    "isvalid" : true,
    "address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe",
    "ismine" : true,
    "iswatchonly" : false,
    "isscript" : false,
    "pubkey" : "03bacb84c6464a58b3e0a53cc0ba4cb3b82848cd7bed25a7724b3cc75d76c9c1ba",
    "iscompressed" : true,
    "account" : "test label"
}

If the field ismine is false, the address doesn't belong to the currently-running Bitcoin Core wallet.


Can I see all transactions not included in a block yet? I'm running bitcoind and would like to see which transactions I've received but haven't been included in a block yet. Is that possible, or do I need to run special mining software to see that?

The upcoming release of the Bitcoin.org client, version 0.7, includes:

getrawmempool


Why is there a difference between the candlestick data on coinigy versus the data that binance provides? The candlestick data on coinigy.com does not match the binance official API. See the screenshot below:

Especially the open and close are very different, does anyone know why this is the case and if I can get the historic candlestick data from coinigy itself?

I think this is pretty weird because Coinigy is there for technical analysis and should be accurate.

Coinigy appears to use data from multiple exchanges, whereas Binance is just one exchange and their data is only for their exchange only.


Explain how CoinJoin enhances anonymity, in plain English? I just learned about CoinJoin, but I don't really understand all the jargon being thrown around. Can someone explain how this works where a 10-year-old can understand?

Alice wants to transfer 1 BTC from address A to address B

Bob wants to transfer 1 BTC from address C to address D

CoinJoin gives them a way to combine their transfers into a single transaction that has two inputs (A and C) and two outputs (B and D). Someone observing the blockchain no longer knows which one of the outputs is Alice's and which one is Bob's.

Because of some cryptographic magic behind the scenes, the participants of the shared transaction (there can be more than two of them) do not have to trust each other. Compared to traditional Bitcoin mixers, there is no possibility of coins being stolen. Also, CoinJoin transactions are compact and incur no additional fees (besides the usual transaction fees)

This is an example of a CoinJoin transaction: https://blockchain.info/tx/e4abb15310348edc606e597effc81697bfce4b6de7598347f17c2befd4febf3b

Blockchain.info has already implemented CoinJoin support (branded as Shared Coin) into their web wallet.


How does Bitcoin Gigahashes Convert to Ethereum Megahashes? I bought 6 XFX Rx 480 8GB graphics cards and I estimate they will do 25-30 megahashes with Ethereum.

When looking on Amazon for other rig ideas I was reminded that they also sell Erupters. The erupters I was looking at are £60 roughly for 16 gigahashes. Not sure if that is only with Bitcoin or not but most of them say Bitcoin in the name/title of the product in sale.

I was wondering what this would equate to in ethereum megahashes and why?

My guess would be that it is something to do with the the difference in complexity with the encryption method, or something like that, but of course, for economy reasons the most important thing I would like to know, if possible, is what hashrate they would generate for Ethereum.

Thanks for any help in advance.

Bitcoin and Ethereum use different hashing algorithms. General consumer hardware (like a CPU or GPU) can be easily programmed at a software level to perform either the Bitcoin or the Ethereum (amongst many other) hashing algorithms. However, specialized hardware (like the Block Erupters you mentioned, which are Application Specific Integrated Circuits (ASICs)) have the hashing algorithm hard-coded into the chip's design, allowing it to much more efficiently perform one type of work (Bitcoin's double-SHA256, for example) at the expense of flexibility--they can't be reprogrammed to do anything else.

On a side-note, a £60 ASIC which runs at 16 GH/s (which isn't a block erupter, it might be the USB Stick from GekkoScience?) is very unlikely to ever reach ROI. At current difficulty and Bitcoin price, and assuming free electricity, a 16 GH/s miner would bring in about £0.26/month, which is likely to get even worse as more mining power comes online in the future.


Bitcoin Core Old Wallet.dat Vulnerability Own a wallet.dat file from 2010-2011. Yesterday I saw there was a vulnerability which is makes attacking somewhat easier if your wallet is generated by old client and I'm pretty sure my wallet is affected that vulnerability because my last transaction is made 2010.

So my problem is I don't have any idea about wallet passphrase. Maybe the vulnerability helps to open my wallet. It is about AES padded encryption. But i don't have enough cryptographic knowledge to handle it. I'm aware it is brute force task but the vulnerability decreases time of task.

I hope that someone can create a brute force tool for me which is using the vulnerability, so that I can recover my wallet.

Github Report about vulnerability : https://github.com/bitcoin/bitcoin/commit/c682cdf3eda0f55297eb0e72a04508b7b9c2f5df

VulDB report : https://vuldb.com/?id.4883

The vulnerability affects the encryption of the wallet file, weakening the encryption by lowering the resources needed to brute force attack it.

Practically, this means if an attacker were to get a copy of your wallet.dat file, they would have an easier time brute force attacking it (ie. guessing your password would become a little easier), compared to an attack against a wallet.dat file using the same password, that is not affected by the vulnerability.

Any attack that exploits this vulnerability would have to be highly targeted, so for affected users the threat of attack is probably quite low. Perhaps ironically, by asking for help, you may draw attention to yourself as an affected user,  so I would be very wary of anyone offering a 'tool' to help you fix the issue!

I assume that your goal here is simply to ensure your bitcoins are secure. If you are concerned that someone may steal (of have already stolen) your encrypted wallet.dat file, a simple fix would be to create a new wallet using software of your choice, and then send the entire balance of the old wallet to the new one. This way, your new wallet file will not be affected by the vulnerability.


What happens if a miner deliberately ignores a transaction, and "wins"? Suppose a miner decides to solve the nonce for a particular block, where the miner deliberately excluded a particular transaction from this block. The miner "wins", i.e. they found the nonce value that, when added to the string of the modified block they were trying to solve, hashes to a number below the target number. They send the solution to the network.
Does their block, that ignores the transaction, get accepted by the network? If so, what happens to the ignored transaction? If not, why not?

Miners have complete perogative over what transactions to include. They may include random transactions, the highest fee paying transactions, just their own transactions, or no transactions at all.
If a miner doesn't include a particular transaction from their mempool, it stays there. It will be available for later miners to pick it up and include in their blocks later.
To incentivize miners to include your transaction, you can include a fee. Miners in practice will pick the transactions with the highest fee first. First matters, because blocks have limited capacity, and so there may be more transactions on the network than can fit in a block.


Electrum wallet is showing not enough fund My electrum wallet presently have 0.0047BTC. i'm trying to send 0.001btc to another wallet but it says not enough fund. Any limitations i need to know?

It's likely because of transaction fees. Go to tools > preferences > fees tab and check edit fees manually and set "propose replace by fee" to "always". Now on the send tab you'll be able to set fees manually. Note that if you set a fee that is too low and your transaction doesn't confirm you can right click on it on the history tab and choose increase fee to bump the fee higher.


Are Bitcoin / Cryptocurrency free & paid "Faucets" illegal in the USA? I was wondering if Bitcoin faucets were illegal in the USA? What about a paid bitcoin faucet where you pay in other coins to get a few cents worth of BTC?

The trade of cryptocurrencies for other cryptocurrencies is not regulated in the United States under FinCEN guidance or IRS guidance, as of August 12th, 2014

Cryptocurrencies are designated as property under IRS guidance, and property generally enjoys like-kind treatment to defer capital gains until that property is exchanged for US Dollars (or other fiat currency) and kept in US Dollars for a certain period of time. These are property regulations and a consequence of designating cryptocurrency as property.

As such a 'paid' faucet would not be money transmitting, or incur a tax event. And there are no other prohibitions on cryptocurrencies in the United States (from a federal standpoint, state and municipal governments may have leeway to make up something else).

A free faucet, on the other hand, may incur a tax event of some type (income?), but the amount is typically very small and sanctions against amounts that small are an afterthought.

Not advice.


What is the main difference between "light/thin client" and "client" in sense of "functionality" and "capability"? What is the main difference between "light/thin client" and "client" in sense of "functionality and capability" ?

I mean, what can a client does that a light/thin client cannot ? (ex. sending transactions? transaction confirmation? etc)

Usually the distinction is made between full nodes and lightweight nodes.

A full node independently validates all transactions. It guarantees that not transactions or blockchain will be accepted which spend funds without authorization (theft), create money out of thin air (inflation), or violate various other rules that exist for a smooth continued operation of the system. Full nodes guarantee this for every transaction, not just your own. Full nodes need to download the entire chain (otherwise they can't validate history), but do not necessarily need to store it on disk (see pruning).

A lightweight node, or SPV node, does not validate anything except proof of work. This means they rely on the majority of the network's hashrate to be honest.

In functionality there is little difference. The difference is in the trust model. Lightweight clients trust the network, while full nodes audit the network themselves.


How to Create New Genesis Block? I am trying to create a new crypto currency and i am struggling with creating genesis block with the bitcoin code. I am following this tutorial https://bitcointalk.org/index.php?topic=225690.0 and i believe the code is quite old.

I have changed the parameters and

genesis = CreateGenesisBlock(1515428732, 2018236893, 0x1d00ffff, 1, 50 * COIN);
   consensus.hashGenesisBlock = genesis.GetHash("");
   assert(consensus.hashGenesisBlock == uint256S(""));
   assert(genesis.hashMerkleRoot == uint256S(""));

but it is not compiling

chainparams.cpp:240:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;
    ^
chainparams.cpp:333:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;

I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.

229tx)
2017-09-07 13:40:39 UpdateTip: new best=00000000000008838dc29dd8f585e69dc53731d6de106179c6a76b1b20c31396 height=177243 version=0x00000001 log2_work=68.044269 tx=2915938 date='2012-04-26 03:22:53' progress=0.011538 cache=210.7MiB(789124tx)
2017-09-07 13:40:39 UpdateTip: new best=0000000000000729fce8abd24f2abb7f1080f603a7d5f75794c79afec3efbadd height=177244 version=0x00000001 log2_work=68.044301 tx=2915981 date='2012-04-26 03:11:31' progress=0.011539 cache=210.7MiB(789104tx)
2017-09-07 13:40:39 UpdateTip: new best=000000000000016217c799e6d414cbd420da4a134a3b1a9b30f728b7da81d6d9 height=177245 version=0x00000001 log2_work=68.044333 tx=2916006 date='2012-04-26 03:09:07' progress=0.011539 cache=210.7MiB(789117tx)

genesis.GetHash("");

This is incorrect. GetHash does not take a parameter, as said in the compiler error. This should just be genesis.GetHash();.

  I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.

The debug.log file is only modified when  you run the program, and because it isn't even compiling, when you run it, you are not running it with any of your changes.


how to get one address from two public keys? Parsing an input script of a transaction, I’ve come across two public keys in the script. Either public key is 33 byte long.

I know how to transform a single 33 byte long public into an address.

What is the mechanism of obtaining an address from two or more public keys?

Note I’m not interested in the bitcoind technique via the createmultisig command.

I answer my question for the benefit of future generations of readers.

If you have only one 33-byte-long public key, you obtain an address by applying a standard technique that consists of 5-7 steps, depending on how you view the technique.

If you have more than one 33-byte-long public keys, you have to construct a so-called redemption script or, in bitcoin parlance, redeemscript. After you’ve constructed the redemption script, you apply the standard technique to the entire redemption script.

Technically, a redemption script is a byte array. Suppose you have two public keys. Conceptually, your byte array should look like this:

[OP_1][length of public key 1][public key 1][length of public key 2][public key 2][OP_2][OP_CHECKMULTISIG]

In my question, I said that I had parsed the input script of a transaction. Therefore, I didn’t have to construct the array. The redemption-script array was already in the input script. I made a “mistake” of extracting the public keys from the redemption script, believing I should massage only the public keys. I should have taken all the bytes of the redemption-script array.


Export all address from bitcoind on one server to bitcoind on another server I need to install bitcoind on a new server, but I already have many addresses in use on the old server. If I want to reuse all of those addresses on the new server, do I need to copy just the wallet.dat file or all files in the Bitcoin data directory?

To re-use the same addresses with the new server, it will be sufficient to copy just the wallet.dat. That single file contains the private keys to all receiving addresses that have been used since the wallet.dat file was originally created.

I would recommend copying across the wallet.dat, then making sure your addresses are there and available in bitcoind on the new server. If they are, then the wallet was copied over successfully and you're good to go.

As @Jannes mentioned, you will need to turn off bitcoind on both servers before you do the copy.


MintChip and Bitcoin - how do they compare? The Royal Canadian Mint announced some time ago a new solution called MintChip, which appears to share some similarities to Bitcoin. How do those two projects differ, and how are they similar?

Note: My information about MintChip is a bit limited and may be incorrect. Corrections are appreciated.

Authority: Bitcoin has no central authority. MintChip is run by a government agency.

Security: Bitcoin is secured by cryptography. MintChip is secured by tamper-resistant hardware. (The Mint says they'll support other models, but I'm quite puzzled how they'll make that work with their framework.)

Anonymity: Bitcoin is pseudonymous. You perform transactions through an account and transactions are public. You can have more than one account. MintChip transactions are only known to the participants and the system operator.

Currency: Bitcoin is a commodity that acts much like a currency. The supply of Bitcoins is fundamentally limited by the mathematics of the system. MintChip is a way to trade fiat currency that can be devalued by inflation and whose supply is limited only by politics.


Is Bitcoin Hong Kong Exchange a legitimate trading platform? I've think the Site of BTCHKEX appears fraudulent to me. Has anyone dealt with them?  Thanks.

They did not appear fraudulent, only overpriced.
But I only made a handful of transactions.
Anyway they are closed now, my wallet is still there.


How to read a transaction from a block? Who paid whom? I'd like to know how to read a 'transaction', so if we take an example of this transaction (which comes from block #520156) it's easy to spot that 'th' paid 'U8' 0.005BTC and
'9E' paid 'Y5' 0.013BTC. but what are what are the 'DD' and the 'vf' for (marked in green)?

Also, why this transaction (..bac192) includes those 2 payments, are those payments related somehow? (shouldn't a transaction have one payment?)

When you send a Bitcoin transaction, your wallet software will use one or more existing Unspent Transaction Outputs (UTXO) to fund the transaction. The transaction will then specify the new owners of the consumed balance in the outputs. If the amount spent in the inputs does not match the amount in the outputs plus fees perfectly, the remainder will be sent back to the sending wallet in a change output. This particular transaction appears to have spent four UTXO to pay a single recipient, sending back the remainder of the input balance to the sender. Alternatively, this transaction may have paid two recipients, but that is not the most common pattern on the blockchain today.

Anyway, while multiparty transactions exist on the network (e.g. look at coinjoin here on the site), they are fairly uncommon today.


How many blocks have no unspent transaction outputs? I can't seem to find statistics anywhere on how many blocks have no UTXOs, or what the distribution of UTXOs are in blocks over time, or anything like that. If you could point me in the direction of something along these lines that'd be great!

The page Bitcoin UTXO Stats has a visualization of the number of UTXOs in each block (image with orange pixels).

Each pixel of the image represents a block, and the color of the pixel indicates how many UTXOs can be found in that block (black pixels indicate a few UTXOs whereas orange ones indicate lots of UTXOs). Hovering over a pixel shows data about the specific block and clicking on a pixel redirects to the block page on blockchain.info.


How much does it cost in computing time/hardware to mine bitcoins? I'd like to know how much the number changes depending on whether it's done using hardware or just in software. I'm curious how long you'd have to leave a computer mining bitcoins for it to pay for itself

It really depends on how much you're willing to spend.
Low end
Let's talk about the very smallest investment you could make for mining bitcoins: a Raspberry Pi. It can do 200,000 hashes per second, which might sound like a lot, but actually it's about 0.000001% of the total network hashrate.
Power: 3.75 W
Hashrate: 0.2 MHash/s
Cost: $35
(Note: this doesn't mean a RPi is useless for mining. You can use it as a host for your ASIC/FPGA miners.)
Mid range
Okay, CPU mining is bad, but what if we use GPU's?
Let's say we use a $162 graphics card, the 5830 from AMD. Let's throw in another $187 for case/motherboard/power supply. (Based off of this list I just threw together.)
Power: 175 W
Hashrate: 302 Mhash/s
Cost: $349
High end
Okay, let's get something specifically designed for bitcoin mining - the ModMiner Quad. It costs $1070, but it needs a host, so let's use a raspberry pi for that.
Power: 43 W
Hashrate: 800 Mhash/s
Cost: $1105
Ultra-high end
Okay, let's say that you have stupid amounts of money to use on mining hardware. Let's say that you can get a Bitforce Mini-Rig. (They are not being sold yet.) In fact, let's say that you can get 10 of them. This gives you 40% of the bitcoin hashrate.
Power: 15,000 W
Hashrate: 15,000,000 Mhash/s
Cost: $299,000
Sources for most of this
The lesson here is that you can spend any amount of money on bitcoin mining.


Wallet suddenly shows transactions from someone else I restored a wallet recently that I have not used in years. Back then, it was only Bitcoin, but at some point Ethereum was added. So now I see all my Bitcoin tx, but on top of that the Ethereum part of the wallet (which I never used) shows transactions that someone else must have performed.
Any idea what's happened there?

According to this link: https://media.mycelium.com/2020/01/31/mycelium-wallet-to-support-eth/
Mycelium supports few other cryptocurrencies now.

So now I see all my Bitcoin tx, but on top of that the Ethereum part of the wallet (which I never used) shows transactions that someone else must have performed.

Not sure why did this happen.
What can be done to resolve this or use Bitcoin in a better way?

Create an issue in https://github.com/mycelium-com/wallet-android/issues

Use better Bitcoin Wallets. Example: Bitcoin Core, Electrum, Wasabi, Specter, Bluewallet, Samourai etc. How to restore wallet with your backup: https://bitcoin.stackexchange.com/a/61401/

https://www.reddit.com/r/Bitcoin/comments/4jy1yp/myceliumelectrum_seed_technical_question/d3apuka?utm_source=share&utm_medium=web2x&context=3


With the btc price changing every second, how can you accurately display conversion to fiat currency? So the ASK price of BTC is constantly moving -- every second. I'm trying to build out a simple UI where the user can enter in the amount of BTC they want to buy, and then display how much that will cost them in USD. But when the user finally presses the 'Buy' button, the price of BTC might have changed slightly, and the user will be charged a different value of USD than what was displayed in checkout. WTF? Is there a way around this? How are other exchanges handling this? I know this can be achieved with limit orders and such, but I'm trying to accomplish this with simple market orders.

There is not a way around this unless you are using an exchange. But, even exchanges have a disclaimer:

  Market orders may be partially filled at several prices. Each part of
  your order will be shown in the fills panel. See Coinbase Pro - overview of order types

The way exchanges work is sellers place limit orders, which show up on the order book. When a buyer does a market order, it will buy up the lowest priced volume that is already on the order book. Basically, you have to remember there is a seller for every buyer, and everyone is choosing their price. Things happen fast, if your order is placed right after someone else buys all the volume at the price you wanted, you might get a different price.

Your best option is probably to use an exchange api, and get a feed of the order book, so it is as real-time as possible. E.g. see Coinbase Pro API and their Level 2 channel in Websocket Feed.