Mining Difficulty and Leading Zeros I understand that the Bitcoin mining problem is to find a string s (hash of previous block + Merkle Tree Hash + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.

According to Blockchain.Info, The Current Difficulty is 63,93,02,37,17,201.

The output of sha256() is a 16 bit hex value.
Question 1
The above image indicates that if N=4, there are 4 zeroes in the 16bit hex value. So if N=16 is the entire string is expected to have only zeroes? Please explain difficulty using this example.
So if N=6393023717201 How do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string? Please explain the significance of this huge number of zeroes in this context.
Question 2
Why is difficulty decreases at some point in time?

Bitcoin mining problem is to find a string s (hash of previous block + Merkle Tree Hash + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.

First a clarification. string s (block header) will include hash of previous block header, merkle root, nonce, target bits, timestamp and nonce.

  So if N=6393023717201, how do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string?

That is not how difficulty is represented. We start with the genesis block that has a difficulty of 1. At that difficulty we needed to find the block hash that was less than 0x00000000ffff0000000000000000000000000000000000000000000000000000. The current target hash is finding block header less than 0x0000000000000000002c071d0000000000000000000000000000000000000000. So your difficulty number is genesis block header hash target/current block header hash target. That's how you get 6393023717201.863.

Refer here for more info as to how block header hash target is determined using target bits that are in the block header.

  Why difficulty decreases at some point in time?

In bitcoin the difficulty keeps the average block time at 10 minutes. If miners start using sophisticated instruments (eg. ASIC chips) that find the solution to the block header faster than 10 minutes, then every 2016 block the difficulty is adjusted so that the time needed to mine blocks increases. If miners start lowering their investments in sophisticated instruments so that average block mining time over 2016 blocks is more than 10 minutes, then the difficulty is lowered so that block mining time is faster. All of this is done so that we converge to 10 minutes as the average block mining time.


How can pool operators reduce the number of orphaned blocks that they mine? Every time a pool mines a orphaned block, that is wasted effort for the pool.

In an interest to increase pool efficiency and overall network efficiency, what can a pool do to increase efficiency when mining, and prevent orphaned blocks?

Some ideas may include

Polling other pools
Certain BIP technologies (etc)

Lots of things really, most are fairly abusive if they're a large pool though, or at least undesirable in network terms.

Not including transactions in blocks. This is the obvious one, it's a lot easier to broadcast a single 25kB block than it is a bigger one. You do of course forfeit all the fees you would otherwise get, but some might see that as a tradeoff for an almost instantly reaching block.
Multiple exits for blocks. Something that many pools already do, having exists in the Tor side of the network, along with multiple high-bandwidth nodes apparently has an effect. Curating a list of high profile nodes like nogleg.com and those based on .edu domains would probably allow for the fastest block propagation. Remember that you need to have enough bandwidth to submit to every peer you are connected to simultaneously, if you fill your pipe then your block is seriously delayed and has a greater chance of being orphaned.
Building on orphan blocks. This is something I know at least one pool does, the concept is to build on your own orphans until they are at least 2 blocks buried. The chance of you getting a second block on top of the orphan is the same but the expectation of profit is double that of a normal block. The idea is essentially to orphan the block that orphaned you, and once the other chain gets higher than you by a sizeable amount this becomes a negative expectation and it's time to revert to the main chain yourself.

There's no secret sauce really, just a combination of many factors. Orphans are fairly rare now anyway.


Pushpoold mmcFE-Litecoin server not running properly I am starting a LiteCoin mmcFE-pushpool pool for several clubs at my university, and am having some problem. First, we are running on an EC2 instance (Ubuntu), and have mmcFE and pushpull running. I am having two major issues before we can start up this pool...

1) On the web interface, users are able to create and account and log in just fine. On the left hand side, there is an error/notice that states: Notice: Undefined variable: totalOverallShares in /var/www/includes/leftsidebar.php on line 64 I am also getting Notice: Undefined variable: totalOverallShares in /var/www/includes/leftsidebar.php on line 71

2) Second, I went ahead and ignored the previous error and decided to run a CPU miner just to test the stats. Normally I can hash out (scrypt) at about 11kh/s on other peoples pools. It has been running for about 5hrs now, and my stats on the website are still saying 0. The cron job is running every 2 minutes. Using MINERD and never getting any "shares submitted, Yeah!" on my pc....

Does anyone have any pointers? I am really stumped as to what could be holding us up. You can see this problem on the webpage at http://p2pool.us

{
# network ports
"listen" : [
        # binary protocol (default), port 8336
        { "port" : 8336 },

        # HTTP JSON-RPC protocol, port 8337
        { "port" : 8337, "protocol" : "http-json" }

],

# database settings
"database" : {
       "engine" : "mysql",

       # 'host' defaults to localhost, if not specified
        "host" : "127.0.0.1",

       # 'port' uses proper default port for the DB engine,
       # if not specified
       "port" : "3306",

       "name" : "sc",
       "username" : "myusername",
       "password" : "mypasswd",
       "sharelog" : true,
       "stmt.pwdb":"SELECT password FROM pool_worker WHERE username = ?",

       "stmt.sharelog":"INSERT INTO shares (rem_host, username,   our_result,               upstream_result, reason, solution) VALUES (?, ?, ?, $
},

# cache settings
"memcached" : {
        "servers" : [
                { "host" : "127.0.0.1", "port" : 11211 }
        ]
},
        "servers" : [
                { "host" : "127.0.0.1", "port" : 11211 }
        ]
},

"pid" : "/tmp/pushpoold.pid",

# overrides local hostname detection
"forcehost" : "localhost.localdomain",

"log.requests" : "/tmp/request.log",
"log.shares" : "/tmp/shares.log",

# the server assumes longpolling (w/ SIGUSR1 called for each blk)
"longpoll.disable" : false,

# length of time to cache username/password credentials, in seconds
"auth.cred_cache.expire" : 75,

# RPC settings
"rpc.url" : "http://127.0.0.1:9332/",
"rpc.user" : "user",
"rpc.pass" : "pass",

# rewrite returned 'target' to difficulty-1?
"rpc.target.rewrite" : true,

# allow clients to update the ntime field of their work
"roll.ntime.disable" : false
}

The above shows my PUSHPOOLD config. Below, is my litecoind conf:

server=1
rpcallowip=127.0.0.1
rpcuser=user
rpcpassword=pass

To answer your questions:

This error is common, and i usually fixed after the first cronjob / first submitted share.
This error is also common, as you have not set a difficulty in the server.json file.
See this line here?

#rewrite returned 'target' to difficulty-1?
"rpc.target.rewrite" : true,

This tells the pushpoold that, if there's no difficulty set, then set it to -1, which is infinite, meaning you will NEVER find a share.

Add parameter

"rpc.target.bits" : 17

To the RPC setting section of server.json. You can change the value however you like. The higher it is, the more frequently you'll find a share. The lower it is, the hard it is to find one. This doesn't impact the ammount of LTC found.

If you're using mmcFE, be sure to edit that value in the configuration file of mmcFE.


Receiving bitcoins without open client? If I am planning to accept bitcoins, does my client need to be running? Can I simply give out my public key and open the client later to receive? Does it depend on the client (I use MultiBit)? Furthermore, if I send bitcoins, do I need to keep the client open for the receiver to receive their payment, or are they all set to receive as soon as their balance (not available balance) goes up?

To accept a Bitcoin transaction, you only need to give out a hash of the public key also known as the Bitcoin address. That said, if you are a merchant then the recommended practice is to give out a new bitcoin address for every transaction to make it easier to distinguish between orders from different people.

Assuming that whatever Bitcoin client you choose is honest, then it doesn't matter what client you use. Underneath it would be the same message broadcasted by the Bitcoin network. You don't need to have a client open at all times to send or receive payment, but if you use Bitcoin-Qt then you would need to have an up-to-date blockchain database in order for client to scan through the blockchain to show all received/sent transactions and display the correct balance.


What other decentralized bitcoin / altcoin exchanges are there besides Bitsquare? I recently found out about Bitsquare's decentralized exchange that lets you trade altcoin or fiat. But are there other decentralized altcoin exchanges out there like bitsquare?

You can try https://localbitcoins.com
It is a p2p crypto exchange market that allows you to interact and exchange currencies with your counter-party directly, no intermediaries.

See also:

https://0xproject.com
https://etherdelta.com


What would happen if there were no full nodes? As I see it, full nodes are there to verify the miners block and propagate blocks to other full nodes.

Miners can act as full nodes, if not they do not they risk the chance of mining a block with an invalid transaction.

What would happen if the miner mined a block, and there were no full nodes to validate it?

Full nodes are more useful than simply for block propagation, and miners are not the only type of user on the Bitcoin network that benefits from validating the whole blockchain themselves.  I would argue that anyone who wants to ensure they aren't being tricked should be running a full node, such that they can be truly trustless.  This group should probably included exchanges, merchants, and even individual users (to some extent).

As for your question about what would happen...well...nothing.  The miner would find a valid hash for a block, and then propagate it to nobody.  Nobody would check it against their blockchain, and nobody would pass it on other nodes (of which there are none).  SPV nodes wouldn't receive block headers, nor would anyone respond to their bloom-filtered requests for transaction updates.  There would be nobody to send them to.

Bitcoin is a network, which consists of nodes and paths.  When you take away the nodes, the paths cannot exist.  You are effectively asking "if there was no Bitcoin network, how would the Bitcoin network operate?"  Simple answer: it wouldn't.


Sustainability of current hashing I'm a bitcoin/blockchain layman. I'm just getting my head around the hashing of blocks and the increase in difficulty (number of zeros) required as more miners get involved. I understand this is to maintain the 10 minute hash rate.

