Freelancer.com-like website but based only on BC payments using some sort of escrow-like system to make sure that employer has enough money? Can a project similar to Freelancer.com or elance.com but based only on BC payments be created or the implementation of BC transfer between the employer and the freelancer would be too complicated?

I mean, i.e. freelancer.com is using escrow for transactions etc.

Is something silimar possible to develop but only for BC? If yes, is there some company that can do it like e.g. https://www.escrow.com/index.asp but with bitcoins?

Such projects are possible with Bitcoins. Generally, what you can do with money, you can do with Bitcoins.

Escrow services in Bitcoin were popping up every now and then in the earlier days of Bitcoin, but I don't recall any of them becoming too popular. However, setting up an escrow-like service should be fairly simple. If you need some help, you can drop me a line ;).

There is http://dogerr.com. It is a freelance marketplace where people can get hired for bit coin, litecoin and dogecoin. It's free to use.


What does "prev_out" and "n" mean in blockchain.info's API data? When getting information about transactions with blockchain.info's API, every transaction contains exactly one "prev_out" object, and within that object "n" is always equal to either 0 or 1.

What do these things stand for/mean?

A transaction consists of a number of inputs and a number of outputs. Outputs define a script that need to be executed to be able to spend the coins in the output. Inputs provide data to enter into an output script to make it execute successfully and to spend the coins in it.

So, a transaction input must be able to reference the output it is willing to spend. Outputs in a transaction are ordered, so an output can be referred to by specifying the transaction ID of the transaction it has been defined in, and the index it has in the list of specified outputs in that transaction.

The prev_out field is the transaction hash (txid) and the n is the index of the output.

It's not true that every transaction contains exactly one prev_out value. However, many transactions do. This is because many transactions have only one input. You must know, though, that it is possible to have multiple inputs.

Previous tx is a hash of a previous transaction. Index is the specific output in the referenced transaction. see: https://en.bitcoin.it/wiki/Transactions


0 hashes per second in Qt for new altcoin Lately I have become interested in the way crytocurrency works. So I decided to make my own cryptocurrency to learn it's internal workings.
I used a clone of SmallChange and followed this guide.
Everything compiled well, but when I run the program, be it via command line or the qt interface, when I tell it to start mining it just tells me that it is mining but the hashespersecond are 0.
I tried building the litecoin source on my machine and used the exact same configuration that I used in my own altcoin (the same ".conf" file) and when I tell it to mine it does mine.
For my altcoin I used the ports:

55883 for RCP
55884 for P2P

My question is, is my computer not mining my altcoin because I'm alone on the network or it is happening because I have made some mistake in my code?
Thank you in advance :)
Edit: my output for "getinfo" is:
{
 "version" : 1000000,
 "protocolversion" : 60001,
 "walletversion" : 60000,
 "balance" : 0.00000000,
 "blocks" : 0,
 "connections" : 0,
 "proxy" : "",
 "difficulty" : 0.00024414,
 "testnet" : false,
 "keypoololdest" : 1369621665,
 "keypoolsize" : 101,
 "paytxfee" : 0.00000000,
 "mininput" : 0.00010000,
 "errors" : ""
}

and the output for "getmininginfo" is:
 {
 "blocks" : 0,
 "currentblocksize" : 1000,
 "currentblocktx" : 0,
 "difficulty" : 0.00024414,
 "errors" : "",
 "generate" : true,
 "genproclimit" : 4,
 "hashespersec" : 0,
 "networkhashps" : -9223372036854775808,
 "pooledtx" : 0,
 "testnet" : false

}

i did same thing bro :) i am very happy when you saw your question :) firstly you have to connect another computer . and you have to see "connection=1" To do that, you have use command: ./testcoin -connect= # . and you have to add listen=1 to main pc and addnode for both pcs.However, hashespersec is also zero for me :(


Should we wait 10 minutes to confirm a transaction I have read this proof of work calculation takes about 10 minutes. That mean people who are making the transaction should wait 10 minutes ?

Let's imagine i want to buy a drink with bitcoin. The waiter should wait 10 minutes to be sure the transaction is okay before giving me a beer ?

Thanks

Yes, you need to wait, because the tx fee is too low, it won't be mined ever, so the transaction will be refused.

BUT if you're using the lightning network, you can create instant transactions. You can read more about lightning.

If you're dealing with tons of money, recommended to wait for 6+ block confirmation, because a strong miner can rebuild the last piece of the blockchain (this is almost impossible)


Problem integrating Bitcoin daemon with PHP I have installed the daemons of Bitcoin, Litecoin and Dogecoin on the same server. All three of them are up and running, but the Bitcoin daemon does not reply with anything when I run bitcoind getinfo. It may be network issues or something like that. I have installed PHP on the same server and created an index.php file in the /var/www/ folder.

Content of index.php file:

<?php
    include_once('Bitcoin.php');
    include_once('jsonRPCClient.php');
    $dogecoin = new jsonRPCClient('http://user:pass@localhost:8332/');
    print_r($dogecoin->getinfo());
?>

Content of Bitcoin.php:

<?php
    class Bitcoin (
        // @var string
        private $username;
        // @var string
        private @password;
        // @var string
        private $url;
        // @var string
        private $id;

        public function __construct($url,$username,$password)
        {
            $this->url=$url;
            $this->username = $username;
            $this->password = $password;
            $this->id = 1;
        }

        public function __call($method,$params)
        {
            $params = array_values($params);

            $request = json_encode(array(
                                       'method' =>strtolower($method),
                                       'params' => $params,
                                       'id' => $this-> id));
            $curl = curl_init();
            curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_HTTPHEADER, Array("Content type:application/json"));
            curl_setopt($curl, CURLOPT_URL, $this->url);
            curl_setopt($curl, CURLOPT_USERPWD, $this->username.":".$this->password);
            curl_setopt($curl, CURLOPT_POST, TRUE);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
            $response = curl_exec($curl);
            curl_close($curl);

            if(!$resposne)
            {
                throw new Exception('Unable to connect to '.$this->url, 0);
            }
            $response = json_decode($response,true);
        }

        Then there are a condition to throw a different error upon a different situation.

    }

Howdy?

Ok I was searching for tutorials all over internet on "how to integrate bitcoin daemon with php" I came up with many and none of them helped me to get it working flawlessly, some of them threw unexpected and strange errors after 90% completion and some of them good enough to throw error in starting only which saved my time and efforts. Now that I have done what I was looking for why not create a step by step tutorial to help fellow members. So let's get started.

Before we start you should install tmux which helps you save your work even if you are disconnected from the vps. To install tmux:

sudo apt-get install tmux

to start tmux simply type tmux and to get back on mai screen press ctrl b and then d to restore the session again type tmux attach.

I am expecting you have a Ubuntu 12.x or later because that is what i used for installation. Log in to your VPS or your computer's terminal and install python software properties by typing following command :

sudo apt-get install python-software-properties

then add repository ppa:bitcoin/bitcoin by typing following command

sudo add-apt-repository ppa:bitcoin/bitcoin

In my case this didn't work and threw an error stating that add-apt-repository command not found. In ubuntu later version versions this command is not found under python-software-properties package, like in previous versions, but available in software-properties-common. So I had installed it by running these commands :

sudo aptitude install software-properties-common

To find in which package the command we are looking for exists the following will be of help:

sudo apt-fille update

Unfortunately in my case this was also not installed so I had installed it by running following command :

apt-get install apt-file

Now I got the message "The file is up to date"

Now run
    sudo apt-file search add-apt-repository

You will be prompted to confirm this installation, press Enter key to confirm.

Now run

sudo aptitude update

and then
    sudo aptitude install bitcoind

Make a new directory by typing :

mkdir ~/.bitcoin
cd ~/.bitcoin

Create a new file inside this directory named bitcoin.conf by typing:
    nano bitcoin.conf

insert the following code in the text file:

server=1
daemon=1
rpcuser=any_username
rpcpassword=any_password

Exit by pressing ctrl+x to confirm the changes press Y and then press return key. Start the bitcoin daemon by typing:

bitcoind

Bitcoin daemon is now installed and runing you can check it by running the following command

bitcoind getinfo

Now we will install apache and php on our server

To install apache we will run th following code:

sudo apt-get install apache2

once apache is installed verify it by typing your ip address in the browser it will say It works!

now we will install php by following command:

sudo apt-get install php5 libapache2-mod-php5

now navigate to var/www folder and download jsonRPCClient.php with the following command:

wget http://pmtocoins.com/JSON-RPC_PHP_light.zip

once downloaded unzip it by typing:
    unzip JSON*.zip

no move to the directory by:
    cd json*/includes

and move jsonRPCClient.php into your www folder

now create a new index.php file in www folder with following code

<?php
include_once('jsonRPCClient.php');
$bitcoin = new jsonRPCClient('http://your_username:your_password@127.0.0.1:8332/');
print_r($bitcoin->getinfo());
?>

and you are done navigate to your ip address on the browser e.g 161.232.12.1/index.php

You can have a look on API call list here : https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

.
You can use Open Source Bitcoin-PHP Payment library -

https://github.com/cryptoapi/Payment-Gateway

    <?
        require_once( "cryptobox.class.php" );

        $options = array(
        "private_key" => "",        // private key from gourl.io
        "orderID"     => "your_product1_or_signuppage1_etc",
        "amountUSD"   => 2          // 2 USD
        );

        // Initialise Payment Class
        $box1 = new Cryptobox ($options);

        // Display Payment Box or successful payment result
        $paymentbox = $box1->display_cryptobox();

        // A. Process Received Payment
        if ($box1->is_paid())
        {
            // Your code here to handle a successful cryptocoin payment
            // ...
        }
        else $message .= "The payment has not been made yet";
    ?>
    <!DOCTYPE html>
    <html><head></head>
    <body>
    <?= $paymentbox ?>
    <?= $message ?>
    </body>
    </html>


How do Bitcoin and Colored Coin react to malformed transactions? I need some help to clarify Bitcoin and colored coin mechanics.

