Bitcoin alert service if price dips or rises by a percentage base? Is there a Bitcoin alert service that monitors the price and alerts the user when price dips or rises by a percentage base? Say I want to monitor the btc price if it rises by 5% and have it email me.

I have never used it personally, but I have a lot of good things of the Bitcoin Paranoid app. It's supposed to alert you on price changes.

Here's the bitcointalk thread: https://bitcointalk.org/index.php?topic=178391.0


How to store private key in MySQL database? I want to receive payments from Bitcoin on my web app, but I do not want to use corporate gateways (coinpayments, bitpay, etc), I'm wanting to make my own gateway. I do not know how best to do this but initially thought of generating the bitcoin address and storing the public/private key in MySQL after the payment was confirmed the system would use the private key and send the balance to an offline wallet.

How can I securely store the private keys that are generated for each payment in MySQL?

Let's say I do not want to leave the funds in these wallets, once I receive the system already sends the official wallet.

Storing private keys in an online server is not best practices (even if you quickly transfer to an offline wallet). Generally, you should not store private keys on an online device

Instead, if you use a BIP32 HD wallet architecture, you can just store an extended public key on your online server. This will allow you to generate receiving addresses on the fly, while generating (and securely storing) the private keys on an offline machine.


BCC sent to BTC paper wallet I sent Bitcoin cash to a Bitcoin paper wallet. I think it is wrong because the transaction on public key give me 0 BTC.
What can I do to recover my Bitcoin cash?
Thanks!

Are you checking the transaction on a BTC or BCH explorer ?

You have to sweep the private key (of the paper wallet) in a bitcoin cash wallet.

I used Coinomi on Android (be sure to select Bitcoincash) with success.


Transaction Records of MtGox? When transactions are done on MtGox.com, MtGox Live will reflect the transactions by showing "popups" (top-right corner).

Does MtGox provide a "history record of transactions" which show us information of all transactions (timestamp and amount traded) done in MtGox?

I've looked into the HTTPv1 API but there doesn't seem to be an option to do so.

As said on https://en.bitcoin.it/wiki/MtGox/API/HTTP/v1#Multi_currency_trades you can use:

https://mtgox.com/api/1/BTCUSD/trades?raw

or

https://mtgox.com/api/1/BTCUSD/trades?since=0

to get all the historical data.

There's also a non-official Python script (using this API) and a SQLite database with all the historical data, you can find it on:

http://cahier2.ww7.be/bitcoinmirror/phantomcircuit/

The 167MB SQLite database should already have all the data you need, and the Python script in the same directory allows you to update it in real time.


How can one realistically model the distribution of the network's unspent transaction outputs? I am working on a simulation to explore the usefulness of a patch for the CoinSelection behaviour of BitcoinCore. To that end, I am looking for statistics on the distribution of unspent outputs respective to their value in satoshi.

So far, I haven't found much on the topic beside an outdated number of unspent transaction outputs, as likely search terms collide with a lot of unrelated topics.

Are there any papers or other sources that discuss:

How can one realistically model the distribution of the value (in satoshi) of all UTXO (unspent transaction outputs)?
What type of curve best approximates the distribution?
What are mean, standard deviation, and variance of the network's UTXOs' values?
Bonus: How did the distribution of UTXO' values change over time?

Clarification: I am interested in modelling the number of satoshi held in UTXO.

I haven't read any papers trying to analyze the amount of unspent outputs. More often, people are interested in the distribution of address' balances. This could be interesting because it reflects how evenly distributed bitcoin is.

I did find this article: http://www.coindesk.com/what-block-chain-analysis-tells-bitcoin/, which seems like it might be of interest to you and is related to the distribution of UTXOs.

If you call gettxoutsetinfo with the Bitcoin Core RPC calls, it tells some basic info about the UTXO set. I just did this and got:

{
    "height" : 338396,
    "bestblock" : "000000000000000009f32437cb28d54ff600ec020778c8ce84ecf93b99d5218c",
    "transactions" : 4525842,
    "txouts" : 16217914,
    "bytes_serialized" : 566046691,
    "hash_serialized" : "1ad2172e4d37ce21291c116580f5b527e4c302b9c2ce4e88a91c0c00f748fb8d",
    "total_amount" : 13709764.78496462
}

So it seems that the average amount of an UTXO is:

  13709764.78496462 / 16217914 = 0.84534699

To analyze the amount of outputs (note, this is not only UTXOs), I wrote up this quick script:

<?php

require_once 'jsonRPCClient.php';

$bitcoin = new jsonRPCClient('http://{username}:{password}@127.0.0.1:8332/');

$info = $bitcoin->getinfo();

$height = $info['blocks'];
$numTrials = 1000;
$includeCoinbase = false;

$cutoffs = array();

for ($i = 0; $i < 10; $i++) { $cutoffs[] = $i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 10*$i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 100*$i; }
for ($i = 1; $i < 10; $i++) { $cutoffs[] = 1000*$i; }

function GetRange($value)
{
    global $cutoffs;
    for ($i = 0; $i < count($cutoffs)-1; $i++)
    {
        if ($cutoffs[$i] <= $value && $value < $cutoffs[$i+1])
            return $cutoffs[$i] . " - " . $cutoffs[$i+1];
    }
    return $cutoffs[count($cutoffs)-1] . " - ...";
}

$sum = 0;
$distribution = array();

for ($i = 0; $i < $numTrials; $i++)
{

    $blockhash = $bitcoin->getblockhash(rand(1, $height));
    $block = $bitcoin->getblock($blockhash);

    $randTxIndex = rand(0, count($block['tx'])-1);

    if ($randTxIndex == 0 && !$includeCoinbase) {
        $i--;
        continue;
    }

    $randTxHash = $block['tx'][$randTxIndex];

    $randTx = $bitcoin->getrawtransaction($randTxHash, 1);

    $numOutputs = count($randTx['vout']);
    $randOutput = $randTx['vout'][rand(0, $numOutputs-1)];

    $value = $randOutput['value'];

    $sum += $value;
    $distribution[GetRange($value)] += 1;
}

echo (json_encode($distribution, JSON_PRETTY_PRINT) . "\n");
echo "average: " . ($sum / $numTrials) . "\n";

And the results are (after being cleaned up a little):

average: 89.55518291596

START   END     COUNT
0       1       636
1       2       73
2       3       18
3       4       20
4       5       14
5       6       11
6       7       8
7       8       8
8       9       11
9       10      12
10      20      36
20      30      26
30      40      15
40      50      16
50      60      29
60      70      5
70      80      5
80      90      4
90      100     3
100     200     29
200     300     4
300     400     4
400     500     1
500     600     1
600     700     1
700     800     1
800     900     3
900     1000    0
1000    2000    2
2000    3000    1
3000    4000    0
4000    5000    0
5000    6000    1
6000    7000    0
7000    8000    0
8000    9000    0
9000    ...     2

Which, when plotted, gives:

And since the 0-1 outputs make the rest go out of scale, this is a plot without the smallest outputs:


When creating a transaction, how can you prove that you own your address without exposing your private key? I'm trying to understand how Bitcoin works under the hood, but there's something I don't get at all, and can't find it.

Suppose I own address A (I have the public key, A-public, and the private key A-private) and I want to transfer 1 BTC to address B (I know its public key, B-public).

In order to be able to do the transaction, I must, somehow, prove that I own A, and the only way to do that is to show A-private. But, if I show A-private, then I'm exposing my private address, so, someone, somehow, could get it.

To sum up: in the Bitcoin blockchain, how do I prove that I own a certain amount of bitcoins without exposing my private key? Or, alternatively, how does the Bitcoin protocol handle that?

In Public-Private Key Cryptography, you can use your Private Key, (without sharing it with anyone), in a way to create a message that is completely tied to your Public key.

Anyone can look at that message, and your Public key, and deduce that the only way that message could be generated is by someone who knows the Private key, even though they don't know what the Private key is.

The fact that the message can be confirmed with your Public key proves that you must know the Private key, and must be the owner of the Public Key and the Wallet Address.

Think of it as a lock that is left closed all the time.
You can unlock the lock anytime with your secret key, without showing anyone your key.

Anyone can look at that lock, and come to the conclusion: "This lock must have been opened by the owner who has the key; no one else could have opened it", but you still never shared the key with anyone.


How will a common guy use Lightning Network when BTC hits 10 mln$? If BTC hits 10mln$ and transactions fees will be horrendous denominated in $, how a "common guy" will be able to opt in using Bitcoin, if even opening LN channel will be too expensive then since it requires on-chain payment? As I understand the only way for him would be to rely on third party which would'nt be very different from using a bank.

I assume that people will have more refined ideas by the time this would actually appear on the horizon, but here are some ideas:

channel factories
Custodial Lightning Wallets, i.e. "Lightning banks"
atomic swap from a payment focused sidechain
purchasing spendable LN balance on other users' Lightning nodes via macaroons that permit spending a specific amount

Or more generally, I suspect that people would develop third layer solutions that permit multiple users to share Lightning Network channels effectively.


How many blocks are there in blockchain as of today? I have currently downloaded 300,000 blocks and the last one is generated 1 year and 19 weeks ago. I wonder how many blocks are more to go, before I am up to date.

There's a generic answer to this question that anyone can use, and an answer specific to users of Bitcoin Core (versions 0.10.0 or higher).

Generic version

Rather than directly answer your question with an answer that would become outdated within a few minutes as the next block was discovered, here's a general way you can look up the current number of blocks in the blockchain:

Go to this list of blockchain explorers.
Choose one (or choose several) and visit its website.
Almost all of them on their main page display the heights of recent blocks.
The height of a block is how many blocks there are before that block on the blockchain, so take the height of the highest block and add one—that's how many blocks there are on the blockchain.

Please note that it's not uncommon for blockchain explorers to be wrong about various facts, including the height of the highest valid block.  Visiting several sites decreases your risk of getting bad information without realizing it—if different sites disagree about the height by more than a single block, you'll know something is wrong.

For Bitcoin Core users

The getblockchaininfo RPC includes both the height of the highest downloaded block and the height of the highest valid-looking downloaded header.  On a fast connection, Bitcoin Core will typically download all the headers within two minutes of the time it is first started, so this number of headers is usually the total number of blocks on the best blockchain (minus one, since counting starts from zero).