I understand the generation of more difficult hashes is attractive because it makes the chain more difficult to re-write and therefore safer.

As I read-on, the escalated use of computing power required is a point of conflict in my mind. We can't continue to increase the difficulty because the hashes are fixed length and need to be unique? Can't keep adding zeros. Am I missing something?

What's the plan, longer hash digests with a different algorithm?

Is there research I can read on hashing algorithm development?

Unique hashes are not something that we are likely to run out of in the near-to-medium term future, unless huge advancements in computation are made (in which case we'd have other issues to worry about).

When Bitcoin adds a zero to the front of the target, it is not a zero in hexadecimal (how hashes are usually visualized), it is adding it in binary.  The difference is huge:

0FFF -> 00FF

means this in binary:

0000111111111111 -> 0000000011111111

What really happens is this:

0000111111111111 -> 0000011111111111

Or in hex:

0FFF -> 07FF

This means it will take 4 times as long to reach your point of concern as you thought.  Also, let's look at the block hash you posted:

000000000000000000bbfa2afceac352a16db934867103aa85e6a83dc0fb6dfb

There are currently 18 leading hex zeros, which translates to 72 leading binary zeros.  This leaves 184 bits (256 - 72) for a unique hash value, or 2^184 unique hashes.  So right now, if the difficulty never increased and assuming a 10 minute block time, that still leaves us with 4.66*10^50 years worth of hashes (which is roughly 5 time the age of the universe).  When the difficulty doubles, we now only have 183 bits of hash space.  This means it's about 4.66*10^25 years, or about 2.5 times the age of the universe of hash space left.  As you can see, it will take some time for the difficulty to reach a point where hash space is a reasonable issue.

However, the real problem is not with total hash space, but with probable collisions.  Let's say that we have gotten to the point where there are only 56 bits available for hash space.  First, this would take a truly massive hashing increase in the Bitcoin network to ever come about (difficulty would have to double 128 times), but we'll ignore that for this example.  While 2^56 may seem like a small hash in modern cryptography, for this use case, it's not.  We still have enough hashes left to cover the entire age of the universe, but again, we are concerned with someone finding a block with a hash that matches an existing block (or competing block).

So what would we do?  I'm sure there'd be some debate if this ever came up, but I think the simple solution would be to reject that hash, just as if it were above the target difficulty.  Miners would be forced to continue hashing until another block was found.  After all, there is still plenty of room in the hash space, even when reduced to 56 bits (which is currently preposterous). Such a change to the protocol would only be a soft fork.

To summarize, even with our best estimates of future computing technology the remaining time for Bitcoin hashes is best measured in multiples of the age of the universe.  Even if this became an issue, a simple soft fork could fix it.  There's really not much to worry about here.


can blocks remain capped to 1MB forever? this is perhaps more of an economics question than a bitcoin question, but i'm wondering if it would be viable to leave the block size capped at 1MB for all time and simply let a series of rules govern which transactions get included into a mined block, eg:

paying a higher fee gives higher priority
older coins get higher priority
bigger spend gets higher priority
etc

this would incentivize people to rely more on off-chain transactions (eg gyft cards), or sidechains, to accumulate many payments into a single transaction, and perhaps to delay transactions if they do not wish to pay high fees. and one benefit would be that the blockchain would not grow beyond a size which would fit on a single user's hard disk. this would keep bitcoin decentralized without any need for a hardfork.

are there any fatal flaws to this notion?

The blocksize topic correlates directly with the current 7 transaction per second (TPS) ceiling Bitcoin has that was recently brought to light before US Congressional Testimony. https://en.bitcoin.it/wiki/Scalability describes the 7 TPS ceilings under "Current bottlenecks".  Ignore block framing data fields, the 7 TPS limit implies that ~4200 transaction (10*60*7) with each being ~238 bytes in size fitting nicely into the 1MB block brown bag. A careful examination of the top of blockchain-dot-info will indicate the real world is a little more complex, and the 7 TPS ceiling is extremely optimistic, most transactions will be significantly larger than 238 bytes size! My mining Payouts alone are ~4K in size.

The tweaking of the blocksize a very hot/political topic. Remember the March 12, 2013 Bitcoin forked Blockchain issue??? (http://bitcoin.org/en/alert/2013-03-11-chain-fork) It is too early for me to tell what the trade space pros & cons [system's engineering truth concerning the trade space analysis of alternative (AoA) results for backward compatibility, scalability, security, sustained decentralization... measures of effectiveness (MOE) and measures of performance (MOP)] is for increasing the current 1MB block size in the Blockchain.

Ignoring state politics, in the end, the dynamics between stability of developer solutions, hardware engine solutions, miners and pools will ultimately determine the block size(s) supported in the future.

See:

http://keepbitcoinfree.org/
https://bitcoin.stackexchange.com/tags/blockchain-fork/hot
http://www.reddit.com/r/Bitcoin/comments/1owbpn/is_there_a_consensus_on_the_blocksize_limit_issue/
http://www.reddit.com/r/Bitcoin/comments/ioeob/an_alternative_to_supernodes/


Receiving transactions in prune mode I am new to Bitcoin.  I have downloaded the whole blockchain but I still can't access my wallets because I get a popup telling me to use prune mode.  My question is: I know that I have received transactions that I have not yet seen in my wallet.  If I run prune mode, will I lose those deposits since they are not yet in my wallet?

I am new to Bitcoin.

Welcome !

  I have downloaded the whole blockchain but I still can't access my wallets because I get a popup telling me to use prune mode.

You might not have enough disk space (hence why you're not able to see your funds).

  If I run prune mode, will I lose those deposits since they are not yet in my wallet?

No, not at all.
By using prune mode you'll be able to fully sync to the tip (current last block of the chain) and thus see your funds, which you apparently cannot without prune mode because of your disk space.


Which coin to mine with CPU long-term I have a machine with 48 CPU cores, running Linux. I would like to mine for a coin, not to sell immediately, but in several months when the value has increased (hopefully).

I don't want to keep changing every day, so what coin would be best, and why? I realise this involves predicting the future, but would like to hear various views.

Generally, CPU mining isn't worth the electricity consumes.  However, we will assume that you've got some adequately efficient cores.
If you are going to do CPU mining, you might have more luck using a scrypt based fork of bitcoin, such as tenebrix, litecoin, or fairbrix.
Because the effectiveness of a setup can vary, as well as the price of various cryptocurrencies, your best bet is to do your own experimentation:

For each coin:

Mine for an hour or so, and determine your average mining rate
Look up the current difficulty of that coin
Use something like the Bitcoin Mining Calculator to determine how much you stand to make
Convert it into $ per day or something similar

You would then compare the profitability of the various coins and choose which is best.

Alternatively, if you wish to assume that scrypt is best for your setup, and that your hashrate will be identical across different scrypt-based coins, you can use CoinWarz to determine the best coin to mine (currently Fastcoin, although they rate fastcoin as having bad stability, so you may wish to drop down to digitalcoin or novacoin if you feel like you need something a little more stable.)


Empirical analysis of blockchain branches: once every 380 blocks? I've completed an empirical analysis of blockchain forks from block #300000 thru #400000. I found the following: (a) blockchain forks of length 1: observed every 380 blocks on average; (b) blockchain forks of length 2: none observed.

I recognize there is variation inherent in any such analysis, as different full nodes may produce different results.

Does the above data "ring true"? I am keen to hear from anyone with good data (or even good intuition) and especially eager to hear from anyone with different numbers.

Blockchain forks are an artifact from the network propagation and appear at random intervals (and far more often than what you observed). It is important to note that since nodes do not forward information that contradicts their view of the network, i.e., they have accepted one of the forks, you will not be able to observe all forks in the network, but only those that are propagated to you through the network.

For details on what causes blockchain forks and their impact on the security/performance of the network see Information Propagation in the Bitcoin Network (disclaimer: I am one of the authors).


How can I import an existing Blockchain.info wallet to bitcoin-cli? I manage several accounts which I created via Blockchain.info for my webapp. I'm migrating to bitcoin-cli instead of using their API due to the high amount of calls I have to make.

I'm a bitcoin-cli noob. I have been able to send raw transactions in hex, but I cannot find how to import an existing account to my bitcoin-cli install. Is it possible to do this?

The ultimate goal is to get balance and received transactions of all addresses I have on Blockchain info via bitcoin-cli.

Is this at all doable?

Thanks,
Alberto

It's possible to export your private keys from Blockchain.info (a bit of googling showed me this: https://github.com/OmniLayer/omniwallet/wiki/Exporting-Private-Key-from-Blockchain.info-and-Importing-to-Omniwallet.org) and then import it in bitcoind using the import function (as described in https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)

Good luck!


Easy Miner showing zero work, no devices shown I have servers at my home (I work as a computer architect from my home for the Fortune 50) that are on all the time and plan to procure some Bitcoin hardware miners in the next few weeks. In the meantime I have got my own Bitcoin Wallet and signed up to a Bitcoin Pool and want to 'test the water' by mining with my extra GPUs I have in one primary Windows Server.

I have an account with Eclipse and have the original Wallet from Bitcoin Qt and I run a GUI mining tool from Butterflylabs called Easy Miner.

I am confused as I ran all night for about 18 hours but the logs show nothing but zero's when it talks about my work! It shows no devices and it 'looks' like no GPU!

I am confused...do I need a different Mining Tool to use my GPU or CPU (can you even use the CPU anymore...I know it would be slow and hence o not really want this.

So if you read the fine print on "Easy Miner", you can only use the software with their hardware devices in "out-of-the-box" mode (direct download --> run) (Disclaimer: I have a Jalapeno 5 GH/s miner, this shows up as a valid device. My GPU does not, however).
See this thread about how to configure GPU mining. I believe it's in the settings, plus you need to set a bunch of flags to get the miner to recognize your GPU settings.

You would most likely be better off using CGminer / BFGminer, if you want to go the GPU mining route, however as the comment says, you're unlikely to get any real yields from any amount of GPUs, as they are just not as efficient as ASICs or FPGAs (see this for a good comparison of dedicated hardware versus graphics cards).


Is it possible to run Bitcoin on Google App Engine? / alternatives? This question is cross-posted on bitcoin.stackexchange, stackoverflow and bitcointalks.

I'm planning to build an application on Google App Engine that will heavily make use of Bitcoin trading. I've been Googling along a little but I couldn't find whether it is possible to run Bitcoin itself on App Engine (with Java). I have some experience with App Engine, but limited to a pure web-app centered usage.
I've read about a few people that have made applications using Bitcoin with App Engine as well that are hosting Bitcoin separately on an Amazon EC2 instance.

So, does anyone here either has experience with running Bitcoin in App Engine for Java or would anyone have an idea how this could possibly be done?
I know there are a lot of Bitcoin applications out there, I'd like to know how these manage their Bitcoin traffic.

I'm trying to avoid needing a separate Amazon service running all the time next to App Engine.

In fact, receiving Bitcoin can easily be done by using passive APIs like blockexplorer or blockchain, so I'm considering to find a reliable API to handle my outgoing payments. But this approach causes extreme dependency on this API service, which I actually want to avoid as much as possible.

You should have a look at this (my master thesis topic connected to running Bitcoin on GAE).

While it is possible to run a Bitcoin-related application on Google App Engine, the service will inherently depend on another application to run. GAE only allows one to use the most basic ports for HTTP and HTTPS communication, whereas running an independent Bitcoin node requires the use of TCP/IP. It is possible to write a simple program to convert HTTP calls into TCP/IP ones, but that would need to be hosted elsewhere. If you want to use Bitcoind as the way to communicate with the Bitcoin network, things get significantly easier.

I've tried writing my own implementation of a Bitcoin client on Google App Engine in Go, but was ultimately defeated by OP_Checksig and its lack of documentation. But honestly, I found using Bitcoind for everything Bitcoin-related to be a lot simpler.

What you also need to consider are the costs of running apps on Google App Engine. I personally found the write and read operations to be a bit limiting if you want to stay on a free tier, but depending on what you will actually want to do, there can be other factors to consider.


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


Why does the amount of sats in a lightning payment channel amounts vary if no txns are occuring? I recently got my lightning node up and running (went the easy route via Casa node).
I noticed that I was having a difficult time tracking the amount of sats in a given channel..I wasn't doing any transactions with them, but they seemed to vary up and down 1000 sats up, 2000 down, etc.

Confused, I finally opened up a payment channel only to watch it, see how it moves, with a nice round number: 1,000,000 satoshis.

It's still in pending state (trying to open it up with ACINQ node for little miner money, still hasn't been picked up by a btc miner)...anyways..it's still in pending state, but the amount now lists "989,869 sats Pending" not 1 million sats as I tried to open the channel with. . .

Should'nt satoshi quantity stay the same for a given channel (if it's all opened up and no txns are occuring, or if as in my case it's in pending state?). Does the bitcoin price going up or down affect the amount of btc/satoshis in a channel?

Without detailed log files I can only guess the exact reason why you see this behavior. Two likely things come to my mind:

1.) Your node might have routed smaller payments. So in case you have outgoing capacity on one channel and incoming on another one someone might have used that to rout a payment. which would move some satoshi from one channel to the other

2.) If you opened the channels you are responsible for paying the fees in the case of a force close. These fees are taken away from the amount of satoshis which you own in your channel. Everytime you make a channel update (for example with a routing attampt - even if routing was not successfull) the fee estimator of your node and your peer try to estimate the onchain fees that your node would have to pay in case of a close.

Since your node seems to be fairly new and since the onchain fees have been fluctuating a lot recently I am almost certain that my second guess is the reason for the behavior that you observed.


How to measure block propagation time? What could I do to measure block propagation time?

An estimate of block propagation time would by necessity consider the speed of a sample of nodes in the p2p network.  As such it isn't possible to get an estimate using your node alone.  You could measure the time it takes to upload/download blocks to/from peers as well as verify them.

To estimate propagation time you would need several nodes dispersed geographically and with unique peers.  You could then monitor how long it took between for first and last node to receive the block.

You could also listen to your connected peers for their announcement of new block headers.  This would allow you to estimate propagation time based on more nodes.


What happens if Bitcoins are sent to a wrong, randomly generated address? I am new to Bitcoin and I confused creating a New Address for receiving and sending payments.

Here's what I did:

Generated a random Bitcoin Address (using www.bitaddress.org)
Created a New Address in my wallet (added it to "Addresses", for SENDING payments - I simply thought this would be my address for receiving BTC)
Purchased BTC in an online exchange and send the money to that address.

What happens to the coins now? Are they lost forever or waiting for someone lucky to get this address to receive payments (if it doesn't exist yet)...? What can I do to get them back, if anything?
Also, is there any way to assign a randomly generated address to my addresses for receiving payments?

Please help.

Well, you don't need different addresses for sending and receiving bitcoins. In fact, you don't have to worry about addresses at all. The Bitcoin client will create addresses when you need one for receiving payments and it will automatically send bitcoins using one of the addresses you previously received coins with.

If you generated the address on bitaddress.org without saving the private key, your coins are lost. The situation may occur that sometime in the future someone will create a new key that's the same as yours and be able to spend your lost coins, but that's extremely unlikely.

If you did save the private keys and you are using the original Bitcoin client (bitcoind or Bitcoin-Qt), you can import the private key as follows:

Close the client that is running. Either close the Bitcoin-Qt client or typing bitcoind stop.
Start bitcoind as a daemon using the command bitcoind -daemon. (If it gives the error that you need to add RPC user details to your bitcoin.conf file, do so, but also add rpcallowip=127.0.0.1 for security.)
If you wallet is secured with a passphrase, unlock it with <space>bitcoind walletpassphrase <your passphrase> 120 The space is for not saving your passphrase into the command history.
Import the private key: <space>bitcoind importprivkey "<your private key>" "<label for key>". (Again the space is for security.)
The private key is now imported in your wallet. You can now lock it again and close the daemon: bitcoind walletlock and bitcoind stop.
You can now reopen Bitcoin-Qt to see the address added.

Then, this answer tells you how to easily add new addresses for receiving bitcoins.


Is there still a shortage of available inbound connection slots? David Schwartz's answer to this question states the following:

"For some reason that isn't well-understood, the Bitcoin peer-to-peer network is consistently short of available inbound connection slots. This makes it more difficult for newly-started clients to establish a resilient connection to the Bitcoin network."

Is that still a problem? If so, could it be because of some sort of attack (or selfish behaviour) on the Bitcoin network?

It is due to a lot of people not port forwarding from their routers to their Bitcoin machines. Without the forwarding the client can only make outbound connections to those client that have port forwarding enabled. The limited number of such clients is probably due to people not realizing this need and now knowing how to change their router options.


How do I solo mine on a mac? I know it's pointless. I just want to learn how to do it. Are there any guides out there?

For Mac OSX users, you must have Snow Leopard (10.6) or newer
installed.
A fully-connected BitCoin wallet. see http://bitcoin.org/
If this is the first time you have launched BitCoin, it must
download and verify all the existing blocks in the system.

 This can
    take an hour or longer - just ignore it for a while.

  Update: since the time of this post the block chain has grown It can take several days on a slow connection to download and is currently pushing past 15GB

Install DiabloMiner see
https://github.com/Diablo-D3/DiabloMiner/wiki/Solo-Mining


Consequences of sibling keys when xpub and xprv are leaked Let's say the following keys are leaked:

44'/60'/4'/0 extended private key
44'/60'/4'/0 extended public key (you can just derive this from the above private key)

Now using the above information can we derive the private or public key of this path:

44'/60'/4'/1

I don't think we can derive the private key because to get the private
or public key of 44'/60'/4'/1, we need to know the private key or
public key for the path 44'/60'/4'. But that's not something which
we can calculate from the above information. Is my understanding right ?

You have interpreted that correctly. If your child extended private key belonging to path m/44'/60'/4'/0 is leaked, the attacker cannot figure out the child extended private key from path m/44'/60'/4'/1.

The non-hardened derivation for child private key is kchild = kpar + hash(Kpar, cpar, i). Here k represents private key, K is the public key, c is the chain code and i is the index number. If you note, the index number sits inside the hash function in the child key derivation. Since hash functions are undeterministic, slight change in its input can have a very different effect on the output. Hence incrementing the index number i from 0 to 1 will yield completely different result and hence cannot be back-calculated.

However, do note that according to BIP 44 derivation, the index number after the account level denotes whether it is receiving or change. The child extended private key that has been leaked (index = 0) will act as a parent private key to derive all receiving addresses belonging to account 5. Thus all receiving addressees derived from the 5th accounts are compromised in your case.


If I buy a house for Bitcoin directly, do I owe the government taxes in Bitcoin or in fiat? If Sue buys a house for 1 Bitcoin, that is, giving the 1 BTC directly to the person selling the house (no fiat involved), does she have to pay a % of that in Bitcoin to the government, or do they demand a fiat %?
If the latter, since Sue has no money on her bank account, she will face the situation of being unable to pay the taxes.
And to get more fiat money, she would have to sell Bitcoin to get fiat money to pay the first taxes, but then she owes more taxes on that!
Isn't this an impossible, eternal loop? Doesn't it prevent anyone from actually using their Bitcoin unless they also have tons of fiat money saved up which they are comfortable burning away for nothing just to pay taxes on their even more hard-earned Bitcoin?

I am not expert in US law, but I have understading of taxes in my local country and general principles.
In general, transactions and taxes are made in local currency, unless it is external trade, financial (like currency exchange) or other operation allowed by local tax/economic laws. Even if transaction is made in foreign currency, it is treated for tax purposes in local currency (converting foreign currency to local at the day of transaction).
In your example there is 99,99% probability that you will pay taxes in fiat currency after buying home. The exact amount depends on the value of bitcoin in the day of transaction. For example, if you by a house at 1 June for 1 bitcoin in the US, then the price of that home is converted to USD, and that sum is later used in calculating taxes.
However, not all jurisdictions currently allow to contract (setting price) in bitcoin for all assets. For example, in your country you can buy bitcoin at local exchange, but you cannot buy a house with bitcoin. However, you can still write buying agreement quoting local currency, paying in bitcoins and signing additional document with the seller regarding that transaction occured in bitcoin in the amount equivalent to price in local currency (this document is equivalent for bank recepeit for local currency). Still, such agreement may not be recognized by local authorities and declared as void.
Regarding the demand for fiat currency. In your example Sue will have to sell some amount of bitcoin to pay taxes. Unless the tax rate is not 100% (which in nonsense) the loop is not eternal.


How does a full-node index watch-only addresses? I can import watch-only addresses into my full-node's wallet. I can start querying their utxos from that point onward.

Where are watch-only addresses stored and how does my node keep index of their balances / utxos?
If I want to backup and boot a new instance of my node will it retain the indexes associated with my watched addresses?
Is there a limit to how many addresses I can watch, will many make querying inefficient?

Where are watch-only addresses stored and how does my node keep index of their balances / utxos?

Usually the software creates a wallet file just like any other and stores information in that, except the wallet file will be missing private key information.

If I want to backup and boot a new instance of my node will it retain the indexes associated with my watched addresses?

Yes

Is there a limit to how many addresses I can watch, will many make querying inefficient?

Depends on your computer and the software used. There is no hard limit but the more there are the slower it'll be.


Other database besides UTXO? In this post it is explained that the UTXO are removed after they are spent. This makes sense because they are not "unspent" anymore.

But don't all UTXOs have a reference/connection to their previous transaction? Is there a second "list" in the blockchain where all transactions from the past are stored? Because if not, where does that reference point to if the previous transaction is not in the UTXO list anymore.

The whole UTXO Model confuses me a little bit, so thank you for the clarification.

Once spent, the wallet removes the UTXO from its cache of unspent transactions. The transaction is not removed from the general database (the blockchain or block index). Full nodes running with txindex=1 keep every transaction forever. Some wallets though optimize the database to recover disk space - but this is a wallet-specific optimization and not part of how Bitcoin works.

For instance, Bitcoin Core has many caches and optimizations. One of them is the UTXO cache. The reason to have this cache is kind of obvious: if you had to search the entire blockchain for your own unspent coins before every transaction, that could potentially take hours. So Bitcoin Core keeps track of your UTXO's. Your UTXO's output amounts add up and become the balance you see on the wallet software.

The UTXO cache never points to previous transactions - it's just an optimization cache that makes it easy for Bitcoin Core to find TX's. The algorithm which builds the UTXO cache knows which transaction the UTXO came from, but the cache never points anywhere except to the TX index where the unspent output is located.

The pointer to a previous transaction only exists when you spend a UTXO and then a new input TX is created on that transaction. That input will point to the previously unspent transaction and that former UTXO will become spent. A new UTXO is then created after this transaction is mined. This UTXO becomes part of the Bitcoin balance of the recipient, just like the UTXO was part of your balance before you spent it.

This image (courtesy of bitcoin.org) might help illustrate how it works:

See those UTXO's dangling without a new TX ahead of them? Until they're spent, they remain as UTXO.

The arrows in that illustration show the money flow direction, but technically the arrows point the other way around : the inputs point back at some previous UTXO output. Once an input points at an output that output is no longer a UTXO, it is a committed TX. The input links the previous TX to a new UTXO and the previous one is marked spent. Bitcoin Core then removes this previous UTXO from the cache.


Is anyone using the blockchain (or other core Bitcome technology) for device registration? I've been reading about several alternate uses for the underlying technology behind Bitcoin:

Proof of Existence (digital notary)
Namecoin (for DNS as well as identity and messaging)

I was wondering if there is any project or team working on a system for registering devices that are marketed broadly (like cellphones) with decentralized set of identity servers. Once it is registered with one server it cannot be registered with any other server, and if it is identified someone else they can look up which server and which identity manages the device. Also, if the valid user transfers the identity of the device to a new server, then everyone can be certain of the new host.

As mentioned in the comments, I can certainly see the benefit of using the immutable recording function of the blockchain to identify and record parameters, in this case MAC (media access control) addresses, which are unique to each device.

Here a few challenges which will need to be overcome:

having a device's MAC details would be fantastic for tracking ownership, for example, in the case of stolen goods. However, anyone with even IT basic knowledge knows it's trivial to change a MAC address; so whilst the blockchain is immutable the data (ie MAC) addresses is not
privacy concerns also arise. Without going in to too much detail, it's problematic to say the least to be sharing one's identifying information on a public ledger if one had less malicious intentions (eg identification of MAC address for a stolen iPad, which could then be used to match up with social phishing (social engineering) with Apple Tech Support to match an owner's name with the stolen device)
The MAC address (or similar identifying number) should be encrypted, ideally. Homomorphic encryption allows for manipulation of data without decrypting it, and will be of great use for secure cloud based access. That being said, we're still a long way off meaningful use cases of homomorphic encryption in conjunction with blockchain ledgers


The first bitcoin wallets? I am trying to track down my old wallet, and I can't remember what kind of wallet it was! I am wondering what some of the first most popular wallets were, from the start of bitcoin in 2009 to about 2013! Thanks!

Well, as far as I know, the most famous BTC wallet was and will always be Bitcoin Core Wallet

Then the rest of the most famous ones are as listed below:

MultiBit (Now MultiBit HD)
Electrum
Blockchain.info
Armory
Bitcoin Knots

There are other wallets as well whose info you can get from the official site by clicking here


Misledgering possibility for double spending attack Imagine a malminer with two important abilities: having enough hashrate for producing blocks in a single-miner mode in reasonable amount of time and having a malconfigured miner software which doing somewhat a usual mining job, but forces some malminer's coins to be spend twice instead of processing only first transaction. What will next miner do if he will get the misledgered block with all others conditions satisfying (correct coin owner's signature, enough proof-of-bruteforse zeroes in checksum, 6 trailing blocks without double-spending, etc)? If the attack is not possible, I want to look at the code behind such a protection.

If a block contains an invalid transaction, it will be rejected by all honest full nodes. Full nodes verify transactions in a block in linear order, so after the first transaction is encountered, the nodes will deem the UTXOs being used as spent. Then when the second transaction (the double spend) is encountered, the nodes will see it as trying to spend already-spent outputs, and reject it along with the block.


Please explain CFeeRate::GetFee(size_t nBytes) Referring to the function CAmount CFeeRate::GetFee(size_t nBytes_) in feerate.cpp:

If I pass in say 2000 as the nBytes argument, what will this function return as the fee nFee? I don't understand how nSatoshisPerK is defined. Also, curious as to why this is used instead of letting miners determine this fee through selective mining.

CAmount CFeeRate::GetFee(size_t nBytes_) const
{
    assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max()));
    int64_t nSize = int64_t(nBytes_);

    CAmount nFee = nSatoshisPerK * nSize / 1000;

    if (nFee == 0 && nSize != 0) {
        if (nSatoshisPerK > 0)
            nFee = CAmount(1);
        if (nSatoshisPerK < 0)
            nFee = CAmount(-1);
    }

    return nFee;
}