Are the assumptions below correct (and complete)?

If an error (maybe a fraud) is presented in a Bitcoin transaction, nodes (including the miner) reject this transaction and do not forward it to other nodes. This transaction will never be included in a valid block.
If an error (maybe a fraud) is presented in the "color code" (included after OP_RETURN) of a colored Bitcoin transaction, this is a legal Bitcoin transaction accepted by (non-colored) nodes and mined by a miner. But these colored transactions are verified, rejected and ignored by colored nodes and therefore they are forgotten by the colored coin network.

Thank you!

I think you are correct.
It is perfectly reasonable that a colored-coins transaction is malformed while its bitcoin-level data is correct.

Indeed, most colored-coins transactions are legal bitcoin transaction in any case. Think of wallets like Colu, which cover every transaction for you. It's very unlikely that something done automatically comes out malformed.

Anyway, I wouldn't say that colored-coin nodes "forget" this transaction.
They will just consider it as a non-colored transaction or an invalid colored-transaction, depending on the error.
However, since it is a valid bitcoin transaction, it will be included in the blockchain (which is the same for both colored and non-colored nodes);
and then "visible" to all nodes.

Generally speaking, I would say it will be simply considered as the other (non-colored) bitcoin transactions.

I'm not sure what you mean by a "colored coin", so I'll just answer question 1.

Usually the wallet software would reject the transaction. If it got past the wallet software, it's likely someone will be doing something malicious. This is where the network comes in. No matter how many malicious nodes the attacker has, there will be much much more clean nodes. They will reject the transaction.

However if the attacker somehow managed to get a majority of nodes, the miner's node will still have to be tricked. The miner will reject it unless they are in on it.


Historical Prices Immediately Following Bitcoin Halving I searched here for posts on historical price movements following Bitcoin halving but didn't find much.  I found some old posts that inquired about the anticipated price changes expected for future halvings, but my question is not speculative in nature, but about what has actually happened to the price of bitcoin during past halving events.  Can anyone provide a brief summary of what has happened within a few days or weeks to BTC price (or even of other relevant cryptos) in the past when a having has occured?

First halving happened on 2012-11-28, the price was around $12, after the event the prices started to rally and by April 10th, 2013 it reached over $250, after which it crashed to around $60.

Second halving happened on 2016-07-09, the price was around $575, after the event it fluctuated for a couple of months and then we know what happened next.. $20k top and now it is around $3.5k

The third halving will happen approximately on May 25th 2020
Source and countdown: https://www.bitcoinblockhalf.com/

You can check the dates and see how the price acted on this chart:
https://www.tradingview.com/chart/?symbol=BITSTAMP:BTCUSD

Afterr historical max price ~3k$ BTC on june'17 BTC fall down due to fork effects expectations. Few days next to fork BTC began rising as ability to get more BCH for holding more BTC wile halving ends. After that was rally till dec.17 max.


Owner of Blockchain Technology Is Blockchain an open source technology or is it owned by a company?

I didn't see it spelled out but Blockchain.com website appears to belong to a company.

There also seems to be different implementations of blockchain databases/ledgers.

Blockchain is some concept. There are different implementations of blockchain. Most of them open source. The most notable one is the cryptocurrency Bitcoin with their reference implementation -Bitcoin Core.

Blockchain.com is just the company with the website which provides some services related to the bitcoin cryptocurrency and owns very attractive web address.

Its called blockCHAIN for a reason, There are many makers of this masterpiece this son. I hope it works for you, Best of luck mate.


How would SPV proofs be verified when moving assets back in 2-way pegged sidechains? I've seen similar questions posted all around, but haven't found an answer I can comprehend.

Ok, so the process of 2 way pegging is:

I move some coins to OP_SPVPROOFVERIFY on the parent blockchain.
I wait for some time (e.g. 1 day)
I get coins on the sidechain, transact.
Now, I want to move some of those coins back to the parent/main blockchain.
I send them to a special address on the sidechains, and they are now locked on that chain.
... magic magic
Now I can "SPV prove" that the coins are done with on the sidechain and are now free for transacting on the main chain.

How does step 6 work?

Assumptions

Only a subset of the parent chain miners & spv & full nodes are aware this sidechain even exists
The sidechain may use completely different proof of work, block format, address scheme (Or rather: what can a sidechain change compared to Bitcoin, and what is fixed?)

Under these assumptions, how can a full node running the parent chain recognize that the coins really vanished from the sidechain (of which they are not explicitly aware)? Remember, the parent full node isn't aware of the type of proof of work (if any) that happens on the sidechain, address scheme, really it only knows and speaks the language of Bitcoin, not the sidechain. So how does step 6 work?

Your question is spot on and poses the main problem of sidechain interfacing: How to prove to some chain (call it the "mainchain") that an event (such as a deposit) took place on a remote chain (call it the "sidechain").

As far as I'm aware there is as of yet no precise specific of how this works, but there are several approaches that can be taken. The approach usually taken here is to allow for a set of "functionaries" or "fishermen" to observe the transaction on the sidechain, wait for it to become confirmed there, and then vouch for the fact that it took place by signing off a statement (a "certificate") which attests to the fact that the transaction in the sidechain really took place. This can work well if there are some honesty assumptions about the functionaries, e.g., that the majority of them is honest. In that case, in practice, the withdrawal can really be a multisig check. This approach would work with the existing bitcoin implementation. This approach is very compatible with sidechains whose consensus is permissioned/byzantine, e.g. Plasma, Polkadot, Elements.

If you don't want to remain within the realm of bitcoin, there are more elegant solutions with different trust assumptions that can be realized. If you dislike the threat model of a centralized group of functionaries (or a "federation" thereof) and you want to go completely trustless, you need to produce a proof of a remote event in a decentralized manner. This proof will need to have the form of a simple string which attests to the fact that something happened on the remote chain, even if the local miners do not connect to that remote chain and do not know how its consensus works.

If the sidechain has Proof-of-Work consensus, then these proofs make a claim which attests to the fact that sufficient proof-of-work took place to bury a transaction on the remote chain. As they prove that proof-of-work took place, they are "Proofs of Proof-of-Work" (PoPoWs). The verification of such proofs is not a trivial manner and bitcoin does not have an opcode to do this currently, nor is there any support being planned. Hence, such schemata would be possible when the mainchain is a Turing-complete blockchain or supports a PoPoW opcode (unlikely).

On the other hand, the sidechain has to support the generation of these proofs too. This can be built-in to the chain, like ERGO, WebDollar, or Nimiq. A blockchain without PoPoW support can add it without soft forking and without miner approval by conducting an appropriate velvet fork.

Finally, these PoPoWs have to be produced by sidechains maintainers in a "one-shot" attempt that generates a simple string and they should not require interaction, i.e., they should be Non-Interactive Proofs of Proof-of-Work (NIPoPoWs). Given these ingredients, you can do it in a completely trustless manner.

All of the above constructions pre-suppose that the sidechain and mainchain survive securely independently. For example, the sidechain needs to have honest majority computation power if it's PoW-based.

To summarize, bitcoin does not currently have a way to do what you're asking in a trustless manner, but there are federated / cothority ways to do it. If you're willing to work on new systems, you can do it in a decentralized manner.

Disclaimer: I am one of the co-authors of the Non-Interactive Proofs of Proof-of-Work paper.

The first important thing to understand is that this method is one of two different ways of moving coins back and forth between two chains. The other is called Federated Peg, which I believe will be more successful despite being less technically sophisticated and more centralized.
General concept
The first step is that you send a transaction on the sidechain that locks your money in place. Once that transaction has a few confirmations, you create the SPV proof to send to the mainchain.
Let's go into more detail about that last step:
When you run an SPV client, your client doesn't download full blocks. It downloads headers. Then, it downloads the transactions to or from your wallet. Then, it downloads the merkle branches to connect your transaction to one of the block headers.
When you create an SPV proof, you take those block headers that you downloaded, and those merkle branches that you need to connect to your transaction, and your special coin-locking transaction, and you serialize them into a single datastructure.
Why do we need to serialize the SPV proof at all?
…can't the nodes checking the SPV proof ask nodes on the sidechain to provide the SPV data?
No, because the sidechain nodes might reply differently to different mainchain nodes. That would result in a fork of the mainchain. A serialized SPV proof will be evaluated the same way by all mainchain nodes.
Some complications
SPV proof might not match sidechain network
If I have lots of mining power, I don't need to have money on the sidechain in order to withdraw money from sidechain outputs on the mainchain. (i.e. I can fake a sidechain withdrawal.)
This is how it works: I create a transaction from a fake output on the sidechain. If I broadcasted this to the sidechain, all of the nodes would reject it. However, I mine a block containing this transaction, and I keep going until I get enough blocks that the mainchain will trust my SPV proof.
Mitigations

Require more confirmations before moving money from sidechain to mainchain
Create a grace period where someone can block your withdrawal by creating a 'counter SPV proof,' which shows a longer chain of proof of work that does not include your block header.
When the sidechain detects that someone successfully stole money, it marks down all future withdrawals to avoid a bank run.

What you're depositing won't match what you're withdrawing
If you're using the sidechain for transactions, you're going to wind up with more or less than when you started. However, this is a softfork, so we can't just deposit all of the incoming funds into a single pot. All of the funds are spread around many different outputs, and in Bitcoin, you need to entirely spend any output you claim. (You can't partially claim an output.) There are two solutions to this:

Lock up the exact amount of money of an output on the mainchain, then claim that. Potentially do this many times. This is simple, but has two problems: first, it uses more blockchain space than nessary; second, if there is no set of outputs that add up precisely to what you're withdrawing, some of your money will be stuck in the sidechain.

Allow people to claim one or more outputs, and optionally send change to another OP_SPVPROOFVERIFY output. This solution is much more flexible, but has some hidden teeth. (Can you accidentally send an 80 BTC miner fee because you screwed up your javascript? Will people have an incentive to avoid the dust outputs, leading to a bunch of outputs that nobody wants to pay to redeem?)

