How to know that the account balance of a user needs to be updated after paying/sending an invoice? Lets say there is a service in which users can have a few satoshis but are also able to deposite/withdraw satoshis by paying/sending a lightning invoice. Let us assume the service has some data store which tracks the account balance for the user:

What is the best practice architecture to know that the account balance needs to be updated?

I know there is the waitinvoice RPC-call in c-lightning which tracks the label of an invoice (which could be a user id + some other data). Still in a live application the site should update the balance once the invoice was paid. If however the user left the side and pays the invoice it still needs to work so there needs to be some bridge from the lightning node to the data store.

In withdrawing the situation gets even more critical since withdrawing can take some time and calls can occure concurrently balance needs to be locked or widthdraw calls have to by synchronized (which I guess ist not preferable)

So what kind of architectures / best practices are you using?

Both lnd and and c-lightning will include the payment request when notifying you of a payment. I personally used it through lightning charge with c-lightning for satoshis.place.

For each invoice generated (aka an "order"), I would keep a record of it in my database, along with the pixels to be drawn. Then when I see a payment coming in I go and fetch the order and process it.

I'll describe a simple architecture, lets break it down in 2 steps: deposits and withdrawals.

Deposit

You're gonna need to maintain your own database of user accounts.
Include fields like: email, password, unique UUID and balance (you can add 2FA and API keys later).
Generate invoices for deposits, attach the UUID of the user that created it.
Increment the balance of the user when you see the payment come in, remember to do validation like checking amounts sent.

Withdrawals

Have users give you invoices, maintain a table of withdrawal requests.
There might be situations where there isn't enough lightning capacity to pay a user. In this case you might want to provide the option to do off-chain withdrawals instead.
Off-chain withdrawals can be batched with other withdrawal requests, depending on usage of your service. I.e. withdrawals go out at the end of the day / week. This would optimize block space usage and lower any potential related fees paid per user.

I think what you are asking for is essentially software to run your own payment processor. Think about Strike and OpenNode but open-source?

I'm really interested in this topic. I really like the idea of stretching the idea of "Swiss Bank" in everyone's pocket to "PayPal / Stripe in everyone's node". I have some code I've been working on bbut it's still closed source, was intending to release it once MVP. If you're interested we could talk more about this during the Lightning Residency!

-- Koala


Are fees required for distribution when using NXT/Ardor Monetary System when distributing via one of the mining protocols? The monetary system in NXT / Ardor lets users create their own coin, but also gives the ability to distribute these coins via mining for it using one of the protocols (scrypt/keecka/etc...). When mining for these coins, who pays the network to send these monetary system coins to these users? Are there any fees involved? And when a user successfully mines a coin, do they have to have the native currency in order to send it out?

I spoke with Bas and he mentioned that like with mining, the coins themselves aren't really sent but rather generated, in a similar manner with mining on Bitcoin. Because of this, there are no fees involved.

Regarding sending out the currencies though, they will need to have the native coin in order to send it out. So with Nxt, this would mean that the user would need to have NXT. On child chains on Ardor, such as IGNIS, users will need to have the native coin of the respective child chain the currency is created.


What exactly is selfish mining? What is a selfish mining attack MonaCoin suffered from?

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


How to set up LndHub on top of RaspiBolt ir RaspiBlitz? My goal is to support multiple LN clients without having to run a full node for each client.

How to set up LndHub on top of RaspiBolt or RaspiBlitz?

The RaspiBlitz is running LND. So, when you look at https://github.com/BlueWallet/LndHub, you will find that you only need to install Redis and then you can set up LndHub.io as in their documentation:

git clone git@github.com:BlueWallet/LndHub.git
cd LndHub
npm i

Install bitcoind, lnd and redis. Edit config.js and set it up correctly. Copy admin.macaroon and tls.cert in root folder of LndHub.

You can do all of that via ssh on your RaspiBlitz.


How much computing power is required to bruteforce a Litecoin private key in reasonable time? Say I want to break a Litecoin private key having the public key using brute force. How much computing power is required for that? Does any hardware exist which can find a matching private key in, say, a year? Is it possible that it ever becomes cheap enough to bruteforce Litecoin addresses, i.e. it costs less money than one can steal from the address once the key is found?

I'm asking about Litecoin just for the sake of being more definite. I think mostly the idea is the same for other blockchain systems.

How much computing power is required for that?

The computing power required to brute force private keys is incredibly immense, so much so that the human mind cannot consider its largeness.

Let's assume that you have a processor (say an Intel Xeon) that can perform 1 Trillion key guesses per second. The number of keys possible (and thus the number of keys that you would have to guess in order to guess a private key) is 2^256. With 1 trillion guesses per second, that single processor will take 3.671743 * 10^57 years, which is  2.7 * 10^47 times the age of the universe.

Now if you wanted to have enough processors to get a "reasonable" time frame of 1000 years, you would need 3.671743 * 10^54 processors. With Intels biggest Xeon Platinum chips at 7.6 cm X 5.6 cm, this many chips would take up 1.564162518 * 10^55 Square Meters just to lay them all out (not even on motherboards or the rest of a computer required to even have these processors be useful). With this much area, you could cover the Sun 2.564 * 10^36 times.

Even with more efficient ASICs and processors that can do more key guesses per second, the immense-ness of these numbers makes it so that the numbers barely change; they are still incompreshensibly large.

  Does any hardware exist which can find a matching private key in, say, a year?

No, if there were, then Litecoin's signing algorithm would be considered broken.

  Is it possible that it ever becomes cheap enough to bruteforce Litecoin addresses, i.e. it costs less money than one can steal from the address once the key is found?

It is possible, but not through brute force. Making it cheap enough requires a cryptographic break. Currently, the only known solution to finding someone else's private key besides brute forcing is to use a quantum computer with several thousand qubits. Such computers do not yet exist.


How do I profit from bitcoin For a newbie like me, I am still confused about how this bitcoins works. And I don't mind if someone can help me get a clear sight on how this thing works.

Thanks

Your question, “How do I profit from bitcoin?”, suggests that you have read some of the disinformation about Bitcoin that is to be found in the media.

Bitcoin is often described wrongly as an “investment”, which is absurd because it doesn't sell goods and services and therefore cannot generate a revenue stream. Also. you can't build anything on a bitcoin balance, so a property developer's definition of “investment” does not apply either. Bitcoin is just ten years old, and its novelty has attracted speculators, some of who made money by speculating that its price would go up as it grew more popular. You might therefore describe bitcoin as a speculative asset. The Bitcoin White Paper says its purpose is to be electronic cash.

You might speculate that its price is going to go up from its present value, but seeing as you freely acknowledge that you don't understand it, your speculation would be pure guesswork — gambling in fact. Among those who do understand Bitcoin, some expect its price to go up, and some expect its price to go down. Whom do you believe?

So, successful speculators have profited from bitcoin, and unsuccessful speculators have suffered losses. Can anyone else profit from bitcoin? I can think of two examples, traders and exchange operators. Successful traders make money from bitcoin using the same techniques that they use to make money from the forex markets, the stock markets, the oil market and so on; but very few people have the skill and self-discipline to trade profitably. If you don't have a solid understanding of derivatives in some other market, you're unlikely to succeed as a bitcoin trader. Bitcoin exchange operators make their money by providing a similar service to the people who run stock exchanges: they earn fees for connecting buyers and sellers.

If you don't own any bitcoins, and you're thinking of buying, I suggest you hold back until you've got your head around the following:— The statement “I own 0.25 bitcoins” is really just a short way of saying “I have a private key that lets me sign withdrawal transactions affecting a Bitcoin address where the present balance is 0.25 bitcoins.” (The 0.25 might be spread over multiple addresses, but you get the idea.)

You say you want to “get a clear sight on how this thing works”, so here's another suggestion:— If you can send cryptographically signed emails (and validate the signatures on cryptographically signed emails that other people send to you), then you will be off to a good start. Asymmetric cryptography is an astonishing invention that has changed the world in many ways, with Bitcoin being just one of them.


How does the bech32 length-extension mutation weakness work? A bech32 address ending with p can be modified be inserting or removing q characters immediately before the final p character to make a new valid bech32 address. Why does this work?

Are there any other similar mutation weaknesses in bech32?

References:

issue raised against bech32 repo
mailing list post

I'm going to provide a more algebraic explanation of the issue.
Every valid (and invalid) Bech32 string can be seen as a polynomial in the variable x, where the coefficients are elements of GF(32). I'm going to ignore the GF(32) part in what follows, so it suffices to say that they're simply numbers from 0 to 31 inclusive, with weird addition and multiplication rules that guarantee every operation always stays within the range 0-31.
The data part (which means the string excluding the human-readable part (HRP) and the "1" that follows it, but including the 6 checksum characters at the end) uses the character set that's included in BIP173 in table form. For example, a "q" means 0, "p" means 1, "3" means 17, and "l" means 31. Each of these characters forms the coefficient of the term of our polynomial. I'm going to ignore the human-readable part as well in what follows as it doesn't matter for the issue, but for completeness the HRP also encodes coefficients of the polynomial, but using a different (and slightly more complicated) translation.
For example, the string "3qlp" corresponds to the polynomial 17x3 + 31x + 1. As "q" represents 0, there is no x2 term.
Now, every valid Bech32 string corresponds to a polynomial p(x) that can be written as p(x) = f(x)⋅g(x) + 1 for some f(x), where g(x) = x6 + 29x5 + 22x4 + 20x3 + 21x2 + 29x + 18.
Why is that + 1 there? If it wasn't, then for every valid p(x) = f(x)⋅g(x), x⋅f(x)⋅g(x) = x⋅p(x) would also be a valid polynomial. As multiplying by x is simply adding a 0 (or "q") at the end, this would let anyone accidentally mutate valid Bech32 strings into distinct valid Bech32 strings by simply appending a "q".
However, it turns out that adding the + 1 does not fully solve this sort of issue. It isn't possible anymore to simply multiply by x, but it's still the case that for every valid p(x), xi⋅(p(x) - 1) + 1 for any i > 0 is also valid. If p(x) happens to end in a "p", it can be written as x⋅e(x) + 1 for some e(x). In this case, xi⋅e(x) + 1 is also a valid string, for every value of i. In string form, this corresponds to inserting "q" characters in the penultimate position (just before the final "p").
Similarly, if p(x) happens to end in a "qp", it can be written as xi⋅e(x) + 1 for some e(x) and i > 1. In this case, xj⋅e(x) + 1 where j < i is also a valid string. In string form, this corresponds to removing "q" character in the penultimate position (just before the final "p").


