Why can’t they use super computers to mine all the bitcoins?

I have very limited knowledge of bitcoin, but, I hope you don’t mind my asking this question:

As I understand it, “mining bitcoin” requires “significant” computational prowess. A lot of dedicated mining rigs have been built out of FPGAs, ASICs and GPUs. But, I have always wondered: would it not be possible to mine ALL the bitcoins if you had access to some of the most powerful computers? So, for argument sake, if the NSA decided to stop snooping upon people and instead decided to, you know, mine bitcoins… would they be able to mine all the bitcoins in just a few hours if they redirected all their super-computational-power towards this one problem: mining bitcoins? Other potential candidates for this game include, but are not limited to: NASA, DoE, etc.

I realize that running a supercomputer to mine bitcoins may NOT be efficient (because a super computer consumes too much power, costs a lot of money, etc) but for a govt agency all that money comes from taxes so …

Now, hypothetically, could “they” mine all the bitcoins in a few hours, or even in a few minutes if they redirected all their super-computational-power towards this one problem: mining bitcoins?

How to find the change / sender address given a txid?

Suppose I’m making a service like SatoshiDice and when I receive a transaction I want to give some money back. Where can I find the sender address?

If I run this, e.g.:

bitcoin-cli gettransaction 8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c

I get:

{
    "amount" : -0.00750000,
    "fee" : -0.00050000,
    "confirmations" : 10130,
    "blockhash" : "00000000000000002b44cdc1b2fe4ec2aa6b31b25ae8eedc8d1ef16799bd3114",
    "blockindex" : 13,
    "blocktime" : 1398584440,
    "txid" : "8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c",
    "walletconflicts" : [
    ],
    "time" : 1398584248,
    "timereceived" : 1398584248,
    "details" : [
        {
            "account" : "",
            "address" : "1Gxua3AptLgz1DWbG38dakLP4DVY2Jia4d",
            "category" : "send",
            "amount" : -0.00750000,
            "fee" : -0.00050000
        }
    ],
    "hex" : "01000000013c75459d163a5343725362a5b412dde392784814ec04c4e77df7ee5edbd10352010000006a47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9ffffffff0250c30000000000001976a9144233e899673c755c11664d43d0a83a56d06ce23188acb0710b00000000001976a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac00000000"
}

I can find the address I am looking for in details -> address. But is this the right place to look? The details array can be empty or have more than one element?

I know there are two similar questions already: How to findout the sender of a transaction and What's the best way for a website to detect payments from green addresses? but the problem is that theses questions don’t explain if I can use gettransaction securely to find it.

Following the answer tip, I was able to do this:

bitcoin-cli decoderawtransaction "01000000013c75459d163a5343725362a5b412dde392784814ec04c4e77df7ee5edbd10352010000006a47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9ffffffff0250c30000000000001976a9144233e899673c755c11664d43d0a83a56d06ce23188acb0710b00000000001976a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac00000000"

which produces:

{
    "txid" : "8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "5203d1db5eeef77de7c404ec14487892e3dd12b4a562537243533a169d45753c",
            "vout" : 1,
            "scriptSig" : {
                "asm" : "304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca01 02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9",
                "hex" : "47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00050000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 4233e899673c755c11664d43d0a83a56d06ce231 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9144233e899673c755c11664d43d0a83a56d06ce23188ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1733nLJx6QrYa7AemEHXgq89G2NaWjPpRW"
                ]
            }
        },
        {
            "value" : 0.00750000,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 af1ca5c63970b893a4ef79d030b28ca91ccd22ce OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1Gxua3AptLgz1DWbG38dakLP4DVY2Jia4d"
                ]
            }
        }
    ]
}

This let’s me find the change address.

But can I skip these steps and take it from “details”?

What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?

I am wondering if I can use node.js and levelup to access a copy of the blockchain database directly.

But from what I can see, I need to know the name of the key(s) before I can get any data, as this is used in the get method of levelup.

However, I have not been able to find out anything about the possible key(s) associated with the values in the key value pairs, so I’m at a loss as to how I might retrieve the data.

Firstly, what are the keys in the key value pairs, and secondly is it possible just to select the first n records?

Why do I see a ‘Yay’ with a 70% match, and a ‘Booo’ with a 75% match?

Just what the title states.

I’m just a couple of days into this idle CPU utilization thing; I run a CPU miner (x-coin-minerd on a Windows 7 box).