{
  "chain": "main",
  "blocks": 381466,
  "headers": 381466,

The first few lines of getblockchaininfo on a fully-synced node

It's important to node that the headers count can conceivably go down if Bitcoin Core discovers the blocks that are supposed to be attached to those headers are invalid.  This most recently happened during the 4 July 2015 fork (although 0.10.0 and later Bitcoin Core nodes were unaffected) and it could also happen if there's a hard fork attempt that has the support of the majority of the network hash rate.

In Bitcoin Core GUI (Bitcoin-Qt), you can run the getblockchaininfo RPC by going to Help menu -> Debug item -> Console tab, and then typing in:

getblockchaininfo


Special bitcoin node I was thinking of hosting my own node. I have a fast Amazon AWS server, however not enough storage to host a full node. What I was thinking, is to host a full node on the AWS client, but get it to store and write to a blockchain on a different database server, where storage is cheaper.

Is this possible? Or is this not classified as a full node?

If you are running bitcoind on a VPS it will expect the blockchain to be stored on the local disk.  You could setup a remote file system using NFS or SMB but this will probably slow down the node and make it less responsive.  Amazon already has one of the cheapest cost's for storage why not just increase the size of the drive?  If you are talking about moving the blockchain from disk and storing it in a database that cannot be done without modifying the bitcoin source code.


What prevents a node from receiving a solved solution and claiming it as its own work? During the relay process a node finds the solution and forwards that solved block to all other nodes in the network to validate that it has indeed solved the problem. But then what if another node decides to rebroadcast it again and claim that he was the one who found the answer first.

Do you modify the block or do you not modify the block?

If you don't modify the block, it still pays the mining reward to the same account. So you've just done what everyone wants you to do.

If you do modify the block, it won't be valid anymore until and unless you mine it. That leaves you two choices:

1) You can ignore this block and mine some other block. But then someone else who mines on top of this block will have a longer chain than you and you won't get any reward. So why would you do this?

2) You can mine on top of this block. Well, that will just help ensure the person who mined that block gets their reward by producing an even longer chain that includes their block.


How to explore ripple ledger? I'm running a ripple node on my own server, and try to conduct some analysis to the balance of all ripple accounts. Thus I need to synchronize the ledgers and analyse them.

Currently, my server has been running on the consensus ledger, and I found the browser /rocksdb. However, I don't know how to extract the data from that browser. It there any GUI tool or example code to do so?

You can extract the entire last validated ledger as a giant JSON file if you want to. Be patient, it might take a while. Your server has to have an RPC port open with administrative permissions. You can use this command:

  rippled -q json ledger ' { "ledger_index" : "validated",  "expand" : true, "full" : true } ' > ledger.json

Be patient, this will take awhile. And your server may use a bit more memory and CPU when it's running.

When it's done, you'll have a giant file (about 1.7GB as of right now) called ledger.json that contains the entire current ledger. This will contain every account, every XRP balance, every offer, every trust line, every escrow, and so on.


What is 500K in Bitcoin? Many times I see something like this 500K or 2Bytes.
What are those in bitcoin and how can I calculate them.

Sorry for this noob question ;)

k is kilo and refers to 1,000. 500k are 500,000. This can have a lot of use cases, sometimes one wants to sell 500k Bitcoin (unlikely) and sometimes users refer to exchange rates in Satoshi: 500k Satoshi basicly mean you can buy something at the rate of 0.005 Bitcoin (0.00500000).

2Bytes are two units of digital information. It tells you how much space is required to store two characters like OK on a disk or in memory. 2 Bytes can be broken down into 16 Bit of plain binary information. I'm not sure in which context this could be related to anything Bitcoin-specific. Maybe you add an example reference.


What prevents somebody from "re-mining" an already existing Bitcoin? This may reveal that I know nothing about math or cryptography.
Let's say that a given Bitcoin was "lost" in that it was once mined and assigned/given to a person who had it in their wallet.dat, but then they either lost the password to this file, or deleted it, or otherwise lost access to it forever (or without any realistic hope of ever retrieving it).
Now, that Bitcoin has been mined out of the 21,000,000 total ones ever, but it's "lost".
But if a computer once guessed the right private key for that coin, why can't another computer do it again?
Basically, isn't it possible that all the Bitcoins that are currently mined and in possession of somebody, could be "re-mined"?
Is it just "extremely unlikely"? And you cannot "target" a specific existing private key/receive address/Bitcoin?
I'm always fearing that one day, somebody "re-mines" the Bitcoins that I have, thus seizing access to them, either by sheer accident or by somehow deducing the ones I own and specifically try to "re-mine" those in order to make me poor?

But if a computer once guessed the right private key for that coin, why can't another computer do it again?

It wasn't guessed the first time. It was generated randomly from a set of 115792089237316195423570985008687907852837564279074904382605163141518161494336 valid keys (that's the actual number).
Generating the same one a second time is so astronomically unlikely that it's not worth talking about.

Basically, isn't it possible that all the Bitcoins that are currently mined and in possession of somebody, could be "re-mined"?

What you're talking about is guessing, or otherwise retrieving, the private keys to existing public keys that hold coins. It has nothing to do with mining.

Is it just "extremely unlikely"?

Beyond extremely. Even if every computer on earth would generate 100 million keys per second, and there are 2 billion computers, they'd take several billion times the age of the universe before they have anything resembling a feasible change of randomly hitting any key that holds a balance currency.

And you cannot "target" a specific existing private key/receive address/Bitcoin?

You can. There are algorithms to find the private key for a given public key faster than just brute force, but the numbers are still astronomical, and believed infeasible with humanity's current technology.


Repurposing old FPGAs So, I have a couple of BTC mining FPGAs lying around from the earlier days when they were worth running (specifically a BPMC Red Fury and an ASICMiner Block Erupter). I'm wondering if these can be used to mine any other cryptocurrencies that might be a little more profitable these days. Any tips would be appreciated!

Those are ASIC miners, not FPGA.

They can mine BTC and clones, but nothing else.


How does bitsquare sell/buy fiat currencies when it is decentralized? I noticed that on bitsquare you can sell your BTC for fiat such as usd or euro. But my question is how is that decentralized when you want to cash out with USD or EUR? Who is the middle man that interacts with the bank to do your fiat cash outs?

And second of all how do you get fiat into the system in bitsquare in the first place? Who issues these fiat tokens in usd or eur?

There has to be "someone" that issues these fiat tokens as how do users get fiat tokens in the first place? If they deposit fiat, you need a 3rd party to verify those deposits are legit. Who is this entity?

In this situation you are the third party who verifies those deposits are legit. All banking transactions take place directly between the buyer and seller. Bitcoin goes into an on-chain 2of3 multi-signature address (in the case of bitsquare and cancoin) or a custodial wallet (in the case of localbitcoins). Once the bitcoin is in escrow the seller gives their bank payment details to the buyer and the buyer initiates a bank transfer directly to the sellers bank account. At this point the seller will release the bitcoin from escrow and send it to the buyer.


Bitcoin Script Execution - Must end with just `true`? When executing bitcoin validation scripts, does the final stack have to end with just true on the stack, or can there be some elements under the true? In other words, are both of these final stack configurations valid, or just the first?

Stack1:

true

Stack2:

0 {pub_key} true

Quoting Bitcoin wiki:

  A transaction is valid if nothing in the combined script triggers failure and the top stack item is true (non-zero).

From the source code:

if (CastToBool(stack.back()) == false)
    return false;

