How to check if a given address belong to an exchange Does any exchange provides any public information about its private keys managed BTC addresses, or is there any service that provides this information?

A few exchanges publicize their hot and cold wallets, but currently, as far as I'm aware, no exchange publishes a full list.
This may change as FATF's Recommendation 16 adoption grows, but may still be limited to closed access networks among exchanges.
Beyond that, for most services, it is not very hard to determine if a used address belongs to an exchange - most exchanges tend to follow fairly easy to identify sweeping patterns to move funds between receiver, hot, and cold wallets. Many block explorers tag various addresses to exchanges, in addition to paid coin monitoring services.


Can I restore old MultiBit wallet with receive address and password? I have the multibit receive address and the password, from maybe 2014 or so.  The actual wallet is on a drive I will have to have recovered.  Is there any way to recover with and/or without having the drive recovered?

There is no relationship between the password and the wallet itself.
Without the wallet file the password is of no use to you.


Are there other ways to have more than one address involved in a SINGLE transaction input or a SINGLE transaction output? Full question:
Except for the case of multisignature, are there other ways to have more than one address involved in a SINGLE transaction input or a SINGLE transaction output?

Bitcoin address is human-readable form for representation output script. So, one output transfers funds to one address by the definition of the term address.

One transaction input always spends one output of the prevoius transaction.

Your question has no sense.


Is there a local wallet for Ripple? The only wallet I can find for Ripple is the standard web client. I don't like the idea of always having to trust a web client with my keys. Is there a local-only client for the Ripple network? If not, is there something preventing a local client from being developed or has it just not got enough interest yet?

Ripple Labs makes a downloadable client available. You can store wallets in a local file, encrypted with a passphrase. The source code is available on github along with build instructions.


Why does Binance use USDT instead of USD? binance seems to have BTC-EUR but no BTC-USD. I can see BTC-USDT. Is this the closest one to trading BTC-US dollar?

It makes sense to me that they don't offer a USD trading pair, as binance does not have access to the US banking system, much less so to the or a federal reserve account.

How they are able to represent the euro in the first place within their exchange/framework, i don't know. That would mean they would have an account at a EU bank and subsequently at a NCB within the eurozone, which i highly doubt given they operate with and within "anonymous" accounts. (I highly doubt this would be allowed by the ECB and subsequently their commercial bank), If anyone could shed some more light on this and how this would actually work (I fear I might be wrong here.), I'd be extremely interested.

Before thinking you can use USDT as a safe haven, you should note that more often than not, these "stablecoins" are not backed 1:1, or at least not proven to be, and that while they might be stable as of right now, that that is not a guarantee for the future.

USDT in particular lacks audits. A quick google search on the topic will give you a wide range of articles why they're so controversial.

Anyway, to answer your question, yes, USDT is probably the closest to representing the value of an actual dollar, but, as i said, it is NOT an actual dollar, and you should be really careful using them, or preferably; not use them at all.


How do I send Bitcoin in paper wallet to other person? I'm new to bitcoin.
Can you tell me step by step how do I send Bitcoin in paper wallet to other person.

Thank you!

Spending money from a paper wallet is the hardest part. Making the wallets themselves is easy but spending the coins is harder than it should be. Here's a guide on how to do it safely:

Create a NEW wallet on blockchain.info. Keep in mind that you will only use this wallet for the express purpose of emptying your paper wallet. You will not reuse the paper wallet and you will not reuse the blockchain.info wallet.
Log into your blockchain.info wallet and go to Import/Export. You will get a warning about advanced usage. Agree to that to make it go away.
Use the import private key option or the scan with webcam option to import your paper wallet private key.
Once you've done the import you must spend the entire balance. Send what you need to an address owned by the other person and the rest to an address on your desktop client. Don't keep any balance in your blockchain.info wallet.

You might ask why go through the trouble to do all this. That is because sometimes if you import a private key it might be reused by the wallet app/web service and change is sent back to it. You want to avoid that because if you assume you've spent all the coins in the private key and then you make the private key public and change is sent to it somebody could steal your coins. So to avoid all that you import into a temporary blockchain.info wallet and spend all the coins in one go.


Does a margin trade influence the order book? I'm not sure if this is the place to ask this, but I didn't know where else to go. I'm doing some crypto trading on bitfinex and I'm particularly interested in margin trading.

What I wonder about is the following: if I do a large margin trade (long or short), does that influence the order book? I mean; does a margin trade actually buy (or sell) the underlying assets? Or does a margin trade only buy a derivative (just like options) and thereby doesn't influence the order book of the underlying asset?

It does influence the order book. Margin trading is a 2-step process :

you borrow currency A. This has no influence on the order book
You then sell currency A to buy currency B. This influences the order book.


Why is coinbase mentioned in a BIP? I thought that BIPs were similar to Pythons PIPs. So I was confused when I read BIP 34 mentioning coinbase explicitly. The author, Gavin Andresen, seems not to have a connection to coinbase.
I thought that coinbase was just a cryptocurrency exchange, similar to Binance / Huobi / Kraken. Does coinbase have a special role? Is coinbase in some way bound to follow BIPs or did/does Gavin Andresen have influence on what coinbase does?

The coinbase mentioned in BIP34 is not the company; it is referring to the first transaction in a Bitcoin block (which is special as it is allowed to bring new currency into circulation).
Coinbase-the-company didn't even exist when BIP34 was written (or at least, wasn't known/public). The company was named after this special transaction.


How do Bitpay invoices hide the Bitcoin address to pay to? I want to pay with another wallet. Bitpay invoices are not compatible with most Bitcoin wallets out right now. I wanted to pay a bitpay invoice, but my wallet doesn't support it.