Scrolling through the command line output I see several lines that say ‘accepted’ – some show a ‘Yay’, whilst others show a ‘Booo’. Yet some ‘Yay’ show a lower match (70%), and some ‘Boo’ show a higher match (>75%).

(The previous entries were lost, but the most recent Yay/Boo visible on the command line are posted below for reference)

[2014-06-24 08:37:25] accepted: 14/15 (93.33%), 89.76 khash/s (booooo)

[2014-06-24 08:37:45] accepted: 15/16 (93.75%), 89.75 khash/s (yay!!!)

Why do I see a ‘Yay’ with a 70% match, and a ‘Booo’ with a 75% match?

Bitcoin is not connected in regtest mode

I am having trouble using regtest mode on Linux. Using pre-compiled version 0.9.2.1 for linux and starting regtest mode as instructed on bitcoin.org:

<bitcoin-ver>-linux/bin/64>> ./bitcoind -regtest -daemon

The server starts but doing a getinfo returns ‘connections’ : 0. Tried experimenting with various rpc* settings in the .conf file. What exactly do I need to set in order to use regtest mode? Do I need to add real nodes via addnode for regtest? It doesn’t seem like I should need to. I was able to get a few connections by adding several real nodes one time but after a few minutes ‘connections’ dropped back to 0. Let me know if any additional info would help.

ECDSA Signature and the “z” value

The following link contains details on how to reverse the ECDSA signature if given two identical “R” values.

http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html

I have read over this and there’s one part I don’t understand; how he got the “z” values.

Does a copy and paste of
“OP_DUP OP_HASH160 70792fb74a5df745bac07df6fe020f871cbb293b OP_EQUALVERIFY OP_CHECKSIG” (minus the quotations) into a ripemod-160 hashing function produce that result?

Did he have to essentially copy and paste some other string? Did he just ripemod or sha 256d? Did he have to do it more than once?

I’ve read up on these things but I just cannot decipher their programming description of how to do it. The non-programming descriptions don’t show “hey this ‘xyzx’ is what I’m referring to when I say ‘message to be signed'” or whatever. Many things on that page and on the

https://blockchain.info/tx/9ec4bc49e828d924af1d1029cacf709431abbde46d59554b62bc270e3b29c4b1

Seem as though they could adequately be described as the “message to be signed” besides the fact I don’t know what type of hash is being applied to even compare my calculations with the ones shown on the first link.

Why is it possible to have multiples addresses in an output of a transaction?

I am trying to load the blockchain into a MySQL database by using the data gathered from RPC calls to bitcoind. I am wondering why the addresses key within the vout array of a transaction is plural. Why can there be multiple addresses receiving bitcoins using only a single output? Below is the result of running

bitcoind getrawtransaction 40d9e9dc25f89b590a26c486c46df9d40a72200080200c8fdf1bdf0562b2fba7 1

for some arbitrary transaction with hash 40d9e9dc25f89b590a26c486c46df9d40a72200080200c8fdf1bdf0562b2fba7. If you look at the bottom you’ll see the transaction’s vout array with two outputs. The addresses values for each of those outputs are 127W9E5BVn6KxVCV2iiVbJmQrVoUd8xmu3 and 18AQDxusBQTJiNSG6EszPUfi85RhDpo7Qf respectively. Is there some future plan by the core developers to allow multiple addresses to receive bitcoins from a single output? As you can see I am confused by the use of the plural here.