How exactly is network time sampled? How exactly is network time sampled?

Is it as simple as one node stamping data right before being sent, the receiving node logging the current time before all other activity, and taking the difference?  Or is there something more complex involved?

Links to code would be much appreciated.

Bitcoin block headers serve as the timestamp system for bitcoin. Whichever miner finds the next block includes their systems timestamp and the network either agrees it is valid or throws it out for being outside their margin of acceptance.

Bitcoin verifies the time with a margin of nTimeOffset, which is set by bitcoin asking other nodes what time they think it is and taking the median. You can find this code by looking at AddTimeData in util.cpp, found here: https://github.com/bitcoin/bitcoin/blob/master/src/util.cpp

It should also be noted that some miners, principally ASICs, do so much hashing that they actually push their timestamps a few seconds into the future using rolltime to get extra work sets: https://en.bitcoin.it/wiki/Getwork#rollntime


BIP 37 automatic filter update not inserting outputs I'm having a problem with bloom filters when using the getdata message.

As I understand BIP 37, setting the bloom filter on a connection using the loadfilter message with flag BLOOM_UPDATE_P2PUBKEY_ONLY set, the responding client automatically inserts all outpoints (TXID and output index) in the bloom filter of transactions matching the filter. However, when I attempt to do exactly this, the node only ever sends transactions containing outputs TO the address I am filtering for, never transaction that contain outputs FROM the address I am filtering for.

My approach is as follows:

Add the following public key to the bloom filter: 1JbFvyaMyHHmvvjc54h4YARq3uoX2ZZ4Qj (randomly picked)
Send the filterload message containing the filter (as seen in the wireshark snippet below).

Bitcoin protocol
Packet magic: 0xf9beb4d9
Command name: filterload
Payload Length: 261
Payload checksum: 0x2bb02c45
Filterload message
    Filter
        Count: 251
        Data: 000000040004010000000100000000000000020000400000...
    nHashFunc: 13
    nTweak: 0x1a689ff4
    nFlags: BLOOM_UPDATE_P2PUBKEY_ONLY (0x02)

Send the getdata message with the hash of all blocks containing transactions to and from the wallet (which I have identified on a block explorer for the purpose of testing this). The inventories are typed MSG_FILTERED_BLOCK.

The node responds with the following messages in order:

MerkleBlock: 000000000000000001201ab2679db7c87a432967c060596bad0ac093dac94111
Tx:......... 187b00588e8d7844c405da9a15d78dbd7ebb9b2887fb5aace6651719fede923e
Tx:......... dbbca0d839435ac77db65378a9607d17b0aa965f3027d84dcf0ee5115dc8d32f
Tx:......... 17c12f45956082a913c0c862d573cf067fa5ee96ba5b954914371da6bef51f7f
Tx:......... 36cce25d34a5da0f7d69253743eae7bb7c576e5543d0eb16db0f72967edb4bc6
Tx:......... 6ea48c6286b1691cd1ecec271a3f52a3fe099467bb6c926b41ba8942e21d4aa6
MerkleBlock: 0000000000000000049ee67931f6d4970a7d06b14b8aadd406223ab65efe5025
MerkleBlock: 0000000000000000019f3fc2c8da43e8a81373ae189ace4caec6c59969f46ff6
MerkleBlock: 000000000000000000f67dad206798db2e6c5dffec84d213397784be894e66fa

The 5 transactions in the list are correct, as the contain outputs targeting said wallet.
However, block 0000000000000000019f3... contains transactions with inputs from said wallet, but the merkleblock message of this block is not followed by these transactions.
Shouldn't the node add the outputs of these 5 transactions to the bloom filter, and thereby match the later transactions containing inputs pointing at them?

I have confirmed that the node is in possession of the relevant transactions.
If i load the filter manually, adding the outputs myself, this works as intended.

Am I misunderstanding how BIP 37 is used?

BLOOM_UPDATE_P2PUBKEY_ONLY means only update the filter with outpoints when the matched transaction is pay-to-pubkey or bare multisig, not p2pkh or others.  I don't know why though, since what you're trying to do is very common.

You may also be interested in this work in Bitcoin XT which allows a filter to be updated with any unconfirmed ancestors of a matching transaction (to better assess its confirmation prospects).


pushpool not updating mysql Whenever I connect miners to pushpoold (connected to litecoind), it's not updating the shares table in MySQL (which in turn means the stats on mmcfe isn't updating). I'm pretty certain the database settings are correct as pushpool can read the users table to authenticate the miners and it's not an mmcfe config because I've inspected the shares table independently of mmcfe.

My pushpool server.json file is as follows:

{
    "listen" : [
            { "host": "domain.com", "port" : 8336 },
            { "host": "domain.com", "port" : 8337, "protocol" : "http-json" },

            # HTTP JSON-RPC protocol, port 8339,
            # with trusted proxy appserver.example.com forwarding
            # requests to us
            #{ "port" : 8337, "protocol" : "http-json",
            #  "proxy" : "appserver.example.com" },

            # binary protocol, localhost-only port 8338
            { "host" : "127.0.0.1", "port" : 8338, "protocol" : "binary" }

    ],

    "database" : {

            "engine" : "mysql",

            "host" : "localhost",

            "port" : 3306,

            "name" : "db",
            "username" : "user",
            "password" : "pass",

            "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 (?, ?, ?, ?, ?, ?)"

    },

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

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

    "forcehost" : "localhost",

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

    "longpoll.disable" : false,

    "auth.cred_cache.expire" : 75,

    "rpc.url" : "http://127.0.0.1:8332/",
    "rpc.user" : "user",
    "rpc.pass" : "pass",

    "rpc.target.bits" : 21,

    "work.expire" : 120,

    "roll.ntime.disable" : false
}

I've already searched through stackexchange as well as the wider web, so I think I've picked up on all the basic mistakes (eg not including stmt.sharelog and the rpc.target.bits), but I suspect this is still a configuration problem and that I've overlooked something really stupid.

Overview specs:

Debian Wheezy 64bit
pushpool (repo: https://github.com/jgarzik/pushpool)
litecoind
mysql  Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (x86_64) using readline 6.2

First of all I thought that you were using a bitcoin pushpool as your primary software for a litecoin pool. But I guess you've checked that?
Otherwise, try this recomended pushpool fork instead, which worked for me: (For LTC) https://github.com/ArtForz/pushpool

This one works for me, but ideally you would want to use the stratum software for mining purpose. (If you have clients connecting with LP/Getwork, you can add the stratum-proxy locally on your server)


What is Multi-PPS (Pay Per Share)? I know the original proposal on bitcointalk is here, but can someone explain it more succinctly?

How does Multi-PPS work?
Can it actually prevent mining centralization?

If I understand multi-PPS correctly, it's really simple.

How does multi-PPS work: Miner Alice registers with Bob's pool: she gives Bob one of her addresses (to use for payouts) and Bob gives her one of his addresses (to use in coinbase transactions). Bob will give Alice credit for mining shares which pay that coinbase address, and at defined intervals or compensation levels, he'll send payment to her payout address. Alice also registers with Charlie's pool, which gives her a different coinbase address that does the same thing.

Using a protocol like GetBlockTemplate, Alice gets a block template from any full node and inserts a custom coinbase transaction with two outputs: one that pays 50% of reward+fees to the coinbase address from Bob's pool, and one that pays 50% to the coinbase address from Charlie's pool. When Alice finds a share, she submits a merkleblock for its coinbase transaction, plus the coinbase transaction itself, to both pools. Both pools give her 50% credit for that share based on difficulty, pool fees, and other pool rules. The same thing happens for a block, except that Alice only has to submit the full block once so it gets on the block chain---the pools will still give her credit for it as a share once they see it on the block chain. At the defined reward interval, which is up to pool policy, each pool pays Alice's payout address based on the number of shares she submitted and the percentage each credited towards the pool.

Two pools each with 50% is the example here, but in reality Alice will be able to distribute her 100% among as many pools in whatever proportion she wants, provided it's technically possible and allowed by pool policy.  Because this is Pay-Per-Share (PPS), Alice's variance is fully determined by share difficulty---so Alice makes the same amount of money mining for a tiny pool as a giant pool as long as the share difficulty is the same.

The kicker---if I understand correctly---is that multi-PPS also reduces variance of pools to the average of all the pools their miners mine in.  For example, if all mining was done in pools and every miner mined in every pool (no matter how little of their reward they dedicated to any particular pool), every pool would have variance exactly equal to that of regular block creation (e.g. 99.8% chance a block will be mined within 60 minutes: 1-exp(-1/10.*60)).
Can multi-PPS prevent mining centralization: You can't prevent what has already happened. :-)  Seriously, multi-PPS isn't a cure-all (and Mr. Rosenfeld doesn't claim it is), and there are still economies of scale that benefit large pools---including things that no Bitcoin technology can fix, like marketing advantages.  What multi-PPS offers is the ability of small pools to have the same variance as large pools, equalizing one significant competitive advantage large pools currently enjoy.

Multi-PPS has the additional highly-beneficial advantage that, in order to implement it, block-creation policy must be separated to a certain degree from pool payouts---in other words, if Alice mines in both Bob and Charlie's pools at the same time, neither Bob nor Charlie will have as much centralized control over what transactions Alice creates, further decentralizing mining.

However, this is also multi-PPS's primary weakness and likely the reason nobody has implemented it in the 15 months since Mr.  Rosenfeld first described it: current mining and pool software isn't fully compatible with decentralized mining. And, except for Bitcoin Core developer Luke-Jr, I don't know of anyone focusing on making decentralized pooled mining possible. (Perhaps everyone else who really cares about decentralized pooled mining has already switched to P2Pool.)

An additional weakness is that most people may not care enough to use multiple pools, or that they have come to trust certain pool operators. Because multi-PPS makes small pools more competetive, hopefully they'll be able to innovate to make themselves more desirable to miners. For example, they can make immediate payouts for each share received using a micropayment channel, significantly reducing the trust miners need to place in the pool operator.


Can't recover MtGox password I go to:

https://mtgox.com/users/login

Click on "Forgot your password?".   Enter "User Name or email".  Click on "Recover my password".

Nothing happens.  They say " We will email you a link to reset your password."  But they don't.

Is there some way to get past this?  Is there some way to contact someone who maintains the site about this?

MtGox support is available on https://support.mtgox.com, by email (support AT mtgox.com) and on IRC freenode server channel #mtgox.

You could try to check your spam folder if you are using a bad webmail provider or bad antispam.


Is JavaScript wallet generator available at bitaddress.org relatively secure? I wonder if it's safe to use JavaScript generator available at bitaddress.org.
Even if I'll generate it offline, how can I know if the algorithm is not using any pre-computed / pre-planned way of generating the addresses?

It is good to consider the security of a system in which you are relying.

The HTML and Javascript served is not obfuscated so the code is easily verified.

While there have been no formal security audits, at least not that I'm aware of, there  are many people with strong skills in cryptography, programming, math and security that have looked at the code.

The method used to generate an address draws from other open source tools (e.g., Crypto-JS) as well as a subset of Bouncy Castle for the ECSDA ported to Javascript.  In other words, BitAddress isn't doing anything that hasn't already been implemented elsewhere, it just implements them in Javascript.


Is there data on the geographic distribution of bitcoin users? If you are a company wanting to adopt bitcoin as a payment method or an academic wanting to study the bitcoin market it is important to know as much as possible about the bitcoin users. Since bitcoin is pseudonomous it is hard to gather direct information on the users. However, if users want to make transactions then they need to broadcast to the network. Although the IPs are not stored in the block-chain, there are ways to learn them. With the IP addresses, it is possible to use IP Geolocation to get an idea of where the user is. Hence the question:

Is there data available on the geographic location of users of bitcoin? Especially on volume of bitcoin transactions from given geographic areas?

Or is it impossible or unlikely that such data can be gathered? If the majority of users use Tor for instance, then it would not be possible to get a good location data. Are there other technical constraints that make it impossible to use this or other approaches to learn the geographic locations of a large number of users?

Meta note
Since bitcoin is new, it is possible that such data is unavailable yet just due to the novelty. Please don't provide such answers, we can just wait until such a study is done and given as an answer. A 'no' answer is interesting only if it explains a technical constraint that would stop such studies from ever happening.
Also, it is possible for a committed user to invest effort in order to hide their location. However, unless there is reason to believe that most users use such efforts, this is also not a very relevant answer.
This question is an attempt to turn our lowest voted question into a legitimate specific question.

This shows bitcoin nodes based on IP address location.

http://www.weusecoins.com/globe-bitcoin/  (UPDATE: link is broken)


What is the format of coinbase input scripts? The input script of the coinbase transaction of block number 1 (right after the genesis block) looks like this: 04ffff001d010b

How do I recognize this as a coinbase transaction?

Do I simply know that this is a coinbase transaction because it is the first transaction in the block?

Does the coinbase script have to have a special format?

A coinbase transaction is characterised by "previous_output" field of the transaction being 32 bytes of zeros and 4 bytes of 0xFF. It should be the first transaction of the block, but I'm not sure whether all the clients enforce this rule. The signature script of the coinbase transaction need not obey the Script protocol, but as far as I remember the first block's script pushes data onto the stack and then pops it off. The data encoded in the Genesis Block represents the famous headline of Times:

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

And was used as a way to prove that the block was created no sooner than on 2009 01 03, but can also be speculated that it relates to Satoshi's intent when creating Bitcoin - to counter debt-driven currencies.


How do I install Phoenix 2 on Mac OSX Mountain Lion? I'm trying to install the latest version of Phoenix2 on Mac OSX Mountain Lion (on a Macbook Pro Retna) and unable to get it to work

What works:

The BitMinter client says OpenCL works on my CPU and GPU (It's Java based)

What I've tried:

The BitMinter client on older macs says OpenCL fails for the video card (which is expected)
This OpenCL Test Script fails
python -c "import numpy; print numpy.version.version"  returns 1.6.1
Installing PyOpenCL by running make and python configure.py
Running the command: sudo easy_install --upgrade twisted
Checking dependencies: python setup.py --requires
Installing Phoenix by running sudo make install and `sudo python ./setup.py install'
Running Phoenix by typing python phoenix.py example.py

Question

Can anyone walk me through the process of installing Phoenix2 (or other client) on OSX?

I suspect I need to uninstall OpenCL, twisted, etc, and replace it with a download from http://www.macports.org/, among other tasks

I found the following to install PyOpenCL.  It installed on my MBP 8,1 running ML:

git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
git submodule init
git submodule update
python configure.py
python setup.py build
make
sudo python setup.py install


Is there a namecoin (or similar) social network? How would it work? I'm looking for information on how Namecoin could create a "Facebook-style" social network and what prior work exists.

I understand that namecoin has fundamental problems and fledgling support, but I'm interested in where this idea has gone in terms of creating a distributed social network.

Well Retroshare somewhat falls into this category. It is not Coin-Based however, rather related to Bittorrent DHT technology und not well documented.

There is also the Bitmessage protocol which uses Coin technology for exchanging mail.

I do not know why you would build such a system as a Coin network, plain BT style DHT is more suitable for this purpose in my opinion. I do not know any good reason why Bitmessage does it this way either. I think it is just overcomplicated and not well thought through. The usecase is just very different from Bitcoin.

I mean, what would be the purpose of the block chain? Prevent double friending?


How the Bitcoin community will handle attacks on a Client's code? I have some thoughts about the following scenario.

The brightest future.

The Bitcoin becomes a very popular and liquid currency all over the world. Some serious financial or political parties may become unhappy with this fact - they may have no influence on an Internet or may be unable to publish new laws. Since the major support of the Bitcoin infrastructure comes from the logic of its official client. And the easiest way to shutdown the network, as I can see, is to compromise the client itself. Someone may:

Buy the Github at once and quickly release new malformed version of the official Bitcoin client.
Bribe one of the trusted developers to sabotage the client code.
etc.

It doesn't seem so impossible, if someone with a big money would really want to stop the Bitcoin, even if everybody else will like it.

The question is

Is it possible to technically shutdown the whole Bitcoin network - with reasonable efforts and abilities to replace official client?
Are there any Central Trusted Authorities, that may verify any arbitrary client out there for it's correctness about the Bitcoin Protocol and, thus, prevent my scenario?

Note: I don't mean the situation, when someone will accidentally place an untrusted line in the client's code, and this fact will be overplayed to weaken the trust in the Bitcoin. I mean the situation, when the compromised client will irreversibly destroy all the system - leaving no viable ways to recover it.

FYI since BTC mining became so prohibitively expensive due to use of ASICs 1 51% attack could be pulled off at any time by BTC Guild. Their listed % is just under 50% at ~48% but I find it hard to believe they aren't sitting on >51% mining power. See the problem is every client is meant to be able to mine making large conglomerates like BTC Guild impossible.
This could very well be the end of BTC since you've got no change at all of mining BTC using anything but an ASIC pool.


How does the bitcoin exactly prevent Double spending attacks? I recently started reading about Bitcoin, the idea seems hard to get, and I'm trying to understand the basics now.

I read the white paper by Satoshi Nakamoto but I still have some confusions

First, it has been said that the main advantage of the Bitcoin is its capability to prevent the Double spending attacks, my questions are:

Is this because of the idea of blockchain or the proof of work?
Can anyone spend his bitcoins twice in two different transactions and
two different blockchain? if not, how does the protocol prevent
prevent such a case?
What exactly the process that minors follow to detect that a
certain transaction is spending the bitcoins twice?
Why don't minors (voters) simply accept a new block without even
check if it's truly valid or not? what are the consequences?

I'm sorry if my questions seem very basic,

Thanks in advance

A full node is a computer running full node software like bitcoin core that has verified every transaction in the blockchain and continues to verify new ones as and when it hears about them. Every full node validates transactions and rejects double spends. If it has learned of a transaction that spends certain coins it will reject any new transaction that tries to spend those same coins unless the original transaction has been marked as replaceable.

Because of the nature of computer networks it is possible that not every node has heard of every transaction. It is also possible that different nodes will have heard of the same transactions in different order. The blockchain fixes the order and history of the transactions so that everyone agrees on the state of the ledger. Once a transaction has been committed to the blockchain and enough blocks have been added to the chain after the block containing the transaction that transaction cannot be modified.

So every node individually prevents double spends that it hears about and the collective consensus of what transactions happened or did not happen comes through the blockchain.

  What exactly the process that minors follow to detect that a certain transaction is spending the bitcoins twice?

Miners aren't the only ones validating transactions. Like I said every full node validates transactions to make sure that there are no double spends.

Miners follow the same process as full nodes. The full list of validation rules is given here.

  Why don't minors (voters) simply accept a new block without even check if it's truly valid or not? what are the consequences?

There is no voting in bitcoin. It's not just miners who need to check the validity of blocks. Full nodes run by users check it too. If a miner generates an invalid block then full nodes will reject it and the miner will lose money because he will have wasted electricity and time producing that block.


Consistenly getting Block magic mismatch error? I have bitcoind running (0.18) in my ubuntu machine and it keeps shutting down due after getting this error:

ERROR: ReadRawBlockFromDisk: Block magic mismatch for CDiskBlockPos(nFile=0, nPos=68821043): 00040000 versus expected f9beb4d9

I restart it and it goes for a couple of hours and then the same error is encountered and it shuts down.  How can I fix this?

You have a corrupted block file. You will need to delete that file and all higher number files and then redownload the entire blockchain.

The block file that is corrupted is the 0th file, blk0000.dat. Since this is the first block file that Bitcoin Core creates, the easiest thing for you to do is to just delete the entire blocks and chainstate folders in your Bitcoin Core datadir. Then start Bitcoin Core. It will redownload the entire Bitcoin blockchain.


Different coin pools in zcash I would like to understand the cryptocurrency zcash a little bit better...

My understanding of it is that there are two address types t-addresses and z-addresses. Only transaction between two z-addresses are fully private. Transactions between t-addresses are working as transactions in bitcoin, i.e. the degree of privacy is exactly the same. Also there are two different pools: shielded pool and unshielded pool.

My questions:

Zcash is based on a base currency. As far as I know it is bitcoin, right?
I guess the coins in the shielded pool are zcoin, right?
How about the unshielded pool? Are they bitcoins or zcoins? (i.e. the marketcap of zcoins consists only of the coins in the shielded pool or both pools?

Thanks a lot for any kind of help!

Zcash is based on a base currency. As far as I know it is bitcoin, right?

Zcash is not based on a base currency; it is an independent block chain. The code was built on a fork of Bitcoin Core 0.11.2 (and since then has had numerous backports of subsequent upstream changes).

  I guess the coins in the shielded pool are zcoin, right?
  How about the unshielded pool? Are they bitcoins or zcoins? (i.e. the marketcap of zcoins consists only of the coins in the shielded pool or both pools?

All pools within the Zcash block chain contain ZEC. There are three pools within Zcash:

The unshielded pool (containing ZEC stored in transparent addresses).
The Sprout shielded pool (containing ZEC stored in Sprout shielded addresses).
The Sapling shielded pool (currently zero, but will start being used once Sapling activates).

ZEC is moved between the various pools when transactions send ZEC from one type of address to another, e.g. from a transparent address to a Sprout shielded address (see this blog post for more details).


Does Bitcoin dust limit include miner fee as well? I've read on What is the dust limit on Bitcoin Cash transactions? that small transaction with less than 546 Satoshi get rejected by miners, but I'm confused.

Is that limited applied to sum of inputs or outputs (excluding miner fee)?

I'm trying to implement bitcoin testnet wallet on JavaScript,

async function signTransaction(fromECPair, to, amountToSend) {
    const address = getP2pkhAddress(fromECPair);
    const balance = await getBalance(address);
    const utxo = await getUtxo(address);

    const tx = new Bitcoin.TransactionBuilder(BitcoinNetwork);
    for (let i = 0; i < utxo.length; i++) {
        tx.addInput(utxo[i].txid, utxo[i].vout);
    }

    let transactionFee = (148*utxo.length + 34*2 + 10) * price_per_byte;
    let amountToKeep = balance - amountToSend - transactionFee;
    tx.addOutput(to, amountToSend);
    tx.addOutput(address, amountToKeep);

    for (let i = 0; i < utxo.length; i++) {
        tx.sign(i, fromECPair);
    }
}

I've just made transaction with one of output less than 546 satoshi so it's definitely possible to make at such output at least on testnet https://chain.so/tx/BTCTEST/021c782fbb75dab2ca843d83a3709e0e846f0d3e99c14a5826f7e18cccfeab25
So attacker can potentially spam my address with lots of tiny outputs and this naive wallet implementation won't work (it would be more costly to sign these UTXOs than value they have).
What would be the correct way to prevent that?

For a transaction to be standard, Each of the outputs has to be at least 546 satoshis. (except an OP_RETURN output, which has some extra rules).

Testnet does not enforce standardness rules.

You can still include  a nonstandard transaction in your block in mainnet, but still, those transactions are not relayed.


How will bitcoin survive if everyone is hoarding? It is the question since I first heard about bitcoin, ethereum and then many others. Most tokens or crypto currencies, usually offer a utility on their respective platforms. Bitcoin is to distrupt traditional payment networks. But if everbody holds bitcoin for speculative reasons and never makes transactions with it, then how can it become a payment network? In that case, how can we suggest that bitcoin has an intrinsic value at all? Same holds for ethereum and many ethereum based utility tokens. For example, insurex claims to decentralize insurance industry and people hold their token in hope for the network will indeed grow. But then if they dont use the tokens for insurance transactions how could it happen? Finally, if everybody holds ETH for speculative reasons and not develop decentralized platforms, how could it become of the new internet?

The evidence suggests that there indeed quite a number of Bitcoin transaction, both people buying and selling. We can only speculate what they are buying and selling but there is a significant number of transactions.

bitinfocharts.com can show us the graphs for the number of transactions per day and the median value of those BTC transactions here - approximately 230,000 transactions yesterday with a median value of US$1,001 - that is a lot of money moving hands.

It is true that there are some who hoard, but not all.


buy bitcoin or bitcoin cash? I have some bitcoins on coinbase and was going to buy more.

But now I see bitcoin cash available on coinbase.

Should I buy bitcoins or bitcoin cash? What is difference? And they have the same price?

UPDATE: They have different price, so it looks like new cryptocurrency.

Bitcoin cash, is centralized, and it is difficult to run a full node of it, and it does not have a great developer strenth.

Bitcoin (the original) have many developers developing new tecnologies like the lighning tecnology. And it is fully descentralized. But the mempool is crowded right now wich makes the fees quite high.

I think in the short term Bcash (Bitcoin cash, nickname) will be more usable, with lower fees, but in the long term in cannot compete with Bitcoin.


How do we know which soft-forks were implemented using User-Activated Soft Fork or Miner-Activated Soft Fork? This seems to be the most common definition

When a majority of miners upgrade to enforce new rules, it is called a miner-activated soft fork (MASF). When full nodes coordinate to
enforce new rules, without the support from miners, it is called a
user-activated soft fork (UASF).

How do we know which soft-forks were implemented by full nodes upgrading clients or miners upgrading clients? Is there any way of knowing, or do we just guess?
https://github.com/bitcoin/bitcoin/blob/master/doc/bips.md

Most past soft forks have been deployed with miner activated soft forks, and we know this because the deployment mechanisms used only allowed for miner activated soft forks. For a user activated soft fork to happen, the deployment mechanism would have to have some form of activation that is not reliant on miners. Thus far, the activation methods used have all deployed based on miner behavior and not a flag day.
There are two exceptions to this where it could be argued that those soft forks were user activated and not miner activated. The first is BIP 16 which ostensibly activated via a flag day (i.e. all blocks after a certain time must support BIP 16). However the flag day was determined only after a certain threshold of miners signaled support for BIP 16 in their blocks. So while the code was a flag day, the process was still a miner activated soft fork, just done manually rather than through code.
The second exception is segwit. However segwit used BIP 9 as its activation mechanism and that is entirely dependent on miner signaling. So technically, it is strictly a miner activated soft fork. But you could argue that it was user activated because users were running software that would have activated on a flag day, but miners began signaling readiness before that day. So the exact mechanism was through miner signaling, but perhaps it was user activated because users threatened miners by running software that had a user activated mechanism.
For future soft forks, it is likely that a combination of BIP 9 (MASF) and BIP 8 (both MASF and UASF) will be used. You can then determine whether it was miner activated or user activated. For both, miners can signal in their blocks to activate the fork. For BIP 8 only, after a certain time, the fork will activate via a flag day, so if that occurs, then it is a user activated soft fork.
The only soft fork that should be classified as a UASF is BIP 30. This was activated by a flag day and miner signaling was not officially part of the activation.


What does this sentence (on ability to broadcast a valid transaction and transfer balance) mean? Here is the article.

"The Bitcoin blockchain records every event throughout Bitcoin's history—new coins and evidence of transfers—back to 2009 when the network started," said Valkenburgh. "Every computer on the network also has to be running compatible software so that the nodes can see and validate transactions. So, if your software is not compatible or if you fail to meet or invalidate any of the consensus rules baked into the Bitcoin code base, then the network would ignore your transaction. That's all it is to have a Bitcoin: the ability to broadcast a valid transaction and transfer that balance."

What does the bold sentence mean?

a. If you have a Bitcoin, it means you have the mentioned ability;

b. Only if you have the mentioned ability can you own a Bitcoin.

Does it mean a or b or none of them?

It means both. The power to transfer your Bitcoin to another address is the same as owning a Bitcoin. You can transfer your Bitcoin if and only if you own it.


Convert Base64 Private Key to WIF How do I get my private key from this? I found an old file on one of my hard drives with a wallet address and something that looks like this (changed for obvious reasons).

What is this and how can I get my private key from it?

LZEuGNcDIJI5mRCATBouTmQgdpaycce0rDH/B//+w7v0hofB6+Apt0bepR8pUUxHEHAXHHAv7+67AHwh80Lx9g==

I tried this https://bitcoin.stackexchange.com/a/43438/105403. When I plug the WIF into bitaddress.org it's not matching my actual bitcoin address so I must be doing something wrong.

The following using libbitcoin bitcoin-explorer (bx) piped command lines, see documentation to better understand the two piped examples below.

The 512 bit output below, leads me to believe the base64 encoded key is an HD key that already might have BIP 39 conversion and possibly BIP 39 passphrase applied.

1% echo -n LZEuGNcDIJI5mRCATBouTmQgdpaycce0rDH/B//+w7v0hofB6+Apt0bepR8pUUxHEHAXHHAv7+67AHwh80Lx9g== | bx base64-decode | bx base16-encode
2d912e18d7032092399910804c1a2e4e64207696b271c7b4ac31ff07fffec3bbf48687c1ebe029b746dea51f29514c471070171c702fefeebb007c21f342f1f6

Let's assume the path is the following Bitcoin path m/44'/0'/0'/0/0, then the compressed WIF key can be computed as follows:

2% echo -n LZEuGNcDIJI5mRCATBouTmQgdpaycce0rDH/B//+w7v0hofB6+Apt0bepR8pUUxHEHAXHHAv7+67AHwh80Lx9g== | bx base64-decode | bx base16-encode | bx hd-new -v 76066276 | bx hd-private -d -i 44 | bx hd-private -d -i 0 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | sed 's/$/01/' | bx base58check-encode -v 128

L2Xa6v3zo12E813ssicXbjEeatdXa37J5532WwtdXYRzgzL9QSxw

The associated public address is as follows:

3% echo -n LZEuGNcDIJI5mRCATBouTmQgdpaycce0rDH/B//+w7v0hofB6+Apt0bepR8pUUxHEHAXHHAv7+67AHwh80Lx9g== | bx base64-decode | bx base16-encode | bx hd-new -v 76066276 | bx hd-private -d -i 44 | bx hd-private -d -i 0 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | bx ec-to-public | bx ec-to-address -v 0

17Wnq9Nm5KcFtvhunSPN9WRTZxTUvkvri5

Your HD path path might be different.


Can I use bitcoin-cli estimatefee API for Segwit? I'm using estimatefee API to calculate transaction fee for Non-Segwit.

I'm using this formula now.

size = 180 * len(inputs) * 34 * len(outputs) + 10
necessary_fee = int(size / 1000 * fee_per_kb)

Example (1 inputs, 2 outputs. They are all p2pkh)

fee_per_kb = 25000 // result of bitcoin-cli estimatefee
size = 180 * 1 * 34 * 2 + 10
necessary_fee = int(size / 1000 * 25000)

// necessary_fee => 306250 satoshi

Now I need to calculate fee for Segwit. My question is that can I use bitcoin-cli estimatefee for weight? My expectation is this like below.

fee_per_kb = 25000 // result of bitcoin-cli estimatefee
virtual_size = (Something calculation logic including segwit discount)
necessary_fee = int(virtual_size / 1000 * 25000)

size = 180 * len(inputs) * 34 * len(outputs) + 10

Unless you are using uncompressed keys (which very few wallets do today), this formula is wrong. It should be 148 instead of 180 as compressed keys are 32 bytes shorter than uncompressed keys.

  My question is that can I use bitcoin-cli estimatefee for weight?

No, you cannot. Bitcoin Core's fee estimation works on virtual size which is just the weight divided by 4. So instead you calculate the virtual size instead of the block weight and then you can use the fee estimate.


about bitcoin market price for a shopping mall I am thinking of making a shopping mall based on Bitcoin payment system.

But, as you all know, bitcoin market price experiences sudden rise and drop nowadays and It will also continue to fluctuate in the future.

In this situation, how should I make my shopping mall using Bitcoin ?

Existing malls using Bitcoin are accepting that ?

I have to change my product prices every time the market price of Bitcoin such as MTgox and BTC-e is changed ??

Does anyone have an idea about that?

There is a simpler option than to re-tag your products every day to keep up with ever changing prices. You could denominate the products in USD/EUR/... and advertise that you are accepting Bitcoin. Then you update your point-of-sale software to be able to do the USD/EUR/... to Bitcoin conversion on the fly, with regularly updated exchange rates. This way you always keep up to date, can give information on the current price in Bitcoin and accept Bitcoin payments, all while keeping the price tags stable.


What happens if the power goes out during bitcoin mining process and system shuts off? I am in an area where there is power outage. I want to know, what will happen to bitcoin or my wallet or anything. Just need the basic information here.

The wallet will be safe. (Unless your drive becomes corrupt and you have no backup of the wallet anywhere else)

Nothing happens to the BTC you already have.

The Blockchain will be out of sync until you sync it again.

If you were about to find the block, it will be lost and the reward will not be awarded.


Why don't the miners just take profit from our coins and make the coin worthless? You own a very valuable thing and you want to go to holiday without it, but there is nobody who you trust and who can look after the thing. So you take somebody unknown to guard it. You pay him a fee hoping he doesn't run away with the valuable think. How much would you pay?

I think you should pay for the fee minimum the value of the valuable thing!

But now to bitcoin. Do the story again:
You own a very valuable coin which is guarded by somebody unknown (the miners). You pay him a fee (mining profit) that is much less than the value of the coin (market cap of bitcoin). Why don't the miners hold short positions on the coin, bring value of the coin down with a large majority attack which destroys any trust in the coin and go with benefit from the destruction?

I asked this fundamental question about bitcoin in a stricter way 2 days before in this question and similar in this question and there is also a bounty for an answer, but there is only less interest and no upvotes and no good answers. I think the question is fundamental, and so I tried to do it in an easy analogy now.

Because miners do not actually own/ or have access to the bitcoins which are being spent in a transaction.

They simply choose a number of transactions which have valid signatures, and put them together with the hash they created/solved, thus creating a valid block.
See https://en.bitcoin.it/wiki/Block_hashing_algorithm for more information.

The person that owns the private key owns the bitcoin, which (unless you share it ofcourse) would be something miners, or anyone in general, won't have access to.

EDIT:

There's currently ~12.000.000 TH/S, In order to gain 51% of the hashpower, ( which is needed to always be faster, thus control the bitcoin chain), you would atleast need 12.000.001++ TH/S, lets say we would generate this power with an Antminer S9+, currently the fastest, (i believe?) which has an average speed of 11.5TH/S

12.000.001TH/s / 11.5 = 1043479 Antminers, which would cost a total of
1043479*2000= 2.1 billion$

If you're willing to spend that much money just to short bitcoin, you have to ask yourself if it's going to viable, and profitable.

Even if there's a majority attack, miners still can't decide the protocol rules. See What can an attacker with 51% of hash power do?

as to what is actually possible with a 51% majority of the hashpower.

You could then speculate on the price going down, but then again, it might not, leaving you with extreme losses.

Also, you would probably be able to earn way more by simply mining the majority of the blocks and its fees.. 25 Bitcoin every 10 minutes ( since you have the majority) = 250k$ every 10 minutes. ( At the current exchange rate. )

250.000*6*24=36.000.000$ in blockrewards each day alone.

So, i'm not saying that you can't theorethically making profit shorting it while trying to destroy it with a majority hashpower, but that there are probably better options.


bitcoin-cli says transaction amount and balance are 0, but that's not the case I imported a few TestNet addresses and sent some funds to one of them. When I run

bitcoin-cli getaccount mvKoQLrzovNbgALa2D7prh9pagd2QUKpWo

it responds with the account I named it to.

I sent 1.1BTC to that address, as can be seen here but when I run gettransaction it says amount: 0, but everything else looks correct. getbalance also returns 0. What am I doing wrong here?

it seems to be that you are not on the testnet network. and i noticed that you're sending the commands with attaching -testnet

  bitcoin-cli -testnet getreceivedbyaddress 'mvKoQLrzovNbgALa2D7prh9pagd2QUKpWo'"

To run Bitcoin on testNet

Stop Bitcoin and open ~./bitcoin/bitcoin.conf using any text editor.

and add testnet=1 save and close.

try bitcoin-cli listunspent 0 9999 you should see the transaction.

Anyway if you were already running it on testnet network

try the following command to get address balance

bitcoin-cli getbalance "" 0 true

Arguments:

"account"         (string, optional)
minconf           (numeric, optional, default=1) Only include transactions confirmed at least this many times.
include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses.


Is it possible to track physical objects on a blockchain? I am currently working on a project for school in which we have to come up with a product. I won't go into the mechanics of my product but essentially what my group has come up with is using tracking devices to track any object through a mobile/desktop application. When looking through tracking technologies, the idea of using blockchain technology to track physical objects came to mind.

However, I am not entirely sure if this is possible so I would like to know if it is and could it work in theory and in practicality? Has this already been done yet?

I forget who once said this, "If you think you need to use BlockChain technology, you almost certainly don't."

BlockChain technology is designed to show proof of ownership via a proof of work mechanism that ties an expensive-to-run algorithm to a cryptographically secure chain of transactions.

If your system seeks to track ownership of objects where ownership changes regularly, and you need to prove ownership, perhaps a BlockChain solution might be applicable.  However, if your objects don't regularly change ownership, and you're simply looking to track geographical position, I would recommend some other data storage system, such as a typical relational database.


unable to get transactions in wallet console I'm trying to get transactions infos out of the bitcoin core wallet with the console.
For that I picked a random transaction of a block from today and tried to access it with

  gettransaction 8c0430d0139603db9983daf539604c612b3f7e8d5244aefc3cd3181ece08dd1f

Instead of a json-output with the decoded transaction I get

  Invalid or non-wallet transaction id (code -5)

Shouldn't I be able to retrieve every transaction in the blockchain with this command?

How can I read/access the transactions included in mined blocks?
I already did this on some altcoins with PoS and there is was possible for every transaction. Now with bitcoin it seems that only wallet transactions are available? Why is that and can I get around that to access / read the transactions on my own?

The same problem appears to be with the getrawtransaction command, so I can even decode a transaction on my own.

I run a bitcoin core 0.14.2 and my blockchain is up-to-date.

To retrieve arbitrary transactions in the Bitcoin Core console, you need to use the txindex=1 option in your configuration file.

Note that setting that option will trigger a full rescan of the blockchain that might (depending on your setup) take several hours to complete.


Largest number of bitcoins at a single address at one time? What is the largest number of bitcoins that were stored in a single address at any one time to date?

I know there were >474320 BTC at this address at 2011-07-18 (identified to be MtGox's from the 424 242.42424242 transaction). Has any address ever contained more than this?

Here's a complete list of 'record setting' address balances over time:

   date        block  transaction       balance                    address
-----------   ------  -----------   ---------------   ----------------------------------
Jan 03 2009        0   4a5e1e4b:0       50.00000000   1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
Jan 14 2009      496   a3b0e9e7:0       61.00000000   1BBz9Z15YpELQ4QP5sEKb1SwxkcmPb5TMs
Jan 15 2009      586   4d6edbeb:0      250.00000000   19QKDUJtx9n7Vaga6nX1bVHdsnT4Khfyi6
Jan 19 2009     1055   8897ea9c:0      500.00000000   15oUEZFKAC8E8BTLt1s1jx4fPxumwB3ecr
Jan 22 2009     1296   59bf8acb:0      875.00000000   12higDjoCCNXSA95xZMWUdPvXNmkAduhWv
                              [36 records omitted for 12higDjoCCNXSA95xZMWUdPvXNmkAduhWv]
Jan 15 2010    34887   ffcea1e6:0    72374.36000000   12higDjoCCNXSA95xZMWUdPvXNmkAduhWv
Oct 02 2010    83231   689f1772:0   110001.00000000   1LUPDXYf9XD9Ee1AqCuM3gZCA3ZMKgTcgw
Oct 02 2010    83240   0ee1f4e6:1   120001.00000000   1NJWs6g6hQsgxqtpRxXLhZJwHYhH2P2bvx
Oct 02 2010    83243   31b00090:0   122001.00000000   1NJWs6g6hQsgxqtpRxXLhZJwHYhH2P2bvx
Jan 27 2011   104770   8f821069:0   400000.00000000   1AYtnRppWM7tWQaVLpm7TvcHKrjKxgCRvX
Jun 12 2011   130281   a09ac44c:1   432109.87654321   1KLahQtqDNAXvrjNyfvgSBtAhwco5ZxLp4
Jul 18 2011   136856,  e4762860:1   434242.43424242   1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC
                              [36 records omitted for 1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC]
Jul 18 2011   136870   b96a37e4:1   474320.43424242   1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC
Nov 16 2011   153509   29a3efd3:1   500000.00000000   1M8s2S5bgAzSSzVTeL7zruvMPLvzSkEAuv

And this shows for record setting transaction sizes:

   date        block   transaction       amount
-----------   ------   -----------   ---------------
Jan 03 2009        0     4a5e1e4b        50.00000000
Jan 14 2009      496     a3b0e9e7        61.00000000
Jan 15 2009      586     4d6edbeb       250.00000000
Jan 19 2009     1055     8897ea9c       500.00000000
Jan 26 2009     1945     5559270f      1000.00000000
Feb 09 2009     3645     cec658ac      2200.00000000
Mar 16 2009     7677     e6f00fa6      2400.00000000
Apr 20 2009    11666     eebd343e      3500.00000000
Jul 20 2009    19863     123a3968      6049.53000000
Oct 16 2009    25095     4aa98b18      9700.00000000
Oct 22 2009    25618     1aae9d58     11950.00000000
Oct 24 2009    25788     5d793270     12250.00000000
Oct 27 2009    25969     3cd9410f     13000.00000000
Nov 04 2009    26402     6029e51c     15500.00000000
Nov 19 2009    27525     f2e5fdd3     21850.00000000
Nov 19 2009    27528     67fc73c7     22500.00000000
Mar 06 2010    44006     23709241     23247.39000000
Jul 12 2010    65566     ba62e528     35000.00000000
Jul 26 2010    70527     b9d69463     46753.13000000
Jul 28 2010    70870     73ac0fdc     50000.00000000
Nov 04 2010    89583     3bc57f90     50000.01000000
Nov 06 2010    90003     70dab592     55000.00000000
Nov 08 2010    90505     1ec28eee     96999.00000000
Jan 27 2011   104770     8f821069    400000.00000000
Jun 12 2011   130281     a09ac44c    432109.88745232
Jun 23 2011   132749     3a1b9e33    442000.00000000
Nov 16 2011   153509     29a3efd3    550000.00000000

So both the biggest balance and the biggest transaction are in block 153509.

The transaction is 10% bigger than necessary due to some sub-optimal coin selection code in the default client.  It makes sure, when using a set of different coins to make up the transaction inputs, that the selected coins total at least one cent more than the transferred amount.  This is an attempt to prevent sub-cent change which would trigger transaction fees.  However, in some cases there is no need for any change at all.  In this case the 'spare change' it allocated was a 50k BTC coin.  I've since submitted a fix for this issue.  This 500k coin and its subsequent movements caused the spike in global Bitcoin transaction volume referred to in this question.

Data is accurate as of February 9th 2012.


Does the block size issue also apply to Dogecoin? Looking at https://bitinfocharts.com/ I see that Dogecoin has only 13% of the number of transactions per day that Bitcoin has (12,778 vs 94,166). I understand that makes block sizes less of an issue for Dogecoin.

Is that the only reason why I've never seen Dogecoiners partaking in debates about block sizes, or do they have some other reason for not worrying about this yet?

It has been discussed before, but you're right that the problem isn't nearly as big. There are a couple of reasons for this:

Dogecoin has the same blocksize limit as Bitcoin, but it has ten times as many blocks, and therefore the limit is ten times higher.
As you say, there are fewer transactions on Dogecoin's network.
Hard forks are regarded differently within the Dogecoin community. For example, they recently altered their coin to remove the one hundred million coin cap. I don't think the Dogecoin devs would have any compunctions about raising the 1MB limit.


Can you create empty Bitcoin transactions? Is it possible to create Bitcoin transactions of zero value, or in other words sending 0 bitcoin to an address?

Yes, it is possible and allowed by the consensus rules to create 0 value outputs. Such outputs can even be spent. However such outputs are also non-standard and thus transactions with 0 value outputs will not be relayed. They can still be mined into a block by a miner directly inserting the transaction into a block they are mining.


Blockchain.info transaction unconfirmed for several days I swept a paperwallet to blockchain.info and the transaction has been unconfirmed for several days...it looks like it was sent in multiple tiny transactions. Has anyone seen anything like this before?

https://blockchain.info/tx/e34097f257af3f91b7874f33ad0b4bb2f5980d35ba6f8e7ca38148c084d4656c

This is normal. Your paper wallet consisted of lots of small transactions inbound, and now you are sweeping them to a new address. A wallet is a collection of unspent outputs.

The transaction looks fine, and the txfee is standard. Given that the network is under a spam attack of sorts right now, its possible that the fee is simply not high enough to confirm. It may take a while under the current circumstances until it does.


How do bandwidth requirements for running a full node grow with blocksize? I know they increase.

I'm looking for something more precise than that.

The maximum bandwidth requirements for blocks previously (there is other traffic overhead including for transaction broadcasts if your node participates, the other traffic is variable depending on many factors mostly around network utilization) were ~1MB block size per ~10 minutes.

Now the max bandwidth for blocks is ~4MB block weight per ~10 minutes.

There is some information for current block size here.


Is there a way to change the wallet.dat location without changing the entire data directory? I know that Bitcoin supports the -datadir command line option which specifies that the wallet.dat and blockchain should be stored in a custom location rather than %appdata%\roaming\bitcoin but is there a way to specify a wallet location without also changing the blockchain location? I have a highly secured spot I'd like to stash my wallet.dat in (permanently) but I don't want to stash ~2GB of blockchain data alongside it.

A symlink will do it on Linux.

On Windows there's a symbolic link method as well:

http://en.wikipedia.org/wiki/Symbolic_link#Windows_7_.26_Vista_symbolic_link

A -walletdir= feature has been requested before:

http://bitcointalk.org/?topic=2730.0
https://github.com/bitcoin/bitcoin/issues/68


Transaction order in the blockchain What is the difference between segregated witness (segwit) and canonical transaction ordering (CTOR) ?

TTOR (Topological Transaction Ordering) is used by Bitcoin and pre-CTOR Bitcoin Cash. In TTOR, there might be multiple possible ways to sort transactions. The only requirement is, chain of transactions should be sorted by time and the coinbase transaction must be the first.

Let's say there are A, B and C transactions, and assume that there's no coinbase transaction. A and B are usual transactions, but C spends at least one output of B. The possible orderings are:

A B C
B A C
B C A

Amaclin is right, SegWit didn't change anything related to them.


json-rpc of bitcoin not working for testnet(curl command) I am trying this command to get transaction from bitcoin testnet:

curl  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["txId"] }' -H 'content-type: text/plain;' http://username:password@IP:PORT/

And i am getting following error

{ "result":null, "error":{"code" :-32601, "message" : "Method not found"}, id:curltext}

You're passing invalid transaction to the gettransaction method.


What different options are there to start bitcoin on command line? I had troubles with my client on a Raspberry because it was using the wrong configuration file and I could not find any entry in the configuration file that referred to the right location of the data directory, but I knew it was beeing used correctly in the past.

I was trying to use -printtoconsole to debug the problem but that did also not work.

On command line bitcoin can be started in several ways

bitcoind starts a process with the current user. This way the home directory of this user will be searched for a config file and will be used as data directory as default.

service bitcoin start will use the startup script /etc/systemd/system/bitcoind.service. This might contain a link to a configuration file. In my case this config file did not contain of a data directory which I found troubling. But the solution is that it contains a user. This user's home directory is then automatically referred to.

So, in my case I was using the terminal as user pi and had to start the process as user bitcoin instead. This can be done by

sudo runuser -l bitcoin -c 'bitcoind'


Is there a logging system for bitcoind, and if so then where is the log? Where and what is the name of log files of bitcoind?

If I make a command like "sendtoaddress", will the command and the arguments (like the amount of bitcoin I sent and which address I sent) all be logged?

The default data location of bitcoind is ~/.Bitcoin on unix and %APPDATA%\Bitcoin on windows. In it, bitcoind will write a debug.log file which is automatically trimmed every once in a while. I'm not sure what is in it, but it should be easy to check. You can also start bitcoind with a commandline parameter to send its debug info to stdout, if you wish.


Out-of-the-box pool mining solution It is very hard to find an open source free solution to build a public mining pool.  Is there any pre-made, out-of-the-box solutions one can buy?

I would disagree that it is hard to find open source solutions, there are three pieces of software that need to be combined to create a mining pool.

bitcoind (or litecoind etc)
Pool software (pushpool or stratum)
Web front end (SimpleCoin, mmcFE, MPOS)

I am unaware of any commercial out-of-the-box solutions at this time.


Unspent/Spent Flag in Blockchain I just started getting interested in the blockchain a week ago, however there is something I can not just figure out.

Regarding the flag "Spent/Unspent" in transactions. I get that we flag "spent" the output of a transaction if this same output is used as an input in a future transaction.

-Suppose that we make a transaction (transaction 1), and this transaction get included in the blockchain (let's say block 1). We do not spent the output (consider a simple transaction single input & a single output) until 100 blocks later (transaction 2) in the blockchain.

I understand that in transaction 2, in the inputs, there is the info of the previous transactions (since we are implementing hash pointers)like shown below in "prev_out" (JSON format of transaction extracted from Blockexplorer api) :

'inputs': [{'prev_out': {'addr': '1PFtrRjbq4aLfM7k4tyLZ3ZAuTsgLr6Q8Q',
    'n': 0,
    'script': '76a914f423dfee34e4833104508103d89e316b4a49314088ac',
    'spent': True,
    'tx_index': 356882858,

Up to now, there is no problem, I can totally understand that we can add a flag spent/unspent for the previous outputs (inputs) in transaction 2.

Suppose now this is the output of transaction 1 (which we are going to spent 100 blocks later).

By the way, this is a real transaction, its hash: a117a7aab7e2db8ef5fd40e74f72d689e13b733136454d2340a244236fbed9eb

'out': {'addr': '1PFtrRjbq4aLfM7k4tyLZ3ZAuTsgLr6Q8Q',
   'n': 0,
   'script': '76a914f423dfee34e4833104508103d89e316b4a49314088ac',
   'spent': True,
   'tx_index': 356893407,
   'type': 0,
   'value': 16351264}

My question is:
You can see that the flag "spent" is True, How is this even possible ? Because during 99 blocks the transaction was unspent (flag=False). There is only one case possible for the flag "spent" to be True:

-The transaction 2 has to be in the same block as transaction 1. Otherwise if transaction 2 is in block 100 and the flag "Spent" of transaction 1 is True, it means that:

For 99 Blocks the flag was False and in the block 100, we change the flag of transaction 1, which is in block 1.

That means that we changed block 1, hence changed its hash --> impossible given the structure of the Blockchain.

Thank you for enlightening me !

It is important to understand that the spent flag you are talking about, is not a field of an output that is stored in the blockchain. It is rather created internally by the client interacting with the blockchain. The only fields of information of an output that is permanently stored on the blockchain are:

The Amount
The Locking-Script Size
The Locking-Script

All the full nodes on the bitcoin network checks if an output is spent or not by checking if the output is part of a structure called the UTXO set. In this structures all nodes keep all outputs which has not yet been spent at the last block of the blockchain the nodes have validated. If an output is part of the UTXO set, it means that the output is unspent.

For every new block in the blockchain, the nodes validates the block and removes any previous outputs in the UTXO set, that has been used as inputs in the new block.

Since a new node validates the blockchain by starting from the first block ever, called the genesis block, and updates UTXO set for every block in the blockchain, the UTXO set will contain all current unspent outputs once the node is synced with the rest of the network.


Can I sign a text with a Bitcoin address using PHP only? I have the following...

Bitcoin Address: 1H2zzoAncRcQYihgTMYtX55ioXYErmYQQC

Public Key: 021FE07FBBB27AD176F1E082950474CD6252FB86751B893BC0887962B008830798

WIF Key: Kzy3fea4xCwLczAj3g8TYvDw6QRKCMqvVZX2J7vaXgy78VhieRdV

HEX Key: 6FCE4A50EA529B2D4B3E9671B5B0AA0D5D19266D778FB005F25AE4599D5D2BA0

I need to sign: Just a sample text

I want this result: H9saC8UiO0n++3dHZev/apRXkQCrqFofvW9vMpzWqPKsYTNvx/4bdtbdcMORGvNblQknT34UErnwEM3fxTZII0U=

How can I code it only in PHP without calling any API or invoking any JS library?

A bit late but I created a PHP library for cryptocurrency. You can use this library to achieve what you want.

You can use it like this:

require('CryptoPHP.php');
$wif_key = 'Kzy3fea4xCwLczAj3g8TYvDw6QRKCMqvVZX2J7vaXgy78VhieRdV'; //this is your wif key
$private_key = $this -> wif2key($wif_key); //get the wif key to a hex private key
$hash = 'Just a sample text'; //this is what you're trying to sign.

$signature = $this -> sign($hash,$private_key);


On Blockchain.info, how many addresses can I pass into one API call? Most of the Blockchain.info API calls (eg Unspent outputs) allow you to specify multiple addresses in one call separated by "|". Is there a limit to how many addresses I can pass in?

If I pass in 1000 addresses, does it still count as one API call toward my rate limits?

rate limit counts each request you send to the server, so doesn't matter what parameters are you passing.

I'm talking about Nginx and apache rate limits techniques which are used by blockchain.info.

Blockchain has no limits for requests but the limit is coming from Nginx and Apache (default config), unlike blockcypher which counts each address as a request.


Throughput of Lightning Network Is there any reliable source of information regarding the estimation of the number of payments that occur in Lightning Network every day? If the total number is impossible to estimate are there any nodes that publish their throughput i.e. the number of payments they handle every day?

as explained here I showed that the betweeness centrality of a node on the fee graph is proportional to the expected routing fees which again is proportional to the throughput of your node.

So taking your throughput and dividing it by your betweeness centrality score should give you a rough estimate of how much throughput is handled by the network.

That being said. The betweeness centrality is constantly chaning as well as routing fees. Also the entire argument assumes a uniform distribution of sender, receiver pairs (which is highly unlikely) Other than that there are no verifiable sources you can use. You will however find people publishing their logfiles or some statistics. All of that information has to be taken with doubt though


Why does pool latency matter? I often read about latency and ping.
I am programmer and I understand what latency and ping is.
But I do not understand why miner can't process block with certain delay.
Why do 10ms or 100ms matter?

Latency of connections between nodes matters when mining because, essentially, a valid block found that reaches the highest number of peers first wins that block height.

For example, if miners Alpha and Beta both find within a few milliseconds of each other, their incentive to push that block around to connected clients as quickly as possible is that they get their block on the chain first and thus are able to claim the reward.

More technically, if we're currently at block height 10, and miners are hashing to find a solution that will become block 11, and Alpha and Beta both find a block, they can both claim it to be block 11. However, it only actually becomes block 11 when 51% of nodes believe that a certain block is the 11^th block. The other block, the valid block that lost the exposure contest, becomes an orphaned block, and gets pruned when the height 12 blocks start coming in.


When is a new block added to the bitcoin blockchain and is it vulnerable to modifications till then? I'm a beginner to Bitcoin and blockchain and from what I understand, one block can hold multiple transactions. Until a block is saturated with the number of transactions it will eventually hold, where are all these transactions stored?
Until a transaction is added to a block whose hash is finally computed and the block added to the blockchain, how are the transactions tamperproof?

a block is assembled by the decision of a miner. If he wants to, he cannot include transactions at all. If he includes tx, then he uses tx out of his mempool. tx are normally verified before entering into a block. If the miner decides to tamper with a tx (change its contents), then when sending the block to the network, other nodes will reject this block, cause it contains an invalid tx.

  Until a transaction is added to a block ... how are the transactions tamperproof?

tx be tamperproof doesn't make sense, while the block is created. It is at the risk of the miner! If he wants to win the block reward, he better transmits correct blocks into the network.
The whole idea of bitcoin is, to better play well and get incentivized for it. If you try to play against the network, you have enormous costs to carry.


Initial Block Download Problem I started a new Bitcoin Core(testnet) and the download of blocks worked perfectly till 15% and then i don't know what happened, but i got the following error:
unknown new rules activated (versionbit 1)
What should i do?

This is not an error that has halted progress, the sync is continuing.

Warnings are informational messages that may need attention.


How to start with bitcoin? I have been listening about bitcoin from my colleagues and they convinced me to investment into bitcoin. They also suggest me couple of websites to start with. I have started with one of them and invest $150 bit seems no profit from them. Can you guys please suggest the sites or the people to with I can start my investment. Also need some guideline about how that works, sell and buy, how and when and all that primary stuff.

One of the popular trading sites is coinbase.com. There you can sign up and buy and sell - should be straight forward. Of course there are other sites as well.


Question about Merkle trees and blocks There is something I cannot understand about Merkle trees. I understand how they are calculated and etc., but I cannot understand how they are used on a blockchain. If a block stores only the Merkle root, how can a blockchain explorer let you search and view specific transactions? I think this requires that a block must store the whole array of transactions, not just the Merkle root. Please help me understand this. Thanks in advance.

The block header contains the merkle root, but the full block itself contains all the transactions, in order of their appearance as merkle leaves.


is this paragraph on bitcoin correct? When Alice sends BTC to Bob, Alice creates a transaction, which is sent to the bitcoin network.
However this transaction now needs to be validated and added to a block of the blockchain. The blockchain is a chain of blocks, and a new block is added every ~10min. We will explain how miners create new blocks, why it takes roughly 10 minutes to mine a new block, and why validation of a transaction takes on average 60 minutes if everything goes well (=6*10 minutes).

Miners are currently rewarded by 12.5 BTC by block (it used to be 25 BTC/block, now is 12.5 BTC/block until 2020, then afterwards 6.25 BTC/block. This halving continues until 2110–40, when 21 million bitcoins will have been mined.)
A block consists of 2 things:
- an easy part: a list of transactions since the last block was found, this is to validate the transactions.
- a difficult part: a code that proves the identity of the miner that mined it (so that the network can award him the 12.5 BTC). Note that if a miner proposes a new block but that the block is found by other miners to contain invalid transaction, the miner will lose his reward.

How these 2 parts are linked: Given that validating the transactions is much easier than generating the code that validates his block, there is a strong incentive to only propose blocks with valid transactions.

Now we will explain why miners need a lot of computing power, this is because on top of validating transactions, mining also ensures supply of bitcoins at defined rate every 10min, and there is competition to get them!
The rate used to be 25BTC every 10min, now it is 12.5 bitcoins every ten minutes until mid 2020, and then afterwards 6.25 bitcoins per block for 4 years until next halving.
In order to achieve that defined supply rate, the network is constantly adjusting the difficulty of mining so that a new block is roughly found every 10 minutes.

A transaction is considered as finally confirmed after it is added to a block and ~5 other blocks have been validated. This means 6*10 minutes = 1 hour.

Now the problem is that there is since origin a limitation in the size of each block: 1Mb. This corresponds to ~ only 3 transactions by second. If the transaction rate goes significantly higher, it will create further delays in the validation process. This is the reason of the bitcoin forks.

There are a number of badly worded or misconceptions in there, but in future it would be better to ask specific questions rather than posting an entire description of bitcoin and asking if it is right :)

  and why validation of a transaction takes on average 60 minutes if everything goes well

This is slightly badly worded, validation of the transaction is easy (just makes sure its a valid transaction spending valid inputs). Its confirming it which you might like to take up to an hour for, but technically you don't have to wait for confirmations if you want to sacrifice a bit of security for speed (1 confirmation should be plenty for smaller purchases).

  it used to be 25 BTC

Note that it started at 50, this makes it sound like it started at 25.

  an easy part: a list of transactions since the last block was found, this is to validate the transactions.

The block just has a list of the transactions in the block. Your wording sounds weird, and it doesn't necessarily include all transactions since the last block, just the ones picked by the miner.

  a difficult part: a code that proves the identity of the miner that mined it (so that the network can award him the 12.5 BTC).

The miner doesn't prove their identity. They just include a special coinbase transaction in the block which pays the block reward to an address of their choice. And the block hash isn't really a "code", its just a valid block.

  at defined rate every 10min

The 10 minutes is just an average, the difficulty of finding a valid block changes to adjust for hashpower changes every 2016 blocks. You mention this, but you make it sound like somehow the decreasing supply of bitcoin per block is related to it. Its not, the difficulty just depends on how quickly the last 2016 blocks were found (technically 2015, due to an off-by-one error in the code).

  Now the problem is that there is since origin a limitation in the size of each block: 1Mb. This corresponds to ~ only 3 transactions by second. If the transaction rate goes significantly higher, it will create further delays in the validation process. This is the reason of the bitcoin forks.

This is outdated, it ignores the changes by segwit such as block weight instead of size, and the softfork to a maximum of 4Mb blocks. And where did that 3tx/s number come from? Also, the forks are hugely political in nature, you're oversimplifying.


Why are transactions grouped into blocks? (how are new blocks-to-solve formed) Why are transactions grouped into blocks when put onto blockchain (PART 1)?

Lets say we have just put a block on a chain and there are no blocks at the moment that users mine. At that moment how many new blocks will get created for users to mine? Will only one block-to-solve get created, or more of them?
If more blocks will get created (to be mined on), how will the miners distribute themselves on the blocks?

Why are transactions grouped into blocks when put onto blockchain?

Blocks provide a way for transactions to be committed to the blockchain. They are what allow transactions to become immutable. By grouping transactions into a block, they become protected by the Proof of Work that the miner had to do in order to create the block. This means that in order for anyone to change a transaction, they must also perform the Proof of Work to modify the block too, and all blocks that come after the block a transaction was in.

Lets say we have just put a block on a chain and there are no blocks at the moment that users mine. At that moment how many new blocks will get created for users to mine? Will only one block-to-solve get created, or more of them?

If more blocks will get created (to be mined on), how will the miners distribute themselves on the blocks?

Mining does not work like this. Blocks are not distributed to miners to be worked on.
You can think of minining more like this: each miner creates a block, hashes it, and sees if it is less than the target. If it is not, they throw away the block and make a new one that is slightly different. They do that over and over until a block is found that has a hash that is less than the target. Miners will end up making quadrillions or even quintillions of invalid blocks until they get lucky and make on that is valid. Each block is unique and constructed by the miners themselves.


How to tell who mined a bitcoin? If the Bitcoin algorithm was broken and someone started spitting out blocks one after the other through their otherworldly space computer, could it be detected that the same miner was busting all the blocks? Follow-up question: How does the network strength or hashing power get computed? By just assuming the required H/s for the current technology?

If bitcoin algorithm was broken and some one started spitting out blocks one after the other through their other worldly space computer, could it be detected that the same miner was busting all the blocks?

Not necessarily. There's not enough data recorded to conclusively show that the same person is behind the new blocks, but people would figure it out: The block generation rate and network difficulty would shoot up without anyone knowing why. People could try to trace where the mined bitcoins are first seen and where they go. And you could trace the first IPs known to report the blocks: if your interplanetary computer always communicates over one IP, it might get noticed as something that has a lot of power behind it (be that a pool, supercomputer, etc.).

If that happened, the value of Bitcoin would probably drop as people realize that we'd be vulnerable to a 51% attack at the hands of an unknown party.

  Follow up question: How does the network strength or hashing power get computed? By just assuming the required H/s for the current technology?

The difficulty is known (since it's calculated based on all the previous blocks), and the block generation rate is known (since you can look at how often blocks are coming in). From these, it's easy to estimate the network's total hashing power.

It's like having a lot of people throwing weighted coins (such that 1 millionth of the time it comes up heads) and telling you when they hit a heads. If one such "heads" is reported every 10 minutes (600 seconds), you can make a very accurate estimation of how many times per second the coins are being flipped. In this example:

(1,000,000 flips/heads) / (600 seconds/heads) ~=
1,667 flips/second

The network difficulty is how you adjust this 1,000,000 figure so that the 600 figure stays consistent as the network's total hash power (1,667) changes.


error: couldn't connect to server I did a web search before posting, but none of the similar topics shed any light on my problem.

This is the command I'm using to start bitcoind:

./bin/32/bitcoind -datadir=/somedir -daemon

This is the contents of my bitcoin.conf, which is located in /somedir (of course):

server=1
rpcuser=some_user
rpcpassword=some_password
rpcport=8332
rpctimeout=60

Here are the results of netstat --ip -lpan | grep bitcoin

tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN      24203/bitcoind
tcp        0      0 0.0.0.0:8333            0.0.0.0:*               LISTEN      24203/bitcoind

Then I attempt to send a commend to the bitcoind using:

./bin/32/bitcoind -datadir=/somedir getinfo

Result

error: couldn't connect to server

I'm probably missing something simple and obvious, but what?

This happens usually when your server isn't yet fully loaded, i.e. the executable/binary is started, but is still busy processing (I think loading the wallet and a vital part of the block chain necessary for most basic RPC commands, although I'm not sure). This could take, depending on your wallet size and processing speed, from a few seconds to several minutes in general.

If that doesn't work please comment!


p2sh checksig failing I'm attempting to validate a p2sh transaction from the live bitcoin blockchain, however it is failing the checksig. I am using pybitcointools for the checksig and I have successfully validated lots of other txhash/pubkey/signature sets so I don't think the problem lies in the ECDSA library.

I think I must be evaluating p2sh incorrectly. Please could someone tell me where I am going wrong:

tx hash 7edb32d4ffd7a385b763c7a8e56b6358bcd729e747290624e18acdbe6209fc45 spends txout with index 0 from tx hash 40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8.

First I evaluate the scriptsig:

OP_FALSE
OP_PUSHDATA0(72)
3045022100ad0851c69dd756b45190b5a8e97cb4ac3c2b0fa2f2aae23aed6ca97ab33bf88302200b248593abc1259512793e7dea61036c601775ebb23640a0120b0dba2c34b79001
OP_PUSHDATA0(69)
5141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51ae

This leaves the stack like so:

0 - 00
1 - 3045022100ad0851c69dd756b45190b5a8e97cb4ac3c2b0fa2f2aae23aed6ca97ab33bf88302200b248593abc1259512793e7dea61036c601775ebb23640a0120b0dba2c34b79001
2 - 5141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51ae

I back this up as stack_copy.

Then I evaluate the scriptpubkey:

OP_HASH160
OP_PUSHDATA0(20)
e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a
OP_EQUAL

This passes fine.

Finally I evaluate the p2sh - I restore stack_copy and pop the last item (2) off the stack. I deserialize it to get the following script:

OP_TRUE
OP_PUSHDATA0(65)
042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf
OP_TRUE
OP_CHECKMULTISIG

And then evaluate this using stack_copy (without element 2 which has just been popped). The data for the checksig evaluation is:

serial tx: 0100000001c8cc2b56525e734ff63a13bc6ad06a9e5664df8c67632253a8e36017aee3ee4000000000455141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51aefeffffff0120f40e00000000001976a9141d30342095961d951d306845ef98ac08474b36a088ac0000000001000000
txhash: 8fcf56ee75816930fb141fdc19b2aa1bc721b124d2a76d5f0c1be17bcd21ccdc
pubkey: 042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf
signature: 3045022100ad0851c69dd756b45190b5a8e97cb4ac3c2b0fa2f2aae23aed6ca97ab33bf88302200b248593abc1259512793e7dea61036c601775ebb23640a0120b0dba2c34b790

However this is failing! Let me know if you need more information and I can provide it.

i had the locktime field of the spending transaction accidentally set to 0 when in fact it is 272295 for this transaction.

{
    "hash": "7edb32d4ffd7a385b763c7a8e56b6358bcd729e747290624e18acdbe6209fc45",
    "num_inputs": 1,
    "input": {
        "0": {
            "funds": 990000,
            "hash": "40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8",
            "index": 0,
            "parsed_script": "OP_FALSE OP_PUSHDATA0(72) 3045022100ad0851c69dd756b45190b5a8e97cb4ac3c2b0fa2f2aae23aed6ca97ab33bf88302200b248593abc1259512793e7dea61036c601775ebb23640a0120b0dba2c34b79001 OP_PUSHDATA0(69) 5141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51ae",
            "script_length": 144,
            "sequence_num": 4294967294
        }
    },
    "lock_time": 272295,
    "num_outputs": 1,
    "output": {
        "0": {
            "addresses": [
                "13fLLox43yXYvfoZadXpGbkTUXkW8bhqut"
            ],
            "funds": 980000,
            "parsed_script": "OP_DUP OP_HASH160 OP_PUSHDATA0(20) 1d30342095961d951d306845ef98ac08474b36a0 OP_EQUALVERIFY OP_CHECKSIG",
            "script_length": 25
        }
    },
    "size": 229,
    "version": 1
}

and the serialized tx with the txin 0 script replaced with the following script:

OP_TRUE
OP_PUSHDATA0(65)
042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf
OP_TRUE
OP_CHECKMULTISIG

should actually be:

0100000001c8cc2b56525e734ff63a13bc6ad06a9e5664df8c67632253a8e36017aee3ee4000000000455141042f90074d7a5bf30c72cf3a8dfd1381bdbd30407010e878f3a11269d5f74a58788505cdca22ea6eab7cfb40dc0e07aba200424ab0d79122a653ad0c7ec9896bdf51aefeffffff0120f40e00000000001976a9141d30342095961d951d306845ef98ac08474b36a088aca727040001000000

only the final 8 bytes that contain the locktime are different from before: a727040001000000

the new serial tx has hash:

607789be41392e6b12735a79bc9ea94573b4e39948badef18ca48e85ee15196d

and the signature and pubkey from before were already correct. these evaluate correctly in pybitcointools now, like so:

pybitcointools.ecdsa_raw_verify(tx_hash, pybitcointools.der_decode_sig(bin2hex(signature)), bin2hex(pubkey))


Figure out transaction ID How can I find out the ID of a transaction I just made?

I sent bitcoin to a site and they are requesting me to send the transaction ID to them.

How do I find it out?

Some wallets have a function called something live "View on block explorer". For Electrum, you can see it if you right-click a transaction.

This will take you to a website on which you find your transaction ID. I drew a red ellipse around it so you know which number it is.

If your wallet doesn't have that functionality or you don't find it, simply copy the address you used to send the money and paste it into the search field on https://blockchain.info. You'll get to a page showing you all transactions that address has been involved in.

Green arrows mean that that address gained money, red arrows mean that that address lost money in the transaction.


Is Ripple's UNL list maintained by the network? Who maintains the Ripple UNL list?

This says

  We periodically poll our sources. If they mention a new node with a score over an amount, we add the node to our trusted core set.

Who is "we"?  Are "we" the network, or are "we" a set of maintainers, founders, etc?

Currently, Ripple Labs runs five validators and most Ripple servers have only these five validators on their UNL. A transition is in the works to distributed community management of UNLs, and that transition is expected to be completed during the first half of 2014.

In the final scheme, publishers will be able to publish lists of validators (by public key). They will ensure validators accurately report their identity, jurisdiction, type of organization, and so on. Publishers will monitor the validators they publish to ensure they are operating reliably. Since validators must sign every proposal and validation, most types of misconduct will be easily provable.

The Ripple server software will come with a default list of publishers, though you can add or remove them as you see fit. You can also manually add validators or remove validators. You will be able to tune the policy based on the parameters the publishers vouch for. For example, if you don't want any validators operated by governments, you can opt to do that. If you don't want any validators in Australia, you can opt to do that.

Your server will periodically poll the publishers and statistically combine their lists to come up with a set of validators to use.


Recovering from an old Wallet I have recovered my wallet from an old data file using Bitcoin Core. The wallet has synchronized without issues. I have tried to send BTC to at least two exchanges and neither transaction has completed. After the first transaction (going to the Coinbase Wallet) I waited 10 days and then tried increasing the transaction fee - no change. The returned stats code says "Status: 0/unconfirmed, not in memory pool, abandoned."
I then cancelled that send and tried sending to Kraken and it's still processing after six days. The status code for this one says "Status: 0/unconfirmed, not in memory pool?
Any ideas? Am I just SOL?

As a workaround for the problem that you are facing - instead of using Bitcoin Core to send BTC to your account with the exchange, you might want to try exporting your wallet's private key from Bitcoin Core, then importing the private key to your account at the exchange.  See https://wallet.coinbase.com/faq/ (under 'Can I switch from my existing wallet app like Metamask, MyEtherWallet, etc.?') for information on how this is done with Coinbase.  Then, your BTC will be available in your account at the exchange.