Things that aren't complications
Nodes on the mainchain that don't understand OP_SPVPROOFVERIFY
Since this is a softfork, not all nodes have to upgrade.
What can be changed in a sidechain?
Since we're supposing that we're designing a new opcode from scratch, we can make it support many different things. It could support Scrypt, X11, whatever hashing algorithm we want. It can't support pure Proof of Stake in a meaningful way. It could support multiple different target times, address types, etc.
However, it can't support unanticipated changes, so if someone comes up with a brilliant change that's visible to SPV clients, it won't work with the above.
Well, that's not entirely true. You could create two instructions, OP_SPVPROOFCHECKERREGISTER, and OP_SPVPROOFVERIFY. The first one would register an ethereum-like script that could keep state, and would check all incoming redemption requests. The second would commit a sum of money until the former script said that it could be unlocked. That would allow arbitrary SPV proof systems (although it still wouldn't allow pure PoS systems) at the cost of increased complexity.


How does the Bitcoin forex work? Does it work differently in relation to a regular forex because of its underlying technology?

How can the market calculate its value?

No, it's all the same. Well, maybe there are some very small differences, but in general it's the same as forex. I would say that the cryptocurrency is much more unstable, and this is why I prefer trading CFDs on Investous broker. I am much better in that area, and it's much easier for me to analyze this market. However, it has the same thing at base, so, if you are already good in one area, you will be successful in the other one too.  I would suggest reading more information about that on the internet, there is a lot of information available on that topic


What is the Bitcoin spot price and how is it calculated? I was offered to buy Bitcoin for today's spot price (MtGox to be specific). So, I am wondering, what is the spot price and how is it calculated? Is there a standard tool to look it up?

Just like with other commodities, there can be multiple "spot price" numbers.

With gold, for instance, there can (and usually will) be different price on the Comex exchange versus the price the at the auctions in London for local delivery there.

So when referencing the spot price, that is ambiguous until the specific market whose prices will be used are clearly defined.

Even then there is the issue of the the bid/ask spread at any point in time.  Since there is no regulations defining how spot price is computed, there is ambiguity between whether the highest bid offer should be the spot price, or the lowest ask offer.  Others might consider the value from last trade as being the spot price.  Another approach is to find the value exactly in the middle of the bid and ask and deem that as the spot price.

BitPay uses an algorithm that attempts to be fair in determining "spot price" by using multiple exchanges:

https://bitpay.com/bitcoin-exchange-rates

And Coindesk provides a proprietary spot price service where "spot price" also is computed using data from multiple exchanges:

http://www.coindesk.com/price
http://www.coindesk.com/coindesk-launches-proprietary-bitcoin-price-index/

There is not single "spot price" for bitcoin. There are only bid and ask prices on various exchanges, for various currencies.

You have to factor in how much BTC you want to buy and then look at the order book to see what price you will pay to buy or sell.

There is a tool to view all markets for a given currency, see http://bitdango.com/currencies to view all currencies. Then pick a specific one (USD, EUR, PLN, etc) you are interested in. For example, here is the USD URL:
http://bitdango.com/markets?quoteCurrencies=USD - that gives you all the bid/ask prices for Bitcoin Markets that support USD.


How do I buy Bitcoin with cash? How do I buy Bitcoin with cash? I am Canadian, and have a lot of cash that I would like to convert to Bitcoin without using any banks. Can I do this?

Yes surely you can, Check out this website : https://localbitcoins.com/country/CA

I knew about One Popular way to buy Bitcoin with cash that is Localbitcoins, there has a payment method to buy Bitcoin with cash.


Bitcoin Core RPC "importaddress" for a P2SH watch-only I am trying to import a p2sh address as watch-only:

bitcoin-cli importaddress <P2SH ADDRESS> true true

for which the command seems to execute, pause, then after a few minutes give me the error message:

  error: couldn't connect to server: unknown (code -1)
      (make sure server is running and you are connecting to the correct RPC port)

Why is this not working for me?

I believe the issue is that you forgot the label parameter. According to the RPC help documentation, the parameters for importaddress should be:

 importaddress "address" "label" rescan p2sh

You have used "address", rescan and p2sh but not label, so the error is likely due to an issue converting the parameters you provided into the ones it expected.

But the fact that the error message is so hard to understand / unrelated to the actual error is a bug, please open an issue on github here: https://github.com/bitcoin/bitcoin/issues

for some reason bitcoin-cli requires bitcoin.conf to be setup before it can work. To do this, you can go to your bitcoin data directory and add the following:

name the file bitcoin.conf then add the config file or you can just add:

rpcuser=Randomusername
rpcpassword=randompassword
server=1
daemon=1
listen=1


Does the bitcoin block contain minimal transaction detail? (Is it as private as possible given the proof-of-work design?) From https://crypto.stackexchange.com/questions/508/could-one-prevent-double-spending-in-decentralized-digital-currencies-like-bitc

"Now, the only information about the transaction that needs to be public is enough information to prove I have the coins and prove that I didn't transfer them elsewhere. As it happens, the Bitcoin protocol leaks much more information than this (for example, the account I transferred the coins to). The protocol could have been designed to make less information public if that was desired."

Is this true, could the block-chain report less data but still gain the proof-of-work mechanism's benefits?  If so, what aspects of the blockchain are non-essential and what is the reason for including them?

In order to send someone some coins, you need to know their public address.
In order for them to redeem their coins, they have to show everyone that they possess the private address associated with that public address.

You could try encrypting your public key by some means and later decrypt it when you want to spend the coins, but you'd probably have to provide something that could identify you similarly to using a public key.

You could alternatively encode only transaction hashes in the block, rather than actual transactions and only send the actual transaction to the peer you are sending the coins to. This approach though creates a lot of new problems with validation and so forth.

All in all, Bitcoin protocol doesn't have much excess data. In fact, by today's standards one may say it is trying to be too slick at times (say by using something like VarInt).

I'm not a crypto expert but I think the answer is exactly the opposite, Satoshi chose to give out less information than he could have.

To use PGP encryption you publish a public key that anyone can use to send a message that only you can read. Typically your public key is available to everyone in the world, including the NSA, from a public keyserver. This is convenient, someone dosn't have to email you and say "Hey guy, I need your public key to send you a private email".

The NSA might have spent the last 17 years cracking my old 384bit public key to read a couple of email replies I got in 1994 saying "Re: can I sleep on your floor after the 2600 meet? Yeah dude bring a sleeping bag".

A bitcoin address is a hash of a hash of an ECSDA public key. That is just as identifying as the public key, or a non-existent "account number" since it is unique to the person receiving the money.

There is loads of money sitting in the bitcoin block chain. To take the money from an address you just have to provide a number that meets certain conditions. The whole thing rests on it being really really difficult to find a number that meets the conditions if you don't have the private key that was produced along with the bitcoin address.

Satoshi could have just had the bitcoin software publish the public key. That would mean that if someone dosn't spend some bitcons for 15 years an attacker has 15 years to try to crack the ECSDA crypto. That should have an insignificantly tiny chance of success but there is no harm in making it more difficult.

In theory the hashing means that there are more possible numbers which satisfy the condition to get the money. That should reduce the cracking time from a 1000 zillion years to only a zillion years, which dosn't matter. In practice it means an attacker has to crack ECSDA plus two hashing algoristhm instead of just ECSDA so it's probably more difficult in practice.


BTC sent to Coinbase BCH wallet I have sent my BTC to a BCH wallet on Coinbase, it is for a sizable amount of money and I read that if greater than $5K, they will help you.  What is the proper channel to ask for help as the cases I have opened are not getting any results.  Both accounts are mine one on Electrum (BTC) and one on Coinbase (BCH)

Coinbase has the private key for the BTC transaction (because it should be the same as the BCH address), but it might require manual intervention on their part to recover the deposit and refund it. Unfortunately, their support is swamped with many other issues this month. If you submitted a support ticket to https://support.coinbase.com/, you might just have to wait a while before they get to it.

Thanks Ryan I did a similar mistake. But when I contacted Coinbase they just said due to irreversible nature of crypto currencies transactions they cannot do anything about it. Do you know if this is a routine process and at some point in time they will get to intervene and transfer private keys or their reply means there is no hope and coins are lost? Are you aware of any simple similar incidents that were resolved?


How to do a market trade in bittrex? I am not sure how to set to do market buy and sell
Please help

Bittrex doesn't let market trading at the moment. So you can't. Yes, it sucks.


Is there a way to tell which *coin is most profitable to mine? Basically a program that could run some hashes for all of the different hash functions that are used in the different big cryptocurrencies and then get the current difficulty from all of them. From there you can determine how many of those coins you could be mining and look up an exchange rate from there.

I was guessing that I should switch my GPU mining from bitcoins to litecoins, but I was just wondering if its worth it.

I was thinking about starting to write a small script to do this automatically if nothing like it exists.

This site allows you to compare the mining profitability of the various coins:
http://dustcoin.com/mining

you can try  bestcoin.udf.me it is a new site with calculator, and charts


What is the best way to implement withdrawal in online service? Suppose we have a service, which holds user balance in Bitcoin.

How to implement withdrawal from bitcoin perspective?

Which RPC call to use? How to archive transaction to have a proof of sending money to user? How to prevent duplicate money send in corellation to SQL transaction?

The most important thing is to prevent dual-submission having in mind power loss at any time. So we should have a way to mark some money as "possible sended" + some way to check in future time if it really was succesfuly sended and stored in blockchain.

(note that I am not asking about security, ACID transaction itd. I am interested in a way to comunicate with wallet daemon service)

As far as I know, there is no third-party ID could be associated with a bitcoin transaction. This means, if the power goes down, you would not be able to determine if the transaction "made it" by looking at block chain for the sender and recipient wallets.

But wallets and transactions are cheap. So you can create a pool of wallets and then intelligently rotate them making sure you lock on one until the entire transaction is complete and confirmed with public records. Then based on exclusivity of access you can determine BTC transaction hash for your system transaction record.