How does Bitpay hide the bitcoin address on their invoice pages? I don't even see it in the source.
I know there is Debitpay ( https://alexk111.github.io/DeBitpay/ ) static app to decode these invoices, but I'd like to extract the Bitcoin address from the bitpay invoice manually myself. How can this be done?

Bitpay uses the BIP 70 Payment Protocol. This protocol does not use addresses, which is why they are able to now show an address. Rather, the Bitcoin URI that you are given (either you scanned it with a QR code reader or you entered it into your wallet) points to a place where your wallet can download a PaymentRequest. The Bitcoin URI format for pointing to the PaymentRequest download location is specified by BIP 72.

The PaymentRequest that is downloaded contains a list of outputs (amounts and scriptPubKeys) that Bitpay wants you to have in your transaction. These outputs do not contain addresses; instead they have directly the scriptPubKey that should be in the output. This allows for forward compatibility with other new script or address types that did not exist at the time of BIP 70's writing.

  but I'd like to extract the Bitcoin address from the bitpay invoice manually myself.

You can download the PaymentRequest as a file from the URL specified by the PaymentRequest. That PaymentRequest encoded using Google's Protocol Buffers with the fields specified in BIP 70. So using a Protobuf decoder, you can get each specific field of the PaymentRequest, and from there, each field of each output, and then convert the output scripts to addresses if those scripts even have addresses. I have a slightly outdated project that runs locally to do all of this for you.


Given a transaction hash, how do you get the block the transaction was included in? I'm using Blockchain.info's api:

https://blockchain.info/api/blockchain_api

I understand that it is impossible for a transaction to know which block it will be included in but maybe one could use the block height to match the tx to the block?

but maybe one could use the block height to match the tx to the block?

Indeed that would work fine, block_height is returned by the /rawtx/ call (https://blockchain.info/rawtx/$tx_hash) for transactions that have been included in a block (unconfirmed transactions have no block_height key). Then you can find the block hash and/or information about the block with the /block-height/ call (https://blockchain.info/block-height/$block_height?format=json)


Has the payment protocol – which is supposed to protect against Man-In-The-Middle attacks – ever been implemented? The two main problems generally mentioned that payment protocol “BIP 0070” (Andresen, 29-07-2013) is supposed to solve are usability and protection against Man-In-The-Middle attacks. In the latter the attacker would substitute an address he owns for the merchant's address when the payment address is shown to the customer. This could result in the customer paying the attacker instead of the merchant.

Has this attack been done before? If so, how was it implemented?
Or is this just a theoretical problem?

I am not sure if there are verified reports, but I would be shocked if there were not any man in the middle attacks.

It's super simple to do. Compromise the vendors payment processing (exploit a security hole on the vendors web werver. if the wallet address is generated from a local bitcoin instance, an atacker could point the address generation code away from the vendors instance and towards their own malicious bitcoin instance... Or the malicious user could just hard code their own address in to the payment processing. Depends on how intricate it needs to be. You could even compromise the vendor by having a copy of their wallet, watching silently for a large transaction then running once you find a big haul of coins.) you could compromise their payment gateway api and have it redirect to you(or your coin address) instead of the vendors address. or if they use email: simply compromise the communication protocol (email/web support ticket/etc) and replace the merchants address with yours.

A script kiddie sadly could (and probably has) executed one or all of these methods of attack... There's a ton of ways to do it. Those are just a few off the top of my head.

Be safe. Do not try any of this! This information is posted so you get an idea of what to keep in mind.


How to decode raw tx hex programmatically createrawtransaction(...) in testnet returns this hex:

01000000010470c3139dc0f0882f98d75ae5bf957e68dadd32c5f81261c0b13e85f592ff7b0000000000ffffffff02b286a61e000000001976a9140f39a0043cf7bdbe429c17e8b514599e9ec53dea88ac01000000000000001976a9148a8c9fd79173f90cf76410615d2a52d12d27d21288ac00000000

I know how to decode this with decoderawtransaction but if I want to do this programmatically how can I do it? In other words, what is the exact encoding/format of this hex and how can I decode it into plain text or json using c# or some other language?

The decoded text should be:

{
    "addresses": [
        "miXoR8DUo5tQJyr6rkKMF2WKkrBRTb8tEV",
        "mguTTnqj3ASi3YYtzGAoYrUqXGRjCTuovG",
        "mt9Y1HCL8ntHrT5jX9kx1G86rGZ2bcyajh"
    ],
    "block_height": -1,
    "block_index": -1,
    "confidence": 0,
    "confirmations": 0,
    "double_spend": false,
    "fees": 500000,
    "hash": "b020bdec4e92cb69db93557dcbbfcc73076fc01f6828e41eb3ef5f628414ee62",
    "inputs": [
        {
            "addresses": [
                "miXoR8DUo5tQJyr6rkKMF2WKkrBRTb8tEV"
            ],
            "age": 2596,
            "output_index": 0,
            "output_value": 514729939,
            "prev_hash": "7bff92f5853eb1c06112f8c532ddda687e95bfe55ad7982f88f0c09d13c37004",
            "script": "",
            "script_type": "pay-to-pubkey-hash",
            "sequence": 4294967295
        }
    ],
    "lock_time": 0,
    "outputs": [
        {
            "addresses": [
                "mguTTnqj3ASi3YYtzGAoYrUqXGRjCTuovG"
            ],
            "script": "76a9140f39a0043cf7bdbe429c17e8b514599e9ec53dea88ac",
            "script_type": "pay-to-pubkey-hash",
            "value": 514229938
        },
        {
            "addresses": [
                "mt9Y1HCL8ntHrT5jX9kx1G86rGZ2bcyajh"
            ],
            "script": "76a9148a8c9fd79173f90cf76410615d2a52d12d27d21288ac",
            "script_type": "pay-to-pubkey-hash",
            "value": 1
        }
    ],
    "preference": "high",
    "received": "2016-01-22T12:58:23.224606219Z",
    "relayed_by": "54.167.150.115, 127.0.0.1",
    "size": 119,
    "total": 514229939,
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 2
}

Reference: decoderawtransaction in C++

This is specified thoroughly on the Bitcoin Wiki.

The first 4 bytes are the version number, the next 1-9 bytes are the number of inputs (almost never more than 1 byte) and so on.

Programitically, there are a ton of libraries that take the raw text and spit out the json as the bitcoin RPC call does in your example. They all use the same specification, though, so you can create the code yourself or use something already written.


iPhone App for Bitcoin trading / transfering? Is it any iPhone App that I can use to buy / sell / transfer easily Bitcoin? I want to be able to download from Apple's App Store.

You cannot buy Bitcoin with credit card as far as I know.

iOS apps are generally limited to either:

HTML5 client (Blockchain.info or GreenAddress.it)
a "pure" (ie no website integration) app like BreadWallet, Pheeva
A trading app (ANX), Coinbase

So buying BTC and managing or trading are very distinct functionalities, and you'll likely never find the former because of credit card fraud allowing for untraceable Bitcoins to be purchased. Also, most all purchases of Bitcoin (except OTC or cash LocalBitcoins.com transactions) require ID to allow fiat to BTC conversion.

The only exception I can think of is Coinjar.io which are rolling out a debit card in Australia which can be used like a normal credit card, but automatically debits a linked Coinjar BTC deposit.


Tx Malleability: Why is the Script not included in the Signed Hash? Sipa lists sources of tx malleability here: https://gist.github.com/sipa/8907691

It is clear to me how a change in the signature itself or the signature formating leads to a different tx hash (1. & 2.). But why is it allowed to modify the rest (may be "") of the scripts?

From what I understand only the txin script can be modified because the txout scripts are included in the signature hash(es). Obviously the signature itself can not be included in the signed hash.

For each signature the corresponding txin script is replaced by the appropriate previous output script (?) and all other txin scripts in the tx are removed.

Why is the txin script (without signature, so it is an empty string for a standard tx) not included in the hashed and signed data?

(Please correct me if I got something wrong.)

edit: trying to express myself more clearly:

Of course the range and format of the signature needs to be standardized. But there are other cases of malleability as Sipa points out like adding nonsense OPs to the tx_in script or using alternative OPs that have the same or a similar effect. I am only talking about these other cases.

My point is: The signature itself can not be signed but why are OP codes that may or may not be present in the txin script not signed?

Example:
Today:
 normal txinscript: "sig"          -->  signature format: "" --> valid
 malled txinscript: "OP_NULL sig"  -->  signature format: "" --> valid

Why not:
 normal txinscript: "sig"          -->  signature format: "" --> valid
 malled txinscript: "OP_NULL sig"  -->  signature format: "OP_NULL " --> FAIL

Signature format today replaces the whole txinscript with "". To me it seems that it would be safer to only remove the signature itself but keep the opcodes if present so that it is impossible to alter existing opcodes or add nonsense opcodes.

Is it because it is not know what part of the script is the signature? I think it could be marked as such should that be the issue.

You are absolutely right.

The only reason why this is done, is because that is not how the consensus rules currently work. Changing it would require a hard fork, updating every node and eventually every wallet.


Installed latest Bitcoin-Qt, fully synced, but 'getreceivedbyaddress' etc doesn't work? I downloaded and installed Bitcoin-Qt 0.8.6, fully synced the block chain (according to the software itself) and now trying some basic commands through the console.

For some reason, getreceivedbyaddress <address> always returns zero, even for addresses that I know contain some bitcoins.

For example: getreceivedbyaddress 1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX gives 0.00000000 (mini-screenshot), yet we can all verify that this address actually did receive bitcoins (see comment).

Restarted the software several times, restarted my PC, and also tried doing this from the command line using bitcoind instead of the Bitcoin-Qt user interface, still the same result.

Am I doing something wrong or misunderstanding Bitcoin-Qt?

getreceivedbyaddress only works for your addresses, i.e. those for which the private key is in your wallet.  Those are the only addresses for which bitcoin-qt keeps indexed transaction data.  Getting balance and transaction information for arbitrary addresses is unfortunately not supported by bitcoin-qt; sites like blockchain.info write custom software that manually parses the block chain.

See also this answer.


Merkle root with one transaction I am trying to build a merkle root which contains only the coinbase transaction from bitcoind
After creating the coinbase transaction i need to convert it to little endian, hash it twice and then put it in the blockheader as it is, or i must reconvert it again before i put it in the blockheader
I mean:
step 1: convert coinbase transaction to little endian
step 2 : double SHA256
step 3 : reconvert to little endian or let it as it's?
step 4 : put it on the blockheader
I am a little confused
Thank you for help

I think you may be missing that when a node in the Merkle tree doesn't have a hashing partner it is concatenated with itself before hashing. To calculate the Merkle root of a transaction tree with a single transaction txid0, you would need to hash:
Merkle root = sha256d(txid0 + txid0)

I'm not sure about the endianess conversions.


What is the highest recorded difficulty in the main net? What is the highest recorded difficulty in the main net and which blocks was it used for?

As at 9th May 2012, the highest recorded difficult has been:

1,888,786.705353 first reached August 01, 2011.

Blocks 139,104 through 141,119:

http://blockexplorer.com/b/139104
Bitcoin Difficulty History


how http://blockchain.info/, http://blockexplorer.com/q or http://www.bitcoinmonitor.com/ works Possible Duplicate:
  How can I read information from the blockchain?

Can anyone tell me from where exactly sites like

http://www.bitcoinmonitor.com/
http://blockchain.info/
can't post more links

take their information.
How bitcoinmonitor knows what transactions have been done right now?

They monitor the public blockchain from multiple Bitcoin servers. There's a very simple rule for which chain is valid -- whatever chain has the most work is the valid one.


Do i have to run full node to receive unconfirmed transactions? i want to query unconfirmed transactions by using getrawmempool.

do i have to run a full node ?

or if i set prune in bitcoin config, will i still get the newly unconfirmed trsanctions ?

As far as I know, this should work just the same even with pruning enabled.

A Bitcoin Core node with pruning really still is a "full node" on the network; it relays transactions and fully checks the validity of incoming transactions and blocks.  The only difference is that without pruning, received blocks are stored forever and can be shared with other nodes who are initially downloading the chain.  With pruning, all blocks are downloaded and checked but only newer blocks are stored and shared.  Everything else should be the same.


How to put QR Code whenever I generate a unique address? block.io API Hi guys as the title says. how can I generate a QR code whenever the block_io.php generates a unique address? I seem to have a problem when calling $newAddressInfo or $newAddressInfo->data->address whenever I'm echo-ing it. Please disregard the missing characters as per it's perfectly working.
so this is the whole script.

Bitcoin Address validator from Kyle : HIS YOUTUBE CHANNEL
QR GENERATOR FROM : TERRAGON

I just tweaked kyle's script.

SCRIPT :

require_once ("block_io.php");

$apiKey = "myAPIkey";

$version = 2; // API version

$pin = "myPin";

$block_io = new BlockIo($apiKey, $pin, $version);

if(isset($_POST['submit'])){
    $newAddressInfo = $block_io->get_new_address();
    $address = $_POST['addr'];
    $decoded = decodeBase58($address);

    $d1 = hash("sha256", substr($decoded,0,21), true);
    $d2 = hash("sha256", $d1, true);

    if(substr_compare($decoded, $d2, 21, 4)){
        $message = "Invalid Bitcoin Address";
    } else {
        $message1 = "Valid Address";
        $message2 = "Your Receiving Address : ";
    }
}

function decodeBase58($input) {
    $alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

    $out = array_fill(0, 25, 0);
    for($i=0;$i<strlen($input);$i++){
        if(($p=strpos($alphabet, $input[$i]))===false){
                throw new \Exception("invalid character found");
        }
        $c = $p;
        for ($j = 25; $j--; ) {
                $c += (int)(58 * $out[$j]);
                $out[$j] = (int)($c % 256);
                $c /= 256;
                $c = (int)$c;
        }
        if($c != 0){
            throw new \Exception("address too long");
        }
    }

    $result = "";
    foreach($out as $val){
            $result .= chr($val);
    }

    return $result;
}

</form method="post">
    <input style="width: 100%;" name="addr" type="text">
<input name="submit" type="submit">

if (isset($message)){ echo $message; }

 if (isset($message2)){ echo " Your Unique Deposit Address: " .$newAddressInfo->data->address."
"; }

 if (isset($message2)) $str = "Your Receiving Address : ";
 $str ; echo $address = $_POST['addr'];

 if (isset($message2)){ echo img src='qr/qr_img.php?d=$newAddressInfo->data->address'> ; }

</form>

The address validation script is actually from RosettaCode https://rosettacode.org/wiki/Bitcoin/address_validation#PHP

All you need to do is create the new address and then put the address in a QR Code. You could use the Google Charts API

<?php
 require_once("block_io.php");

$block_io = new BlockIo($apiKey, $pin, $version);
$createAddress = $block_io->get_new_address();
$address = $createAddress->data->address;
?>

This is your new address:

<img src="http://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=<?php echo $address; ?>">


Sending funds on same block of received funds. Confirm sending not received? My question in quite conceptual:

For creating a raw transaction, I just need the txid from the older transaction and the address to send it. Put the funds, the change, what's left is the fee. Sign it and broadcast it.

Let's say Alice sends to Bob's disposable address some funds. Bob has a "master address". Whatever funds he gets on the disposables addressess he sends to his master one. Bob runs a full node and get the transaction before it gets confirmed on the blockchain.

When Bob receives the broadcasted Alice transaction, Bob gets the raw transaction sent to his disposable address, get the txid, put the funds, put the address of his "master" address, change, fee, sign it and broadcast a new transaction, getting the funds sent from Alice to his master address.

So, now, Alice sends to BobDisp (Bob's disposable address) that sends to Bob. All those transactions have 0 confirmations and are both valid.

For the point of the argument. Alice sent the transaction with 0 (ZERO) fee. Bob signed his transaction with a 'standard' fee (let's say 0.0003 BTC), which has a high priority.

When miners get the transactions to mine, do they know that both have to be on the same block? Or what happens if the block is mined with only 'BobD -> Bob' transaction (without the Alice -> BobD)? Is the block invalid?

The miners won't rescan the whole blockchain to know that the 'BobD -> Bob' uses the funds of a new transaction, right? The Alice transaction could be 50000 blocks old or, in this case, a new one.

PS: not sure if it is clear. thanks

They don't have to be on the same block, but as they do depend on each other the BobD->Bob transaction can only be mined if Alice->BobD is already in the same or an earlier block. If not, the entire block would be invalid and noone would accept it.

Note that smart miners would add up the fees for both transactions and on the basis of that decide whether to include it in a block or not. So Alice->BobD might have 0 fee and therefore not be interesting for miners, but if BobD->Bob pays enough fee to compensate for it, a miner might include both transactions in the same block. This is known as Child Pays For Parent or CPFP. I don't think it's very common yet for miners to have this implemented at the moment. Are there any pools or large miners running "child pays for parent" patch?


How it is possible to validate existing Pay to Public Key Hash transaction without public key? These are my understanding or assumptions.

Sign a document requires secret key and message only as below

SignDocument(secret key, message) => signature

And verification of signature requires public key, signature and message as below

VerifySignature(signature, message , public key)

Purpose of scriptPubKey is a script for validating signature for P2PKH transactions.

It is clear that we need public key in order to validate transaction but existing transaction data doesn't have public key data but hash of public key only.

I can easily understand Pay to Public Key transaction because public key is part of transaction data.

If public key is not stored in blockchain so how it is possible to validate P2PKH transaction without public key?

A transaction which spends from a P2PKH output provides both the signature and public key in the input script. So the public key is part of the transaction data, just the spending transaction, not the output creating transaction.


Altcoin connecting nodes I have created my crypto currency based on Litecoin 0.13.2.
All seem works fine except fact that nodes are not synchronizing.

Debug says:

  Ignoring getheaders from peer=x because is in initial block download.

If I compile version 0.8.x and connect to 0.13 there is no problem with blocks data interchange.

I have mined few blocks for testing but stil getting same error, therefore I cannot run my network.

Regards,

This is happening because your node thinks it is in initial block download.

There are several reasons why that might happen, but I think only two apply here.

The chain tip is more than nMaxTipAge seconds old. Try setting the -maxtipage option to a big number, and see if that fixes it.
The chain tip has less than nMinimumChainWork (from chainparams.cpp) of work put into it.

Here are the conditions that trigger initial block download:

bool IsInitialBlockDownload()
{
    const CChainParams& chainParams = Params();

    // Once this function has returned false, it must remain false.
    static std::atomic<bool> latchToFalse{false};
    // Optimization: pre-test latch before taking the lock.
    if (latchToFalse.load(std::memory_order_relaxed))
        return false;

    LOCK(cs_main);
    if (latchToFalse.load(std::memory_order_relaxed))
        return false;
    if (fImporting || fReindex)
        return true;
    if (chainActive.Tip() == NULL)
        return true;
    if (chainActive.Tip()->nChainWork < UintToArith256(chainParams.GetConsensus().nMinimumChainWork))
        return true;
    if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
        return true;
    latchToFalse.store(true, std::memory_order_relaxed);
    return false;
}


BIP 44 is scanning external chain really enough? When reading the BIP 44 proposal I stumbled upon this paragraph about address discovery:

  We scan just the external chains, because internal chains receive only
  coins that come from the associated external chains.

Is it really enough to scan only the external addresses to recover the full transaction history? What if you are using the same wallet simultaneously on another device and it makes a new transaction using the internal (i.e. change) addresses as the only inputs?

Imagine having a new empty wallet and receiving 1 BTC to your first external address and making a 0.01 BTC transaction to somebody else subsequenly. The remaining 0.99 BTC (minus fee) would be sent to your first change address and subsequent transactions to other wallets could and would use as inputs only change addresses, so scanning the history of your external addresses when rcovering the wallet from zero would reveal only the first and second transaction you made with the wallet, not the subsequent ones.

Is it perhaps enforced to include an external address as a change address in the transaction if all the inputs are internal? What am I missing there?

I got it - the paragraph in the BIP 44 proposal I referenced is about "Account discovery" - i.e. discovering whether an account was used at all. It's not about used addresses discovery within the account which is another thing of course, and it apparently requires scanning the change addresses as well, given the example in the question. So I just misunderstood it.


Very Slow Mining on CPU with 8 Core Xeon E5-2660 I have a 8 Core Xeon E5-2660 machine with 16GB Ram (without GPU). I have used ByteCoin and MinerGate both of which gave me just 90-100 Hashes/sec.
I see people talking about 2-4 MH/s whereas I am getting only a fraction of that. Could anybody please tell me where I am going wrong, what should I do to get such hash rates.

The hardware and electricity both are free for me. Basically I have no expenses. So please give the instructions so that I can make the most of it. Which currency, miner, drivers, etc to use.

You have no hardware that is suitable for mining, so your mining rate is going to be atrocious. You'll never make enough to compensate for the extra wear and tear on your expensive, general purpose hardware.


How can I generate more coins while mining on PoS? I couldn't find the specifics on how would one get more coins with PoS.

I understand that with PoW one gets more coins by having more hashing power and running software like cgminer.

With PoS, I need to have more coins, and… what else? Just have the client open? If that's the case, it's kind of risky, isn't it? I mean I would have to have my private keys in an online machine?

Yes, you have to have client with all your coins open with your private keys and have it sitting on online machine.

See Proof Of Stake Details section for NXT


BTCe setting price per BTC Say I want to make a money exchange to sell a small amount of Bitcoin for USD (I've not done this before). I notice a few things that I am not sure I understand when I visited btc-e.com. There are two boxes:

Amount BTC (is initially blank)
Price per BTC (looks like it is set to the Highest Bid Price when the page first loads but doesn't get updated).

Will the 2nd box effect how / if the order gets filled?

If I want to sell as I say then shouldn't the 2nd box be set to a lower price in USD so that they sell quicker? Or say I wanted to put the 2nd box to a value in USD that is higher than the highest bid then will it take longer (or never) to be filled?

The fact that the price in the 2nd box doesn't get updated and is editable seams weird; as I thought it was the spread. What if you left the page open for ages and then hit sell? Surly there would be a totally useless order on the book!?

Will the 2nd box effect how / if the order gets filled?

Yes. The order can't be filled until there's crossing offer in the other direction.

  If I want to sell as I say then shouldn't the 2nd box be set to a lower price in USD so that they sell quicker? Or say I wanted to put the 2nd box to a value in USD that is higher than the highest bid then will it take longer (or never) to be filled?

It depends what's more important to you, selling quickly or getting the highest possible price (but possibly never selling at all).

  The fact that the price in the 2nd box doesn't get updated and is editable seams weird; as I thought it was the spread.

You can place an offer to buy or sell at any price you want.

  What if you left the page open for ages and then hit sell? Surly there would be a totally useless order on the book!?

Well, not necessarily. Someone might want to buy more coins than are available at a price closer to the market price and might have to take offers a bit outside of the normal market price. Some people place offers just in case the price moves.

Imagine the price is $300 and nobody places out of market offers. What happens if all the people willing to sell at $300 have their offers taken? There would be no sell offers at all on the books and people willing to sell at, say, $325, would lose an opportunity. So there will generally be lots of offers to sell above, and buy below, the current market price.


How does a range proof bound lower at 0 and not -1? From the confidential transactions article:

  C' = C - 1H Then I provide a ring signature over {C, C’}.

  If C was a commitment to 1 then I do not know its discrete log, but C’
  becomes a commitment to 0 and I do know its discrete log (just the
  blinding factor). If C was a commitment to 0 I know its discrete log,
  and I don’t for C’. If it was a commitment to any other amount, none
  of the result will be zero and I won’t be able to sign.

What if C and C' are commitments to 0 and -1? Then if I can sign, that means the ring signature is a proof is over {0,-1}. I'm probably missing something, so please tell me, why can't the amount be -1 in this proof?

What if C and C' are commitments to 0 and -1? Then if I can sign, that means the ring signature is a proof is over {0,-1}.

To create a signature, the public key must be a known multiple of G. That multiple is known as the private key. When a point has a nonzero H term in it, no signature with that point as public key can be created. In order to write rG+vH as a multiple k of G, k = r + v*(G/H). H is constructed in such a way that nobody knows the ratio between G and H. As a result, rG+vH can only be a known multiple of G when v = 0.

As a result, you can only sign for public keys that are points which are commitments to the value 0.

A ring signature means you're picking multiple points as public key, and signing for 1 of them, without revealing which one.

So if C is a commitment to 0, and thus C' a commitment to -1, you absolutely can create a ring signature with {C, C'} as public keys. But it's due to the presence of C there.

  I'm probably missing something, so please tell me, why can't the amount be -1 in this proof?

There is no 'value' in the proof. There is a choice of two values. The signer only proves he can sign for one of them, and verifiers cannot know which one he meant.


Trezor; How is it true cold storage if their is a recovery seed? I don't understand how a Trezor is considered cold storage if you can lose it, and then recover your keys through their recovery seed and another Trezor.

Where are the keys coming from?

Where are they being stored?

It is considered cold storage because the private keys are never exposed to an online device which can steal them.

The private keys are stored on the Trezor itself. They can never leave the Trezor, even when it is plugged into a computer. Thus they are never exposed to something which is connected to the internet that is able to steal the private keys.

The recovery seed is a BIP 39 mnemonic. This encodes a BIP 32 seed which is then used to generate all of your private keys. The Trezor actually only stores the BIP 32 seed and generates all other private keys when they are needed. Restoring a Trezor with the recovery seed (aka BIP 39 mnemonic) just tells Trezor what the BIP 32 seed should be.


Blockchain Receive Callback API in callback url not working I want to accept payments with the Blockchain Receive Payments API
Using create different user different address on get bitcoin but not work Callback api

https://blockchain.info/api/api_receive

&& also try Monitor addresses for received and spent payments api but not work

My problem is, the callback is never called— can anyone check my code and tell me where I the problem is?

i also try to log create but not called and check callbacl log api using not call.

please solved my problem :)

create balance update api using this file create.php

$url = "https://api.blockchain.info/v2/receive/balance_update";
    $secret = $address;
    $post_data = array(
        "key"           => $this->API_KEYCODE,
        "addr"          => $address,
        "callback"      => "https://my-server.com/callback.php?customer_id=".$user_id."&secret=".$secret,
        "onNotification"=> "KEEP",
        "op"            => "RECEIVE",
        "confs"         => $conf
    );

    Log::info('START SERVICE CALL :' . json_encode($url). " : ".json_encode($post_data));
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, count($post_data));
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER , array(
        "cache-control: no-cache",
        "content-type: text/plain",
    ));
    $ccc = curl_exec($ch);
    curl_close ($ch);

    Log::info('END SERVICE CALL :' . $ccc);
    $json = json_decode($ccc, true);
    return $json;

this api successful return response in index id , address and callback url

second file callback.php

Log::info('TEST : START (BLOCKCHAIN Callback)========================================');
    Log::info('GET : '.jsone_encode($request));
    Log::info('GET : '.jsone_encode($_GET));
    $res = 'Nothing';

    $out_address = $_GET['secret'];
    $in_address = $_GET['address'];
    $user_id = $_GET['customer_id'];

    $transaction_hash = $_GET['transaction_hash'];
    $confirmations = $_GET['confirmations'];
    $value_in_satoshi = $_GET['value'];
    $value_in_btc = $value_in_satoshi / 100000000;

    $status = true;

    if($status == true) {

                $res = "*ok*";
        } else {
            //Waiting for confirmations

            $res = "Waiting for confirmations";
        }
    }
    Log::info('RES : '.$res);
    Log::info('TEST : END (BLOCKCHAIN Callback)========================================');

It's not about your code; it's from Blockchain.info.

I've made a transaction right now and never received the callback.

Blockchain.info always has these types of issues from time to time.

Please aware an issue with gap limit also. They may say that you've created 20 unused addresses and you're not.


Constructing a P2WSH address from the BIP173 spec The BIP173 specification defines how to create Bech32 Segwit native addresses.

In the examples section a public key is given: 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798.

Based on that key it is somewhat easy to generate a P2WPKH address, one hashes the key with SHA256, then with RIPEMD160 and use the hex decoded result as the witness program (first two commands are simple CLI and the last is from the Dart bech32 library):

$ echo 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 | xxd -r -p | openssl sha256
(stdin)= 0f715baf5d4c2ed329785cef29e562f73488c8a2bb9dbc5700b361d54b9b0554

$ echo 0f715baf5d4c2ed329785cef29e562f73488c8a2bb9dbc5700b361d54b9b0554 | xxd -r -p | openssl ripemd160
(stdin)= 751e76e8199196d454941c45d1b3a323f1433bd

Segwit('bc', 0, HEX.decode("751e76e8199196d454941c45d1b3a323f1433bd"))
// bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3

Generating a P2WSH involves the script key OP_CHECKSIG followed by once SHA256 hashing. I'm at a loss how to construct said script. The opcode OP_CHECKSIG is encoded as 0xac. But appending that to the key seems silly (and doesn't work). Besides the CHECKSIG opcode requires two parameters. What do I hash?

First of all, what are you trying to do? Why do you need a P2WSH address?

A P2WSH address (and P2SH addresses earlier) send coins to a script, which requires satisfying that script to decode. A script of the form <key> CHECKSIG is wasteful - you should be using P2WPKH instead. In general, you use P2WSH when you have more complex spending requirements than a single key. This most often happens when you need multisig (multiple devices or people need to sign off on a spend).

Now, all of this is outside of the scope of BIP173, which only specifies how to encode segwit outputs into human-readable strings and back.

A segwit output is an output whose scriptPubKey starts with OP_0, OP_1, ..., OP_16, and is followed by a push of 2 to 40 bytes. That's it, and BIP173 can encode any of those.

Now, since the activation of BIP141 in Bitcoin, a small subset of segwit outputs have been given a meaning:

OP_0 + 20-byte push of RIPEMD160(SHA256(pubkey)) is called a P2WPKH for that public key.
OP_0 + 32-byte push of SHA256(script) is called P2WSH for that script.

All other kinds of segwit outputs are meaningless right now (non-standard and spendable by anyone), but that could change in the future. However, all of them can be encoded in Bech32 using BIP173. It doesn't care what the context or meaning is; it just encodes the version number (the OP_n opcode at the start) and the data bytes (what is being pushed afterwards).

Perhaps your confusion comes from the fact that the BIP173 test vectors use "key + OP_CHECKSIG" in its examples. That was just a simple way of constructing examples that are reproducible. They're not representative for how to actually use it.


Accept bitcoin easily without strict terms of services? I'm interested in starting a gambling site, it has been difficult to find an easy way to handle user funds.

Solutions such as Bitpay or Coinbase disallow usage for gambling.

BIP32 blockchain notifiers like Mycelium Gear appear to be vulnerable to spam attacks and difficult to scale.

I've looked into interacting with a full node but things seem to get complicated very quickly at scale.

I wrote a webshop app using armory daemon. It can generate bitcoin addresses on the fly and not put any funds at risk since it's using a watch-only wallet:

https://github.com/goatpig/BitcoinArmory/tree/master/webshop

If you're not afraid of a little code, this should work without having any dependency on external services.


What is the collective name for Bitcoin, Namecoin, etc? Is there some standard term to describe all Bitcoin-like internet currencies, like Solidcoin, Namecoin and so forth? Like "currency" is to dollar, euro, yen, etc?

distributed digital currency, or distributed digital crypto-currency. the "distributed" bit is a key issue - anyone can make a centralized digital currency, even with crypto thrown in.


Recovery of lost bitcoin i have my wallet id and bitcoin address in a safe but deleted from all electronic gadgets. So how do i recover my bitcoin by using these said method please advise.

I have my wallet id and bitcoin address [...] how do i recover my bitcoin by using these?

You cannot recover control over Bitcoin using only a Bitcoin address.

You cannot recover control over Bitcoin using only a "Wallet-ID" you typically need a password also. But in the case of custodial wallets, the custodian may provide a means of recovery based on other information (e.g. an email address used for original registration). Note that custodial wallets are widely regarded as the least secure way to store Bitcoin long term. See What kinds of wallets are there?. Also note that private companies like Blockchain.com don't own either the Bitcoin system or the Bitcoin blockchain - they are just one of many businesses that offer services based on cryptocurrencies.

You generally need either

The Private Key in some well-known format (e.g. WIF) or
A seed recovery phrase (often 12 words from a special list)

If you don't have these, it usually means your Bitcoin are forever unusable.


What is the mechanism to ensure execution of contract parameters specified in a contract reference transaction? If it is allowed to specify contract parameters within the contract reference transaction, it should be possible to adapt the HelloWorld example contract to send a message to an account specified in the reference transaction.

For example, when I send a trigger transaction from account A to the contract runner account B, the contract responses with a message to Account C (where account C is specified in the reference transaction).

What if there is another reference transaction that specifies an account D? How can I be sure that the response will be sent to account C? Is there a parameter for the trigger transaction to reference a specific contract reference transaction?

The trigger transaction only specifies the contract reference name. This contract reference name is unique per account. It is possible for a different contract runner to use different contract runner account with different contract reference names. Which means that the same trigger transaction can trigger different runners to load and run a different version of a contract from the blockchain or even a completely different contract depending on the reference.

Having said that, a trigger transaction most likely will set its recipient to a specific account, triggered contracts should first check if they are the recipient of the trigger transaction and ignore it if they are not.

There could be variations on this, for example a contract can choose to process a trigger  transaction for which its contract runner account is not the recipient. Perhaps the contract runner account has set specific account properties on a group of accounts it would like to consider when they are a recipients of a trigger transaction.

Having said that, in most cases I expect that only one contract runner will process a trigger transaction and the rest will ignore it.


Which address do I use to dump private keys from Bitcoin Core wallet? Trying to get my private keys from bitcoin core wallet
Have got to the part where i put in  dumpprivkey then it wants my address
Which address do i give?

It will be the public address that you want the private key for.

The details available in the question here might be useful:
Using dumpprivkey to make a paper backup


Could blockchain technology be used to implement a verifiable voting system? From an efficiency point of view, voting at elections online seems to make a lot of sense except that there is currently no way to have a completely trustable electronic voting system because of the lack of the ability to verify it, e.g. source code, transactions matching input, etc.

Blockchains seem like they could provide this function, but I've probably missed details – what are they?

Remember, this is in the context of national voting system where nations stick to paper based voting because they have no other way to verify and audit the accuracy of the vote.

Blockchain voting could be done easily. Each citizen could send an amount of bitcoin (say, 0.1mBTC) to the addresses of their favorite candidate address.
One obvious problem is that anybody could vote. A trusted third party could set up a site where each citizen gives his bitcoin address with his id number. There would be a window to give everyone a chance to vote (and, if one wishes to, change it).
After voting, the trusted third party could check the blockchain for the last transaction each citizen made.
We would still have to trust this party in counting valid votes, because presumably, it would be the only one with access to the database.
The database could be available once the election is over to allow complete transparency, but then, voting wouldn't be private anymore.
Furthermore, currently at 1MB per block capacity on the bitcoin blockchain makes voting on it a very big challange if not impossible.


Unconfirmed bitcoin transaction 5 hours Its been 5 hours since I did a transaction of $ 64 and it has not been confirmed
I checked it says unspent
Am very much confused please any help?

How much did you pay in fees? when they are too low they do take a while to confirm.

Keep in mind that you will not lose your coins. The tx will either get confirmed or around 48 hours that it hasn't been confirmed it will be invalidated (your coins returning to you).

Some wallets signal that a utxo is only spent after a transaction using it has been broadcast and confirmed. As you don't have confirmations, that's probably why it is marked as Unspent


Reject or refuse to relay a valid transaction Under the Bitcoin protocol, how much control does a node have on how a transaction is dealt with once received? Can a node reject a valid transaction? Can a node refuse to relay a valid transaction to neighboring nodes or is the transaction relayed automatically once validated? If not relayed automatically, why not? Why give a node the option to control whether or not a valid transaction gets relayed?

Nodes are just software, at the end of the day.

The Bitcoin Core software will automatically relay standard valid transactions provided they meed the minrelayfee.

It would be fairly trivial to modify the software to relay only if certain other rules are met, however. You could easily do this without impacting the rest of the node functionality.

Usually, the node broadcasting a tx will broadcast it to multiple peers, so even if some peers enforce additional relay rules, the transaction will be broadcasted further by those who don't.


How to get bitcoin Unconfirmed Transactions I want to built a platform for mining bitcoin.
So i want to know how to get all performed transactions for bitcoin and also all unconfirmed transaction like (blockchain.info).

You can use blockcypher api to check bitcoin address transaction.

http://api.blockcypher.com/v1/btc/main/addrs/{{YOUR_ADDRESS}}

For ex :
http://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD


Sending fund to an existing bitcoin address BTC address1 has 2 BTC
BTC address2 has  4.5 BTC
Assume the address is reused, the fee is zero.
Address2 sends 1.5 BTC to address1.
Thus, BTC address1 has 3.5 BTC and BTC address2 has 3BTC
Since BTC address1 is receiving fund, it does not need to sign anything.
The transaction
Input: 4.5 BTC address2 , output: BTC address2 : 3 BTC (return change), BTC address1: 1.5)
How does the blockchain know that BTC address1 got 3.5 BTC?