{
    "hex": "0100000005f5cdbc9dc70fae996a991a08e8f9ca4000fc1cd07f98ef7af14b7b8337c1e010570000008a47304402206104041c8f9330103a1c3b77714b95e61ec90769b7f54cba426baaf8e676256402204134829de0e0ac24f340a680655b35747fbad26ab517d5324a22e20505130ba8014104ec3619fb20e737d551489c16b2df50bf91fb95b1d7b15a7835f752b9aeb5bcb4337c40aef04e39962c95e1a8630c793c158ee464d93a80b14cfb0ce9f8039d25ffffffff0238484550f656494ed81189447a256c3abddea3305c5a4fa21b275cefcd1c6e000000008b48304502210092bd8b04c5df3c23e9bf3516c1434ff4cdde8aff42d14ec18eea16393de900ad022008a005f46fdee01c17032fc3688af311c8413ca2c866e8bc95f6c4e955816697014104d1a7f146aa464889c80286b105739bdfe05c186d4d1bc0737898f28d4e1c17a99d5a3c71ada20873916d0d5d75a92db2aaab37b8a14a18338b7b223727f5d417ffffffff37d00652b664deb37d20f7764c4d1b85a19e608024c2343f5449d2beef8576a9020000008b4830450221009ba99d89a15ccd7cefb499c42c0d94ed5e41a18d11007ba6d9d3edd479ec20bb02206c002e270c17190ab5f8d7fef33a73509aea518fae2671e21cdb3aa8dedf53ce0141049a56e83820ad23350de1b1fa3b2686ef053c75c2a01dcae4e777e057e985aa94e8d2a5d7d158c970b10097249dcaa4ec34748f4402a5c4c8eb7a61a27cf3ba80ffffffffb6cf6633a550b4d262c7c37f0fb795f82e091f951cec152ff532deee0f87d9b4010000008c493046022100cb5b6ba715d77876adcd39f5ecc315cd8bd79c29bb56970b9650603decd3f243022100ac157b1ccd55dc53afac81424d8bcadc371e70660659e4b1d2ac38dfd54e008601410408ddf2624fcd9a76b6821768d901d136c72df5cfdeca960f698bbec2a24ce6fe65dc2795c4106db990f40674215c0badc15547749e1098ebf1acc23bfa164299ffffffff405d52e2368d0dbbda25b28c9eec5b48ca25141ec60a94b2dd982550289cfb19010000008b483045022070d50be3affd2201bd8c7cf800c2610b4b1dc8b0edd3292c88b1a9abca272d69022100b60eef3992902992032087c51e6487115dd54ec35ecd75b0e83804f7dcc61a5d01410403f8182f373e43770c0edcf5d793ec1e19d8600a4ef19d90860a5ed8ecd7fc445c4edb315e78db4a80f6aa2fe89e99a88e780bcf964af2b505abe7aefd2039c6ffffffff02104a0f00000000001976a9140c32f2aac46ffdcc2f02048c5f18e1b24b9be3b188ac8035bd00000000001976a9144e900299bc94a699aef0fbf2dbbeabd3a3cb03e888ac00000000",
    "txid": "40d9e9dc25f89b590a26c486c46df9d40a72200080200c8fdf1bdf0562b2fba7",
    "version": 1,
    "locktime": 0,
    "vin": [
        {
            "txid": "10e0c137837b4bf17aef987fd01cfc0040caf9e8081a996a99ae0fc79dbccdf5",
            "vout": 87,
            "scriptSig": {
                "asm": "304402206104041c8f9330103a1c3b77714b95e61ec90769b7f54cba426baaf8e676256402204134829de0e0ac24f340a680655b35747fbad26ab517d5324a22e20505130ba801 04ec3619fb20e737d551489c16b2df50bf91fb95b1d7b15a7835f752b9aeb5bcb4337c40aef04e39962c95e1a8630c793c158ee464d93a80b14cfb0ce9f8039d25",
                "hex": "47304402206104041c8f9330103a1c3b77714b95e61ec90769b7f54cba426baaf8e676256402204134829de0e0ac24f340a680655b35747fbad26ab517d5324a22e20505130ba8014104ec3619fb20e737d551489c16b2df50bf91fb95b1d7b15a7835f752b9aeb5bcb4337c40aef04e39962c95e1a8630c793c158ee464d93a80b14cfb0ce9f8039d25"
            },
            "sequence": 4294967295
        },
        {
            "txid": "6e1ccdef5c271ba24f5a5c30a3debd3a6c257a448911d84e4956f65045483802",
            "vout": 0,
            "scriptSig": {
                "asm": "304502210092bd8b04c5df3c23e9bf3516c1434ff4cdde8aff42d14ec18eea16393de900ad022008a005f46fdee01c17032fc3688af311c8413ca2c866e8bc95f6c4e95581669701 04d1a7f146aa464889c80286b105739bdfe05c186d4d1bc0737898f28d4e1c17a99d5a3c71ada20873916d0d5d75a92db2aaab37b8a14a18338b7b223727f5d417",
                "hex": "48304502210092bd8b04c5df3c23e9bf3516c1434ff4cdde8aff42d14ec18eea16393de900ad022008a005f46fdee01c17032fc3688af311c8413ca2c866e8bc95f6c4e955816697014104d1a7f146aa464889c80286b105739bdfe05c186d4d1bc0737898f28d4e1c17a99d5a3c71ada20873916d0d5d75a92db2aaab37b8a14a18338b7b223727f5d417"
            },
            "sequence": 4294967295
        },
        {
            "txid": "a97685efbed249543f34c22480609ea1851b4d4c76f7207db3de64b65206d037",
            "vout": 2,
            "scriptSig": {
                "asm": "30450221009ba99d89a15ccd7cefb499c42c0d94ed5e41a18d11007ba6d9d3edd479ec20bb02206c002e270c17190ab5f8d7fef33a73509aea518fae2671e21cdb3aa8dedf53ce01 049a56e83820ad23350de1b1fa3b2686ef053c75c2a01dcae4e777e057e985aa94e8d2a5d7d158c970b10097249dcaa4ec34748f4402a5c4c8eb7a61a27cf3ba80",
                "hex": "4830450221009ba99d89a15ccd7cefb499c42c0d94ed5e41a18d11007ba6d9d3edd479ec20bb02206c002e270c17190ab5f8d7fef33a73509aea518fae2671e21cdb3aa8dedf53ce0141049a56e83820ad23350de1b1fa3b2686ef053c75c2a01dcae4e777e057e985aa94e8d2a5d7d158c970b10097249dcaa4ec34748f4402a5c4c8eb7a61a27cf3ba80"
            },
            "sequence": 4294967295
        },
        {
            "txid": "b4d9870feede32f52f15ec1c951f092ef895b70f7fc3c762d2b450a53366cfb6",
            "vout": 1,
            "scriptSig": {
                "asm": "3046022100cb5b6ba715d77876adcd39f5ecc315cd8bd79c29bb56970b9650603decd3f243022100ac157b1ccd55dc53afac81424d8bcadc371e70660659e4b1d2ac38dfd54e008601 0408ddf2624fcd9a76b6821768d901d136c72df5cfdeca960f698bbec2a24ce6fe65dc2795c4106db990f40674215c0badc15547749e1098ebf1acc23bfa164299",
                "hex": "493046022100cb5b6ba715d77876adcd39f5ecc315cd8bd79c29bb56970b9650603decd3f243022100ac157b1ccd55dc53afac81424d8bcadc371e70660659e4b1d2ac38dfd54e008601410408ddf2624fcd9a76b6821768d901d136c72df5cfdeca960f698bbec2a24ce6fe65dc2795c4106db990f40674215c0badc15547749e1098ebf1acc23bfa164299"
            },
            "sequence": 4294967295
        },
        {
            "txid": "19fb9c28502598ddb2940ac61e1425ca485bec9e8cb225dabb0d8d36e2525d40",
            "vout": 1,
            "scriptSig": {
                "asm": "3045022070d50be3affd2201bd8c7cf800c2610b4b1dc8b0edd3292c88b1a9abca272d69022100b60eef3992902992032087c51e6487115dd54ec35ecd75b0e83804f7dcc61a5d01 0403f8182f373e43770c0edcf5d793ec1e19d8600a4ef19d90860a5ed8ecd7fc445c4edb315e78db4a80f6aa2fe89e99a88e780bcf964af2b505abe7aefd2039c6",
                "hex": "483045022070d50be3affd2201bd8c7cf800c2610b4b1dc8b0edd3292c88b1a9abca272d69022100b60eef3992902992032087c51e6487115dd54ec35ecd75b0e83804f7dcc61a5d01410403f8182f373e43770c0edcf5d793ec1e19d8600a4ef19d90860a5ed8ecd7fc445c4edb315e78db4a80f6aa2fe89e99a88e780bcf964af2b505abe7aefd2039c6"
            },
            "sequence": 4294967295
        }
    ],
    "vout": [
        {
            "value": 0.01002,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 0c32f2aac46ffdcc2f02048c5f18e1b24b9be3b1 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a9140c32f2aac46ffdcc2f02048c5f18e1b24b9be3b188ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": [
                    "127W9E5BVn6KxVCV2iiVbJmQrVoUd8xmu3"
                ]
            }
        },
        {
            "value": 0.124,
            "n": 1,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 4e900299bc94a699aef0fbf2dbbeabd3a3cb03e8 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a9144e900299bc94a699aef0fbf2dbbeabd3a3cb03e888ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": [
                    "18AQDxusBQTJiNSG6EszPUfi85RhDpo7Qf"
                ]
            }
        }
    ],
    "blockhash": "000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf",
    "confirmations": 104243,
    "time": 1348310759,
    "blocktime": 1348310759
}