(In case you don't know what vector.back() does, it returns the last item.)


dumpwallet output documentation & explanation? Where do I find complete documentation on what the console command "dumpwallet" output means?
Sample of my testnet output:
# Wallet dump created by Bitcoin v0.21.0
# * Created on 2021-01-21T16:59:50Z
# * Best block at time of backup was 1905234 (00000000e26170d0f846a334a1bfdfebe8da906c5),
#   mined on 2021-01-21T17:05:05Z

# extended private masterkey: tpR2efnJMh85ufpQcYSTwrrKrYJ

cTdH4SbvTR 1970-01-01T00:00:01Z label= # addr=mnb8RSpTqvhLh8Q6,2MudYFE2awqc,tbvhpur8zf35ql3yx5h9nu
cRaKzuR9MCVwAxVa3aAZrVh15YbV 2019-08-26T01:19:00Z reserve=1 # addr=tb1q3qc52q hdkeypath=m/0'/0'/222'
cT2ozo5xcj6iCe4dTfywan3qJnib 2019-08-26T01:19:00Z hdseed=1 # addr=tb1qzqtu25qsue0a5pp3hg8lkftclf8ds
cNb2K9tUhQaeXiVz2Jt2Wq9DMLdf 2019-08-26T01:19:00Z reserve=1 # addr=tb14d7lx hdkeypath=m/0'/0'/117'

.....4040 lines
# End of dump

What's "hdkeypath"?
What's "reserve" ?
What's "hdseed"?
Why does "addr" sometimes have 1 address and sometimes 3 addresses?
Why does my dump have 4040 lines?
(for purposes of formatting & discretion, all addrs/keys are mangled)
This is the best I could find. It offers no detail about the output:
dumpwallet

AFAIK there isn't any documentation of dumpwallet's output. You need to read the source code to know. I suppose I can just document it here though.
The dumpwallet output contains comments. Comments are prefixed by a #. This can be found at the beginning of a line or in the middle. Anything on that line following the # is a comment and will not be parsed by importwallet. Comments are used to provide additional information to the user reading the dumpwallet output but prevent the importwallet parser from doing anything with the data in the comment.
The first 4 lines are just some extra information to the user to know which version created the dump and at what time. It includes the current clock time as well as the time and hash of the current best block.
For HD wallets, this is followed by the extended master private key.
After that, each line lists out an individual private key and some metadata about that private key. The private key will be encoded using the Wallet Import Format.
The private key will then be followed by a timestamp. This timestamp is in UTC time and is the time that the private key was created and added to the wallet.
Each private key will have one of the following metadata fields: label, hdseed, reserve, inactivehdseed, or `change.

label: This is a label assigned to one of the addresses for this private key. Since a single private key can have multiple addresses, and each of those addresses a different label, this just gets one of this labels. It's a holdover from when one private key corresponded to one address. All receiving addresses will have a label even if it does not have a label. For those addresses, the label is the empty string so you may see label= a lot.
hdseed: This private keys is the current active HD seed. You will always see this field as hdseed=1. The HD seed is a BIP 32 seed. Bitcoin Core stores this as a private key and it is therefore indistinguishable from other private keys. This HD seed is used to produce the extended master private key found earlier. It may also be used to derive many of the other private keys in this wallet. There should only be one key with hdseed=1.
reserve: This indicates that the private key is part of the keypool. You will always see this as reserve=1. The key has not been requested for use as a receiving address nor as a change address, it is in reserve in the keypool.
inactivehdseed: This private key was a HD seed previously used by the wallet but is no longer the currently active HD seed. You will always see this as inactivehdseed=1. It is the same meaning as the key with hdseed=1 except it is not currently active.
change: This key is no longer in the keypool and it's address is not a receiving address. The assumption is that such addresses are change addresses. So this key is marked as being change by having this metadata field. You will always see it as change=1.

Following the metadata, on the same line, will be a comment with some additional metadata that may be useful to the user but will not be parsed by importwallet. This will have 2 fields: addr and hdkeypath.

addr: This is a comma separate list of addresses that have been used for this private key. Since a single private key can have multiple addresses, you may see multiple addresses in this field.
hdkeypath: This is a string representing the BIP 32 derivation path for this private key. In cases where there is only one key marked as hdseed=1, you can derive this private key by using the extended master private key at the top of the file and then deriving from it the key with this derivation path. When there are multiple HD seeds in a wallet (i.e. when there are inactivehdseed=1 keys), it is not possible to know which seed this key was derived from without trying to derive from them all.

After each of the private keys is listed, you will see lines for scripts stored in the wallet. This is similar to how private keys are listed.
Each script is written out in hexadecimal. The script is then followed by a timestamp indicating the time that the script was added to the wallet. It will then be followed by script=1 to indicate that this line is for a script. Lastly there will be a comment containing an addr field. This address will be the P2SH address for this script.
At the end of the file is a comment End of dump to indicate the end of the wallet dump.

When you use dumpwallet, you should expect to see several thousand lines. This is because Bitcoin Core, by default, has a keypool of 1000 receiving keys and 1000 change keys. For a newly created wallet, there will be 2000 key lines.
If you have not imported any scripts, you should have the same number of key lines as script lines. This is because each key has a segwit script. This is an artifact of how the Bitcoin Core wallet supports segwit.
If you have imported any scripts such as multisig scripts or addresses which are not yours, then you will see those scripts in the script lines as well.


OP_RETURN data transaction Looking at Dev Update #5 and in particular the OP_RETURN data function due to be included in 0.9 release, how is data returned during the transaction?

Am I meant to create a new txout with no value and a scriptPubKey with just "OP_RETURN mydata" or is it included as part of another txout with a value and being sent to an actual address? How is the data represented when reaching the other end?

If I have asked the wrong question it could be due to my limited understanding of how scripting is meant to be used. In which case links to resources explaining this better would be appreciated.

Thanks

That is correct. You create an additional txout with value 0 and script "OP_RETURN data".


How do I retrieve the funds on my Core wallet when I can't synchronize the blockchain? I have about $200 in bitcoin but my wallet (Core) won't synchronize the blockchain (it's been doing this for days) since for some reason it got corrupted (As it tends to do say every other month) and now I'm unable to retrieve my money. I want to transfer it to a lightweight wallet so this won't happen anymore but I don't want to lose the money I have locked in there. How do I transfer this money when I can't synchronize to the current state of the blockchain?

You'll want to use bitcoin-cli to dump the priv key and import it into a lightweight wallet. Here's the command to do this in bitcoin core:

$ bitcoin-cli dumpprivkey <address that contains your coins>

This should dump out the WIF format private key.

You can import this private key into something like Mycelium which will then have access to your funds. Typically, the wallet will sweep the funds from the address containing your coins to an address controlled by Mycelium. In any case, you'll have full access to your funds after you do this, though at the cost of some miner fees (about 10 cents)


Copying .bitcoin to another system I already have a bitcoin node running over the network. Now my question is whether copying .bitcoin to another system will make a new node on that system or not?

I have seen some post where people have faced issues in doing so. If it is possible then what is the way to do so.

Problem solved. You can just copy the whole blockchain to default location i.e. /home/user_name/.bitcoin and run bitcoind and that's it. Your system will hardly take 3 4 minutes to verify and then your system will run as a full node.


How to automate bitcoin wallet to send return payments to website subscribers? When a .onion website sells subscription log-in accounts, they ask for subscription payment and say that a return payment will be received immediately after, containing the payment code for creating a user account.
For example, the subscription might cost 0.001 BTC, so if the new subscriber pays that, and she receives 0.0002713 BTC afterwards as a return payment, then the new user can create their account by entering the following fields in the registration form:

Username
Password
Payment Code: 2713

How can a bitcoin wallet even be programmed to automatically respond to incoming payments with a return payment?
and further, disguise the payment code in the return payment amount such that the form will associate a unique code to each new user (unless maybe they are just fixing the payment code to be identical for all users)

How can a bitcoin wallet even be programmed to automatically respond to incoming payments with a return payment?

What is a bitcoin wallet, exactly? It can be just about anything that is programmed to create keys, check UTXOs and build/sign transactions... A bitcoin wallet can be programmed to do just about anything.
Your question is broad... You need to program it yourself. Build a database to keep track of addresses and payment codes and whatever else then build your site to interact with your database and your wallet, or build your own wallet.


What happens when i change the encryption password of Bitcoin-Core wallet What happens when i change the encryption password of Bitcoin-Core wallet?
Is first pass lost forever , where is it saved - on the blockchain or on the wallet.dat file? What if encrypt wallet with pass1 , save wallet.dat  , than change the password and encrypt it again with pass2  -  what will happen if i input the first wallet.dat with pass1 - can i unlock the wallet ?

Bitcoin Core wallet encryption works by encrypting the private keys stored in the wallet file. The private keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase that you enter using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption.

Now, the first wallet file contains private keys that were encrypted using your original passphrase. So, if you had backed up that file before changing the passphrase, then your old passphrase will work in unlocking that wallet. Thus you can spend the funds held in your original wallet.dat file with the old password.

However, the look-ahead keypool is refreshed so that any new addresses you request after the password change are not in the old wallet with the old private keys. This means that if you don't spend your bitcoins after you change your password, anyone with a copy of the original wallet with the old password can still steal your Bitcoin if they have the old password.


Ways to buy bitcoin (I'm in the US) Possible Duplicate:
  How do you obtain bitcoins?

I just want a straightforward answer, I read a few answers but the explanations are convoluted. Where can I buy bitcoins online? Is there a site or sites? Do/can we buy them with a bank card or credit card or directly with my bank account? If not, how the hell am I supposed to get them lol

There are many sites indeed and some over the counter transaction, but for the sake of being short.

Try: Mt. Gox

You can draw money from your bank account and put it in escrow for BTC and vice-versa... It's known as the biggest bitcoin exchange over the world.


Downloaded bitcoin core and it says synchronising with network, how do I get it to download the blockchain? I downloaded Bitcoin core today, and my got an address for my friend to send me some bitcoins. He sent them, and I didn't realise I should have waited until the blockchain downloaded, and this can take some time. My problem is, at the bottom (iOS) it just says 'synchronizing with network' and that's it? The bar is empty (not green or anything) and it hasn't downloaded anything yet. Could someone please help me!! I'm extremely worried I've lost the money my friend sent :(

You have not lost the money, "synchronizing with the network" means that your Bitcoin Core is downloading the blockchain!

This may take a few hours or days depending on the computational power of your computer. If you don't need them immediately, you can just wait until the synchronization is finished which is what I would suggest that you should do.

If you are anxious to check whether the bitcoins were transferred, you can look up your address (that it was sent to) on one of the block explorers.


Is there any open source implementation of Bitcoin wallet encryption in Java? I intend to establish an efficient and secure scheme for protection of wallets. For this , I need source code that implements wallet ecryption as mentioned in https://en.bitcoin.it/wiki/Wallet_encryption

BitcoinJ is the Java open source library used by many popular wallets, including Bitcoin Wallet for Android, MultiBit, GreenAddress GreenBits, and lots more.

It supports some sort of encryption of private keys, although it may not be AES-256-CBC (but it probably is).

HD Wallets

It's worth noting that BitcoinJ was recently upgraded to support creating and using BIP32 hierarchical deterministic (HD) wallets.  This is an option, and the old method of generating separate random keys is still available.

When used in HD mode, as the wallets listed above do[1], it won't store the private keys directly, but will simply generate them on demand from the HD root seed, so it's only the HD root seed that needs to kept encrypted.  Also users are strongly encouraged to keep a paper backup of the root seed, meaning that digital backups of the encrypted key are usually not needed.

[1] MultiBit currently doesn't do it, but the in-beta-test MultiBit HD does.

Bitcoin Core Wallet

In addition, Bitcoin Core developer Jonas Schnelli is working on splitting off and replacing Bitcoin Core's backend wallet code, so you may not want to start on any major projects without coordinating with him.

One of the proposed objectives for his project---although I haven't heard his take on this---is adding HD support to the wallet code.  (In any case, HD support will likely be added as an option; at least one core dev would like to keep random-derived private keys for some applications because they've been much better studied than HD derivation.)


how to split transactions based on send and receive Json rpc bitcoin I am creating new wallet for bitcoin and want to know how we can get the separate list of send and receive transactions using JSON rpc.

I cant see any method for json rpc that give list of send and receive category

Sounds like you are looking for the listtransactions API call in combination with the category field.

First argument is for a specific account, use * to return all accounts.
2nd is how many you want to return.
3rd is if you want to skip transaction from the start.
4th argument is if you want to include watch-only addresses.

$bitcoin->listtransactions("*", 100, 0, false);

Example output (note the category field):

{
"result": [
    {
        "account": "",
        "address": "32NFcoB96ANoPnqycLH9WUd94o7bwRyq66",
        "category": "receive",
        "amount": 0.00385000,
        "label": "",
        "vout": 1,
        "confirmations": 24827,
        "blockhash": "000000000000000000250cffa73c2a08e64e53dab398ede3f38b1c30ae5c66ca",
        "blockindex": 317,
        "blocktime": 1529098309,
        "txid": "07b1d3fbc4d78d480d510264bb01bd390e81cda34dcb01e882e94adfa9355d10",
        "walletconflicts": [

        ],
        "time": 1529098115,
        "timereceived": 1529098115,
        "bip125-replaceable": "no"
    }
],
"error": null,
"id": null
}


how do I get list of all "used" addresses in bitcoinj Bitcoinj generates receiving addresses on demand and change addresses after each transaction. So how do I list all receiving addresses ? I guess I have to deal with KeyChainGroup and BasicKeyChain. I know how to get all issued receive keys

wallet.getActiveKeyChain().getIssuedReceiveKeys();

but cannot find change keys. So where is getIssuedChangeKeys() method or if there is not such method whta is the reason. I'm trying to imagine how recovery would work if the wallet is restored from seed.

This seems to get change addresses:

public List<String> getChangeAddresses() {
    List<String> ret = new ArrayList<>();
    int issuedKeys = wallet.getActiveKeyChain().getIssuedInternalKeys();

    for (int i = 0; i < issuedKeys; i++) {
        ChildNumber childNumber = new ChildNumber(i, false);
        List<ChildNumber> childNumbers = new ArrayList<>();
        childNumbers.add(ChildNumber.ZERO_HARDENED);
        childNumbers.add(ChildNumber.ONE);
        childNumbers.add(childNumber);
        ECKey key = wallet.getKeyByPath(childNumbers);
        ret.add(new Address(params, key.getPubKeyHash()).toBase58());
    }
    return ret;
}


Help! Unconfirmed transaction for the past 12 hours! I am a noob in the bitcoin world, I made a transfer of 0.0577201 BTC , with a transaction fee of 0.000221 BTC,  but the transaction has not yet been confirmed. Please help me! Here is the link for the transaction: https://blockchain.info/tx/72b2b1191693f5d916daf899ef6e43171599b065779e394fc7096c8fc5262091

There is currently a backlog of about 69,000 unconfirmed Bitcoin transactions and only the transactions with the highest fees will be confirmed until the backlog clears.

  Please help me!

For similar situations going forward, you have a few options:

Submit your transaction to the ViaBTC Transaction Accelerator
If you control either of the receiving addresses, send a new transaction from one of them with a much larger fee, encouraging a miner to pick up the whole chain of transactions (Child-Pays-For-Parent).
Wait. The transaction should be either confirmed or removed from the memory pool within about 72 hours.

21.co has a good fee estimator for future transactions.


Applying blockchain in telemedicine app involving 'video sessions with doctors' for more transparency PS: there was no 'Blockchain' community so I'm posting the question here.

Hi,

I am very new to blockchain but understand the basic underlying concept of blockchain. I can understand application of blockchain for supply-chain in ensuring transparency and maintaining quality of the product from manufacturing till customer acquisition.

Now consider an app, can be web app or mobile app, that screens the doctors to get them on the app, then customers can choose the doctors according to the illness they are facing and audio/video call to them to diagnose and write prescriptions.

My question is, do you think there is a considerable need for blockchain to enhance transparency- means a doctor who was screened at beginning is the same doctor treating you and that the medicine that was prescribed is the same medicine that patients gets ? So every event is recorded in a distributed database which is decentralized and that makes it much harder to introduce fraud into the system.

Or there is simply no need of it because its already digitized to an extent that we can ensure these basic points above without the use of preserving tokens at every step.

Let me know if anyone needs more info on this.

Eagerly waiting for a response !

Thanks

I think this topic is a bit off, as this is a developer oriented forum.
A better forum might be bitcointalk.org.

But sometimes we have to think outside the box :-) To re-create the link to dev and crypto: it might make sense to think about a "colored" coin (medcoin ?), that allows to pay for medical services. Thinking about the insurance in the background, using (Bitcoin's) smart contracts, one could really innovate the extremely expensive medical system (can only speak for Europe). And lightning would allow us to pay per pill! Or per minutes of consultancy.

If I get it right, you are trying to put a reputation system up and running, by bringing everything into blockchain, to be fraud proof. Sounds a bit like an overkill, as Pieter already mentioned.

I can see the benefits for transparency, and some disadvantages (from a socio-political point of view). There is the point of data protection, which plays a vital role in Europe. And certainly you don't want everyone to know, that the doctor gave you medicaments, which may have bad reputation for you (aka Viagra or similar).
And then, the link between a doctor and a patient is - a bit delicate. On the one hand side you need to have trust, and on the other hand side you pay... Introducing a control instance, I don't know what will it do to doctors. Would they be willing to support?

The idea is a bit too fresh and new, challenges us, needs to get some more thoughts spent on, and then be developed into the proper direction. My two cents...


Data for market depth over time? I'd like to create a 3d representation of the market depth graph (of BTC/USD) over time. (the graph here https://www.bitstamp.net/market/order_book/) I think it would provide a nice representation of buy/sell walls and price (the trough in the middle) over time. Where can I download this data? A list of all trades won't work, but open orders over time would.

You can't, but you could do something similar.

To start off with there isnt a single set of order books for BTC/USD, because there are dozens of exchanges each with their own set of books. Aggregating all of data from all the exchanges in to a single order book isnt going to work due to the pricing differentials (arbitrage opportunities) across the exchanges.

If you wanted to do this for a single exchange (such as BitStamp) you'd need to write script (or program) to download all of this data from their API (or scrape it from the HTML), and insert it in to a database. However this would only give you data from the present forward. If you wanted historical data, you'd have to find someone who is actively running a bot, and try to purchase the data from them. Try asking around on BitCoinTalk.org, or you could ask the exchanges themselves if they'd be willing to sell you this data.

Also something you should be aware of, in my experience writing my own trading bot, i've noticed that some open orders exist for a very short amount of time (< 1 second). So if you're going to write your own bot, keep this in mind. Also keep in mind that most exchanges use CDNs to prevent DDoS attacks, and will actively throttle your bot if you send too many requests per second. If you're clever you can evade the CDN throttling, and send enough requests per second to observe those short lived orders.

And how to create this in to a moving 3D graph? I have no idea. You could always write your own program, but for something like this i'm sure there is already a product out there than can do it.


What would be a rational subkey depth to use so that my address is infeasible to locate via a systematic search? Using pycoin.

ku <ext_pri_key> -s 1/4/6/2/8/4/2/5.......

How many levels deep into the tree would I need to go (using only single digits) before it would be infeasible for an attacker to find it using a systematic search.

Twenty levels deep I thought would be adequate:

10**20 = 100000000000000000000

I know there are more effictive ways to obscure your address but I'm interested in this particular use case.

Thanks.

It's a bit strange to use single digits for the entire HD path since the BIP32 spec allows you to pick numbers up to 2^31 (non-hardened). BIP32 key derivation is largely using SHA512. Current ASICS for SHA256 can calculate about 10 trillion SHA256's per second, so about 160 quintillion hash operations in about 6 months. Assuming an ASIC can be built with roughly the same hashing power, you would need to go about 20 levels deep to force a machine like that to find your address in about 6 months. Of course, more machines mean faster cracking.

A far simpler solution would be to use the entire space of each level instead of just 10. 3 levels then would be plenty (~10^28)


Are high-s ECDSA signatures forbidden in segwit witnesses? I must have looked that up five times by now, but did segwit actually forbid high-s ECDSA signatures in witnesses, esp. in standard single-sig constructions such as P2SH-P2WPKH or P2WPKH? Or are high-s signatures still only non-standard even in segwit inputs?
(I'm aware that the transaction malleability problem due to low-s/high-s is mitigated by moving the signature into the witness, that's not my question.)


Hash-based crypto-currencies? What are the most famous crypto-currencies which use repeated hashes as proof-of-work?

What are the other proof-of-work methods?

repeated hashes? most of them use just two repeats.

There are not many other, the vast majority just use two calls to some cryptographic hash function. But a primecoin and cuckoo hash cycle has been suggested. Primecoin arguably searches for some sequence of prime numbers, yet the utility of the result is questionable. On the orher hand the cucoo cycles in hash tables weren't implemented in a practical crypto coin.


Why can't Dwolla send to Mt Gox? I received the following after trying to make a USD deposit to Mt. Gox from Dwolla today.  Does anyone know more information about this or if the court order may apply to other methods of deposit/withdraw?

  As of 12:13 PM on 5/14/2013:

  You’re receiving this notice because our systems have indicated that
  you’ve processed and completed a real-time Dwolla-to-Dwolla payment to
  Mutum Sigillum LLC (“Mt. Gox”) within the last 24 hours.

  Due to recent court orders received from the Department of Homeland
  Security and U.S. District Court for the District of Maryland, Dwolla
  is no longer legally able to service Mutum Sigillum LLC’s account.

  This is a courtesy email encouraging you to follow up on any
  uncompleted orders with Mutum Sigillum LLC as Dwolla is now unable to
  move money to and from Mutum Sigillum LLC’s Dwolla account.

  Dwolla is not party to this matter nor does it have any information or
  further insight into the situation. We strongly encourages those with
  questions to contact Mutum Sigillum LLC

  Note: Dwolla requires a court order before honoring requests such as
  seizing funds or revoking access to an account.

  On behalf of Dwolla, we apologize for this inconvenience.

UPDATE:

Here's what I got back thus far after contacting Mt. Gox to ask about the situation. Looks like they will make a formal announcement about it:

  Hello,

  Thank you for the email. We can see that the Dwolla transactions are
  not getting processed right now. We will contact Dwolla and post an
  announcement regarding this. Your patience is appreciated till then.

  Thanks, MtGox.com Team

Update 2:

The balance that I transferred in on the morning of 05/14 was added to my MtGox account that evening, so it appears they are still honoring the transfers that went through before the lockdown.

Update 3:

Here's the current statement from Mt. Gox (still waiting for the real reason for the court order):

  TOKYO - JAPAN - May 15, 2013

  MtGox has read on the Internet that the United States Department of Homeland Security had a court order and/or warrant issued from the United States District Court in Maryland which it served upon the Dwolla mobile payment service with respect to accounts used for trading with MtGox. MtGox takes this information seriously. However, as of this time MtGox has not been provided with a copy of the court order and/or warrant and does not know its scope and/or the reasons for its issuance. MtGox is investigating and will provide further reports when additional information becomes known.

  Regards
  Mt.Gox Co. Ltd Team.

Mutum Sigillum LLC was the legal entity that Mt. Gox used for transferring funds using account-to-account transfers and for adding to (and withdrawing from) their account using bank funds.

Mutum Sigillum LLC is not registered as a money transmitter in any states.

It may not even be registered as a Money Service Business (MSB) through FinCEN.

FinCEN provided guidance that those exchanging "virtual currencies" (which they misapply, but intend to refer also to Bitcoin) for dollars are money transmitters and required to register.

This action by the DHS may be related to that.

Or it could be related to the Bitcoinica lawsuit in which Mt. Gox is holding funds of Bitcoinica customers that the court-appointed liquidator in New Zealand has requested access to.

Or it could be related to any number of additional factors, including a single illicit transaction in which the funds traveled through Mt. Gox, who knows.


How to get all income transactions of an address? I want to get list of all address's income transactions since the genesis block

import requests, json

rpcPort = 8332
rpcUser = '[removed]'
rpcPassword = '[removed]'

#Accessing the RPC local server
serverURL = 'http://' + rpcUser + ':' + rpcPassword + '@localhost:' + str(rpcPort)

headers = {'content-type': 'application/json'}
payload = json.dumps({"method": 'listunspent', "params": [0, 999999, ['1KuWLoZuoJgz3N6sLoAwGth9XGm8YuFTGt']], "jsonrpc": "2.0"})
response = requests.post(serverURL, headers=headers, data=payload)
print(response.text)

it returns

{"result":[],"error":null,"id":null}

But according to https://blockchain.info/address/1KuWLoZuoJgz3N6sLoAwGth9XGm8YuFTGt there are a lot of transactions. How to get list of address-related transactions without private key? Can I add address not owned by me to local account to achieve transactions by getreceivedbyaddress command?

Can I add address not owned by me to local account to achieve transactions by getreceivedbyaddress command?

No, bitcoind only keeps track of transactions related to your wallet, not all transactions. So to do this, you can add a specific address as a watch only address to your wallet if you don't have the private key, and then rescan to find relevant transactions for it, but that will usually take a while.


Whether coldcoinbitcoin.com or some other, possible to save our private key? I don't have wallet yet, so I do googling about it, and found that cold wallet is more secure than hot wallet, one of example of cold wallet I found is coldcoinbitcoin.com

And I think about how they can print our private keys, if they can print our private keys that means, they are possible to save them? is not that can be dangerous for our assets?

They appear to simply be offering a physical coin stamped with the Bitcoin logo. Moreover, it appears that the private key is generated by them, which means that nothing prevents them from keeping a copy.

You are far better off sticking to trusted hardware wallets such as Ledgers and Trezors. Never trust any service that has the possibility of keeping your keys accessible to themselves (obvious exceptions like custodial accounts on exchanges apply).


How is a “reward” encoded in a block? If a miner creates a block including an appropriate hash value, then he sends it to all nodes, and each node verifies if this is correct or not and add it to the previous block chain if this is chosen to be a correct one.

I read here that after 100 more blocks are added to the previous block chain (actually it is written that after 100 depths, but I think this means what I am saying here), a miner gets rewarded.

When a block is created, a miner puts informations like “I take 0.05BTC from transaction A for the mining fee” to get transaction fees. However, as far as I know, a miner get 12.5BTC newly created bitcoins in addition. How does a miner put this information in a block?

Both the block reward and the fees are collected via a "coinbase transaction", which is the first transaction in the block.  It has no inputs, and the total value of its outputs is allowed to equal the sum of the block reward plus all the fees from the block.  The miner can then set the outputs of this transaction to pay the total to their own address(es).

In particular, it is not necessary for the miner to explicitly list which fees are being collected from which transactions.  It's assumed that all fees from all transactions in the block can be collected, so this determines the allowable amount for the coinbase transaction.

The "after 100 blocks" rule is enforced by requiring that none of the next 100 blocks is allowed to contain a transaction which spends this block's coinbase transaction.  I guess it's a matter of semantics whether the reward "happens" with this block or 100 blocks later.


Running bitcoin node with already verified blockchain I'm following this guide https://stadicus.github.io/RaspiBolt/ to setup a bitcoin full node on my new raspberry pi.

I already downloaded and verified the blockchain on my host machine. I also pruned it (6GB) so it can fit on my microSD card. I moved the blocks and chainstate folders to ~/.bitcoin on my raspberry. But when I run the bitcoind service with the same bitcoin.conf file proposed on the guide, the verificationprogress shows that it starts from 0.

I've tried with these options too:

prune=6000
reindex=1
reindex-chainstate=1

But none of them make the progress to be completed. I also tried waiting some minutes in order to see if the progress completes faster but that's not the case. What options do I need?

I've found it. I've removed testnet=1 and now it's fully verified. reindex* options are not necessary.

Huh, I had verified the blockchain from main net. I didn't know the testnet was using a separate blockchain?


Mining 0 fee transactions If a miner is payed per block found, why not scrape the bottom of the barrel and full up blocks with 0 fee transactions? You would still be getting coins for blocks found just not the fees. The bonus would be no competition on finding blocks. Win/win for everyone...

Because fees + 12.5 BTC > 0 + 12.5 BTC. It is a lose for the miner because they could have picked transactions that would have paid them more.


Security of Bitcoin Wallet I have a doubt on Bitcoin wallet. Suppose I have an online Bitcoin wallet. Now, someone breaks into my computer and steals my Bitcoin wallet. Fortunately I have a
backup of my wallet on another computer. Now, What determines who has the bitcoins now?

Suppose I have an online Bitcoin wallet. Now, someone breaks into my computer and steals my Bitcoin wallet.

It is generally not recommended to store Bitcoin in any online wallet or exchange. Mostly because it is unlikely that you are in full control of your private keys. In the event the website is compromised, hacked, or you become victim of some sort of man-in-the-middle attack, you are at risk of losing your funds. This is especially true if the service is poorly managed (Mt. Gox had a similar fate).

  Fortunately I have a backup of my wallet on another computer. Now, What determines who has the bitcoins now?

Anyone who obtains your private key(s) have full control of your funds. The only variable in this case is time (who can spend the funds faster). If you are even slightly concerned your keys may have been stolen but have not yet been spent, you should defiantly move them out of that wallet and into a freshly generated one.


How much data is transferred using Andreas Schildbach's Bitcoin Wallet Android app? After installing the app, a message appeared on my phone saying there were 83 weeks of data to synchronise. How much data is involved in this process? I don't want to exceed the data limit for my phone.

Also, 14 peers appear to be connected. While the app remains open in the background, how much data does connecting to peers require over time?

A comment against the app in the Play store says:

  During the last 4 weeks, Bitcoin Wallet has consumed 166 MB of my data
  plan, 160 MB of which was running in the background. I am pretty sure
  that I had once set it to only transfer data in background when Wifi
  is on and it had been running smoothly like that for about 1 year. For
  now, I turned of "Sync on Power" and I hope this helps for now. But I
  think you should re-introduce the "background sync only on wifi"
  setting.

That gives some idea of the quantities of data, but it doesn't split it into what's required for the initial synch and the ongoing connection, so my question still applies.

Since January 14 on my Galaxy Nexus, Bitcoin Wallet for Android has used 120 bytes of mobile data. It's used approximately 160 MB of data on WiFi in the same period. One month cycle earlier, it used 463 KB of mobile data, and approximately 113 MB on WiFi. I plug it in every night and whenever I'm in my car.

I can't answer for the amount of data necessary for the initial synchronization, other than advise you to do it on WiFi for both speed and data limit reasons.


Would bitcoin be destroyed if a wealthy organization obtained a CPU majority for a sustained period? Inspired by this question ("Could bitcoin be destroyed by an entity cornering the market?") and the top comment on this answer to this question ("How much would it cost to execute a 51% attack?").

The United States government hates currencies competing with its own, so it may at some point have great motivation to destroy bitcoin.

Answers to the first question show that the government couldn't destroy bitcoin by cornering the market. Answers to the second question show that it would be very expensive for an individual to sustain a 51% attack.

However, the top comment on the referenced answer reads:

  A related point is: why bother mounting such an attack? If you were
  indeed successful and started building your own block chain, then
  confidence in Bitcoin would plummet and investors would sell out their
  positions (assuming their positions could be sold out). The price
  would drop through the floor and the value of your exploit would be
  reduced to nothing.

Given the upvotes on this comment, many appear to agree that a sustained 51% would plummet bitcoin values. This would lead to extreme distrust, and possible collapse, of the system.

But $16.35M + $84k / day is likely spare change for some branches of the U.S. government. If the U.S. sustained a 51% attack almost indefinitely, would this destroy bitcoin? For them, the value of their exploit would hardly "be reduced to nothing", instead it could possibly save their inflationary currency.

One might even say the 51% attack investment would pay itself off with the amount of inflationary income they could generate given the downfall of bitcoin.

This same scenario may apply to any wealthy organization. One could bet on bitcoin falling and then apply this attack for profit. The IMF or a different government could have reason to attack Bitcoin.

One of the questions you linked to has the wrong chosen answer— Bitcoin can also be destroyed by a sufficiently deep pocketed attacker which corners sufficient marketshare of coins to enable causing debilitating volatility. Probably won't require any where near majority share to create volatility. I added my claim at that question.

Yes Bitcoin can also be destroyed if an attacker cornered sufficient Proof-of-Work to disrupt the system. Even if developers release new protocols after the attack, there will be chaos as to which fork to trust and reputation will be shattered.

Might not even require 51%, as the minority share attacker could cause many transactions to be randomly delayed, which is also potentially debilitating to a currency.

As the prior answer points out, one the keys to hardening a P2P currency is to make the Proof-of-Work more difficult to corner. But that alone is not sufficient, as the volatility of the value is another attack vector. I am contemplating solutions to harden against both classes of vulnerabilities.

Bitcoin might even be attackable simply by talking and enumerating the flaws in it. We could see a crash at any time if enough people become concerned. So public opinion is another attack vector.


What does -server option do? What does the -server option do in bitcoin node? https://en.bitcoin.it/wiki/Running_Bitcoin says 'Accept command line and JSON-RPC commands'. However I can't see any difference whatsoever. In both cases I'm able to curl my request as well as use the cli.

As stated by the help,

  -server
       Accept command line and JSON-RPC commands

You may however also have to check if this configuration parameter has been enabled by your local configuration, usually a file called bitcoin.conf, unless configured using the -conf parameter to bitcoind.

On linux builds, this should default to ~/.bitcoin/bitcoin.conf, on Mac OS X ~/Library/Application\ Support/Bitcoin/bitcoin.conf

In this file, you can explicitly configure the server as off using the server configuration parameter.

server=0

You can alternatively pass a parameter as 1 (enabled) or 0 (disabled)

bitcoind -server=0

You should not be able to access your server assuming this has been toggled to 0.

The headless daemon bitcoind has the JSON-RPC API enabled by default, the GUI bitcoin-qt has it disabled by default.


What software and skills do I need? Never having owned bitcoins I don't know how bitcoin wallets work and I'm wondering: if I buy bitcoins, what will I need to know about the software involved, and where should I keep my bitcoin wallet?  I have a home computer and I have a Google account.  Can the latter be used?  What security issues are involved?  If I'm travelling and far from home, how would I have access to my bitcoins?

if I buy bitcoins, what will I need to know about the software involved?

You don't have to know anything really, if you don't want to.

  and where should I keep my bitcoin wallet?

If you don't want to learn about the software or how to keep your wallet secure you should try to find the most reputable e-wallet and keep your money there. People will have different opinions on which one is the safest so have a look around, read forum threads, use something that is well established. MtGox is one option that is well established and is also the exchange with the highest volume.

  I have a home computer and I have a Google account. Can the latter be used?

If you don't want to use an e-wallet you could download the official client from bitcoin.org and store your money in its wallet. Your money is then stored in a file on your computer. You could use your Google account to backup that file (your wallet). That would basically mean that the same money is stored in two places - on your own computer, and in your Google account.

  What security issues are involved?

If you choose the option of downloading the client it means that anyone who gets ahold of your wallet file can spend your money. If you have uploaded the wallet to your Google account that simply means that there are two places to rob you. It would be enough for the thief to get it either from your home computer or from your Google account.

There is an option in the client to encrypt the wallet using a password. That way anyone who gets ahold of your wallet file can't use your money unless they also know your password. Things to keep in mind here is that if you have some malware on your computer it is possible that it could sniff that password as you type it and then the encryption won't help you. Also, if you forget your password your money is gone. There is no way to recover it.

  If I'm travelling and far from home, how would I have access to my bitcoins?

Then the simplest way would be to use the e-wallet option.


API where i can get min and max price daily, going back months/years I'm looking for an API service, where i can get historical data.
Something like: for each date:

max price & time of day
min price & time of day

Is there any service that provides this?

Yes, but they are paid. Take a look at https://bitcoinaverage.com/ and https://coinmarketcap.com/ which are the big 2 services for this.


How do I determine whether an input or output is segwit? I'm trying to go through the transactions in a block and determine how many segwit inputs or outputs there are.

I've noticed in getrawtransaction that segwit inputs seem to have a 'txinwitness' field. Is that a good way to classify them?

For outputs I know I can't just look at the 3* address because not all p2sh are segwit. So what's the best way there?

EDIT:
I just found this page about 3* addresses. Difference between a SegWit address and a P2SH address

Am I correct in interpreting this to say that you can't determine whether an output is segwit? Only an input?

I'm trying to go through the transactions in a block and determine how
  many segwit inputs or outputs there are.

BIP141 defines a segwit tx marker and a flag at the beginning of a transaction. So if you decompose such a tx, you would see with the flag, if there is SegWit:

raw tx is: ### raw tx is this:
01000000000102FFF7F7881A8099AFA6940D42D1E7F6362BEC38171EA3EDF433541DB4E4AD969F000000004948
30450221008B9D1DC26BA6A9CB62127B02742FA9D754CD3BEBF337F7A55D114C8E5CDD30BE022040529B194BA3
F9281A99F2B1C0A19C0489BC22EDE944CCF4ECBAB4CC618EF3ED01EEFFFFFFEF51E1B804CC89D182D279655C3A
A89E815B1B309FE287D9B2B55D57B90EC68A0100000000FFFFFFFF02202CB206000000001976A9148280B37DF3
78DB99F66F85C95A783A76AC7A6D5988AC9093510D000000001976A9143BDE42DBEE7E4DBE6A21B2D50CE2F016
7FAA815988AC000247304402203609E17B84F6A7D30C80BFA610B5B4542F32A8A0D5447A12FB1366D7F01CC44A
0220573A954C4518331561406F90300E8F3358F51928D43C212A8CAED02DE67EEBEE0121025476C2E83188368D
A1FF3E292E7ACAFCDB3566BB0AD253F62FC70F07AEEE635711000000

VERSION
 01000000

SEGWIT (BIP141): this is a segwit tx, marker=00
       (BIP141): flag=01

TX_IN COUNT [var_int]: hex=02, decimal=2
 TX_IN[0]
  TX_IN[0]       9F96ADE4B41D5433F4EDA31E1738EC2B36F6E7D1420D94A6AF99801A88F7F7FF
  TX_IN[0] hex=00000000, reversed=00000000, decimal=0
  TX_IN[0] Script Length hex=49, decimal=73
  TX_IN[0] Script Sig 4830450221008B9D1DC26BA6A9CB62127B02742FA9D754CD3BEBF337F7A55D114C8E5CDD30BE022040529B19
4BA3F9281A99F2B1C0A19C0489BC22EDE944CCF4ECBAB4CC618EF3ED01
  TX_IN[0] Sequence (uint32_t)
  EEFFFFFF
 TX_IN[1]
  TX_IN[1] 8AC60EB9575DB5B2D987E29F301B5B819EA83A5C6579D282D189CC04B8E151EF
  TX_IN[1] OutPoint index hex=01000000, reversed=00000001, decimal=1
  TX_IN[1] Script Length hex=00, decimal=0
  TX_IN[1] Sequence FFFFFFFF

TX_OUT COUNT, hex=02, decimal=2
 TX_OUT[0]
 ...

WITNESS TXIN[0] stack elements: hex=00, decimal=0
WITNESS TXIN[1] stack elements: hex=02, decimal=2
 WITNESS data[0]:
  47304402203609E17B84F6A7D30C80BFA610B5B4542F32A8A0D5447A12FB1366D7F01CC44A0220573A954C4518331561406F90300E8F3358F51928D43C212A8CAED02DE67EEBEE01
 WITNESS data[1]:
  21025476C2E83188368DA1FF3E292E7ACAFCDB3566BB0AD253F62FC70F07AEEE6357

 LOCK_TIME
11000000

As this is a tx with two inputs, the first input is non segwit (hence a signature in the V_IN part), the second input is segwit (Script Length = 0), and the witness for second input is added at the end of the tx.

  Am I correct in interpreting this to say that you can't determine
  whether an output is segwit? Only an input?

With P2SH, you take an original set of data, and run it through a hash function. As the hash function is not reversible (to today's knowledge), you cannot know, what is inside a P2SH. Usual use cases are for example multisig transactions. But it can be other things as well, and only if the spending transaction is in the blockchain, you can see, what was previously inside. So this adds a certain layer of privacy for the time between funding the tx and spending the tx.


Mining costs, impact on long term viability of BTC Given the rapidly rising difficulty level and electricity consumption/$30 cost per transaction, is the protocol sustainable as-is, and if not what is most likely to happen in the evolution of BTC.

As Bitcoin expands there will be much greater numbers of transactions while the cost of maintaining the network will remain relatively constant, if not decrease, as power-inefficient GPUs and higher consumption ASICs are replaced by more efficient ASICs. The cost per transaction will thus drop.

Also, keep in mind that it isn't replacing nothing, it's replacing centralized accounting which has a significant cost per transaction.


Is ASIC Bitcoin Mining Profitable? I’m pretty well versed in Bitcoin trading but am really new to Bitcoin mining. I hear a lot of conflicting views regarding the profitability you can achieve with Bitcoin mining. I was wondering if I’m better off mining Bitcoins or to try and look into mining other crypto currencies such as Dogecoin or Litecoin.

This question has been asked before here and here but this was a long time ago before the difficulty leaped in November of 2013. Bitcoin mining is getting more and more difficult as time progresses. This is because the Bitocin protocol is designed in a way that the mining difficulty increases as the network’s hash rate increases - This chart shows Bitcoin difficulty over time. Hash rate is the computing rate of the system - so the more miners come aboard, the higher the difficulty for mining Bitocins - This chart shows the network’s Hash Rate.

Today if you want to mine Bitcoins you will probably need to join a pool of miners working together in order to compete with this difficulty. For a detailed explanation look here.
If you want to calculate exactly how much you can make with Bitcoin mining use a mining profitability calculator like this one. From my own experience I can say that using the most powerful home-made miner you can make a few hundred bucks per month which usually would barely cover electricity cost. Here’s a real live example from a guy on Reddit.

One more option to mine would be CEX.IO which is a cloud mining service where you basically buy mining capabilities without the hassle of operating your own miner. I haven’t tried it myself so I can’t recommend it.

If you want to mine Bitcoins today it will probably be purely for hobby or ideology. You can however try mining altcoins and then exchange them for Bitcoins. The problem is that there are so many altcoins it may sometimes be hard to know which one is worth wasting the time on. This chart shows you some sort of a mining profitability indicator for different altcoins. So even though you may have “missed the bus” on Bitcoin mining you can still try to mine altcoins.


Is there a reason pooled miners should revert to 0.7 due to the fork? Can miners who mine in a pool ignore the request to revert their bitcoind to 0.7, and stay with 0.8? As far as I know, it's the pool that counts in this case.

(Except P2Pool, which behaves a bit differently)

Miners who use a pool don't necessarily even have bitcoind. They use separate mining software (which does not constitute a node, or build blocks or anything of the sort) and the bitcoins they receive are first credited to the pool eWallet, and can then be withdrawn to any wallet.

The pool is the one choosing the blocks and even if the miner's wallet happens to be bitcoind it has no influence on this process. So there is no reason to downgrade.


Sending multiple output transaction with total output exceed the total input value I am still confused about whether it is still a valid transaction for multiple output transactions if the total output of the transaction exceeds the amount of total input.
For example, there are two inputs in Bitcoin transactions, one having a value of 1.5BTC and one
of 0.75BTC, and two outputs, one with a value of 1.3BTC and one of 1.25BT.
Is this a valid transaction? And how about the transaction fee? Because one output is still less than the size of some of the input or the total input.

No, it is not. The individual values of the inputs and outputs don't matter, only the sum matters. So the sum of the inputs is compared against the sum of the outputs. And since the sum of the outputs is greater than the sum of the inputs, the transaction is invalid.
Bitcoin does not take Bitcoin from particular inputs and map it to a particular output. Instead it's like all inputs in the transaction get mixed together, and then that total amount is split out into outputs and fees. So only the sum matters.


p2pool manual difficulty I'd like to experiment with different minimum difficulty settings for my p2pool miners to see if I can get more shares per block. Does anyone have a formula or any recommendations for a minimum difficulty level, based on the GH/s available and the current share difficulty?

I ended up forking p2pool and applying an adaptive difficulty patch.

My fork:
https://github.com/jramos/p2pool

Adaptive difficulty patch: https://github.com/jramos/p2pool/commit/e44dc19dada6a346628d838fa9261cd1872f493e

I'll post results of adaptive vs. non-adaptive on the fork's README page when I have a better sample.


can I use same wallet/private keys twice can i use the seed words of my online blockchain.info wallet on a trezor so i create a trezor wallet which has the same private keys as my blockchain.info wallet?And in the future i will only use my trezor wallet for transactions: I will let the blockchain.info unused.

Yes, both Blockchain and Trezor use BIP 39 standard seeds to generate the keys. Keep in mind that if you eventually stop using blockchain, it will still have access to all private keys used on the Trezor still, so it must remain secured, you can't just forget about it.


How to interpret Mt Gox Live orders chart How does one read and interpret the data on the MtGoxLive/Orders chart?

The axes have units.  The new help link at the bottom does not have much information.

It's essentially a market depth chart, with the orange/brown line on the left representing the (cumulative) volume of standing buy orders and the blue line representing the (cumulative) volume of standing sell orders. The y-axis represents an amount of BTC and the x-axis represents a given buy/sell price in USD. The green line represents recent historical price shifts in that value.

At the top right are large numbers representing the current, high and low prices for the day. From the "Help / Options" menu at the bottom right, several additional options are available including the ability to show volume as lighter or darker shades of green on the price line and the ability to disable the gray ghostlines which appear every time the volume curve shifts. This Help/Options dialog also contains the following helpful instructions:

  This is a cumulative graph of the outstanding orders on the MtGox
  exchange. It shows how much BTC/USD will have to be bought/sold before
  the market rate hits a certain USD price. For example, let's say you
  want to know how much USD would have to be spent buying BTC before the
  price reaches 40 USD. First find 40.0 on the bottom axis. Then find
  where the blue line intersects $40.0. Now find what value that
  corresponds to on the right axis. If it corresponds to $200000 then
  that's how much USD would have to be spent buying BTC before the price
  reached 40 USD.


What temperature should a USB ASIC Miner have while running? What is the maximum temperature a USB miner should be running at? Mine are at about 60°C/150°F.

If this graphic is true, the miner's PCB should run at around 125°F (51°C)

However, If reviews are to be believed, you shouldn't run it at all.


Why isn't my PSBT considered complete after walletprocesspsbt and finalizepsbt? I created a transaction using createrawtransaction spending a UTXO that I own the keys to and then converted it to PSBT using converttopsbt, then I used walletprocesspsbt and finalizepsbt. After finalizepsbt, my "complete" value is false.
Is there a way to get more details on why it's not considered completed?
Thanks,
Francois

To get more details about the next steps for a PSBT, you can use the analyzepsbt RPC. Additionally, decodepsbt will tell you what information is in a PSBT so you can use that to inspect the PSBT to learn what is missing.


Low fee set by client Hello I am using an old BitCoin client named MultiBit v.0.5.18. There is no option to change a fee. My transactions that I was send two days ago still in 'Unconfirmed status' and I guess here is a problem because I cannot move money from this wallet and may will never can do it.

The wallet set the default fee to 44.843 sat/B. It is lower for current time. I see the middle fee is 220 sat/b for now from https://bitcoinfees.21.co/.

How can I solve the problem? Is it possible to open wallet through another client? Electrum for example. Or I should wait when fees will go down (if not?).

A transaction with 44.8 sat/B should probably confirm most weekends, the fees had been dropping down to 5-10 in the last weekends. Sometimes even 1 sat/B transactions confirmed. This weekend the mempool seems pretty full, though.

AFAIK, MultiBit has an option to export private keys. However, MultiBit uses compressed private keys, while Electrum uses uncompressed private keys. Bitcoin Core understands either, so if you don't want to wait for the transaction to confirm, you could install Bitcoin Core to doublespend them. This comes with a wait time though, as you'd have to wait for Bitcoin Core to synchronize with the Bitcoin network which can take a few days. If you're time-pressed, I think Blockchain.info does allow importing keys also, although I would just use it then to send your money to electrum, so that you only relinquish control of your own funds as briefly as possible.


Why are there fees for arbitrage trading and wallet transfers? Deciding which exchange to buy BTC from (and sell at a future date) I wondered if I could choose one with the best fees for buying and a separate one with the best fees for selling and if this is even allowed.
It is as I read in other threads but there seemed to be a fee for this type of operation. I thought when you bought BTC from an exchange it would be exactly the same BTC (not a wrapper instrument) as if you bought it from any other exchange. How could there be extra fees if the exchanges themselves can't tell where the BTC in your wallet came from?
I also struggle to understand why there would be fees to transfer BTC from one wallet to another. A wallet AFAIK just stores private keys, anyone in possession of those keys (like yourself) could just register in another wallet and use that private key to transfer the BTC to your second wallet. I'm sure there's a hole in my reasoning somewhere.

Deciding which exchange to buy BTC from (and sell at a future date) I wondered if I could choose one with the best fees for buying and a separate one with the best fees for selling and if this is even allowed.

Sure, but you'll have to use the blockchain to transfer the bitcoin from one exchange to the other.

It is as I read in other threads but there seemed to be a fee for this type of operation. I thought when you bought BTC from an exchange it would be exactly the same BTC (not a wrapper instrument) as if you bought it from any other exchange. How could there be extra fees if the exchanges themselves can't tell where the BTC in your wallet came from?

There's a fee for executing a transaction on the blockchain. Exchanges typically impose this as a "withdrawal" fee. They don't care where you're withdrawing from or where your deposits come from. But those transactions do have a fee associated with them.

I also struggle to understand why there would be fees to transfer BTC from one wallet to another. A wallet AFAIK just stores private keys, anyone in possession of those keys (like yourself) could just register in another wallet and use that private key to transfer the BTC to your second wallet. I'm sure there's a hole in my reasoning somewhere.

Right, so to transfer the bitcoin from one wallet to another wallet, the private key that authorizes their transfer has to be changed from one custodied by one wallet to one custodied by the other wallet. Only the blockchain can do that.
It is impossible for an exchange to assign separate private keys to every user to minimize fees. In fact, such a setup would maximize fees because every transfer of bitcoin balances between users on the same exchange would result in a blockchain transfer.
For example, say I deposit one bitcoin, then sell it to Alice who sells it to Bob who then sells it to Charlie. If the private key securing that bitcoin had to change each time, then each of these exchanges would require processing a transaction on the bitcoin blockchain. That would be much more expensive than executing blockchain transactions only on withdrawals.


I transferred BCC to Bitcoin Core I bought BitcoinCash. I sent this to a BitcoinCore address. Is this okay? I'm still syncing. I'm a little afraid I've lost my BCC. Who knows the answer? And possibly a solution?

Addresses/keys formats are the same and behave the same.  If you have the private key for the destination address then you still have access to the funds, regardless of if it's BTC or BCH.

The issue is if you send BTC to a BCH address (or vice versa) that you don't own (e.g. transferring to an exchange) since the exchange won't look for the tx on the chain you claimed to have sent it on.


Bitcoin's cryptographic protocol allows for leakage of information about one's Private Key, making recalculation of the private key possible? Is it true that the cryptography which is used in bitcoin allows for leakage of information which could be used to recalculate the private key - IF you are continuously reusing the same public address for transactions?
I think there were faulty client implementations in the past which have mishandled the protocol and leaked the keys when reusing same address.
If that is correct, is it possible to make any kind of mathematical assumption, how many times of reusing the same address could practically enable the reengineering of the private key?

After how many times of reusage would you strictly advice a user to
migrate to another wallet with a new private key? Two times reusage is enough to break the key?

Yes, this happens when the same key is used perform multiple signatures with the same R value - simply using the same key for multiple, sanely produced signatures with a different R value will not result in leakage, no matter how many such signatures you make.
Modern wallets use a deterministic nonce via RFC 6979.


How are blockchain addresses pre-existent? I read the following statement somewhere on the web:
"Every blockchain address possible already existed, long before a wallet found it. The reason is that blockchain addresses are the result of a mathematical operation."
Can somebody explain this to me as they would to a child. I have no computer science background.

An address is an encoding of a 20 byte value. This value is just a number, from 0 to 2^160 (there are 8 bits in a byte, so a 20 byte value has 160 bits and a bit can be 2 values). Because we know what all of those numbers are, all possible addresses are known beforehand and already exist; they are just a number.


How is a BIP accepted? Who decides to change the status from Draft to Accepted?

BIP 0001 doesn't seem to clearly state this.

Is this a vote by the developers?
Whose vote exactly do we count?
How is it conducted and counted?
Are there veto rights?
Who handles disputes?
Is there a specific channel/topic/bitcointalk thread where accepted BIPs are published? (for those of us who don't follow the entire dev mailing list)

The process is not formalized precisely because only really non-controversial changes are supposed to make it in at all.

This hasn't always been the case, but is becoming more true in the last year.
Right now the process goes like this:

Start by thinking of some feature/improvement.
Convince the dev team(s) of the relevant parts (core consensus, wallets, other layers) that this is a good idea in the abstract, and it needs to be standardized.
Write a draft.
Get gmaxwell to assign a BIP number for reference.
Make everyone happy with the detailled draft.
At some point, the status of the draft changes to Accepted (based on actual agreement of all/most devs).

You can follow https://github.com/bitcoin/bips to see when changes are made.


Is there a JSON-RPC method for retrieving all transactions for a given address? I mean something like listtransactions method but with parameter .

This would be nice but, no, there isn't a way to do this.  The simplest way to accumulate this information is to call listtransactions or listunspent for a list of transactions in your account.

After receiving the list, filter for the needed information.  It is worth mentioning the listunspent RPC call.  This can cut down on a lot of returned data if you are only interested in the incoming transactions that make up your current balance.


How can I prune my Bitcoin Core correctly? The other way did not work for me. Have I done any unnoticed mistake? Saving the entire blockchain in my computer is taking mi a lot of space. I looked in this forum for a solution and I saw that there was an option to prune the node and save a lot of space.
I followed the instructions, I went to the Bitcoin data directory, I created a file there and called it "bitcoin.conf" and I wrote "-prune=1100" in it.
Nothing I expected happened, the space it took remained the same, it only started downloading a new blockchain called "testnet".
Have I done something wrong? And how can I fix it in order to save space?
My version of Bitcoin Core is v0.14..2

PS: Latter, I have discovered that, in fact, I have three Bitcoin data directories, and suddenly I have doubts about in which of them shall I place my "bitcoin.conf".
Is having three directory data how it shall be? And in which of them shall I place my "bitcoin.conf".

From your description it sounds to me that you may have edited your configuration file while Bitcoin Core was already running.

prune=1100 is a startup parameter. It will take effect once you restart the program.

If you add a parameter to the startup instructions,  parameters start with a dash (-prune=1100), e.g.:

"C:\Users\<username>\AppData\Roaming\Bitcoin\bitcoin-qt.exe" -prune=1100

Please make sure you use the correct path for the actual directory you installed Bitcoin to.
If you add it to the configuration, the parameter must be listed without a dash in the bitcoin.conf:

prune=1100

If you're unsure how to locate your Bitcoin data directory, please see: Where is the configuration file of Bitcoin-Qt kept?

There is no need to manually delete any files from your Bitcoin directory, or to start over the initial blockchain download to enable pruning.
You merely need to restart Bitcoin Core after you've edited the bitcoin.conf. If you don't know how to restart a program, you may find it simpler to shut down and restart your computer.


Change addresses and key backup on Bitcoin Wallet for Android I've had the  Bitcoin Wallet for Android for some time. When I installed it I was assigned some public address/key. I have made various transactions in and out of the wallet but as fas as I can tell the address has not changed.

Does Android Wallet not transfer change from a transaction into a new address?

I actually don’t want it to do this. I want one fixed address I can use to send and receive coins. I also expected that the private key I backed-up early on would still be valid.

If change addresses are created does this mean I have to backup my keys after every transaction?

Android Bitcoin Wallet does not send change to a new address. You don't need to re-backup your keys unless you explicitly generate a new address.


What are "discouraged blocks" in the blockchain? (examples and explanation please) As of the time I write this, only one block type is marked as "discouraged", and I'd like to understand why this exists.

Is a correct reading that is that "it should be in the blockchain?
Is this simply the block number embedded in the transaction?
Are there any sample blocks that do or don't have this information?

The wiki article you describe has been updated since by a skilled developer who is part of the Bitcoin team and the key change now reads:

  Bitcoin does not currently implement block discouraging in any form.

So this appears to be a concept that has not been implemented by any clients.


Why does Base58 WIF-format of PK have '5' prefix (the standpoint of mathematics) I'm trying create raw private keys using the steps:

Take a version of PK (0x80) and concatenate (as prefix)with my pseudo-random 32bytes-array.
Take a calculated checksum (4bytes) and push it to the end of the array.
Encode the result to Base58Check using the algorithm:

code_string = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
x = converted_arrayofbytes_to_big_integer;
output_string = "";
while(x > 0)
{
    (x, remainder) = divide(x, 58); //x becomes the integer part of dividing here
    output_string.append(code_string[remainder])
}
return  output_string.Reverse();

Ok, I have done it, but I can't understand when x  devided into 58 (through the loop) why the last remainder is 4  always (decimal: when the remainder is 4, it use as index of code_string: the last value of output_string is 5 (Base58) therefore)? I assume this's beacause of version's prefix but who can explain it from the standpoint of mathematics?

Mathematically, the thing to understand here is that base58 is similar to any other counting system, base 10 for example. They are both just a way of representing arbitrarily high numbers. The difference is just the characters used.

With counting in base ten, for example, when you get to 9, you start using the next available place holder, and you get 10. In base 58, when you get to z (57), you start using the next available place holder, and you get 21 (weird, I know, it's because 2 in base 58 is like 1 in base 10, and 1 in base 58 is like 0 in base 10).

The point here is that as you count up with the bytes that you are encoding, the base58 value counts up as well. Take this for example:

0x2220 -> 3bd base 58
0x2221 -> 3be base 58
0x2222 -> 3bf base 58
...

Now let's look at the actual data we're encoding with the private key. It consists of 1 version byte (0x80), 32 private key bytes, and 4 checksum bytes, which comes to a total of 37 bytes. Now take the smallest possible 37 byte bit string (which begins with 80):

80000000000000000000000000000000000000000000000000000000000000000000000000

When that is base 58 encoded, you get:

5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAbmahZy

And take the largest possible 37 bit string (which begins with 80):

80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Which base 58 encodes to:

5Km2kuu7vtFDPpxywn4u3NLu8iSdrqhxWT8tUKjeEXs2fDqZ9iN

And since all private key encodings will fall in the range between 80000000000000000000000000000000000000000000000000000000000000000000000000 and 80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, all private key encodings will end up with a 5 at their beginning, just based on how counting in base 58 works!


What programming language should be used to develop Bitcoin exchange software? Why? I've only heard PHP is terrible (e.g. in the context of Mt. Gox) and a more efficient/more security-oriented language would be preferable for matching orders and account security. Which programming language, and due to what reasons, would be better?

There is no possible way of knowing what are the technologies used by the exchanges.

C++, C# and C have been typically used by the financial and trading software industry as they can be optimized for low latency / high frequency behavior needed for real-time trading. Java, F#, Python, VBA, Haskell as well as other programming languages have also been used but it all comes to a matter of a personal taste, what technologies you or your team are familiar with, what open source (or not) modules are out there that will prevent you from reinventing the wheel and much more that are out of the context of this forum.

Another way to get an idea for the technologies used by an exchange is to spy on its job adverts. Still, what you'll get might not be accurate or it might refer to another or new product or service of that exchange, or even a migration of the existing technologies towards some other but still you'll get an idea.


Deeper understating of blockchain forks. Ive spend the last 8 months digesting everything and I have a lot more to learn. Is it possible to use Dogecoin on Litecoin network without converting  through an exchange? I assumed  you could since their both  Scrypt and one is a fork.

Also,  I’d like to go learn more.  I’ve done G code programming for CNC machines but that’s it .  So much info out there,  What would you recommend for learning the basics.
Thanks

Short answer is no.

Forks

A fork can mean that you "forked" the code on a repository, meaning you copied it and modified it for your own use case. It can also mean that the blockchain network itself "forked" when it split the blockchain and the network adopted two different chains and usually code and rules as well.

  Is it possible to use Dogecoin on Litecoin network without converting through an exchange?

Because two different blockchain networks have 2 different blockchains, they have different sources of truth.  One transaction on the forked chain isn't necessarily considered valid on the other (especially if they happened after the fork) because they are reaching consensus on separate blockchains.  See this related question: Can I do a replay attack to spend my testnet bitcoin on the mainnet?


Can a full node provide a bogus block bloomfilter to a Neutrino node? When a thin client using BIP157/BIP158 (Neutrino) requests the block filter for the latest block, would it be possible for the full node serving this request to attack the Neutrino node by providing a fake block filter that omits certain transactions?

Do block filters include a mechanism that enables the thin client to verify that it is an accurate representation of the corresponding block's content? Would it be possible to construct the block filters in a fashion that lying by omission becomes impossible when the thin client is aware of the correct latest block's header already?

They can lie to you about the filters, yes. However due to the filters being deterministic you can query other nodes for the hashes of their filters to gauge relative correctness. You can also use a watchtower like service to give a trusted set of the filters in some cases.

The original design document includes an extension for committing to these filters as a consensus rule. It is designed and presented as “levels” which can improve the reliability and security of using client side filtering in this manner.

  The security model of the oracle bloom filter can be vastly improved
  by instead committing a hash of the BFD inside every block as a soft-
  fork consensus rule change. After this, every node in the network would
  build the filter and validate that the hash in the block is correct,
  then make a conscious choice discard it for space savings or cache the
  data to disk.

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-May/012636.html


Lost wallet address from 5 years ago. I purchased 250$ worth of bitcoin back in 2012 on coinRnr and made two transfers with coinRnr with what I bought from them too two different addresses. I was quite messed up at the time since I spent most of that money on Silkroad but do know that I had 106$ of bitcoin left that I bought and I am hoping it is still out there. I have the emails from coinRnr and Blockchain wallet that's empty and bitstamp which I can't remember my password. With the email from coinRnr that had the address they sent the bitcoin to can I find out what wallet it went to or is that not possible ?

No, addresses are randomly generated and carry no information about what wallet they are associated with.