To take this idea to the extreme, you could create a new wallet for every amount you want to send, and use this wallet to identify the only one outgoing transaction.

Hope this would help,
Alex


How are wallets updated with new balances? Let's say I have a wallet in my computer and I create an address so another person can deposit bitcoins in it.

Then it is passed to miners and later added to the blockchain. But in the meantime this transaction was not verified.

When does my wallet is updated so the balance in my wallet and in the other person's wallet are correct?

Does my wallet (and the other person's wallet) go check if it is finished and validated?

your question is unclear on verification. I think you are asking for this process: You create an address, give it to your friend, he creates a tx, and sends it to you. At this point in time the transaction is not yet mined, but you anyhow get within seconds a message, saying someone sent you some funds.

In the background the wallet software is constantly looking for updates on the network, and here for s.th. like "my address". This eventually triggers the  "funds sent to my address" message on the wallet. At this point in time it is unconfirmed. Roughly after 10minutes it should get its first confirmation, which means it is also included in a block (and verified in all details).

SPV wallets don't do verifications in the same way as full nodes. Full nodes verify each transaction, as described here.

you should wait for the confirmation time of it. if it was accepted by the blockchain then yes, it'll be confirmed and will be broadcasted shortly.


Halving reward, price effects? What is the case after halving reward takes place:

Would bitcoin price gets double, since its harder to mine?

Would Blockchain introduces more blocks (e.g: 1/5mins)?

Will Bitcoin switch to a faster block rhythm?

No, the Blockchain will not change the number of blocks produced. That would require the difficulty retargeting rules to be changed, but the difficulty setting is part of the Consensus Rules, i.e. changing them would require a successful Hard Fork. There are currently no such plans.

Price

There is lots of speculation about price effects, but before we get to that, let's review the facts first.

Facts

Daily production is about 3600 bitcoins (~144*25)
The Halving will reduce this to about 1800 bitcoins per day
The timing of the halving can be predicted fairly accurately: 16th of July (± a few days)
We have data from the first Halving (2012-11-28), and numerous altcoin halvings
Price has been "fairly stable" between $152 and $502 (source Bitstamp) in the past year
Previous research showed that most bitcoins were not circulating, I assume this still is the case

Thoughts

From [1.] daily production, [5.] price stability, and [6.] dormant bitcoins we can conclude that the market is soaking up more bitcoins worth more than 1,000,000 USD per day.
Reduced supply from [2.] would suggest an upward shift of market equilibrium.
Yet, the predictability of the supply event [3.] would suggest that such movements spread out due to anticipation, which aligns with the day of the [4.] first Halving only showing small price movements (+1.7%).
Reduced supply will also cause a steep decline in Mining profitability, may cause inefficient hardware to be sunsetted, or pointed at more profitable coins. E.g. the May'14 Dogecoin Halving [4.] caused difficulty to drop by ca. 25%. This effect should be less pronounced in Bitcoin, as more than half of the Bitcoin network's hash power came online over the last 6 months since the hash rate more than doubled.

Conclusions

It is unreasonable to expect a sharp price increase around the Halving as the event is anticipated. The Halving effects would manifest ±6 months (guess!) around the Halving.
The price remains unpredictable: The longterm effects may have been mis-estimated by the market, leading to a subsequent correction (as with Litecoin's Halving in Aug'15), or a subsequent rally, as reduced supply takes effect.
Remember: There is a large number of other unknown events that will also affect the market.

So my final answer is: We don't know yet whether the price will double. It seems plausible for the exchange rate to rise above current levels.

The bitcoin production costs are about $80 just the electricity + $?? other expenses. My guess that a full cost to produce bitcoin on the order of $200? so this implies for miners to stay operational, the price would need to rise to $400 ? the price already hovers around this level.


Transaction with 0.0002 BTC fee but not confirmed sice 2 days I'm a Bitcoin noob.
This is my second Bitcoin transaction and I'm getting very nervous.

My wallet (KryptoKit on Chrome) doesn't have a possibility to change the fees or anything on transactions.

Could anyone say what happens to my transaction (~100 USD) if no miner confirms it for some reason?
Now the transaction is unconfirmed since 48+ hours.

Here you can see the transaction:
https://blockchain.info/tx/2362971d010c0d38e51019139a4ebee899d0861af3d5288fae6494bad5ecd3d2

Many thanks in advance

Edit:

This is a very weird situation. At the same moment I posted this question, the related transaction were cancelled and I got my BTC back.

Here you can see the note of blockchain.info:
"Transaction rejected by our node. Reason: Transaction was previously accepted but has been pruned from our database."

The transaction were automatically resented, here is the id:
https://blockchain.info/tx/2362971d010c0d38e51019139a4ebee899d0861af3d5288fae6494bad5ecd3d2

this tx has "dust" output of 300 satoshi. miner nodes treat such transactions as non-standard and do not confirm them

  Could anyone say what happens to my transaction (~100 USD) if no miner
  confirms it for some reason?

nothing happens to your transaction

I am not an expert in Block Chain but I read that nowadays Bitcoin is facing a problem with scaleability, so probably your transaction is a certain block and this block was not mined yet due to high numbers of transactions. I may be wrong but this is definitely a possibility.


Is there an efficient way to exploit arbitrages between the different exchanges? The Bitcoin ratio vs other currencies is not the same among exchanges. Is there currently a way to exploit this arbitrage and profit?

Yes.  Simply hold accounts on multiple exchanges.  In the account you should try to keep your holdings at 50% bitcoin and 50% other currency.

When there is an arbitrage opportunity you can execute "complimentary" transactions on both exchanges.  On one you buy the difference, and the other you sell the difference.  You can then equalize the accounts by transferring bitcoins between them, or withdrawing profits.  Don't forget to account for transaction fees on each exchange.

If you are so skilled most exchanges have APIs that would allow you to script interfaces for doing this automatically.  I recommend against accepting other people's scripts to do this since it gives the script access to your funds and it would be trivial for them to write the script to transfer your funds to them.

Yes, at Bitdango you can use the Market Pairs search to find market pairs you want to take advantage of arbitrage on. Open the detail report to see how much profit you make at different levels of investment.
https://bitdango.com/marketpairs

First search:

Then view details:

An API is coming soon, so that will give you an interface to develop your on software bots against. This will take all the heavy lifting out of the monitoring and analysis aspects of arbitrage.


Can someone with 51% computing power earn more than he deserves? See also What can an attacker with 51% of hash power do?

This may have been discussed elsewhere, but I'm not sure what the answer is - if someone owns 51% of the hash power, can't he just ignore the rest of the network, and only focus on his chain, thus earning more than 51% of the rewards (100% in fact)? Will he in fact earn 100% of the reward?

Also - is it possible that several attackers working independently could achieve this scenario? If two people have 34% each, won't one of them always out-race the legitimate chain? Of course, they can't both win, but for some period of time, won't the stronger one among them gain more than his fair share of block rewards?

Yes, if you have 51% of the network you can reject all other blocks, thus making sure you receive all rewards. The difficulty will adjust to match just your own hashrate, making sure you mine the expected 144 blocks per day.

In fact, with a clever strategy you can get more than your fair share of block rewards even if you're below 50%. This was discussed here - for example, with 46% of the hashrate you can get 51.29% of the rewards, assuming the rest of the network is honest.

In the multi-attacker case, an attacker with more hashrate than the honest network and any other attacker (where every attacker rejects all blocks but his own), will get 100% of the blocks. If there are several attackers at the top, you'll have occasional massive reorgs where one moment one attacker owns all the bitcoins generated since the attack started (if he hasn't spent them), and the next moment another attacker one-ups him and replaces the whole branch with one where he has generated all coins.

He could do whatever he wants to, the problem is legitimate clients would ignore the blocks if they are out-of-spec!


Running out of disk space with Bitcoin Core A year ago I purchased some bitcoins and it was sent to my address. I loaded up Bitcoin Core and installed it to my laptop HD, it ran out of space on the HD, mid blockchain sync. It has now been a year. I have confirmation that the coins have been sent to the address and they are there, what can I do?

How are you? WOW guessing you're rich now!
The proof you have bitcoin in your wallet does nothing. Bitcoin is not a system you can go and get your wallet back with showing them you have bitcoin in your wallet.
Go to blockchain.info and download the app. Click on add address. Scan your private key and then you can use your bitcoins again.
Hope you can gain access to your wallet.


64: too-long-mempool-chain I am using bitcoind json rpc api to send bitcoin to multiple bitcoin addresses. I am using sendrawtransaction. When i have 24 unconfirmed payments sent from my account, i can't send anymore because i get this error :

  64: too-long-mempool-chain

I have increased the maxmempool to 1500 but it still doesn't fix it.

root@B2:~# bitcoin-cli getmempoolinfo

    {
      "size": 3946,
      "bytes": 1789073,
      "usage": 6043088,
      "maxmempool": 1500000000,
      "mempoolminfee": 0.00000000
    }

I use Ubuntu on a 32GB RAM , 4TB HDD server.

Any ideas on how to fix it ? I want to be able to create for example 300 unconfirmed transactions and not to receive that error.

You will not be able create unconfirmed chain for 300 transactions. Bitcoin core default limit is 25 transactions. In case you modify this parameter on your local node, network will not accept tx chain longer then 25 tx.  You have to rebroadcast transactions again after your first batch (25) confirmed.

-limitancestorcount

  Do not accept transactions if number of in-mempool ancestors is n or more

and

-limitdescendantcount

  Do not accept transactions if any ancestor would have n or more in-mempool descendants

This has fixed my problem. Thanks Nate Eldredge


How does Bitcoin have an intrinsic value? I have read several articles about how Bitcoin have an intrinsic value. Aside from the fact that some of those articles confuse "intrinsic value" with "benefits of adoption", I found that none of them could prove that Bitcoin is actually money and not a currency.

Take this example, if I take my Bitcoin from the US to Yemen, it would be the equivalent of taking absolutely nothing to Yemen. Why is that, you ask?