How does the blockchain know that BTC address1 got 3.5 BTC?

It doesn't know anything, it's just a list
Wallets and other software know by looking through the whole list of transactions from the beginning of time† and adding up all the amounts received by address 1 and subtracting all the amounts spent from address 1.

† Bitcoin time effectively started 12 January 2009


Is there a limit for bitcoin withdrawal at Mt.Gox? Their page states (https://support.mtgox.com/entries/20490576-Withdrawals-and-Deposits):

  All methods below are subject to a withdrawal limit of 1000 USD per 24hr period and 10000 USD per 30 Day period

They include bitcoin in the list below this statement too. Does that mean they will allow me to withdraw only number of bitcoins that currently has a value of 1000 USD?

"They include bitcoin in the list below this statement too. Does that mean they will allow me to withdraw only number of bitcoins that currently has a value of 1000 USD?"

No, it means exactly what it says, that you can only withdraw $1000 a day.

That being said there is an entirely separate limit that they place on bitcoins. On my account under funding options and withdrawals it reads

  BTC : You can still withdraw up to 100.00000000 BTC provided you have enough on your account (your limit is 100.00000000 BTC per 24 hours )


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

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

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

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

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

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


Private credit card/debit card exchanges? I've seen sites that make use of google checkout or other forms of cards processing to convert USD from debit/credit cards to BTC.  I know that these types of sites cannot be opened up to the public because it takes one bad egg to bring the whole thing to a stop.

But what is keeping someone doing this on a small scale to only trusted individuals, friends, family, ect?
Also if one person can do that, btw such sites do already exist, then why don't we(the community) write an open source version and all run such micro-sites for our friends and families?

Most people I talk to get interested until they realize how hard it is to actually buy coins.

If you operate below the radar that practice can thrive.  For instance, if you were to accept a friend's credit card swipe using your Square dongle for the sale of your bitcoins, you'ld probably be in violation of the merchant agreement.

If the charges are from friends and family and only made occasionally Square will probably never know nor care what the reason was for the purchases.  But start doing regular "card not present" tranasactions for larger transaction amounts (e.g., $100 or more) and that's probably when you'll end up getting asked for more details on your business activity.

Do know that you expose yourself to the risk of a chargeback should a payment dispute occur.


What restrictions are there to the application of opt-in RBF? It is a common meme in some parts of the Bitcoin sphere that RBF erodes the option of accepting zero confirmation transactions. It would be beneficial if the following questions were answered:

What restrictions are placed on RBF in the deployed "opt-in RBF" variant?
How does opt-in RBF interact with unconfirmed transactions?
What influence does this have on zero confirmation payment processing?

What restrictions are placed on RBF in the deployed "opt-in RBF" variant?
BIP-125: Opt-in Full Replace-by-Fee (RBF) Signaling specifies how to declare transactions replaceable until they are confirmed in a block. Replaceability is indicated via the sequence number field which appears in each transaction input. A transaction is replaceable if at least one sequence number in the transaction is smaller than MAX-1.
The meaning of sequence number values:

MAX: transaction is final
MAX-1: transaction uses locktime
MAX-1: transaction is replaceable

A spender may overwrite a replaceable transaction with a transaction of higher feerate before it is confirmed. The feerate must increase at least by minRelayTxFeeRate (currently 1 sat/vB). If the replaced transaction has descendant transaction, the replacement must pay more fees than all replaced transactions. When a transaction is replaced, the transaction update may opt out of future replacements by setting all sequence numbers to a final value, i.e. MAX-1 or MAX.
Bitcoin Core v0.12.0 and later versions will allow replacement under the above description, but will not create opt-in RBF transactions by default.
How does opt-in RBF interact with unconfirmed transactions?

Final (regular) transactions with a sequence number of MAX-1 or MAX are not affected. Nodes that implement opt-in RBF treat them exactly as before. Conflicting transactions of final transactions are still treated under the first-seen paradigm and not added to the mempool or relayed even when they pay a higher fee.
Non-final (RBF) transactions explicitly signal that they should not be accepted before confirmation. Bitcoin Core will create final transaction by default.

What influence does this have on zero confirmation payment processing?
Users get an additional new type of transaction that explicitly signals that it should not be accepted without confirmation.
Wallet developers should either:

Hide RBF transactions before confirmation
Indicate the replaceable status of RBF transactions and warn the user that they are only reliable after confirmation

Accepting final transactions (which don't signal replaceability) without confirmations has exactly the same risk considerations as prior to the introduction of opt-in RBF.
If you want to read more, you may be interested in this study on RBF adoption of various wallets by the Bitcoin Optech Group.


Download the entire blockchain on Bitcoin cash in order to get your bitcoin cash coins? Is it required to download the entire blockchain when using bitcoin cash client in order to send out bitcoin cash coins to an exchange?

Technically no, you only need to know your UTXOs so you can make a new transaction and sign that yourself. But if you want to use a Qt GUI or similar, then yes, it will attempt to download the entire blockchain again I would imagine.


What is payment batching? How does Bitcoin transaction batching work exactly?  How does this end up looking compared to a regular block of a bunch of transactions?  Also, I have read people claim batching causes weaker privacy, how is this exactly?

How does Bitcoin transaction batching work exactly?

Instead of paying multiple people using a new transaction for each person, you make one transaction that pays those multiple people.
For example, suppose you need to pay 3 people. Instead of making 3 different transactions with one output each, you make one transaction with 3 outputs to the 3 people you are paying.

How does this end up looking compared to a regular block of a bunch of transactions?

It is cheaper partially because each transaction has a fixed amount of overhead. By batching transactions, you only have to pay for the overhead once, not multiple times. Furthermore, usually each transaction will have a change output, and many times that change output must be spent again in the next transaction. This means that if you are sending to 3 people, you are creating 3 change outputs, and 2 inputs that have to spend from a change output. By batching, you only need to make one change output and you don't need to have those 2 additional inputs that spend the change. Those effectively cancel out and are thus removed from the transaction.
In a normal case with paying 3 people:
Input 1 -> Person 1
        -> Change 1 -> Spend Change 1 -> Person 2
                                      -> Change 2 -> Spend Change 2 -> Person 3
                                                                    -> Change 3

By batching:
Input 1 -> Person 1
        -> Person 2
        -> Person 3
        -> Change 3

So you have cut out Change 1 and 2, and Spend Change 1 and 2 which means you are paying less transaction fees.

Also, I have read people claim batching causes weaker privacy, how is this exactly?

All of the people being paid in a batched transaction can see who else you are paying and how much. However it is hard for observers to also know the true identities of those people.


Find all transactions for a bitcoin address I'm looking for a way to query all transactions related to a particular bitcoin address - I periodically need to find all transactions for numerous addresses.

I've seen info about bitcoind searchrawtransactions, although it looks like this may no longer be supported?

Any recommendations?

To use getrawtransaction to lookup any transaction, you have to have the -txindex flag set, so that all transactions are indexed. But, you have to know the txid.

getrawtransaction "txid" ( verbose "blockhash" )

NOTE: By default this function only works for mempool transactions. If the -txindex option is
enabled, it also works for blockchain transactions. If the block which contains the transaction
is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is
provided, only that block will be searched and if the transaction is in the mempool or other
blocks, or if this node does not have the given block available, the transaction will not be found.

I would recommend using an api such as blockchain.info

Single Address

https://blockchain.info/rawaddr/$bitcoin_address
Address can be base58 or hash160
Optional limit parameter to show n transactions e.g. &limit=50 (Default: 50, Max: 50)
Optional offset parameter to skip the first n transactions e.g. &offset=100 (Page 2 for limit 50)

{
    "hash160":"660d4ef3a743e3e696ad990364e555c271ad504b",
    "address":"1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F",
    "n_tx":17,
    "n_unredeemed":2,
    "total_received":1031350000,
    "total_sent":931250000,
    "final_balance":100100000,
    "txs":[--Array of Transactions--]
}

What you want is in the txs property of the returned json object.


What is the algorithm behind multisignature address? I know you can create a multisignature address with the command:

bitcoind createmultisig 2 ["pubkey1", "pubkey2", "pubkey3"]

As described here: https://gist.github.com/gavinandresen/3966071

This command returns the address (starting with character '3') and the redeem script.

My question: how to create that data without using bitcoind? What algorithms are used? I guess the address is just a hash of the redeem script, right? How could I generate the redeem script?

Could you point me to some sources?

OK, I found the answer I needed: https://bitcointalk.org/index.php?topic=317569


How does a miner identify himself There has been a new mining pool appearing after the halving called Lubian.com cf https://www.cryptoglobe.com/latest/2020/05/new-bitcoin-mining-pool-comes-out-of-nowhere-already-5th-largest/

How does a miners say to the world who he is, and how can he prove he is the one that has mined a specific block ?

They will either reuse the address in coinbase transaction subsidy output every time they mine a block, and then publicly claim that address, or they will "tag" their name (ascii-encoded) and some metadata in an OPRETURN or the scriptSig of the coinbase transaction.

Here's the coinbase TX from block 603526:

https://blockstream.info/tx/0eb39c3f1a6813dfe5bb9d86dd71de2593aa76f25d4f25b149c9f564eb33cd54

The script sig is

03863509fabe6d6d0f3e894118566fd52beccf2a405c060fb701171dd16d83f1fb4aa0219fa8656601000000000000002469020000535e15a74a1b00000000e6892f736c7573682f

which is ASCII for:

5  z>mm>   AVoU+lO*@\7Qmq{J !(ef$iS^'J /slush/

There's slushpool!


In PoS how is Net Stake Weight calculated In PoS coins there is a common 'time to stake' estimate, this is based on the users own accumulated stake amount as a proportion of the network wide stake weight.

However there is no way for any node to reliably estimate the network stake weight, in theory it's just all nodes individual weights added together, but as no single node is guaranteed to see all others without duplication, I wanted to understand how this is calculated.

While I don't know how other PoS blockchains operate, I can give some insight about the PoSv2/3 version based on Peercoin's implementation of proof of stake; one such example would be Novacoin.

The total network weight is ~computed by this function:

double GetPoSKernelPS()
{
    int nPoSInterval = 72;
    double dStakeKernelsTriedAvg = 0;
    int nStakesHandled = 0, nStakesTime = 0;

    CBlockIndex* pindex = pindexBest;;
    CBlockIndex* pindexPrevStake = NULL;

    while (pindex && nStakesHandled < nPoSInterval)
    {
        if (pindex->IsProofOfStake())
        {
            dStakeKernelsTriedAvg += GetDifficulty(pindex) * 4294967296.0;
            nStakesTime += pindexPrevStake ? (pindexPrevStake->nTime - pindex->nTime) : 0;
            pindexPrevStake = pindex;
            nStakesHandled++;
        }

        pindex = pindex->pprev;
    }

    if (!nStakesHandled)
        return 0;

    return dStakeKernelsTriedAvg / nStakesTime;
}

How the weight estimation algorithm works is pretty interesting: it iterates backwards through the blockchain, from the latest known best block until it finds 72 blocks that were produced using a proof of stake (basically all the past 72 blocks).

Using these 72 PoS blocks, it calculates the total amount of time that has passed between each consecutive block pair (added up to a total -- nStakesTime) and the total amount of "difficulty" that was satisfied during the production of those blocks (dStakeKernelsTriedAvg).

The final network weight estimation is given by dividing the "amount of work" by the "amount of time".

This algorithm does not attempt to calculate the exact amount of coins that are being "at stake" at any given time, because as you noticed that wouldn't be possible; yet the estimations it gives are pretty accurate.


address that has never been online, will transactions in blockchain still balance? I understand that addresses do not have to connect to the bitcoin network/blockchain in order to be valid addresses, but I am mainly wondering about what can be seen in the blockchain if that address has never connected to the network.

So given this scenario

AddressA sends 1 bitcoin to cold AddressB.  AddressB has never been online.

There will be a transaction id for this. But what would a site like blockchain.info show for the balance of AddressB?

Would it still be able to aggregate all of the transaction that go to AddressB to show a balance for AddressB?

There is no "being online" concept of an address in bitcoin.

An analogy would be to think of bitcoin addresses as if they were an email addresses. You can send to that address whenever you want and only the person with the secret key will have access to the contents of it. It doesn't matter if they are 'online' or not.

So to answer your question, when you first generate an address only you will know about it (unless of course you share it somehow).
As soon as you or someone else sends bitcoins to that address it will be present in the blockchain as part of a transaction


Why can non-standard transactions be mined but not relayed? As far as I understand, a non-standard transaction can be mined in to a block (and this block will be accepted by all nodes), but nodes will not relay a non-standard transaction to other nodes.

Why is it that miners have the freedom to construct non-standard transactions, but everyone else is limited to standard transactions?

I've heard that limiting the types of transactions that get relayed is some form of protection (against unusual script types that could cause problems). However, if this is the reason, doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?

I'm not against standard transactions. I'm just not sure how this situation came to be.

doesn't this just leave miners with the ability to perform an attack whilst leaving everyone else restricted?

Not necessarily. Many of the attacks that the standardness rules protect against require large and many transactions that are expensive to verify. If a node is sent a lot of expensive to verify transactions, it can effectively go down as it spends time verifying those transactions instead of verifying and relaying other "normal" transactions and blocks.

However by virtue of mining, a miner can only create transactions that are limited in size, and they are limited in the number of transactions that can be sent in a block. So non-standard transactions that are large and expensive to verify can be included in blocks (and they have been before), but because there are few of them and they happen, at worst, infrequently, it isn't that big of a problem. The problem is only when there are a lot of such transactions which can only happen via normal transaction broadcast, and then standardness rules will prevent those from being verified (standardness is checked before any expensive verifications happen) and relayed.


Why isn't the description field synchronized at different Electrum wallet? I use Electrum as my BitCoin wallet, and install it on both home PC and office PC.

I fill in "Description" field and send some Bitcoin on the office PC BitCoin wallet, it's OK.

The Electrum wallet on home PC can display the record except "Description" field, why?

1:  Is "Description" field  only for local record on Electrum wallet ?

2:  Doesn't a Bitcoin transaction record incude "Description" field?

Image 1

Image 2

A Bitcoin transaction holds no Metadata beyond what is required for moving coins. Any descriptions, labels, or other such information is purely handled by the wallet, and synchronizing it is up to the wallet.

Electrum does not synchronize any such data, so you will only see it on one device.


Errors Connecting to Bitcoind Server with RPC I have been trying to connect to a remote bitcoind -daemon running server. I can access it with the curl command explained at the end of the page here (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)) by putting in the correct port number, but when I try to call from a remote host, I get a:

curl: (7) couldn't connect to host

error

I checked with netstat and it looks like bitcoind is listening on the port (otherwise I wouldn't be able to do rpc locally), and accepting all incoming IP addresses.

My bitcoin.config file also allows for all IP addresses and rpc (no ssl, although if anyone has a detailed decscription of how ).

I also made sure that I opened up a TCP port.

Here's the curl command I'm using:

curl --user <user> --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' <ip address:port>

Does anyone know what else might be wrong?

Bitcoin disallows rpc requests from IP addresses other than 127.0.0.1 Try adding

rpcallowip=<your ip addres>

to your bitcoin configuration file.

More info


How is the transaction malleability issue being fixed? With the upcoming release of Bitcoin Core 0.9, I am wondering how the transaction malleability issue is being fixed and what are the consequences of the fix?

It appears that transaction malleability is causing a few problems for the Bitcoin network:

The network is DDoSed by multiple apparent double-spends being relayed
Senders of the transactions need to avoid spending 0 confirmation transactions in case they become invalidated by malleability
When saving TxIDs of spent transaction for record keeping one has to make sure the TxID did not get changed later

Will all of those issues be addressed in the upcoming update, and if so, how will they be addressed?

Transaction malleability is a consequence of the features of Bitcoin. The input data (scriptSig) for claiming outputs is purposely malleable to allow for useful scenarios where one would want to claim outputs in different ways.

The consequence of these features is that the hash of the transaction changes and shouldn't be considered as a useful piece of information other than referencing outputs of transactions that have been confirmed.

With that being said, I'm not sure what changes the client could implement to prevent the hash from changing. Perhaps it can enforce specific rules, like making non-canonical data pushes non standard, however that may interfere with later extensions to Bitcoin.


Step by step example to redeem a P2SH output required I have been following BIP16 in creating a P2SH transaction. I want to create a simple (one signature) P2SH. I am getting an error when trying to broadcast the tx. Error is 16:  mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
To be clear, I am not trying multisig. What I am doing can be best described as P2SH-P2PK, though I have not seen this term.
This is the only example given in BIP16, so this should work.
Here is what I have tried (testnet):
private key: BB2AC60BC518C0E239D5AF9D8D051A6BDFD0D931268DCA70C59E5992
public key: 039f53e45f8f18b8ed294378bda342eff69b2053debf27fbede7d2d6bd84be6235
(compressed)

redeemScript: [{pubKeySize,pubKey}] [OP_CHECKSIG]
21039F53E45F8F18B8ED294378BDA342EFF69B2053DEBF27FBEDE7D2D6BD84BE6235AC

redeemScriptHash: RIPEMD160(SHA256(redeemScript))
323D0E8A083E98010299109337850D05DD6157F7

p2shAddress: Base58Check(0xC4 + redeemScriptHash) (C4 for testnet)
2MwprvB9tUMtX4vK8zJK8K329fNu79CJgR7

The above address has two UTOXs on testnet:
UTXO1: e434a13cac79dc3d26e7279bff05c0f071a2df03e2ba6ca13c88f0e82dca9998:0
UTXO2: 9b4943e7ab5f4512e42c94254eb6aab4c6823ce06d4ff816b7ce4fda155a2571:0

I now want to spent both UTXOs and keep following outputs:
Out1: 2MwprvB9tUMtX4vK8zJK8K329fNu79CJgR7 34000000 Satoshis
Out2: 2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF 100000000 Satoshis

I created the tx as follows:

Create unsigned transactions with all scriptSigs empty

For each input to sign, set its scriptSig to redeemScript: 21039F53E45F8F18B8ED294378BDA342EFF69B2053DEBF27FBEDE7D2D6BD84BE6235AC,   keeping other scriptSigs to empty.

Serialize the new tx and append SIGHASHALL bytes (0x01) in little endian 4 bytes

Double Sha256 above and sign resulting value. Add one byte 0x01 to signature to indicate SIGHASH_ALL. Let sig be the resulting value.

Set the scriptSig as:
[0x00] [{sigSize, sig}] [{pubKeySize, pubKey}] [OP_CHECKSIG]

I am assuming that the following scriptPubKey will be used:
[OP_HASH160] [{scriptHashSize, scriptHash}] [OP_EQUAL]
The following are the k, r and s values for each input's signature:
Input 1:
k = 98790447509501799195296257240616657470656053786701275200434341714298778299820
r = 96398386359095408146340664941016369169423137684113382189227162443480418477689
s = 62903510511574365450545635776206168644738316078298063260649088246548574249129

Input 2:
k = 109372172176680138721552873719725202562296645126925021083510279924852033069204
r = 105162394984132461723584277789901247831150698039237112243693144757926439529504
s = 62903510511574365450545635776206168644738316078298063260649088246548574249129

After this, I am getting the following error in bitcoind for sending the tx:
error code: -26
error message:
16: mandatory-script-verify-flag-failed
(Signature must be zero for failed CHECK(MULTI)SIG operation)

What am I doing wrong?
EDIT: Thanks to the answer by arubi, I found there were two issues with the above steps. First thing, I was doing wrong was not encoding the redeemScript as stack data. Second thing, I was doing wrong was putting [0x00] in scriptSig. After fixing that, Step 5 should be:

Set the redeemScript as [{pubKeySize, pubKey}] [OP_CHECKSIG]

Set the scriptSig as [{sigSize, sig}] [{redeemScriptSize, redeemScript}]

The issue is, scriptsig contains the actual redeemScript instead of the serialized script as a push.  The second error, the redeemscript contains an extraneous  0x00 value that should not be there as this is a simple CHECKSIG.


Is a wallet just a collection of private and public keys? There is a fundamental bitcoin concept I don't get. Am I correct in that all I "need" to send and receive money are a single address and its associated private key?

In other words, can't I just create an address and private key and print them off and store it in my desk? And in this case, if I print two adresses and private keys, couldn't my physical desk be considered a "wallet"?

I'm just trying to figure out what a wallet is specifically. Is this just some sort of file or folder that stores those private and public keys?

Thanks!

A wallet can be as simple as just a private key by itself even as software that has access to that can derive the public address from it.  So yes, that data alone can be considered a bitcoin wallet.

But you asked if that is all you need to send and receive so for that you will need software that uses the private key to spend the funds.  Sometimes the term "wallet" is used to refer not to just the data stored but transaction data as well, along with the software that can create transactions and do the accounting for them as well so that you can know your balance.

Proper vocabulary would describe wallet software as being a bitcoin client.  The bitcoin client from Bitcoin.org (also referred to as the "Satoshi" client) does this, and has a local wallet as well.

My Wallet from http://BlockChain.info/wallet is managed through a server, but the wallet itself is stored in your browser.  That type of wallet and client is termed a Javascript-based wallet.  Sometimes the term "hybrid wallet" is used, since to spend using My Wallet you need to use their hosted service where the transaction gets processed.

Another type of wallet is an e-wallet where the wallet data is stored by the service's operator.  An e-wallet can also be referred to as a "hosted wallet".  InstaWallet is one of these.  The just-launched Paytunia is another.  An account at an exchange which hold bitcoins for you is another type of e-wallet service.  Using a hosted wallet incurs risks involving trust extended to the wallet's operator.

But the simplest form of a wallet comes from http://BitAddress.org

It gives exactly what you describe -- a private key and a public address.  This happens to provide one of the most secure wallets as well.  The html source can be copied to a thumb drive and then used to create paper wallets from an "air gapped" system (such as a computer running a secure operating system perhaps using a LiveCD linux distribution) that has no connection to the network and is used for printing out paper wallets.


I'm trying to run Bitcoin on a weak computer, which client consumes the least resources? I am running the standard client on a weak computer (Windows environment). It often is slow and unresponsive, and takes a noticeable chunk of the hard drive. I would want to replace it with some alternative client that offers the same functionality (mainly, running as server and supporting the standard Bitcoin API), while also consuming less system resources.

Which Bitcoin client consumes the least system resources and is the best fit for weak computers?

There is a very useful comparison of the Bitcoin desktop clients here:
http://dre.redmartian.org/compare.htm

In order 'lighter' to 'heavier' there are:

electrum

multibit

bitcoind

armory + bitcoind

If you need the full bitcoind RPC API then only bitcoind will do however. In that case trying/ waiting for v0.8 is probably your best option.


Is bitcoin just one long block chain or are there multiple chains? Is each block found just a link in the same long chain, or are there multiple chains?

The Bitcoin blockchain converges to a single-file chain because each block references exactly one predecessor, and thus there can only be one block at every height in the chain connecting the genesis block and the chain-tip.

However, at times more than one block will be found at the same height. This happens either due to the mere happenstance of two miners discovering a valid block in the same instant, which is benign and will rectify by itself when one of the two sires a successor block and thus creates a new longest valid chain, or it could happen if a faction in Bitcoin adopts an incompatible protocol rule change (hardfork). Since network participants that don't accept the rule change will not accept these blocks as valid, two chain-tips may persist henceforth.

Recently, the hardfork plans of Bitcoin Unlimited have been a major topic in Bitcoin, which frequently includes discussion of possible scenarios with two incompatible chain-tips. I assume that you seeing a discussion of that sort gave you the idea that there could be more than one chain.


Transferering Bitcoins from Coinbase to Binance I've heard people say that you should transfer your Bitcoins from Gdax to Binance. I bought my Bitcoins on Coinbase. Is there a way to transfer your cryptocurrency to Gdax without paying that overwhelming fee?

Your question is a little unclear. Transferring funds between Coinbase and Gdax is free. You just have to sign up for an account with both.  See https://support.gdax.com/customer/en/portal/topics/939402/articles.  Gdax does have lower transaction fees than Coinbase.  You can easily transfer your BTC to Binance but there will be a mining fee associated with the transfer. Coinbase trades BTC, ETH, LTC, BCH. Binance offers many more altcoins to trade so unless you want to trade for these altcoins, I don’t see a big advantage for transferring your BTC to Binance.


"offline" blockchain querying library Is there a library which provides all the same address/transaction querying information as blockchain.info, depending only on having a bitcoind synchronised database?

There are a number of queries which bitcoind cannot answer. For example, bitcoind only indexes transactions which are unspent.

I realize blockchain.info has a public API, but it isn't an option for us to use this. I doubt they'd want us to spider the entire blockchain over their API anyway.

You should take a look at Abe:

Abe: a free block chain browser for Bitcoin-based currencies.

Abe reads the Bitcoin block file, transforms and loads the data into a database, and presents a web interface similar to Bitcoin Block Explorer or Blockchain.io.

Not to mention it was written in Python.


Anonymous Buying/Selling If one person sold bitcoins to another person using a smartphone, will a record of the IP addresses of the devices they used be seen in the blockchain?

No the blockchain does not contain IP addresses.

The bitcoin node or bitcoin API server (if used) that you initially send your transaction will know the IP though and they could keep it in their own databases.

For anonymous buying/selling you can use the Tor network. You may also be interested in mixing to anonymize bitcoin address (e.g. if you bought your bitcoins from an online exchange that has your IP plus much more).


Location of blockchain locally on different platforms, and structure of blockchain file? I just downloaded Bitcoin-QT, and torrented a snapshot of the block chain that is a couple weeks old. I put the bootstrap.dat in ~/Library/Application Support/Bitcoin and started up the app. Right now it is "Importing blocks from disk". Where do the blocks goes once they've been imported? A friend of mine says that the Bitcoin app makes a Merkle tree out of the blocks in the block chain. How is this stored? I want to write a program that takes snapshots of the block chain every couple hours. It would be much better if I could just update a copy of the block chain as needed instead of making an entire new copy and deleting the old copy.

How do I make a bootstrap.dat out of the blkXXXXX.dat files?

You will find the .dat files in the following locations:

Linux: ~/.bitcoin/blocks
MacOS: ~/Library/Application Support/Bitcoin/blocks
Windows: %APPDATA%Bitcoin\blocks
WinXP: C:\Documents and Settings\YourUserName\Application data\Bitcoin\blocks
Win7/Win8/Vista: C:\Users\YourUserName\AppData\Roaming\Bitcoin\blocks

I always found the following attached image helpful in order to understand the structure of the dat files. I am sure it will help you too.


How do I import a private key into Bitcoin-Core? How do I import a private key into Bitcoin-Qt? bitcoind is nowhere to be found, and pywallet says it requires "bsddb" when I run it, which is also nowhere to be found. I generated some vanity addresses and I want to use them.

Run Bitcoin-Core
Select Help (to the right of Settings)
Select Debug Window
Select Console
If you encrypted your wallet, unlock it by entering walletpassphrase "YourLongPassphrase" 600 next to the > input box
Next to the > input box type importprivkey <bitcoinprivkey> (Note that the private key must not have spaces, remove them if they are included in your backup)

Example: importprivkey 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS


Which mining software/script provides the greatest MHash/sec and power efficiency balance? Hopefully this is not too specific..

Which mining software/script provides the greatest MHash/sec and power efficiency balance? (I'm currently using an old version of phoenix miner)

Preferably for the 5xxx series of cards, but if some mining programs are generally more efficient than others in terms of MHash/sec to power usage ratio, those are also welcome.

Thanks

My experience with a 6990 rig is that m0mchil’s Python OpenCL GPU miner is the most efficient one for me.

But I would try them out on a 12 hour basis, and do a comparison. Maximum output might be very different between software/hardware combos. Would love to see the results.


How to programmatically determine the number of bitcoins ever deposited to a given address? I am building an application for which I wish users to be given a unique address to which they can freely deposit funds into their account. Meanwhile, I want to be able to both track their balance and use the bitcoins they've given me. Their balance is effectively the total amount of bitcoins that their assigned address has ever received (regardless of if the coins have been spent) minus whatever I've charged them, and I need a way to determine the first bit.

Also, my server does not have enough storage space to use bitcoind, so I've been using electrum, though I'm fine using another piece of software or even a web api so long as it's reasonably secure.

Using electrum, after instantiating a Wallet instance, the code to achieve this looks like so:

def get_total_received(addr):
    """Returns the number satoshis ever received by this addr.
    Includes coins sent to this addr from this addr (eg change)
    and coins received by addr, but already spent"""
    load_interface()
    hist = wallet.get_history(addr)
    s = 0
    for tx_hash, tx_height in hist:
        tx = wallet.transactions.get(tx_hash)
        for out_addr, value in tx.outputs:
            if out_addr==addr:
                s += value
    return s

The main difference between this method and what is presented by blockchain.info as 'Total Received' is that if the address sends bitcoins to itself, this method will count those towards the total received whereas blockchain.info will not.

Note that this only works if addr is contained in your electrum wallet.


Can the blockchain be included in future packages of the standard client? Is it possible to include actual transaction history to new version of Bitcoin client?

I mean, when someone new downloads a fresh version from http://bitcoin.org.

It is very hard to get more people into the Bitcoin community, when the start takes sooo looong.
(It looks like it never ends, like a bug.)

You can download the transaction history separately (don't have the link on me currently). Adding it to the client would also be disencouraging - 1GB of a "program" doesn't appear too user-friendly.

Alternatively, one can use a lightweight client (like Multibit or Electrum), or an eWallet (like StrongCoin).


What is Skrill's policy on its use in BTC trading? Is Skrill tolerant of Bitcoin trade using its system?
Does it have any kind of history of reversing transactions or suspending accounts involved in Bitcoin trading?

Section 6.7 of the Skrill ToS bans sending payments that are "in connection with any money changing or transmitting business, including but not limited to bureaus de change or currency exchanges"

Bitcoin trade counts as currency exchange, so yeah.


In Electrum, how does one watch/poll a wallet for an incoming payments to a certain address via API? I want to create a simple way to accepting bitcoins on my own, using Electrum. I don't except big volume. I suppose, I'd have at most a handful of incoming payments in the beginning.
That is, I generate an address, a new one for each checkout where Bitcoin is selected as a payment method. And then I'll need to watch an address, via API of Electrum, for an incoming payment of a certain amount. The 1st confirmation, at least, which will have to arrive within, I suppose, 1 hour.
How can it be implemented? I don't need the code, but a high level explanation: what API to use, potential caveats and suggestions in general.
P.S.
I'm aware of this - https://electrum.readthedocs.io/en/latest/merchant.html , but it won't work for me. I'm a developer, therefore I can create a simpler solution and which I also could customise however I like.

I have worked with Electrum 3.3.8 daemon through JSONRPC interface.
A vary simple explanation how it woks in my case:

I send to Electrum "addrequest" command which contains also amount of BTC, memo, timeout.
Get the address of payment in answer from Electrum and display it for payer person.
Store address in database for further checking.
Periodically checks (by cronjob) statuses of addresses by
"listrequests" command.

If status is "Paid" and there are more than 1 confirmations, then payment accepted.


Can hashtype in BTC scriptSig contained value other than 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0x83? As per hashtype value in https://en.bitcoin.it/wiki/OP_CHECKSIG or https://developer.bitcoin.org/devguide/transactions.html#signature-hash-types, hashtype could either be 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0x83.

However, looking at bitcoin testing data in https://github.com/bitcoin/bitcoin/blob/452bb90c718da18a79bfad50ff9b7d1c8f1b4aa3/src/test/data/sighash.json, the hashtype could be in many other value such 1190874345 or -886562767 or other numerical value

Thanks for in advance!

Yes, the sighash type can be other than 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, and 0x83, but it can't be values like 1190874345 or -886562767. You will see these in the tests because of the specific functions being tested, but those sighash types will not work in actual transactions.

In actual transactions, the sighash type is the last byte of the signature item. Because it is one byte, there are only 256 possible sighash type values. However, in creating the sighash (and the functions that create that) take a signed int which is 4 bytes. So the unit tests for that function use valid values for the function but those are not valid in transactions.

So in actual transactions, you can use other sighash types. How they behave is a little hard to describe. Confusingly, sometimes the sighash type is treated as a bit set, and other times, as an int.

If the eigth bit (most significant bit) is set, then the SIGHASH_ANYONECANPAY behavior will apply. If taking just the first 5 bits is equal to 2, then SIGHASH_NONE behavior applies. And if taking just the first 5 bits is equal to 3, then SIGHASH_SINGLE behavior applies. All values that do not meet these requirements (which includes the default SIGHASH_ALL 0x01) all mean to use the SIGHASH_ALL rules.


Where can I buy bitcash Is there any where I can buy bitcash ahead of the fork? Or do I need to keep my bitcoin in wallets that won't signal SegWit?

Bitcoin Cash is technically just Bitcoin before the fork, it doesn't really exist as such, and any Bitcoin you own will become Bitcoin Cash as well after the fork (because your UTXOs will be valid in the shared chain before the fork and thus valid in both branches). Until the fork happens, there is only one blockchain, hence the term fork.


How to integrate 0-conf BCH payments into a web app? I am currently working on a Bitcoin Cash related project with the goal of helping contribute to the ecosystem. I am getting to the point where I will soon be ready to start integrating with the protocol, but I am not quite sure how to proceed. The workflow I am looking for goes something like this:

User visits my website
User is presented a QR code that is for a specific payment amount (always $0.25 usd)
User scans QR code and submits payment
Website is listening for the broadcast of the payment (0-conf), and as soon as the network broadcasts the payment, a callback is executed therefore the user's session knows that their payment has been received.

I know the Bitcoin Cash Fund project is currently working on a bitcoincash.js library but it's not ready yet. Since that is the case, I assume I am going to have to fork the current bitcoin core js library and make it work with the cashaddr format to generate addresses for the QR codes.

The other piece that I am unclear about is how to go about listening for broadcasted txns. I see there is a blockchain.info websocket server, which I assume since they announced full support for BCH, that it will work with BCH:
https://blockchain.info/api/api_websocket

But, from what I can tell, I don't think it's possible to use the testnet?

So that is making me wonder if relying on a 3rd party for this, especially with it being 0-conf, is a bad idea? If so, I assume the answer is to run my own node and somehow have my own websocket server query it at regular intervals. Is that correct?

Also, on the topic of pub/sub for this, what is the best way for the client know a payment was made for that specific user? Is it to just generate a new address with each visit to the site? Or is it to include some sort of uuid as metadata with the txn?

You can host your own Bitcore Web services Bitcore

You can do things like as follows.

User present QR with the random address using this library Bitcore Library
User sends payment using wallet.
Website will be listening to transaction broadcasted by customer wallet.

Here is the resource for a payment protocol read it thorough you will get an idea. Bitcore Pay Pro

Talking about 0-conf: Once a transaction is sent, it is broadcasted immediately even if the next block has a few minutes before its found. If you as a merchant running  a node has capability to verify the transactions.

You can host your own BWS. No need to rely on 3rd party.

For more please refer to bws docs.


How it is possible to create coins only with the proof of stake system? Nick Szabo comes 2011 with a alternative proof system wich he calls proof of stake POS. This system was used later by varios coins ( NXT, Peercoin, Blackcoin etc.)  but all of them had the genesis coins premined or have them created in the beginning with the proof of work system. But how it would be possible to create coins only with the proof of stake system from the beginning ?

The problem you are describing is: how do you mine coins in proof of stake if you have no stake? In essence; you can't, depending on the implementation obviously. If you don't have any coins, you won't be able to mine new blocks. The easiest solution is obviously buying coins from another. If the original creator(s) of a PoS coin simply sell most of their early work, others could start mining as early as the third block (genesis block to finance the creator, second block to transact to others).


Proof of Work and Proof of Stake - Competitive advantage It is said that Proof of Stake will be the mainstream consensus mechanism in the long run. Regarding the nature perspective I totally agree. But it has been rumoured that Proof of stake is more democratic way of having consensus since at proof of work mechanism; people who have more money can invest more to hardware so they have the competitive advantage. Again correct but if we think the other way around if you have more money and buy more Ether tokens you are again have the competitive advantage at the Proof of Stake consensus mechanism. OR am I missing something?

but if we think the other way around if you have more money and buy more Ether tokens you are again have the competitive advantage at the Proof of Stake consensus mechanism. OR am I missing something?

You're not missing anything.

Instead of people investing money in hardware, it becomes people hoarding coins and investing money into buying more coins. All that serves to do is make the rich richer and is really no better than PoW in that regard. This sort of behavior can lead to stagnation of the coin's economy as people use it less and less for transacting and keep holding more for staking.

Furthermore, Proof of Stake has problems, specifically the Nothing At Stake problem. If someone wanted to fork the blockchain, they can do so without risking their money. They can then stake on both the fork and the original at no extra cost. This is not good for the coin. But with Proof of Work, if a miner forked the blockchain, they do have something at stake: they hashrate can only be used to mine the fork or the original, so they risk losing their money if they mine on the wrong fork. Thus there is an incentive to not fork.


I sent some USDT Tether to a Bitcoin Paper Wallet. Can I still claim it back? I sent some USDT Tether to my bitcoin paper wallet. I have the private key, but how do I extract my USDT from this paper wallet? I also have some left over BTC too.

Yes you can since USDT is built upon the Bitcoin Blockchain thru a protocol layer known as the Omnilayer. You will still be able to access the USDT within that wallet address so long you have the private key.