If I pass in say 2000 as the nBytes argument, what will this function return as the fee nFee?

It depends on the fee rate that the CFeeRate object represents. The fee rate is denoted in Bitcoin per Kilobyte. So you pass in the number of bytes into GetFee and and calculates the amount in Bitcoin for the fee to be paid for something of size nBytes_.

If, for example, your CFeeRate object represents 0.00020000 Bitcoin per Kilobyte (or 20 satoshis per byte), giving 2000 as nBytes means that your fee will be 2000 * 0.0002 / 1000 = 0.0004 BTC.

  I don't understand how nSatoshisPerK is defined.

It is defined at the creation of the object. Whatever created the object specifies the fee rate to use.

  Also, curious as to why this is used instead of letting miners determine this fee through selective mining.

This is just an implementation detail, not an actual network thing that specifies the fee rate for everyone to use. CFeeRate is internal to Bitcoin Core and is simply just how fee rates are representing in internal logic. The fee rates themselves are constructed by the fee estimator which calculates fees based upon mined transactions.


Can I get the same stats as are on blockchain.info and btc.com by running a full node? There seem to be some discrepancies between blockchain.info and btc.com, specifically I am looking to extract the following info:

"Relayed By", there was a block that was listed as unknown on blockchain.info and showed as "relayed by" by specific mining pool on btc.com
Is there a way to figure out hash rate of specific mining pool as a % of total in the real time.