Because Yemen has no Bitcoin bank/supplier/merchants, no one cares about Bitcoin. Now, if I take Gold to anywhere on Earth, people will take that. In the case of Gold, the supply is limited but the demand is unlimited (everyone accepts it) for two reasons. One reason is that Gold is money in itself (if the country uses Gold standard, which I don't recall any that does), and two, is because even if Gold is not money in the country, it's still a commodity to be sold to get money!

So Gold indeed has a value just for being Gold! Bitcoin is a supply and demand currency, which Bitcoin.org clearly states ("The price of a bitcoin is determined by supply and demand"), yet they also say "Much of the trust in Bitcoin comes from the fact that it requires no trust at all", that's illogical as it's dependent on the demand of people which varies by location, i.e. you need to trust that that place has a Bitcoin bank!

If people of that country don't have Bitcoin bank, then that immediately means that Bitcoin value is almost 0 in that country. If Bitcoin's value is zero, no bank would want to spend money to build a branch there. So it's more like fiat currency!

I wouldn't go very far with a Dollar in the country that doesn't have its currency tied to Dollar (even though I don't recall any that doesn't, except the Islamic State, which recently announced Gold and Silver money). This proves several things, that Bitcoin is a currency, that it's dependent on the demand (specifically the location of the market), and thus, that, very much, takes the "universality" it's so much praised for when people talk about how you can make international transfers so easily. You really can; but the problem is that you probably wouldn't do so to most countries that actually need that capability; due to the nature of those countries and the lack of a Bitcoin bank. The only reason why one might want to get Bitcoin in countries where no Bitcoin bank exists, is to buy stuff online. But then again, this has never been the main problem. Credit Cards have solved this for a long time.

So I guess the question is, does Bitcoin have an intrinsic value (is it money) or does Bitcoin have "location value"/trust value (is it a currency)?

Talking about intrinsic value is always a difficult discussion. What gives Gold or really anything intrinsic value?

It is of limited quantity. Bitcoin also has a limit to the total
amount in circulation, and so has an element of digital scarcity
built into its design to mimic physical scarcity.

You can't counterfeit it. (Actually you can create gold, it just costs way more than just buying it) Bitcoin can't be copied through
any known process. You can't transmute lead to gold, nor simply
convert a random collection of bits into Bitcoin.
People accept it for Barter You can use Bitcoin with merchants all over the world, as well as person to person payments. The number
of people accepting and transacting in Bitcoin is growing every day.
You can build physical products with it While not a direct correlation the Bitcoin network is a highly secure trust network.
Nothing like it has existed before on its scale, and it seems clear
that quite a bit can be built on top of it. That gives the network
real value for companies emerging in various new sectors, and how do
you get access to this network? Bitcoin.

If people believe it has value, trade in it, and it lets you do things that were previously impossible it seems like it has intrinsic value by any definition.

Bitcoin is NOT money. It does not fit all the qualifications of money (Being tangible is one of those, bitcoin is not)

Bitcoin is simple a currency, backed and fueled by other currencies (all currencies of which are fiat and have no intrinsic value besides the small amount of heat it gives off when you burn it)

People have been fooled, and as soon as the ledger size out paces storage capacity of technology, it will start to back up, slow down, and eventually fail.

Hope you internet doesn't go out!


local bitcoin nodes in a same vlan cannot sync I have two local bitcoin nodes, node1(192.168.105) and node2(192.168.1.101). Firstly, I start node1 to connect the bitcoin network to download some blocks. Then I delete the static dns seeds in file chainparam.cpp for both two nodes. So they both cannot connect to the bitcoin network.

I started node1 with “./src/bitcoind -datadir=/bitcoin_block -listen=1" and node2 with "./src/qt/bitcoin-qt -datadir=/bitcoin_block". And in order to connecting node1, using command "addnode 192.168.1.105:8333" on node2 through the debug window/console.

The status in node2 shows,

We can see that node2 has connected to node1, but cannot sync blocks from node1.

I checked the node2's debug.log and found "Ignoring getheaders from peer=0 because node is in initial block download". Then I changed the nMinimumChainWork value to a more smaller one and provide -maxtipage when starting node2 to make the following check failed(suggestions from Altcoin connecting nodes). But it still won't sych.

"chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge)".

Is there anyone can give some advices here? It really stuck me here. Appreciate your help.

Then I delete the static dns seeds in file chainparam.cpp for both two nodes. So they both cannot connect to the bitcoin network.

They can still connect to the Bitcoin network without the DNS seeds. The DNS seeds are not the only way to connect to the network; there are numerous fallbacks, with DNS seeds themselves being a fallback too.

-datablock= is not a valid command line option. Did you mean to use -datadir?

Check in the debug window of both of your nodes; does node1 have a number of blocks that you expect it to have? Does node2 already have blocks that it downloaded very quickly and you didn't realize it?

Instead of using the addnode RPC, try using the -addnode or -connect startup options to connect your nodes.

I was using bitcoin-0.14 and I forgot to change the chain limit parameter(nMinimumChainWork). It works fine after I lower down the limitation.


Trying to import a private key into bitcoind I am in a special situation where I need to import my private key credentials and basically restore a wallet to bitcoind. bitcoind is running and I do have an rpc user/pass and server=1 in the bitcoind.conf, but no matter what I do, when I try and import the key I get the following error.
There is no password nor encryption on the wallet.

root@coined:/home#  bitcoind importprivkey "5JxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHjdCia9dt7" "root"
error: {"code":-4,"message":"Error adding key to wallet"}

Without anything in the log, it's difficult to day. But here are a few suggestions what could try to find out the cause of the error:

Do you have write permission on the wallet.dat file in your .bitcoin directory?
Is the wallet locked with a passphrase? Then you need to unlock it (would probably give another error message but worth asking).
Did you set the disablewallet option either in command line or configuration file?
Is your wallet possibly locked due to a -reindex operation?

leave away the "" around the key (and the label)?


Is the SegWit2X success due to concentration of mining power? SegWit2X has been called a short-sighted & severely lacking proposal. There is nearly universal preference for its alternative among those listed on the segwit support overview (SegWit, BIP 141,148,149).

Yet SegWit2X has 90% mining support.

Is this because the vast majority of Bitcoin mining / hashing power is concentrated in a few hands? Does this mean that those who control the mining power can get whatever they want?

I feel that the existing answers here fail to highlight that while (the collection of) miners have the authority to select the order of transactions, and impose additional validity rules, they do not have the authority to determine what the rules are.

Segwit2X (in my understanding, there seem to be multiple ideas out there) seems to be a combination of a soft fork (activating SegWit) and a plan to do a hard fork later (changing some resource limits). The first is something that miners can do, but the second will only be accepted by full nodes that implement the same rules, and be ignored by everyone else.

Whatever this group wants, it gets?

Yes. Everyone in bitcoin community has sold his vote to these persons.


Cannot connect to bitcoin-qt server # server=1 tells Bitcoin-QT to accept JSON-RPC commands.
 server=1

 # You must set rpcuser and rpcpassword to secure the JSON-RPC api
 rpcuser=bhhtufhrt
 rpcpassword=ferhrhh

im trying to connect to my bitcoin thats my conf file but i cant connect to

http://127.0.0.1:8832/

im running on my local machine

The default port I think should be 8332 not 8832, however if you modify your config file to include:

RPCPort=8832

Then restart server and it should work

You may want to add the following line to your .config file:

listen=1


Please help! How do I transfer my wallet from bitcoin core to MultibitHD? I (should by now) have bitcoins in my wallet,I sent them to my wallet whilst i was using bitcoin core but after taking days to sync (and it still hasn't synced) i have given up and installed multibitHD. I have tried using blockchain to import the data file but it keeps saying connection refused even thought the password is correct and the file is fine.

Now Bitcoincore wont even open so i cannot check whether it has synced or whether my bitcoins are still there and I'm beginning to worry that I've lost my money can someone please help me transfer my bitcoin core wallet over to multibitHD!?

Put request in multibithd. Scan or put the address shown and put it in the btc core and make sure the receiving amount in multibithd is the same as the sending amount in btccore. No fees thats for sure


How are different Addresses generated from the same Private key? I was reading in the "Technical background of version 1 Bitcoin addresses" that addresses are a function of the private key. More or less:

Private Key -> Public Key -> Address

If the Public Key is the only input needed to generate an Address, how come a wallet generates a different address every time? What is changing?

Private and public key correspond to a point on the secp256k1 curve. They have a one-to-one relationship.

The address is derived from the public key by performing a ripemd160 hash after a sha256 hash on the public key. Multiple public keys hash to the same address, as the address space is only 160 bit, while the public key space is 256 bit.

Since both derivations (private key > public key > address) are deterministic, you cannot derive more than one address from one private key.*

What you can do, is derive additional private keys from a "master private key" with a given derivation rule. These additional private keys obviously correspond to new addresses. This type of address management is called "hierarchical deterministic wallet".

*Strictly speaking, you can create multiple addresses by differentiating between compressed and uncompressed keys. See Sven's and skaht's answers for details.

You can generate unlimited number of addresses from the same private key. Private key is simply a number. from which you can generate compressed and uncompressed public keys. from the public keys you can generate addresses for each network (test, main, reg) for different types of altcoins by changing network byte.


Cold storage companies? I was curious to know if anyone knows of any bitcoin business that stores people's wallets offline?

I'm looking to diversify my backup methods for cold storage and am wanting to send my backups to a company that can store it for me securely.

In my opinion trusting a third party with your Bitcoin savings is kind of against the grain of Bitcoin.

It makes perfect sense to keep day to day amounts on hot wallets either on your phone or online by using services such as Coinbase, Blockchain.info, Circle and their likes.
These companies offer various cold storage options (e.g. coinbase vault) and there are other vendors that specialize in cold storage solutions, e.g. xapo

All these are viable options and have a place on the ever denser continuum of options to store bitcoins, and in all these cases you surrender some control over your bitcoins for the benefit of simplicity and ease of use.
However, part of the appeal of Bitcoin is the fact that by design you can maintain 100% control over your bitcoins. If you choose to do so, let me recommend CoinCooler (disclosure: I'm the founder).

CoinCooler helps you generate and encrypt digital files containing cold storage addresses and keys in a way that is guaranteed to be 100% offline. It also includes splitting the encryption password into shares (as was recommended above by Christopher).
Basically, its a tool that helps you perform cold storage of bitcoins in a way that is easy and secure so that, hopefully, you will consider doing it yourself and not rely on a third party.

Good luck!

There are also many options for storing your bip 38 encrypted private keys on physical coins.  Many of them are DIY options including www.mycryptovault.net They allow you full control of your bitcoin cold storage!


Who pays the fees for transactions initiated by a smart contract in Ethereum? I am wondering who pays the fees for transactions initiated by a smart contract in Ethereum?

For example, if I have a contract that simply forwards any payment made into it to someone else, does the contract have to pay its own transaction fees for payments moving out, or does the transaction that initiate the contract have to pay the fees for both its transaction and the resulting transaction coming from the contract?

A smart contract can only initiate a transaction when it receives a transaction from either another contract or a user. Thus, all transactions must originate from some user transaction, and it is this transaction that must pay for fees. The amount of fees can be limited by setting the gas limit on that transaction to prevent a malicious contract from consuming a horrendous amount of fees.

Also, all transactions that are the result of a specific user transaction will occur before any other user transactions (and it's subsequent contract transactions) are processed.

Usually there is a small transaction fee on any bitcoin transaction. its 0.0002 i think. If the contract says that there is a additional fee for that contract then i would assume you would have both the transaction fee and the contract fee.


Can a Bitcoin (secp256k1) key be converted to a Ed25519 (Tor v3) key? If I have secp256k1 keypair that is widely known, like a Bitcoin address, can I convert that into a Ed25519 key pair such that someone could access a .onion address in a deterministic way?

The bitcoin key could sign a message containing the onion address. There are several other alternatives but there isn't any way to do this without the key holder producing a message of some kind.

No you can't convert them since they are defined over different curves.


Is there a way to chain calls in Bitcoin core console? Is there a way to chain calls in Bitcoin core client console window like this

validateaddress (getaccountaddress "")

instead of

getaccountaddress ""
validateaddress _address from previous call_

You can use the $() syntax to execute another command and have it return its results:

validateaddress $(getaccountaddress "")

Here's the docs: http://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html#Command-Substitution


Bitcoin Core - autogen.sh failing on Mac I'm working on installing Bitcoin Core for the mac. I've cloned the repo and installed the dependencies via brew. I'm trying to run autogen.sh but it is failing:

$ ./autogen.sh
/usr/local/bin/glibtoolize: line 406: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3601: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3845: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 861: /usr/local/Library/ENV/4.3/sed: No such file or directory
: putting auxiliary files in '.'.
: copying file './ltmain.sh'
/usr/local/bin/glibtoolize: line 3771: /usr/local/Library/ENV/4.3/sed: No such file or directory
configure.ac:45: error: required file 'build-aux/ltmain.sh' not found
autoreconf: automake failed with exit status: 1

I'm not sure what is failing. brew doctor is clean. glibtoolize and sed can both be found. There is no .../Library/ENV directory, so I'm not sure why that isn't automatically getting created.

Any help would be greatly appreciated.

Mac 10.12.6
Bitcoin (7b57bc9) - v0.15.1

This happens because /usr/local/bin/glibtoolize: is pointing to the wrong directory

line  49 : ${SED="/usr/local/Library/ENV/4.3/sed"}

This was changed when homebrew decided to move their paths. See this stackoverflow post

What worked for me was

brew reinstall libtool

Easier appraoch:

brew install bitcoin

However, as Jonas points out, you should be careful with trusting 3rd party package managers. Specifically, you should verify the SHA1 of the package you're getting from Homebrew matches that of the official release of Bitcoin from either GitHub or the Bitcoin Core website.

More reading:

Is Homebrew safe?

Example of using GPG to verify a package's signature (in this case the SHA256SUMS.asc signature file in https://bitcoincore.org/bin/bitcoin-core-0.15.1/):


Cgminer not working with AMD APP SDK 2.8 Before I install AMD APP SDK 2.8, I get this error from cgminer 3.7.2:

  [2014-01-06 22:44:56] Error -1001: clGetPlatformsIDs failed (no OpenCL SDK installed?)
  [2014-01-06 22:44:56] clDevicesNum returned error, no GPUs usable
  [2014-01-06 22:44:58] No devices detected!

After I install APP SDK 2.8, I get this window:

  cgminer.exe has stopped working

My graphics card is ATI Radeon HD 545v. I have tried both Catalyst 13.4 and 12.10. The software versions are all 64 bit (except miners).

After installing SDK 2.8, guiminer exits when I run it. Before installation it shows a window:

  No OpenCL devices were found.
  If you only want to mine using CPU or CUDA, you can ignore this message.
  If you want to mine on ATI graphics cards, you may need to install the ATI Stream SDK, or your GPU may not support OpenCL.

Question: How do I get to mining?

Assuming you are using windows:

uninstall all AMD drivers

Do not install (uninstall) APP SDK.

download 3.11 beta version of catalyst drivers
http://www.guru3d.com/files_get/amd_catalyst_13_11_beta_9_2_(13_250_18_november_7)_download,1.html

Make sure you're cgminer settings are modeset and try again. If you are never on modest cgminer settings, you may never know if your software/driver config will work.

Don't use the SDK.  I don't think that it's necessary anymore.

Try uninstalling ALL AMD drivers (SDK and GPU), then reinstall just the Catalyst drivers.  See if that helps.


Will "all" bitcoins ultimately vanish? (be unusable) During this CCC conference from 2011, starting from 00:18:55, the presenter suggests that as bitcoins can be lost (lost private key, dead owner, sending to an "eater" address that nobody posses, etc.), and as the total amount of bitcoins has a known threshold (21 millions), there is a possibility that given enough time, most bitcoins, if not all, will actually vanish (be unusable).

The questions is when?

Actually, according to him:

if 0.5% of bitcoins are getting lost per year, "all" bitcoins will be gone by approx. 2032;
if the losing rate is 0.1% per year, it will probably last for a century, but will ultimately be doomed.

And if we suppose that inactive wallets (2 years with no transaction) are in fact lost wallets, we reach that 0.1%/year threshold...

The math is clearly absurdly unrealistic because as there are fewer Bitcoins available, it becomes harder to lose them. So the rate of loss has to decay as the availability of Bitcoins goes down.

Every year 1% of people die.

If every year 1% of bitcoin is lost, every 70 years:

HALF the coins in circulation remain.

if all coins were accounted for and all were already mined:

2086 0.99^70  = 50% remain
2156 0.99^140 = 25% remain
2226 0.99^210 = 12.5% remain
2296 0.99^280 = 6.25% remain


What happens to the bitcoin network when the miners all stop in the future? What happens to the bitcoin network when the miners all stop, years in the future after all the bitcoins have been mined?  How will the network continue to function?  Won't bitcoins then be useless?  What would be the incentive for an individual to continue using computational power to service all the transactions?  Isn't this like a ticking time bomb or is there something I'm not getting?

Bitcoin becomes very insecure if miners stop mining. Think of how easy a 51% attack would be to pull off.

However, I disagree with your assumption that miners will stop. And certainly that if Bitcoin dies it would be because miners stop. I would instead think that miners would only stop if something else already killed Bitcoin. Bitcoin is designed to always give miners an incentive to keep mining and secure the network. If miners don't have an incentive to mine, then Bitcoin has already failed.

Many mining pools don't pay out income from transaction fees and the whole thing is often glossed over. But mining income is newly minted coins PLUS fees from the transactions you include in the blocks you generate.

Have a look at the tx fee statistics at http://blockchain.info/no/charts/transaction-fees

As I write this at the end of march 2013, it looks like tx fees were about 4 BTC per day a year ago and are now about 50 BTC. At the same time the newly minted coins in each block has dropped from 50 BTC to 25 BTC.

With 6 blocks per hour this means one year ago we mined 7200 BTC in new coins and 4 BTC in fees per day. Now we mine daily 3600 BTC in new coins and 50 BTC in tx fees. So tx fees went from being 0.00056% of the income a year back to the 1.39% of mining income they are today.

I'm sure you can see where this is going. No, mining does not stop when the minting of new coins stops.

One of the answers I read above hit the nail on the head for me.
The innovation that cryptocurrency is responsible for is 'Distributed Ledger Technology' (DLT). And as was said above, the 'Blockchain' is simply one form of such a thing.
In my opinion, Bitcoin and its Blockchain are together, just a prototype that provides proof-of-concept for the 'proof-of-work' algorithm. What I'm hinting at is the inevitability (in my mind) that Bitcoin and its Blockchain (BaiB) will be superseded by something a lot more suitable for international transactions, finance and banking.
I now believe there is no 'one-size-fits-all' when it comes to DLTs and particular use cases. BaiB would be the perfect solution for government record keeping, tax records for companies, expense accounts, payroll, etc. but, Ethereum has proven itself an amazing innovation with its own set of revolutionary capabilities. Then, there's IOTA, a coin that has deployed an amazing innovation for DLT, that being something called a 'Direct Acyclic Graph' (DAG). This DAG is far more suitable as a global payments solution than BaiB as there is no transaction fees on the network, no mining required and the transactions are instant. I can't see how Bitcoin will go about surviving in an atmosphere evolving so quickly!


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.

I can't seem to find statistics anywhere on how many blocks have no UTXOs

what is the sense to counting it?

  or what the distribution of UTXOs are in blocks over time, or anything like that

http://statoshi.info/dashboard/db/unspent-transaction-output-set

https://p2sh.info/dashboard/db/utxo-repartition?orgId=1


How much data traffic does participating in Bitcoin mining cause? I have a limited amount of data included in my internet plan. If I exceed that limit I get charged extra. So, before signing up for Bitcoin, I'd like to know whether Bitcoin mining causes a lot of internet traffic. Does it involve a lot of downloading and uploading throughout the day?

If you mine with a pool, your actual internet activity will be fairly small.  I just took a look at my network statistics and BFGMiner used 9MBytes down and 11 MBytes up over the previous 24-hour period.

The Bitcoin-Qt application on the other hand maxes out my upload bandwidth since I always seem to get 2-3 peers who want to download the entire 12 GB blockchain from me.  Other than that, the main Bitcoin-Qt network usage occurs when you are receiving or relaying the latest block (blocks are typically 100-400 KBytes).

Since you have limited internet bandwidth, your best bet would be to run a lightweight client such as Electrum or Multibit.  If you are mining in a pool, you don't need a local Bitcoin-Qt.

If you use a light wallet like Electrum, definitely not.  But even if you run a full node, it is unlikely.  You could also use a web-based wallet like blockchain.info which would mean that nothing at all is running on your local computer and you can access it from anywhere.


Blockchain validation process is linear? I've read at a few places that the nodes validate transactions in a linear fashion, i.e. after node A validates, then node B, etc. (which is also the reason, as claimed by many, why blockchain suffers from a scalability issue)
But if blockchain is decentralized, how would the nodes know in what global order to validate? It must be the case that several nodes validate on the same block in parallel.

Block validation is linear, transaction validation is not (for unconfirmed transactions).

Block N can only be validated if N-1 has been validated, since each block links back to the previous block, and the updates made to the UTXO set by it.

Transaction validation, for unconfirmed transactions, can be done in any order. However, nodes can only validate transactions if they receive them. Before any given node forwards a transaction to other nodes, it will validate it itself to ensure it is a valid transaction. If it is, it is sent further to its peers, who then repeat the same process before broadcasting it again.

That said, if you perform an out-of-band broadcast to multiple peers, they will all validate the transaction independently of what any other node says.

No, When you transfer token from your address to another then that transaction store in Mempool and from their miner decide to it should validate/process it or not. Like if you have set high Transaction fees then miner will pick your transaction first and put in next block and if transaction fees is very low then it may be take more time for validate.


Why not implement GHOST in bitcoin? GHOST can provide higher transaction throughput by minimized block interval, but community people seldom mention it. What's wrong with GHOST?

GHOST is outdated, the more relevant protocol based on recent research by Aviv Zohar et al is called "SPECTRE" - https://medium.com/@avivzohar/the-spectre-protocol-7dbbebb707b5, https://eprint.iacr.org/2016/1159.pdf.

It has many advantages over the traditional longest-chain rule of Bitcoin, but:

It requires a hard fork, something which has never been done intentionally in Bitcoin.
It is a huge departure from Bitcoin's protocol, and as such it will require extensive research and testing before it is even considered for inclusion in Bitcoin.

There are alts under development that are trying to implement SPECTRE, if it works well for them it can be a first step towards consideration in Bitcoin. You don't risk untested ideas on a $100B production system.

We are using a modified version of Ghost at Hycon. The original plan was to move forward with Spectre, but as yet there are some unsolved issues, particularly around selfish mining and efficient resolution of superposition states at the tips of the DAG. Ghost is useful when the block time is shorter and orphan events are more common. In the case of bitcoin, these days orphan events are rare, so unless it was decided to reduce the block time it is unnecessary.


Ubuntu Linux -- How do I start bitcoind as a service to run automatically? I've got a bunch of other services set up to boot automatically when my Ubuntu server starts (services like wicd-daemon and VPN), but I can't figure out how to set up the bitcoin daemon (bitcoind) to start automatically when the system boots up. (This is on a headless system with no GUI or attached monitor.)

I'm trying to learn how to integrate bitcoin with Python so I can write bitcoin-enabled services, but I want the system to automatically start bitcoind when the system boots so that I don't have to do it manually. (It's a pain in the butt to have to download a whole bunch of block-chain at once. It eats away at uptime.)

If this question has already been asked, please direct me to the answer. I searched but couldn't find it. Otherwise, please help me figure this out!

Thanks so much.

EDIT: Caveat emptor on Ubuntu distributions from 14.10 and forward - init was chosen over upstart and is being phased in the future. I don't know when that will be done nor what impact it will have on upstart scripts.
Extract from the page RentFree refers to; note that it assumes that you have created a user called bitcoinuser for the sake of security:

For those running ubuntu, you may be familiar with upstart, a replacement for sysvinit style booting (/etc/init.d/*).
Configuration files for upstart are stored under /etc/init/*.conf. I've written the following one for bitcoind:
description "bitcoind"

start on filesystem
stop on runlevel [!2345]
oom score -500
expect fork
respawn
respawn limit 10 60 # 10 times in 60 seconds

script
user=bitcoinuser
home=/home/$user
cmd=$home/bin/bitcoind
pidfile=$home/bitcoind.pid
# Don't change anything below here unless you know what you're doing
[[ -e $pidfile && ! -d "/proc/$(cat $pidfile)" ]] && rm $pidfile
[[ -e $pidfile && "$(cat /proc/$(cat $pidfile)/cmdline)" != $cmd* ]] && rm $pidfile
exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile --startas $cmd -b -m
end script

Put the above configuration in /etc/init/bitcoind.conf, then run sudo initctl reload-configuration. To start bitcoind, run sudo start bitcoind. To stop bitcoind, run sudo stop bitcoind.
You'll probably want to change the user, cmd and pidfile to something that matches your configuration, or you can use the following as a template:
/home/bitcoinuser
/home/bitcoinuser/bitcoind.pid
/home/bitcoinuser/bin/bitcoind

Though one user suggests the following correction to the configuration:

home=/home/$user
cmd=/usr/bin/bitcoind
pidfile=$home/.bitcoin/bitcoind.pid

and another suggests setting nice for the process so it doesn't hog the CPU

exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile --startas $cmd -b --nicelevel 15 -m

I've developed a script that may help you install AND run Bitcoin's CLI daemon at the same time.

sudo apt-get install software-properties-common
<your password>
y
sudo apt-get update
sudo apt-add-repository ppa:bitcoin/bitcoin

sudo apt-get update
sudo apt-get upgrade
y
sudo apt-get install bitcoind
y
bitcoind -daemon
bitcoind -testnet -daemon

*The space between apt-add-repository and update is supposed to be there because of a prompt to press ENTER.


huobi.com API to get latest trade price, bids and asks? I'm looking for a simple API description to get some basic stats from the huobi.com exchange. Mainly the last trading price, and current orderbook (bids & asks).

They seem to have an API: http://www.huobi.com/help/index.php?a=api_help but this page doesn't help me much (even after translating it with Google, as I can't read Chinese).

Does anyone know how to use this API?

I had some trouble finding it there but then I found it in "reference"
https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference

You can use normal http queries like on other exchanges so to get an orderbook you use this for example: https://api.huobi.pro/market/depth?symbol=ethbtc&type=step1

I think this is the newest api on github

https://github.com/huobiapi


How old should be my bitcoins to send them again without transaction fee? I'm making some test for a bitcoin merchant webpage. I want to test different actions without paying transaction fees everytime, but I can't since I use the same few bitcoins for everything.

Sooo how long should I wait for my bitcoins to be transfered wihout fee?

As the coins "age" they will have a higher priority.

I don't know the algorithm, but believe it is roughly like a day or so and then the age of the coin no longer is a factor.

So if you are seeing minimum fees for coins more than a day after you've received them, it is because of other reasons, such as having outputs at amounts below 0.01 BTC.

In the Bitcoin protocol, fees are totally optional.  You can have a fee of 0btc or 10btc.

Once there are more transactions then what fits into a block, which isn't now, miners will choose what transactions to include into their block, and they will prefer transactions with a fee attached, because they get that fee.

Right now, fees don't help process a transaction any sooner or better, but in the future it's likely to make a difference.  This totally depends on what happens in the future, and is very much up for debate.


The input of every transaction refers to an output of a prior transaction.

An input can't be defined by only the transaction hash.  A transaction consists of 1 or more outputs if you only specify the transaction hash there is no way to know which output is being spent.**

Since these types of questions often come from a larger misunderstanding of how the network "really works" I am going to start with some "plain english" rules on transactions (tx):

1. A tx consists of one or more inputs and one or more outputs.
2. All tx inputs refer to an unspent output of a prior transaction.
3. The full value of an input is always spent; a tx can not spend part of the value.
4. Likewise all outputs are either spent or unspent, they can't be partially spent.
5. A tx "spends" the outputs which are referenced in the input portion of the tx.
6. A tx creates new spendable "unspent outputs" listed in the output portion of the tx.

Now that we got that out of the way, to define a tx input you need to refer to the hash of a prior transaction AND the output index.  The tx hash identifies the transaction, but the transaction may have more than one output so the index is used to identify which output is being "spent" here.

This may seem confusing because you will hear statements such as "I have 20 BTC stored at address 1XYZ..." or "My wallet had 100 BTC", but this is really an abstraction.  The client is merely showing you the sum of all the unspent outputs for an address or the entire wallet.

The Bitcoin network works on the concept of inputs and outputs

The Bitcoin network doesn't consider the "value" an address when validating txs.  When validating a tx, outputs are considered as independent entities.  Spending one output for a particular address has no effect on the other outputs (if any) for that address.  A transaction is valid (among other things)if all the inputs refer to valid unspent outputs of prior transactions (can't spend coins twice), the sum of the outputs is less than or equal to the sum of the inputs (can't counterfeit new coins), and the inputs are signed by the correct private key (only the "owner" of the private key can spend the coins).

Examples

To avoid a lot of excess detail we will look at a simplified version of the transactions used in the Bitcoin network.

Say an previous transaction exists (tx hash 1234567890).  In this transaction you have an input which referenced an unspent output of a previous transaction worth 100 BTC.  You send 50 BTC to one address, 10 BTC to another address, and the change (40 BTC) is sent to a new address in your wallet.  Remember we can't spend part of an unspent output so the change is necessary because we are spending a 100 BTC input but only need to "send" 60 BTC.

The simplified pseudo-transaction may look something like this.

In[0] <lets ignore the input for now but it does have a value of 100 BTC>
Out[0] Bitcoin address=1ABC... Value=50 BTC
Out[1] Bitcoin address=1DEF... Value=10 BTC
Out[2] Bitcoin address=1XYZ... Value=40 BTC

The tx has 1 input, 3 outputs, all in/out indexes are zero based, and the value of the outputs is equal to the value of the input.  If the output(s) are less than the input(s) then the difference is the fee paid to the miner.  If the outputs are more than the input(s) then the tx is invalid.

Now since the "change" address is 1XYZ is another address in our wallet we can use it in a new transactions. We will pay a merchant 1 BTC and give the miner a fee of 0.01 for fast inclusion in a block.  The change will be sent to yet another new address in the wallet (1ZZZ....). The resulting transaction may look like this:

In[0]  Tx hash=1234567890 OutputIndex=2
Out[0] Bitcoin Address=1HIJ... Value=1 BTC
Out[1] Bitcoin Address=1ZZZ... Value=38.99 BTC

The input refers to the 3rd (0 base array) output of the tx above.  Looking up the output index 2 of tx 123456789 we can see the value is 40.00 BTC.  The sum of the outputs are 39.99 meaning 0.01 BTC will be collected by the miner of the block.

Real txs deviate from the simplified version shown above

Note this isn't really important unless you want to dive deeper into the workings of the protocol.  The output of Bitcoin transactions are actually scripts instead of static addresses and values shown above.  Functionally for most outputs they work the same, although to save space the hash of the public key not the address is used in the output. All blocks have a required tx called the coinbase which has no input because the output is the block subsidy and the fees paid to miners.  All values in the Bitcoin network are integers in Satoshis (1E-8 BTC) so technically all the numbers in this post would be multiplied by 1E8.

In a nutshell vout could be considered as an identifiant of the output inside a previous transaction.

keep in mind that the input that you want to include in your transaction are the  outputs of a previous transaction so you go back to the received transaction and you choose which output to include as input in your new transaction. However, if you don't care bitcoin client will do that in your place .


How can I avoid the "Amount too low" message in my wallet for payout from Cloud mining service? 1) I have a Bitcoin-wallet called "Copay" on my IOS-device
2) I have joined the cloud mining-service "Genesis mining". For trying out the service I started with 50 $ from my credit card.
3) here is a list of payments I received from them and the fees which yielded always the "Amount too low" message

11th July 2017 3,243 bits   fee 0,00044277 BTC
31st July 2017  1,750 bits   fee 0.02086374 BTC
14th August 2017 1,615 bits  fee 0.00224983 BTC

There is another transaction where I went to a bitcoin shop and bought 10 Euro in Bitcoin which gets the "Amount too low" message.

As a newbie I have some questions

1) Is there a possibility to recover any of these funds without paying fees which are high (e.g. the fee from 31st July amounts to around 100 $) ?
2) Would switching to another wallet remedy the situation
3) Is this a general problem of the Bitcoin network that the fees are rising and thus it is not suitable for transactions below 20 $ ?
4) Would there be a possibility to stop "Genesis Mining" from sending me micro transactions but instead accumulating the funds until a reasonable sum is reached ?

Sorry for having so many questions, I would be grateful for any input

Regards

Use the custom miner fee setting to lower fees.  The fee categories make no sense.  If you want a payment to be received in a day or two - faster than ACH, you should set the fee to 10 satosi per byte or so.

After doing research... the fees are currently (mid August) that high... low payments in Bitcoin should be avoided.. there is no glitch in the app


Using funds that have not been completely transferred yet for a new transaction What happens if I start a new transaction with funds from a transaction which isn't 100% complete?

Let's say, the incoming transaction shows 2/3 of the green dot, but the sum is counted as full by my Bitcoin Wallet for Android.

The green dot in Bitcoin Wallet for Android represents the number of confirmations an incoming transaction has. Once the first slice appears, the transaction has its first confirmation; i.e. it was included in the blockchain. Additional slices will appear when succeeding blocks are found, AFAIR marking up to six confirmations.

There should not be any issue or delay to spending any funds that have at least one confirmation as long as you include a sufficient transaction fee.

You transaction will remain unconfirmed until all the inputs to your transaction are confirmed. Assuming proper transaction fees were paid for the unconfirmed payment you are waiting on they will confirm. Once that happens your outgoing transaction will confirm as well.

Your wallet will always search for confirmed inputs first and only uses unconfirmed inputs as the last resort.

https://github.com/bitcoin/bitcoin/issues/3288

To avoid creating chains of confirmed transactions always include an appropriate transaction fee.

https://bitcoinfees.21.co/#delay


Does any exchange provide API to call callback function on each transaction? Does any exchange provide API to call callback function on each transaction?

I would like to build a auto trade platform based on the tick event, but instead of pulling the price, I would like to use the push mechanism.

It is not common to have Push APIs for Exchange sites. However Poloniex has WAMP (Web Application Messaging Protocol) over WebSocket for ticker:

https://poloniex.com/support/api/

After some search, I think pyalgotrade is closest to what I am looking for. I post answer to my own question in case someone has the same question. Thank you.


Total Bitcoins in circulation on any given day? I'm creating a spreadsheet to track total bitcoins in circulation from day 1.
This would be to add up each Bitcoin per day created and add to an accumulating total.
For example, if we picked any day we could then see what the total amount of Bitcoins created was.
If we picked the 1st January 2014 we could say the total Bitcoins mined equals X.
If we pick today (3rd June 2019) we could say the total Bitcoins mined equals X.
By definition, that would also mean we could calculate how many Bitcoins are left to be mined on any given day.
Could some one assist me to find the way to create this spreadsheet?
Thanks.

From command line the piping to date command needs a 2nd eye.  Bit late for me here, but it's a unix timestamp conversion to whatever format you want.

You can find out by:

getting the hash of each block at height X using the RPC or bitcoin-cli getblockhash X
using the blockhash to get information about that block using RPC or bitcoin-cli getblock <HASH>
get the timestamp of that block
convert timestamp into the date format you want
get the first transaction of the block (coinbase transaction) for the amount of newly mined coins using RPC or bitcoin-cli gettransaction <TX>

And run it through every block in a loop.

e.g.

bitcoin-cli getblockhash 1
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048

 bitcoin-cli getblock 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 | jq '.time' | date
Mon Jun  3 18:54:45 UTC 2019

bitcoin-cli getrawtransaction `bitcoin-cli getblock 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 | jq -r '.tx[0]'` true | jq '.vout[0].value'
50

Here is block #1 on a btc explorer showing the same data, 50 new coins.

You can loop like that on command line but probably better to do with RPC and a real programming language.


What value should nonce be when mining bitcoin ? When the miner program start, the value of nonce is zero or a random number? Which of them is better?

This is essentially like asking: "When buying a lottery ticket is it better to have a zero or a random number in my lottery number?"

The reality is that it actually doesn't matter because it's an entirely random process, just like winning the lottery.

EDIT: dave_thompson_085's note below just proved me wrong, as the block hash will depend on your coinbase TXN, and will most probably be different from other miner's.

STarting with a nonce zero is then a valid choice.

This assertion is no more than a semi-educated guess, but IMO it does matter, a lot what your starting guess is.

Just imagine playing a lottery where you choose your ticket number. Choosing a popular number (such as the current year) would give you exactly the same probability to be chosen as a winner than choosing a rare number (say: a random number avoiding obvious choices). But when it comes to sharing the prize you will definitely want to be a single winner instead of having to split prize with other winners.

So, back to mining: if you mine with a nonce of 0, and there is another miner around with more hashpower than you, also starting with a nonce of 0; and if a solution is to be found that is close to 0, they will find it before you. As such, do not start with nonce 0 unless you own or participate in a pool with a lot of hashpower.

You would better start with a random nonce, so that:

You have a better chance to be the first one to a solution (unless you're the majority miner)
Whenever all the possible solutions for a block lie far from nonce 0, the network will not have to wait for all miners to reach it, and will thus perform better (more regularly, not clogging on a 30-minutes-block that will start to pile unprocessed transactions)

As a side note, if the only available solution is lower than your starting nounce, as suggested by jiahmark, then indeed, you lost for that block. But nobody can know that beforehand in a random process, so you don't really care


Can my internet provider see I'm using bitcoin core (Russia) I live in Russia and bitcoin is prohibited here. Can my internet provider see I'm using bitcoin so I will have problems?

UPD: Right now I'm still syncing bitcoin core. Is syncing as dangerous as participating in transactions?

Yes, they can.  It is quite easy to detect an ordinary Bitcoin client; it sends unencrypted messages of a standard and unique format to well-known TCP ports.  Moreover, if they monitor all your traffic, it would not be too hard for them to link you with the transactions you send; Bitcoin tries to "cloak" your transactions by sending them out along with other people's relayed transactions.  But if they can see all your incoming traffic, then when you send out a transaction that you never received from someone else, they can conclude it is one that you yourself created.

Identifying the recipient of the transaction might be harder, unless it happens to be someone they are already monitoring;  then they could see when that person spends the coins you sent.

An encrypted VPN, or proxy service like Tor, can help with this, to some extent.  However, then you have to trust the VPN provider not to cooperate with the authorities, or to monitor your traffic themselves and use it for their own evil purposes.  In the case of Tor, there might be similar problems if you connect to a Tor node which is compromised; someone who controls all your Internet traffic might be able to arrange for this to happen.

if bitcoin is prohibited there, then your government must has a way to monitor its usage, so you probably could get into problem, but the chance of getting prosecuted is very low because they can't trace who you are paying to, so you can buy drug or child pornography or bombs from anyone, and your government won't know what you are buying, but there is a chance that when the police search your house and find the illegal things that you bought with bitcoin and you will definitely go to jail and get your a$$ cleaned there.