"Relayed By"

Bitcoin Core doesn't track which node relayed a transaction, and I doubt most other nodes do either.  In addition, this information is likely to be different for different nodes as each one may first receive a transaction from a different peer.

  figure out hash rate of specific mining pool as a % of total in the real time

Full nodes don't have the information necessary to determine anything about mining in real time as they only receive information about blocks when those blocks are distributed (on average every 10 minutes, but with high variance).  Because block finding is so variable, it's additionally necessary to average results over large numbers of blocks to get reasonably accurate numbers, meaning the statistics you typically see are either trailing actual block production by several days or are probably quite inaccurate.

In addition, miners don't have to identify themselves in the blocks they create, and the way they do optionally identify themselves is not standardized, so no stock full node provides any method for telling you which miner created which block.


Bitcoin-friendly Bank As is well known many Bitcoin businesses and in particular exchanges have had a lot of trouble working with banks. Are there any banks that are explicitly Bitcoin-friendly?

Despite the popular consensus on the matter, banks probably aren't specifically Bitcoin-unfriendly.  The repeated bank problems for exchanges probably come down to three main things:

Automatic risk triggers -- Banks have a lot of mechanisms in place that throw up warning bells when a new customer starts moving lots of money around, is rapidly depositing and withdrawing large amounts of money, etc.  In the past, such activities have often been associated with money laundering, crime, and the sorts of things that are generally bad for business.  Even if a Bitcoin business isn't a problem, it looks like one to the risk algorithms.  If, over time, Bitcoin businesses prove to in fact be low-risk while driving significant business for the banks, the algorithms may be adapted to take this into account.  But they're not rewriting their risk algorithms for what is from their perspective one tiny new technology (and that's probably responsible of them).
Regulatory compliance -- When risk triggers are activated, the first thing the bank wants to know is whether a business is fully compliant with anti-money-laundering legislation.  Many Bitcoin businesses and exchanges are, but the fact is that some aren't.  They haven't been prosecuted for it, but they weren't doing all the paperwork that they really should have been.  Sometimes it's not really the business owner's fault either--financial legalities can be complicated and arcane.  Nonetheless, failure to comply is a huge liability for a bank.
Legitimate risks -- Finally, despite their volatility, bitcoins are a much "harder" currency than most bank deposits and transfers, in the sense that a bitcoin transaction can't be reversed, while bank deposits and transfers are all the time.  That means there is a massive incentive for individually shady customers to move ill-gotten gains out of the banking system and into bitcoins, and there's nothing the Bitcoin exchanges and businesses can really do about that.  This is a major risk problem for a bank, who could end up out some serious money if transferred cash is later "charged back."  At least one major bank recently has quoted risk assessments of individual customers, rather than the exchange itself, as the reason for closing an account.

TL;DR:  Bitcoin per se doesn't have as much to do with it as many people think, and in most cases all three of these issues will apply equally at any financial institution regardless of their personal biases, or (more likely) ignorance regarding Bitcoin itself.  So in the sense that you're asking, there may not be such a thing as a Bitcoin-friendly bank.


How to sweep a bc1... bitcoin segwit address using a mobile app? I have a bitcoin private key with some money on the segwit bc1 address, but when I try to sweep this private key using mycellium android wallet, it shows up as a 3... address. What other mobile app lets me sweep a bc1 segwit address?

You can use Bitcoin Wallet (F-Droid, Google Play) to sweep a paper wallet, including its bc1 (Bech32) address.


Wrong fee on transaction I have sent a (>10000 byte) transaction to mtgox, blockinfo reports that the network fee is lower than recommended, so it will take quite a long while to get confirmed.

I was thinking I can send another transaction with more attractive fees - but that represents two difficulties:

I don't know why the client didn't calculate the correct fee
mtgox uses a single address per transaction, and so I won't get a new one until the current one completes.  If I send another transaction to the current address, when the slow one finally gets there, it will go to the wrong address.

I am not sure what is the best way forward.  I am using bitcoind v80500.

Is there a way I can get a transaction into mtgox without breaking the one I have currently waiting for confirmation, and if so, how can I get the fees to be right?

There is no correct fee for sending BTC to mtgox, and you can send to the same address. MtGox doesn't get the fee. MtGox only requires a number of confirmations. If you added a fee at all then there should be no extraordinary delay. A fee-related delay is for the first confirmation. The age of your source account(s) can make more difference than a fee. Just relax. The first time is painful to wait for.

    I've updated...

I don't know how you can send a ">10000 byte" transaction to mtgox unless you are talking about the bytes of a raw transaction rather than a bitcoin amount. In that case, you should be able to figure this out. Send the same amount again from same addresses but with a higher fee. It is a double-spend and the network may take the second first while leaving the first to be discovered invalid.


How does the sender know the receiver's public keys in a m-of-n transaction? Assume that Alice is controlling an address that requires multisig to spend bitcoins. Someone wants to send Alice bitcoins and this sender needs to create a scriptPubKey as part of the output paying Alice.
The scriptPubKey in the sender's transaction should look like this:
m pubKey_1, pubkey_2, ...pubKey_m n OP_CHECKMULTISIGVERIFY

How does the sender know the public keys to send funds to Alice? And further more, how does the sender know the value of m? Isn't it more logical that Alice determines what the minimal number of signatures is?
If I understood correctly this output format is not used anymore, but I still want to understand how it worked.

Any address that a spender will send to is provided by the receiver. As the owner of the address, the receiver knows these details and will be able to provide the correct sending instructions to the spender. This holds true even for the outdated original multisig construction that required the spender to know the pubkeys, but today most multisig transactions actually make use of pay-to-script-hash (p2sh), so the receiver would simply provide a standard p2sh address to the spender.


Can Multibit be set to use a SOCKS proxy on OSX? I'd like to route my multibit traffic through TOR, but have been unsuccessful finding out if it's possible. It's certainly not in the GUI settings on OSX.

Unfortunately there is a library used in MultiBit/ bitcoinj for networking (called netty) that does not support SOCKS proxies. Thus currently you cannot set up MultiBit to use Tor.

It is something we want to support so there are plans afoot to refactor the code and use a different networking library that does support SOCKS proxies.


How much memory and bandwidth does bitcoind take up on a CentOS Linux system? I'm thinking about installing bitcoind on my web server that runs on CentOS. How much memory and bandwidth might it take up and would it affect my other sites on my server?

I run bitcoind 0.8.3 on a VPS. In May and June, the VPS used between 250 and 300 GB of bandwith per month. Most of that (~98%) was incoming traffic.

I'm not sure if all traffic is due to bitcoind. Of course, we ran updates on the server. But it is only used for bitcoind. No other webservices are active.


Is my profit calculation for Genesis mining correct? The Diamond plan for Litecoin mining promises 200 MH/s for $2400 for 2 years. From the profilatbility calculator, it comes out as $555 per month profit without electricity charges(which wont be there for cloud mining). So it would come out as $13320 for 24 months which is the contract lifetime.
So the profit would be $10920 which seems too good to be true.

I have also heard numerous reports that you dont actually make much profit with Genesis mining. What am I missing here?
I know my calculation is wrong. Can anyone help me understand what else needs to be taken into account here?

One factor I know you are currently missing is mining difficulty. It will become more and more difficult to mine litecoin. So profits will drop as there will be less litecoin mined for the mh/s you're leasing.

I'd recommend you watch some videos about it on youtube.

https://www.youtube.com/watch?v=0phyRzSisyE


could'nt run wallettemplate project in bitcoinJ I just forked bitcoinj and took the wallettemplate folder outside the bitcoinj folder to run it
i've followed the steps in "getting started" docs
now im stuck in trying to run the wallettemplate
i tried to run it from Intellj but i am getting the following massage :
"BUILD FAILED in 3s
Cause: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0"

Please i need your advice
Many thanks in advance

Bytecode version 55 is Java 11. The JavaFX from openjfx that you are using was compiled with Java 11, but you are compiling with Java 8. Java 8 already includes JavaFX, so you don't have to add it via maven from openjfx. So you can either upgrade to OpenJDK Java 11, or remove the openjfx dependency from your project.


Does copay accepts multiple payments? I am a bit confused as to whether copay wallet accepts multiple payments to a single address based on the phrasing "wallet generates new addresses automatically once you use a bitcoin address once"...if tracking is not an issue I suppose the same address can be sent out to several payees right?

Yes, once you have generated an address, you can have people send any number of transactions to that address from then on.  I just tried it with Copay on testnet and it works fine.

It automatically generates a new address when a transaction arrives, just to encourage you to use fresh ones if possible, for privacy.  But previous ones continue to work indefinitely.

(Interestingly, it generates a new address whenever a transaction is received, even if that transaction was sent to an older address and the previously displayed address hadn't been used at all.)


Why are some BIP numbers missing from BIPs list? If I understood correctly https://github.com/bitcoin/bips contains a list of change proposals that have been accepted as BIPs by the BIP editor?
Why are some of the numbers missing, for example 0155.mediawiki to 0158.mediawiki?

If I understood correctly https://github.com/bitcoin/bips contains a list of change proposals that have been accepted as BIPs by the BIP editor?

Correct.

  Why are some of the numbers missing, for example 0155.mediawiki to 0158.mediawiki?

They haven't been assigned yet. The BIP editor sometimes chooses to reserve a range of number for BIPs around a common theme. When a BIP is proposed matching that theme, it is given a number from the range. Other BIPs get numbers outside of the range.


Verifying BitCoin Transactions I am hoping someone much smarter than i regarding bitcoin can point me in the right direction.
And im sorry if my questions sound dumb....

I am trying to work out how i can check if a transaction has been made to a specific address
(so my "ecommerce" system knows the payment was made).
I would however like to do this without relying on 3rd party sites/API's

I though the answer maybe to run bitcoind on my web-facing server, but now im not so sure; As it seems i can only get transaction details for addresses within my wallet (stored on the web server) and i did not plan on having the BTC stored in the online wallet as i only wanted to check the transaction and store the BTC's in an offline wallet.
(if i was to store BTC in a wallet hosted on a web server is this a BIG security risk of having my lovely BTC's stolen?).

I have spent all night (now 7.30 am) trying to work out a plan of action, but think i am now more confused than when i started :-(

I would be very grateful if anyone could point me in the right direction as i really want to develop a BTC related website (and think i may have a good community based idea for a site).

Best Regards
Ford

If you want to see all bitcoin transactions for a given address, coming to or going from, then you need to actually look through the block chain. Fortunately our good friends at blockchain.info have given us a nice api to do just that.


How do I get my spent bitcoin back into my wallet after a mistaken transaction I sent bitcoin from my wallet to Excash wallet address not knowing it wasn't up to the minimum wage they accept, now I have not been credited to my bank account yet neither do I have my bitcoin back into my wallet, how do i get my bitcoin back into my wallet?

how do I get my bitcoin back into my wallet?

Once you send them to someone else, they are no longer your Bitcoin so far as the Bitcoin blockchain is concerned.

Bitcoin transactions cannot be reversed

Since Bitcoin transactions are irreversible, the only way to get your Bitcoins back is to contact the exchange, business or person you paid them to and ask them to create a new transaction to reimburse you.

It may be worthwhile first checking their terms of use to see how they handle this situation. They may have a policy of not getting involved in sorting out this kind of mistake involving small amounts - or they may charge you for their staff costs in sorting out your mistake.

Excash

If by "Excash" you mean some kind of in-game currency used in a multiplayer online game, you may need to contact the business that runs the game and ask for their help.

If by "Excash" you mean www.ex.cash run by "Zebiex". They don't seem at all trustworthy to me. Minimal website, recently set up in the last few months.
I can't imagine why anyone would send money to such an apparently sketchy business.

There are a lot of websites using similar names (e.g. exkash) but I doubt I'd find any of them to be trustworthy.


What are the methods for getting an old, used windows P.C. ready for secure Bitcoin usage? Let's say I am about to set my Grandmother up with a wallet. I have no idea what she has on her computer. There could be a host of malware, keyloggers etc. Let's also say that a complete wipe and reinstall is not an option.

I was thinking of what steps I could use to give the maximum protection.

I could use CCleaner to wipe any temporary files. This will remove any excess past data she has generated.
I could then use a program spybot search and destroy to check for any malware.

What else could I do to check if there are any threats on the computer?

If a reinstall is not an option for you then you should do the following:

Requires: CCleaner

Boot in Safe Mode so that any malware start up entries don't get executed.
Use CCleaner to clean up disk space and registry.
Inspect the Start Up list for any suspicious/unwanted entries and
remove them.
Reboot the computer.
Use any anti-virus to remove any present malware and clean infected
files.

This should clean your old pc.

Source: Experience


Convert WIF to Witness PubKey Hash Address in Go How can WIF be easily converted to WitnessPubKeyHash in Go?

We need to get the public key from WIF and than calculate witness program as ripemd160(sha256(compressed_pub_key)).

But is there a function in btcutil to convert the public key to witnessProg required by NewAddressWitnessPubKeyHash function:

func NewAddressWitnessPubKeyHash(witnessProg []byte, net *chaincfg.Params) (*AddressWitnessPubKeyHash, error)

There are 2 cases where the version byte in the witness program is either 0 or 1.
If the version byte is 0, you need a 20-byte HASH160 of the public key. Reference wiki.
witnessProg := btcutil.Hash160(w.SerializePubKey())
p2wpkh, err := btcutil.NewAddressWitnessPubKeyHash(witnessProg, chainParams)

But I am not really sure about the case where version byte is 1.
Edit: previous implementation was probably wrong, fixed after some more research.


Can I set a zero fee to transaction if there is less transaction volume than space in the blocks? I'd like to set a zero fee to transaction when block is spacious.

Is it acceptable and can be confirmed by network, miner on BTC, BCH, BTG ... these chain?

You can set a zero fee in BTC, it is regarded as a dust. The transaction can confirm in the case you have asked about but, if it will confirm is dependant upon the transaction broadcast by the individual nodes, the node may not accept a transaction with fees below a particular level, particularly if that nodes mempool is rather full, and it depends on if miners will include the transaction in a block.

Even if in the past there have been zero fee transactions included in blocks, I would not risk it.


Any methods or tech to reduce the size of blockchain? Are there any techs/methods applied or going to be applied on the bitcoin network to reduce the size of blockchain. It is really a burden for peroson to run a full-node especially on vps. Or what other coins successfully dealed this storage problem?

In cases like VPS it seems that the storage on plans rarely increases much despite HDD size increasing nearly ten-fold since the beginning of 2009.

Depending on how you use the node there are several options to reduce storage requirements. Here are a few:

Enable pruned mode on the node.
Use an SPV client like Electrum in place of Bitcoin Core.
Enable inline file compression (if available) i.e. btrfs compression.


How to determine the coin amount needed for vin? At first I believed the coin amount of vin just based on what the send thinking. but after read some source code, it seems the coin amount of vin calculated from vout. Is anyone clear about this and please explain how the determination process is in source code. Thanks.

it seems the coin amount of vin calculated from vout.

It is. vin just references a vout from a previous transaction. Each output (vout) are referenced with the txid and an index (e.g. 0 or 1, because there can be multiple outputs in the same tx).

For more information about how transaction inputs and outputs work, see In getrawtransaction, what is the vout integer in the vin list?


How to explore transaction chain via Original Bitcoin API as blockexplorer does it Is there any possibility to explore transaction chain via Original Bitcoin API (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list) as the blockexplorer does it.
If not, why?

You can get information on all transactions in the current chain with the "listsinceblock" RPC command.  By not including a blockhash, all transactions will be returned.

  ./bitcoind listsinceblock

From there, you can get further information on transactions with RPC calls like "gettxout", "gettransaction" and "listreceivedbyaddress" which can give you all the information that you typically see in blockchain explorers.  But there's no user friendly way to view transactions, trace coins etc in Bitcoin Core.  If you want something like that, you might check out open source blockchain explorers such as this:
https://github.com/bitcoin-blockexplorer/old-blockexplorer-php


Is there a chance to return all of the lost money invested when the chart goes back up? Let say, for example, I invested $3 to buy 21 TRX (Tron Tokens), usually a token under Ethereum platform but still working the same as other altcoins when the value goes high, where the price is around approximately $0.14 per TRX. A week later, the token price is raised to $0.21. the following days later it dropped back to $0.14 and later $0.13 which is below the total amount of money I've invested.

Here's the worst case scenario: the price of TRX dropped to $0.001 after several days and definitely all of my investments are gone (30 TRX is equivalent of $0 instead of higher than $3 in return). Take note that this token/altcoin is legit and while taking better changes to improve while the investors are still counting on it. Now, the price of 1 TRX is now suddenly jumped to $1 after another few days.

The question is this: is my $3 invested after couple of weeks will be dropped to $0 and still $0 even after when the price of token drops to $0.001 and raised it back to $1 or not?

The value of TRX relative to the dollar fluctuates, as do all cryptocurrencies.  Whatever the price of TRX relative to the dollar when you sell TRX is the dollar amount you receive no matter what happens to the price between when you acquired TRX and when you sell it.


Bitcoins lost in Bitcoin Core? I sent a small amount of bitcoins to my bitcoin core account when I was messing around learning to use bitcoins several years ago. I am trying to access these coins but I never got along to utilizing bitcoin core. My computer is rather bad so it has never fully synced up to the most recent block and my computer likely lacks the space/processing power to do so. Is there a way I can access the public/private keys for that address through bitcoin core and then manage that wallet online? Would anyone be able to walk me thru getting the keys and setting up wallet online?

In bicoin-qt open Help > Debug Window > Console.

An type the following commands.
First you need to list all addresses with funds, look for every line that has an address and take note.

listuspent

Second, you unlock your wallet

walletpassphrase "YOUR-PASS-PHRASE" 120

Then for each address, you should get the private key

dumpprivkey "1BITCOINADDRESS"

take note of every private key and  import them in another wallet. Take care when handling private keys and don't save them in clear text.
Instead of having an online wallet, what you can do is install Electrum which is a SPV wallet and import your private keys there.


Is Bitcoin mining profitable in india? I am looking to buy a Bitcoin miner. I am from india. So I want to ask , will it be profitable to buy a bitcoin miner set and start a mining business in India ?

That all depends on your local electricity costs, including cooling costs.  It may also be determined by the rates offered at the exchanges you have access to.

I don't know of any India-specific mining profitability calculators, but here's one that calculates based on US dollars.  You could probably convert your costs to dollars and come up with a reasonable answer.


Maximum standard input script size What is the maximum size for an input script so to be considered standard ? Looking at the Bitcoin Core source code it appears to be 10'000 byte, however reading here and there, it appears to be 1650 byte.
If that's the case, if the input script is redeeming a P2SH, is the size of the redeem script (520 byte) to be considered in the count, or not ?
Thank you very much !

By input script, if you mean scriptSig, the max standard scriptSig can be up to 1650 bytes.

See policy.cpp :

// Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed
// keys (remember the 520 byte limit on redeemScript size). That works
// out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)+3=1627
// bytes of scriptSig, which we round off to 1650 bytes for some minor
// future-proofing. That's also enough to spend a 20-of-20
// CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not
// considered standard.
if (txin.scriptSig.size() > 1650) {
    reason = "scriptsig-size";
    return false;
}


Wanted to back up blockchain to save space, now I cannot open bitcoin QT? I wanted to back up the blockchain on my hard drive as it took around 50 GB on my laptop. I did so and deleted all the blk000.dat and the rev000.dat from (~/Library/Application Support/Bitcoin/) which are saved on my hard drive. Apparently this was a stupid mistake as I cannot open Bitcoin QT anymore. I therefore re-transfered everything back to the same folder. But nothing happens, and Bitcoin Core does not open.

After looking around, many are mentioning a bootstrap.dat file which correspond to the block chain. I cannot seem to find this file anywhere on my laptop.

Any clues? thanks a lot!

Delete your chainstate and blocks folder and start Bitcoin-Qt again. It will then re-sync your blockchain.


What example Bitcoin block has a Namecoin hash in it? I'm looking for an example Bitcoin Block that would have a Namecoin merged-mined Tx in it.

Can anyone direct me to a block that has such a hash?

It won't exist. Merged mining only shows up in the auxiliary blockchain (Namecoin), not the parent blockchain (Bitcoin).

Basically, if you find a hash smaller than the target for both, then you submit the block to the Bitcoin network as usual and the Namecoin network as well. If you find a hash smaller than the Namecoin target but larger than the Bitcoin target, then you submit to Namecoin only. Basically the Namecoin blockchain gets stuffed with some junk from the Bitcoin blockchain.


Why does Bitcoin block 526,591 have a 6.25 (instead of 12.5) block reward? https://chain.so/block/BTC/0000000000000000002ba5a1fb96f93e6c215d62db4280f1cbd30e82c7c71fba
https://blockchair.com/bitcoin/block/526591

It's an empty block (zero transactions), but the coinbase transaction is 6.25

The blockchain.com explorer shows this as having a -6.25 fee (despite having no transactions) https://www.blockchain.com/btc/block/0000000000000000002ba5a1fb96f93e6c215d62db4280f1cbd30e82c7c71fba

There is a maximum limit on the block reward which is 12.5 BTC but nothing prevents a miner from claiming less than 12.5 BTC. In fact, there have been times when miners forgot to claim any bitcoin at all (claimed 0 BTC), a very expensive mistake. This is probably a mistake from the miner, he could have certainly claimed more bitcoin.

As long as the block is valid, it will be accepted by the network, even if it's unfair for the miner. In practice, this means that the maximum supply of bitcoin is not 21 million BTC but 21 million BTC - unclaimed BTC by miners. People often see this difference by making the difference between sum(number_of_block_i * block_reward_of_block_i) and the total bitcoin counted from the UTXO set.


How can I sign message for a blockchain watch only bitcoin address I have to verify sign message for one of my blockchain bitcoin address. I couldn't find sign message or private key option in More Options beside all my bitcoin addresses. I thought maybe I have to import it.So I imported my own blockchain bitcoin address which I am mentioning below

1PSBpnjrzpHyKpyQuFaecdnA4WfDetdiwn

and it became a watch only address. In More Options I see only Archive, transfer and spent.
So what to do now ? Please help...

I do not have any bitcoins on this address, but I logged in using this bitcoin address as master address on a bitcoin gambling site and forgot the password.The only way I can recover my account is by verifying my bitcoin address

1PSBpnjrzpHyKpyQuFaecdnA4WfDetdiwn and pasting the signature to be provided by blockchain. I don't want to lose my BTC and LTC on this account.

So what to do now ? Please help...

When you import an address as a 'watch only' address, it means exactly that: you can only 'watch' the address and see whatever funds are sitting in it. You cannot send transactions, or sign messages, with a watch only address.

This is because you just imported the address into your wallet, whereas if you imported the private key, then you would be able to sign the message (and send transactions, etc).

So you'll need to find some wallet software that can sign messages (and that you trust). Import the private key for that address, and then sign the message.


How do I recover bitcoin sent to a wrong wallet address I mistakenly sent bitcoin to the wrong wallet address... How can I recover the money back or get the information of the person I sent the money to?

Unfortunately it is not possible to reverse a transaction based on the design of Bitcoin.

You may be able to contact the receiver of your bitcoin by googling the address (some mining pool addresses are publicly known), but also by sending a message to the address through the use of the OP_RETURN opcode. This will allow you to embed a message in the blockchain via including it in a transaction to the address you mistakenly sent your Bitcoin to. It is possible the owner of private key that corresponds to that address (if there is one) will notice your message and decide to return your funds.

Best of luck!


Preparing for Bitcoin Gold I have been holding a small amount of bitcoins on Coinbase and am deciding to move it to wallet.

I wanted to be prepared for the Bitcoin Gold fork coming up in October and was curious about the best approach to go about this so I can eventually get my equivalent Bitcoin Gold (instead of donating it to the exchange)!

If I move my BTC off the exchange/Coinbase and into a wallet, I now officially own it since I have the private key.

If I wanted to take advantage of receiving Bitcoin Gold, I would want to make this move before Oct 25 (obviously smart to move it to a wallet anyway, but I digress..)

After that, I'm a little confused what to do to actually get BTG. I understand someone needs to support it, but what is everyone else doing?

Thanks, hope someone can clarify how to proceed!

Yes Coinbase has not mentioned supporting Bitcoin Gold or Not so to be safe definitely move your BTC to a wallet so you have control of your private keys.

On Oct 25th the fork will happen and on November 1st you will be able to access your BTG Bitcoin Gold by using your private keys.

Here is a video explaining this better...
https://www.youtube.com/watch?v=natH7Chtv40

Here is the Bitcoin Gold Web site: http://btcgpu.org/


Can the Bitcoin network be used as a timestamping service? Does the Bitcoin protocol provide means to add some freely definable data to transactions such that a small transaction could actually be used to timestamp arbitrary data?

Yes, the bitcoin network can be used as a timestamping service

Here is an article about it
https://www.strongcoin.com/en/blog/using_the_blockchain_as_a_trusted_timestamping_service

Here are additional instructions:
https://bitcointalk.org/index.php?topic=52715.0


Are there any projections about when transaction fees per block will equal block reward? A spreadsheet with a base projection and the following editable variables (for a given block height) would be great:

BTC transaction volume per block
Number of transaction per block
Average transaction fee

Please assume that most BTC transactions will remain on the main chain (and not on a lightning network or something similar).

You can find out the average transaction fees gathered per block here. You can see that it's been slowly increasing recently, and there tends to be a block every year or so that skews the average quite a bit. But we can confidently say that currently, the average fees per block is around 0.35 BTC, which has increased from about 0.15 BTC of a year ago. Assuming a linear 0.2 BTC increase in fees per block per year, and a 4 year halving schedule we get these equations:

fees = 0.2 * x + 0.35
reward = 0.5^(x/4) * 12.5

Reward is a discrete function, so we can just see what happens at the halving in 2020, 2024 and so on.

2020:

fees = 0.2 * 4 + 0.35 = 1.15
reward = 0.5 * 12.5 = 6.25

2024:

fees = 0.2 * 8 + 0.35 = 1.95
reward = 0.5^2 * 12.5 = 3.125

2028:

fees = 0.2 * 12 + 0.35 = 2.75
reward = 0.5^3 * 12.5 = 1.5625

If it proceeds like this, it looks like there actually won't be a moment when average fees and reward actually equal each other as the reward will halve and will be bypassed by fees at that point suddenly.

A different (linear or non-linear) function for fees will obviously achieve different results as would the block halving time being a bit shorter than 4 years, but this projection does make it seem as though 10-12 years is around when fees and reward will approximately meet.


Why does websites give me Satoshies? I am new to the bitcoin world and I am wondering why does some websites give me satoshies just by subscribing to it? (websites like moonbit).

From wkipedia

It looks like they are mostly advertising sites that want to introduce people to coins by giving them small amounts that they can then play with and get comfortable using them before buying larger amounts.


Is the merkle root random? (Crytographically secure?) If I look at a block

000000000000000004f0cc322f551e39676f781186441614da3281bbc7d373e0

I can see the value of the merkel root: 9fe31d0d9d06d9da341a3ee757c57bb29af522796d5d9efa5efded8cda1684a4

Which is supposedly the hash of the hash of all transactions.

Is this value randomly? Could it be manipulated, through people spoofing transactions, or is it cryptographically improbable to know in advance?

I know that the block isn't cryptographically secure for the reason mentioned below, but I was wondering if the merkle tree itself was, thanks!

000000000000000004f0cc322f551e39676f781186441614da3281bbc7d373e0 is not the merkle root, it's the block hash. It seems that's what you are asking about, so I'll answer that.

It's not random, nor cryptographically secure random.

Not random: As you can see, it begins with many zeroes, which a random hash is VERY unlikely to have. The right-most bits are random for the most part, but the value as a whole is not random because of the requirement that the block hash begin with so many zeroes to be a valid block.

Not cryptographically secure: A miner could, although it would be expensive for them to do so, mine many blocks and only submit ones that end in 'FF' for example. So, miners have the option to publish or not publish any blocks they solve. As such, since miners are producing these blocks, it is not cryptographically secure random.


How can I choose the address bitcoins are sent from? So let's say I have multiple bitcoin addresses (some of them already received bitcoins), created a new bitcoin address, received bitcoins on it and would like to use the very same address to send them elsewhere - how can I do that?

I'm using Bitcoin Core (bitcoin-qt) as of right now.

As long as you're running a relatively recent version of Bitcoin Core you can use Coin Control. This feature let's you pick which unspent outputs will be used in the transaction.

To enable Coin Control, go to Settings->Options->Wallet->'Enable coin control features'.

Now in the Send window, you can click 'Inputs...' to select which unspent outputs you want to use. Easy!


partial signature (of P2SH) in Bitcore. howto? Using pybitcointools, it is easy get partial signatures of a p2sh using the multisign function. Then, these can be communicated around to the several controllers of the p2sh address.

Using bitcore, I can sign a p2sh (using ... .sign(privkey)) but I do not manage to get a partial signature object, separate of the transaction itself, which I could send to other owners of the p2sh address (who could be using pybitcointools for instance).

How do you go about getting partial signatures of p2sh in bitcore please?
(What am I getting wrong?)

Thanks

Found out here:

var signature = tx.getSignatures(privKey)[0].signature;

gives you the signature associate with the private key!


How to establish connection for mining testnet blocks? I am new here. I really want to know how scryptcoins work so i wanted to create and altcoin to learn on something.

I learned c++ years ago so i know i have some basic knowledge but sometimes i get stuck, and i need help.

Now i have a problem. I created my coin. I wanted to start on testnet on local network beetwen 2 pcs.

Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=

Client PC

./xxxd -testnet -connect=

Than tried getinfo:

Conenctions: 0

The two pc can ping each other.

I tried other ways like:

Server PC:

./xxxd -testnet -connect=

Client PC

./xxxd -testnet -connect=

Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=:

Client PC

./xxxd -testnet -connect=:

In getinfo they didn't have any connections. I searched forums, topic and found nothing.

If you can help me, please write down your oppinion.

The -connect option overrides -listen; if you specify -connect then the daemon does not listen for connections.  So both your hosts are trying to connect to the other, but neither one is accepting connections.

If you use -bind, the daemon will accept connections on a particular interface, even if -connect is also specified.

So let's suppose the two hosts have IP addresses 192.168.0.1 and 192.168.0.2 respectively.

On host1:

 mycoind -bind=192.168.0.1 -connect=192.168.0.2 -testnet -server

On host2:

 mycoind -bind=192.168.0.2 -connect=192.168.0.1 -testnet -server

I have tested this with bitcoind and it works.

Note that other machines on the 192.168.0 network will be able to connect to either host.  If it is a local network, this should not be a problem.  You will want to make sure that your router will not do port forwarding to port 8333 on either machine.

You should also check firewall settings on both machines to make sure each will accept incoming connections from the other on port 8333.  (Actually, if just one of them will accept connections from the other, that should be sufficient.)


How do exchange services distinguish who sent to them? I know some altcoins have features that allow senders to attach messages to transactions and using those features, exchange services distinguish the sender.
However, I don't know if there's such a function in Bitcoin. How can exchanges tell who paid them without such a feature?

Exchanges generate a new address for each user when a user wants to deposit, so when they receive a deposit to a specific address, they know who to credit the deposit to.

Since Bitcoin does not use accounts, there is no need for the exchange to consolidate their received Bitcoin. They can simply spend from multiple addresses when they want to send Bitcoin to someone, e.g. for a withdraw.


Access Bitcoin Wallet with private key 3 years ago i bought a little bit of Bitcoin. Today i found the private key of my wallet. But I cant access it, I need these 12 words (backup) I dont have.
Why cant I access my Bitcoin Wallet with Private Key? (Like Myetherwallet, here you can access wallet with private key)

You just need to find some software that can import your private key.

These days, the standard for backing up wallets is defined by BIP32/39/44/49/84, and it comes in the form of a 12 or 24 word mnemonic seed phrase. This seed phrase is used to derive all keypairs and addresses in the wallet, so you just need to store it safely in order to recover your wallet later.

So most wallets accept a seed phrase, and inputting raw private keys has become less common (though it is definitely still possible). You just need some software that can accept a private key.

Note that in some cases, you may have to create a new wallet, and then import the private key to it— there may not be an option to create a new wallet by importing the private key alone.


How was the 95% miner adoption threshold determined? SegWit does not need to utilized by all (or even most) nodes in order to be used safely, but it must be adopted by almost all miners in order to successfully minimize or virtually eliminate the risk of forks or double spends after SegWit activation.

My understanding is that (non mining) nodes that have not activated SegWit, will still consider SegWit transactions valid (because they see no requirement for a signature). However, if some miners includes SegWit transaction(s) in a block that other (non SegWit) mining node(s) reject double spends or forks could theoretically occur. Is that understanding correct?

With this risk in mind, exactly how was the 95% miner adoption level selected? Are there any available statistical simulations that estimate the chances of double spends or forks at a threshold more or less than 95%?

New softforks are activated using BIP 9 (versionbits), which specifies the threshold requirements. The 95% threshold is inherited from the old BIP 34 (supermajority) softfork activation method.

A softfork with greater than 50% hashing power should always become the dominant chain because the upgraded miners will create a harder difficulty chain, and the non-upgraded nodes will be pulled onto that chain because it's still valid for them (soft-forks are backwards compatible). However, any non-upgraded miners may create blocks which are invalid under the new rules. Those blocks will be orphaned off the new chain. The lower the miner adoption rate, the higher this new orphan rate will be.

In reality, as soon as the threshold has been reached and the softfork is locked in, almost all miners will upgrade to the new rules.

The 95% rate is a very conservative threshold to ensure that there is widespread consensus for the new change.

  miners who have not activated SegWit, will still confirm SegWit transactions

This isn't true. If a miner hasn't activated SegWit, then it can't include SegWit transactions in its block (to include a SegWit transaction, it would need to include the witness data and commit to the merkle root of the witnesses in the coinbase transaction). BIP 141 documents all the consensus rule changes for SegWit.


Bitcoin nodes voting I'm just watching Adam Back & Gregory Maxwell: Blockstream and Sidechains interview, and wondering how the decision of further Bitcoin core development are made. I know about Bitcoin Foundation, but I do not think that board members represent majority of voting power, when it comes to decision making for bitcoin core development, altough there are some core development members.

Who does make the decision which feature of bitcoin to include?

What will be the procedure of voting (who and how) would decide whether or not to include Sidechains?

Does the participant nodes (roughly more than 6300) vote as well?

The actual stated development process can be found here. That said, there's become a rule where enough core developers need to "ACK" it like seen in this pull request.

Will there be a procedure for voting? If core devs feel it is safe, tested, useful, well written, match coding style, etc. then it gets merged into bitcoin. This is usually not easy and the bitcoin development archives and the numerous pull requests that haven't made any headway should make this obvious.

Will Sidechains get in? The big thing to note about sidechains is that at least a few of the core developers are actively working on it. This means they're going to try their hardest to get it in. So there's a better chance than most features people usually propose.

Do nodes vote? They can, of course, refuse to upgrade their bitcoin client to the new version that has sidechains, for example. That's entirely their choice. But actual getting into the bitcoind code, they do not vote on. People can and do, fork bitcoin and use that as their node (Luke-Jr and Eligius being the most prominent example)


Getting source address of a Tx message from it's signature script I have a simple bitcoin packet which contains TX message.

in a TX message, one of it's Transaction input hex data was like this:

  8b3e6cc50fd114f8f40f4223dcf3150448ffc1dc5587f1ca5de6d65f1972f46101000000232200203fff89bc822618068e248c92163cd1f3d0c4f1c7e71f0baf172f4b31438fb423ffffffff

when i open this pcap file with wireshark, it show's previous output equal to:

  8b3e6cc50fd114f8f40f4223dcf3150448ffc1dc5587f1ca5de6d65f1972f46101000000

after that i see script length which is 0x23(35). so signature script of this packet is equal to:

  2200203fff89bc822618068e248c92163cd1f3d0c4f1c7e71f0baf172f4b31438fb423

.

can anybody explain to me how to extract source address which is generated from signature script in the above?

You can't.

If all you have is a capture of the wire traffic for a single tx, you can't (always) compute the actual address.

In a certain subset of cases, such as for standardized scripts such as P2PKH or P2SH multisig, you might be able to assume the script sig to correspond to one of them, if it has the right data.

The scriptsig mentioned is for a segwit address, and is commonly put as the redeem script for P2SH wrapped segwit addresses.

However, note that just because a script sig matches the expected form for an address does not mean that the actual output corresponds to that address. For example, a P2PKH address would have a script sig with two pushes (one for the signature, one for the public key) - If you were so inclined, you could build an output script that simply consumes the top two elements of the stack, and create an output that will accept a P2PKH script sig as valid, while having absolutely no relation to the P2PKH address.

In general, if you want to know the source address, look up the transaction being spent, and use the locking script from that vout.


Which Bitcoin miners allow one to use paths in URLs? I've recently been experimenting with implementing a pool and testing it against GUIminer. To my surprise, it was not able to handle paths in URL of the pool, only subdomains. For example, calling:

http://tpbitpool.appspot.com

on port 80 gives a proper response of

{'message': 'Method not found', 'code': -32601, 'data': 'The called method was not found on the server'}

But calling

http://tpbitpool.appspot.com/anything

Or even

http://tpbitpool.appspot.com/

Despite being able to be handled by the server, gives an error of

"Problems communicating with bitcoin RPC"

Testing the same URLs with Python's jsonrpc gives correct results.

Is there any reason why a miner would behave in this way? Is there a list of mining software that behave similarly?

(note, the above URL should be up for some time for testing purposes, but reachable only via http and https ports)

DiabloMiner allows both URLs and non-URLs. -l http://user:pass@host:port/ is the same as -u user -p password -o host -r port. URLs may contain paths.


How much inflation does Bitcoin have, year by year? What's the M0/MB inflation rate of Bitcoin?

Note: I'm asking about multiple years in order to make this question less likely to go out of date.