How does changing transaction data in a block change the hash of previous block? I am reading this article, within which it mentions that

"Imagine this for a second, a hacker attacks block 3 and tries to change the data. Because of the properties of hash functions, a slight change in data will change the hash drastically. This means that any slight changes made in block 3, will change the hash which is stored in block 2, now that in turn will change the data and the hash of block 2 which will result in changes in block 1 and so on and so forth."

And I do not understand if a hacker attacks block 3 and try to edit the transaction data within it, how would this affect the hash stored in block 2? And hash of what is stored in block 2 ?

Can someone kindly clarify for me please ? I am just getting confused.

It does not!

Next block contains a reference to previous block header hash.

Let's say the blocks are ordered as 1<-2<-3<-4<-5<- with block 1 being the first block in the chain (so called genesis block).

Block 2 header contains a reference to block 1 header hash.

Block 3 header contains a reference to block 2 header hash.

Block 4 header contains a reference to block 3 header hash, and so on.

If someone changes block 3 header block 4 will not point to that block's header any more, and the part of the chain -4<-5<-6<-... will be invalid.

Each block's header contains a construct (called Merkle root) which is derived from all transactions. Thus changing a transaction in block 3 will make Merkle root in the header of block 3 invalid and the attacker must also change that. Meaning the header will change and thus block 3 header's hash will change. Thus block 4 header won't point to block 3 header hash any more.

NOTE: On the other hand block 3 will also be invalid with respect to its required target threshold but this is another issue.


What wallets currently support RBF? What wallets currently support RBF?
Is there some workaround if they don't?

No wallet currently supports creating replaceable transactions conveniently. To work around this, you can manually create raw transactions from scratch.

The following are suggested instructions for use with bitcoin-cli.

To create a replaceable transaction. You can use "createrawtransaction" to manually add inputs and mark the "nsequence" field to a value less than 0xffffffff. If you would like to replace the first transaction created this way. You will have to dump the transaction to free the UTXOs for use again using the "abandontransaction" command.

Once you've dumped the first transaction. You should be able to repeat the process above then increment the "nsequence" field. This new transaction when broadcasted should then be accepted by any node that supports full RBF.


Can someone please explain the meaning of "neutrino" within the lightning network? Rene Pickhardt wrote the below quoted comment in another thread about whether a mobile wallet can be both a full lightning node and wallet at the same time.

  I have many lightning nodes running but they all need to at least communicate with a bitcoin full node at this time. Most of them share the same bitcoin full node. So yes you could have a lightning node running on your phone that talks to a bitcoin fullnode somewhere else. The game changes when neutrino is fully working (I think it is still not integrated to bitcoin core) – Mar 4 at 22:03

Could someone give more precise explanation -

1)  What is this "neutrino" referred above?

2)  When is it expected to fully work, on what is timeline dependent?

3)  And to what extent/how would this "neutrino" change the "Game" as implied above?  What effects would it have on the way lightning works?

Building on the great answer by Andrew:

  1) What is this "neutrino" refered above?

Where as BIP 37 generates a client side Bloom filter including the HD wallet addresses, BIP 157/158 "Neutrino" creates a server side [can be any Bitcoin full node] Golomb-Rice filter including all transactions in a valid Bitcoin block. You are no longer querying if a specific transaction is in a block, which might reveal which transactions you are interested in, but rather you query which transactions are in a block, and then you download the interesting blocks from another node. Every valid block has only one correct BIP 158 filter, and you can thus cross reference against several different nodes.

  2) When is it expected to fully work , on what is timeline dependent?

I don't know how fast the core process will integrate BIP 157/8 [probably in two weeks?!], but because this is not a consensus critical change, it can be implemented by individuals much earlier. For example, Wasabi Wallet is creating Golomb-Rice filters on the centralized Wasabi back-end server, the individual wallets are checking which block contains their interested transactions, then the wallet is downloading that block on the Bitcoin P2P network over tor, or from your own full node. This provides great privacy improvements, as neither the Wasabi back-end nor the P2P network know exactly which blocks [due to tor / your own node] or addresses [due to BIP 157/8] you are interested in.

Further, Lightning Labs has a testnet version of their app which is running Neutrino, their implementation of BIP 157/8.

  3) And to what extent/how would this "neutrino" change the "Game" as implied above? What effects would it have on the way lightning works?

As Andrew points out, running your own full node and verifying the entire block chain is the best practice for both security and privacy. With SPV proofs you inherently "trust the miners" that the chain with most accumulated PoW is valid. "Inverted" block filters protect wallet privacy and is a great improvement to address filters. I'd say that in all regards: Own full node >>> Golomb-Rice filters > Bloom filters.


How do you setup a bundler for mining / forging child chain coins on the Ardor platform? Is there a step by step guide on how to start your own bundler to mine / forge child chain coins on Ardor? Do you need to run your own server to do this or can you just login to a public node?

From the wallet cogwheel menu select the bundlers page and start a bundler.
You will need to specify your passphrase in order to run a bundler so you'll have to run it on your own node. You also need the node admin password in order to list the bundlers.
Here is some additional discussion https://nxtforum.org/general-discussion/ardor-child-chain-bundler-questions/


Minimum software to broadcast a Bitcoin transaction on a resource constrained environment What is the minimum software I would need to broadcast a Bitcoin transaction without using an external service like bitcoin.info?

I have a signed transaction that I just want to spit into the
blockchain preferably through the command line.
Preferably without having to fully install Bitcoin core.
Preferably not using a browser.
I don't have the resources to run a full node.
I have a very limited bandwidth, think of it from an IoT perspective.

The least resource demanding method I can think of is to use cURL.
The code snippet below will broadcast using https://blockchain.info/pushtx

curl -X POST -d tx='your raw transaction in hex format' https://blockchain.info/pushtx

Example usage:

curl -X POST -d tx=0100000001492d631b86db96ab8b2d50bea0bec53ebde8eda603bdae6441289de454f89cd8010000006b483045022100e21e298f1ce99ade77502955b2bfa1acf1ada40a30e7b3a8ed86ae08bf9b7566022001a9b43a24abdb1b90eac434619f0a49ca2c8ec4152576ac8df0b63de43e2e68012102ed8725a530d72af0cbbaa96b1936042952ae73b78221edc596ea53c9a1c7a2b2ffffffff0210270000000000001976a914a0e6ca5444e4d8b7c80f70237f332320387f18c788ac250e0000000000001976a914ff4b370002146338c95827273de755e0eb8574cb88ac00000000 https://blockchain.info/pushtx

Otherwise I would recommend using a SPV wallet like Electrum, it is both lightweight and not resource-demanding at all.

If you are looking for the highest level of granularity/control, Bitcoins the hard way: Using the raw Bitcoin protocol might interest you.


Question on interpreter.cpp in Bitcoin core - set_success method https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp

Line 22 => Where is declare "ScriptError" ? What does the "*" mean ?

           "inline bool set_success(ScriptError* ret)"

The enum ScriptError is defined in https://github.com/bitcoin/bitcoin/blob/master/src/script/script_error.h, and the * means that set_success requires you to pass a pointer to an enum value rather than the enum value itself.

I have to tell you, however, that if you are asking questions like "What does the "*" mean?", then you are going to have a hard time understanding C++ code.  I highly recommend doing some tutorials on C++ programming before going any further.


Minimum for sending BTC from BTC wallet Is there a particular minimal amount of Bitcoin one is allowed to send under which it is too low to be confirmed as a valid transaction from the bitcoin wallet?
For instance, I have got approx. 85 Euros worth of BTC [0.001707] (at the time of writing this message) in my Bitcoin.com wallet. I seem not to be able to send this amount to any exchange (I keep on receiving the error at confirm "Insufficient funds for fee")?
Unfortunately, I couldn't find any info on site regarding this issue.

Is there a particular minimal amount of Bitcoin one is allowed to send?

0.00005460 BTC.
According to Paxful

Before making any transactions or depositing Bitcoin to your Paxful wallet, it is important for you to know the minimum BTC amount allowed by the blockchain network for a transaction.
Currently, the smallest amount of Bitcoin you can send or receive in a transaction is 5460 Satoshis, which is equivalent to 0.0000546 BTC.
One of the reasons behind this limit is to prevent spamming transactions.

Although Paxfull isn't Saint Bitts LLC (owner of Bitcoin.com) they are talking about Bitcoin network limits, not proprietary company limits. So it applies. See also What's the minimum transaction with bitcoin?
To send smaller amounts you'd have to use something like the Lightning Network (LN).
Currently 0.0000546 Bitcoin equals approximately 2.71 EUR
Your 0.001707 BTC is larger than this limit. So this is not the cause of your problem.

I keep on receiving the error at confirm "Insufficient funds for fee"

Take the transaction fee into account
"Insufficient funds" is an entirely different problem. When you send x amount of money, for the recipient to receive x you also have to send a transaction fee y. So the amount needed in your wallet at the start is x+y.
See https://bitcoin.stackexchange.com/search?q=insufficient+funds
The size of y depends on

The complexity of your transaction (especially amount of small change rustled up to make the amount)
How busy the network is
How long you are prepared to wait for the transaction to go through. Minutes? Hours? Days? Weeks?

Many wallet programs help you to choose an appropriate fee. You can also use a search engine to find sites that report on current fee-rates.


What do the "Fetch Wallet" options when opening a Ripple wallet mean? When I open a Ripple account, I can choose to fetch my wallet from

Payward, Local Browser
Payward
Local Browser

What does this mean? Can someone elaborate on the differences, and when is each option appropriate?

"Payward, Local Browser" tries to fetch your wallet from Payward and if an account has not been found or if the Payward is not available / you are offline, it tries to fetch the wallet from local storage.
"Payward" only looks in Payward.
"Local" only looks in local storage.

P. S. You've set where to save your wallet in https://ripple.com/client/#/register right after the "Create Wallet" button.


Merging blockchains after algorithm change When a cryptocoin changes algorithm (eg. scrypt to X11), how does one achieve the merging of the two blockchains?

I'm assuming that they couldn't be directly compatible based on being completely different algorithms, it would cause a loadBlock() error. They also couldn't just make two blockchains, as all of the scrypt mined coins would be unspendable on the x11 blockchain and vice versa.

I have seen instances of crypto developers having a v1 to v2 exchange (usually at some ratio like 0.8:1), however that would require the v2 blockchain to have a premine for the conversion distribution.

Hopefully I'm not too far off on my thoughts here, any clarification would be greatly appreciated.

I should specify that by merging I don't mean running both algorithms on one coin (saffron-style), I mean how to implement something along the lines of

if blockNumber <= (maxScryptBlock) do
    {block.readHash(scrypt);
    }
else if blockNumber >= (maxScryptBlock) do
    {block.readhash(x11);
    }

I can't seem to find any writings anywhere on how a developer makes the switch from one algorithm to another, or really any for cloning any non-scrypt/sha256 coin.

That seems possible, but I'm not aware of any instances of it being done before.

You have three major problems:

Bitcoin generally assumes that there is one single ordering of transactions. That ordering can change, but there's always only one. The danger is that your two blockchains contain transactions that are mutually exclusive: transaction A and transaction B both spend the same coins, so only one can exist in the new master chain.
Everyone needs to upgrade to a client that supports the new merged blockchain, and the algorithms in both chains. Some people might have been screwed over by the previous step in the process (because a transaction they relied upon was essentially reversed,) so they might be a little reluctant to do this.
You need to avoid introducing any subtle security bugs while doing this.


Betting using Bitcoin Blockchain User1 bet the hash of Block 999,000 that hash(block(999,000) = even
user2 bet the hash of Block 999,000 that hash(block(999,000) = odd
Both users pay/sign 1 BTC in a CoinJoin for that bet to a P2SH. The winner will win 1.99BTC and 0.01 BTC is the tx fee.
How to make the scripts that can perform such action?

Script1 that perform the betting section.(that specify the criteria for redemption).

Script2. Redeem script (based on the output of block 999,000) that transfers the fund to the winner new PubKey Hash.

You can't.
Bitcoin Scripts have no access to the block hash, and cannot determine if it is odd or even. You would need an external oracle for this.


If I install the Bitcoin progam on my computer, that simply means that I will be mining Bitcoins over time? I installed the Bitcoin progam on my computer, does that simply means that I will be mining Bitcoins over time?

Otherwise what are the ways to mine Bitcoins?

No, the Bitcoin software allows you to receive, hold and send bitcoins. To mine you need specific hardware and software - for most people it is not recommended to bother.


What are the country-specific cryptocurrency prices on Yahoo finance? I was under the impression that cryptocurrency prices were set by an exchange's currency volume and buy/sell averages, so what exchanges are used to get the Yahoo finance data with country-specific cryptocurrency prices?

There is a note in the footer under the details for BTC-AUD: Data provided by CryptoCompare

On this page: https://au.finance.yahoo.com/quote/BTC-AUD?p=BTC-AUD


How miners on the same pool search non-overlapping sets of nonce candidates already tried by other miners to find a solution? On Traditional Pooled Mining:

  To solve the problem of high variance, the mining pools were created.
  In a traditional mining pool, many people all agree to combine their
  mining efforts and split the rewards according to their contributions.

Based on that:

For example: There is 500 miners on the same pool. As I understand they all trying different nonce to come up with a solution which is less than the difficulty.

Based on this answer:

  mining is doing the work of finding nonce so that
  sha256(sha256(data+nonce)) < difficulty

[Q] Overall, Do all miners in the same pool create solutions with different nonce between each other, or is there any possibility that multiple miners may create same solution by using same nonce being unaware.

If yes,
How miners on the same pool search non-overlapping sets of nonce candidates already tried by other miners to find a solution?

The pool gives a different template for a block to each miner. Each miner then generates lots of different blocks from their template. For each of these blocks they try all the possible nonce values, or at least some of them. They could even use a fixed nonce value and only change the other parts of the block - that would be just fine too, although less efficient as the nonce is a quick thing to change that won't require a new merkle root.

Trying all possible nonce values for a block only takes a split second and has almost zero chance of finding a block below target.

Duplicate work is avoided by the pool never giving out the same block template twice.

So a miner cannot do the same work as another miner, because it never has the same block template. It can still do its own work twice if it is very badly designed. But in that case the duplicate work results get rejected by the pool.

What's happening with mining is that you try billions upon billions of different blocks to find one with a hash below the current target. Changing the nonce value is only one (very limited) way of generating more blocks. If you only change the nonce then you'll only have a few blocks to try and it is extremely unlikely that any of them will have a hash value below the target.


Is BIP analogous to RFC? It seems that a BIP (Bitcoin Improvement Proposal) is very similar to an RFC (Request for Comments). Can anybody confirm this, or describe major differences in the two approaches?

BIP's and RFC's are similar in that they

debate an implementation in the community in order to improve it, and
produce documentation that's useful to other coders.

However, they're different in a lot of other ways. This is largely because the two solve different problems: RFC's usually invent new protocols, whereas BIP's amend an existing system.
Other differences:

An RFC with a specific serial number always refers to a specific version of that document. If the RFC changes (and the change isn't something tiny, like spelling), it is assigned a new number.
On the other hand, a BIP is expected to go through multiple major revisions in the Draft stage. Changes are instead tracked through version control.

The RFC approval process and the BIP approval process are different.

RFC's have authors, BIP's have champions. This isn't just a difference in terminology. The champion of a BIP needs to convince other people that it's a good idea before it will be accepted, whereas the RFC process is much less restrictive.

See also:

Who specified the Bitcoin protocol?
How is a BIP accepted?


Does broadcasting the network flood it? There are a lot of messages that are sent around the Bitcoin network - e.g. updating new blocks, spreading new transactions. Do these not flood the network? Is it a pure broadcast to all the connected nodes?

Transaction and block broadcast use a gossip mechanism which floods the network. A node will send a transaction or block to its peers. Once those peers validate the transaction or block, those peers will send the transaction or block to their peers and so on and so forth. This results in all nodes receiving a transaction or block.


Transfer blockchain from PC to Mac I have a bitcoin wallet on my PC  but I just recently downloaded the MAC version of it.  I would like to initialize it with the blockchain from my PC so that I don't have to download it all over again.  Is that possible?

See https://en.bitcoin.it/wiki/Data_directory

Copy over your %APPDATA%\Bitcoin directory to ~/Library/Application Support/Bitcoin/

Your AppData directory should be:

C:\Documents and Settings\YourUserName\Application data\Bitcoin (XP)

C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Vista and 7)

If not, you can always run explorer %APPDATA%\Bitcoin in Command Prompt (Super-R, type cmd, hit "Run") to find it.


What are the advantages/disadvantages of a continuously decreasing block reward compared to the current method? The current method to control the bitcoin supply to a maximum of 21 million BTC is to reduce the block reward (currently 50 BTC/block) by 50% every 210000 blocks. In this forum post there is a discussion about "why doesn't the block reward decrease continuously?".
The OP writes:

So I personally wish that Satoshi had instead implemented a continuous block reward decrease.  With that approach, the reward will decrease ever-so-slightly with each successive block but still converge to 21 million.  That would avoid potentially disruptive discontinuities.  It's too late to change that now but, still, does anyone know why he chose a block reward function that looks like a staircase rather than a smooth curve?

This gets rid of the discontinuity (block reward going from 50 to 25 BTC) at the 210000 block mark and at each subsequent block reward readjustment. Would this be better than the current method? Are there other advantages to this method? Are there any disadvantages to a continuously decreasing block reward?
One disadvantage I can possibly think of is that this would favor "early adopters" even more than the current bitcoin implementation.

The main advantage of the staircase rewards is simplicity. It's easier to implement; easier to describe; easier to plan with.

The main disadvantage is that it is less mathematically elegant. It will not be very disruptive in practice because it is known in advance and can be planned for.

The early adopter advantage is not a consideration, as it can trivially be controlled with the timescale parameter.


Tracing SegWit transaction via blockchain.info Blockchain.info give some strange information. For example for transaction 6e58d8c695e3e42c5a7807e2ed99ad7f7731658dfb0d62cdfef44dad8964b350.

Outputs is in unreadable format. Please can you help to find out why outputs in such unreadable encoding?

The basic question is how to find next transaction by the one of the outputs?

Tracing SegWit transaction via blockchain.info

This is not a segwit transaction, this tx starts with:
    01000000048583473E2F1AE32B7C4397D85B041DA5BC75C7CCD3CE9EAD9374EDB27FEE888100000000FC...

and translates to:

VERSION
 01000000
TX_IN COUNT: hex=04, decimal=4
 TX_IN[0]
  TX_IN[0] OutPoint hash  8188EE7FB2ED7493AD9ECED3CCC775BCA51D045BD897437C2BE31A2F3E478385
  TX_IN[0] OutPoint index hex=00000000, decimal=0
  TX_IN[0] Script Length  hex=FC, decimal=252
  TX_IN[0] Script Sig     ... <sig>

whereas a segwit tx would look like this (marker and flag):

VERSION     01000000
SEGWIT (BIP141): this is a segwit tx, marker=00
       (BIP141): flag=01
TX_IN COUNT: hex=04, decimal=4

As the sigs are part of the Input section of the tx, one can derive easily, that it is no segwit.

The tx has 4 multisig input parts, and 58 output parts. The output is mostly structured like this:

 TX_OUT[56]
  TX_OUT[56] Value (uint64_t)
  hex=F06B011B00000000, reversed_hex=000000001B016BF0, dec=453078000, bitcoin=4.53078000
  TX_OUT[56] PK_Script Length (var_int)
  hex=22, dec=34
  TX_OUT[56] pk_script (uchar[])
  002014B288DCA5D59CAA8868D1668C97C971E58AB3CCF10534AC567EA51AA8ABA299
    20: OP_Data32

--> This is an UNKNOWN script, but represents a BIP173 representation of a segwit address.

Two observations:
the amount of 58 outputs is certainly not a standard tx, and the many amounts of bitcoins, which are shifted around enorm. Looks to me like an exchange, which is shifting data between live accounts and cold storage... The script is indeed not a standard script (OP_DUP, OP_HASH, ...). The spending tx needs to meet this output data, and I am not quite clear how this condition can be met. So I think OPs question can be rephrased: "how to redeem a tx with a bc1 type segwit address". Maybe some experts here have a better inside view?


In case of a double spend (after double spend and prior getting resolved) what is actual account balance? For eg. if Ta and Tb are a double spend of the same transaction with different outputs. These two transactions can flow through different path in the network, and assume flow in exactly opposite path. So Ta reaches miner Ma who creates a block and Tb reaches another miner Mb. Now, Ma may solve the block with Ta and Mb with Tb. Both start broadcasting the respective blocks with Ta and Tb to be a part of block chain (fork created here).

After fork is created and before it is resolved, what is actual balance appearing on the account? Is it double down and gets credited later on?

In your example, only one of the blocks will become part of the longest valid chain, and the transaction included in that block will become a part of the blockchain history. The other block would be discarded, this is what is often called an 'orphan block'.

Wallet software will show you an 'account balance', but understand this is not how the book keeping works at the protocol level. The blockchain keeps track of 'unspent outputs', which are bitcoin addresses with some as-of-yet unspent balance stored in them. A double spend is an attempt to spend a certain unspent output more than once, but ultimately the network will only accept one of those two (or more) transactions into the blockchain.

Once one of the transactions is included in the blockchain, those bitcoins now reside at a new address, and the other transaction (and any block it is included in) is dropped from the network. There is no 'double debit' from an account, so to speak. Bitcoins exist at one address, and then once a valid transaction is confirmed in the blockchain, those bitcoins exist at a new address.

I suppose some wallet software could be written to debit all unconfirmed transactions from a wallet's balance (thus allowing a 'double debit, as in your example), but this would be a naïve implementation that is not representative of what is actually happening at the protocol level.


getbalance not working I am getting this error when I type getbalance:

error: {"code":-1,"message":"std::bad_alloc"}

Basically, I type getbalance and wait for about 2 minutes and this error appears finally.

What does it mean?

It probably means your bitcoind has not enough memory to complete the request.


Is it possible to set a dynamic -minrelaytxfee? When I start bitcoind, I like to set a -minrelaytxfee to save bandwidth on transactions that will likely never make it in to the blockchain (because their fees are too low).

However, when the network is under low load, I would be happy to reduce the -minrelaytxfee so that my node receives more of the transactions on the network.

Is there any way I can dynamically change the minrelaytxfee whilst my node is running?

No, there is no way to do that.

However you could make your mempool smaller and that would have a similar effect. The mempool has its own minmempoolfee. The in-practice minrelayfee is the maximum of the -minrelaytxfee and the minmempoolfee. The minmempoolfee will change when the mempool becomes full, and decreases when it has space. So if you set your -maxmempool to be much smaller, you would get a similar effect to changing -minrelaytxfee dynamically.


I'm trying to compile bitcoind on Windows but build_unix for db-4.8.30.NC is empty. What do I need to do? I've been working on setting up the proper environment to compile litecoin, and have been following the instructions from this:

https://bitcointalk.org/index.php?PHPSESSID=1dl8pkva2oqpjsd3h455k7hrj7&topic=149479.0;all

  2.2 Berkeley DB: http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

  We'll use version 4.8 to preserve binary wallet compatibility.

  From a MinGW shell unpack the source archive, configure, edit line 113 of db.h then make:

  Code:

cd /c/deps/

tar xvfz db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix

../dist/configure --disable-replication --enable-mingw --enable-cxx

  after configuring make sure to edit your build_unix/db.h by replacing line 113:

  Code:

typedef pthread_t db_threadid_t;

  with

  Code:

typedef u_int32_t db_threadid_t;

I was all set to do it, but this happened:

I've tried getting db-4.8.30.NC from multiple sources, but no luck—the build_unix folder is always empty.

So what's the deal?

The build_unix directory contains just the .IGNORE_ME file in the distribution.  The directory is populated by the make command.

../dist/configure --disable-replication --enable-mingw --enable-cxx
make

You do not need to edit db.h in the latest distribution since they have already corrected the typedef.


Is BIP 32 Technology Cryptographic Curve Agnostic? Does BIP 32 always implicitly assume secp256k1 elliptic curve cryptography (ECC) is to be applied, or can BIP 32 technology also be applied to create extended public or private keys that can readily be converted to say ed25519 private/public keypairs? One of the reasons I ask is because if a mathematical or computational backdoor is ever discovered for secp256k1, can ed25519 slide right in or does BIP 32 need to be re-engineered to support ed25519?  Ed25519 can also be applied to provide Schnorr Signature capabilities.

Any Elliptic Curve could work in the BIP32 scheme. The only property of a Curve that BIP32 relies on is that a * G + b *G = (a + b mod N) * G, which is true for any Elliptic Curve.

Secp256k1 is a 'Koblitz' curve, which just means its choice of parameters enables very fast scalar multiplication (computing a multiple of the Generator point).

With that said, if a vulnerability was discovered in secp256k1, it's not like everyone could just switch over easily. That would require a major change to the Bitcoin consensus system, and require coordination of many software systems.


Failed CHECK(MULTI)SIG operation - BIP143 hash pre-image Using Blockstream's api to broadcast a raw transaction to the Bitcoin testnet, I encountered the following error:

sendrawtransaction RPC error: {"code":-26,"message":"non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64)"}

I've noticed that many people have ran into a similar issue before. However, all of the proposed solutions didn't fix my issue. I've looked at the Bitcoin source code on Github and determined that the data I am committing to my hash for signing is incorrect.

Below is the hash pre-image that I'm creating for bip143 p2sh(p2wpkh).

    nVersion:     01000000
    hashPrevouts: 4f3c0f6726ec7f020da2a01598d1741225ea429a34bfdd4c4af2a1c9e45a9bed
    hashSequence: 3bb13029ce7b1f559ef5e747fcac439f1455a2ec7c5f09b72290795e70665044
    outpoint:     b9d615615976600739be12a67f326836e4256d7d1c4fe50163536ad8dd7647c301000000
    scriptCode:   1976a91499f27cf1ecb8c1a4c20bdbcdc7992cdb12c9ee5d88ac
    amount:       6981680000000000
    nSequence:    ffffffff
    hashOutputs:  57dbf9cb180c89fe35000b693ea089e521097e6d3f504cfec1620325fcec0036
    nLockTime:    00000000
    nHashType:    01000000

After a while of debugging, I was able to find the issue.

My previous assumption that I was committing the wrong data to the hash was correct.

The transaction ID that is needed to construct hashPrevouts and outpoint was incorrect. I needed to reverse the bytes of this value for the hash to be correct.

For example:

b9d615615976600739be12a67f326836e4256d7d1c4fe50163536ad8dd7647c3 (a searchable txid on Bitcoin testnet)

becomes...

c34776ddd86a536301e54f1c7d6d25e43668327fa612be39076076596115d6b9.

In summary, my advice would be to step through the interpreter and reevaluate your assumptions of all the data that you're committing to the hash for signing.

A little bit of code never hurts,

Typescript: Buffer.from(transactionId, "hex").reverse().toString("hex");


Most efficient way to store Segwit Address in a database This is not a duplicate of What is the most efficient way to store bitcoin addresses in a database? but it's the same question except I need a segwit answer.

Let's say I wanted to store every standard BTC address in an SQL database.
The most space efficient way is to extract the HASH160 address by converting to base58 then slicing away the checksum. This will allow you to store a BTC address in 20 bytes.

Until segwit blocks come.

Is there a way to get to the hash160 address from:
bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c

If not, could someone tell me the most space efficient way to store this address in a database?

I have no need to convert it back to original string, but only ensure its identity.

Thank you

Is there a way to get to the hash160 address from bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c

Yes, you could use the reference implementations in various languages to encode and decode a bech32 address. For example, I have decoded the sample address you mentioned in the question, bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c, using python below. The decode function gives us the witness version (0 in this case) and a byte array.

import bech32

address = "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c"
address_decoded = bech32.decode("bc", address)

address_decoded  # a tuple containing witness version and bytearray of the address
>>> (0, [141, 122, 10, 52, 97, 227, 137, 23, 35, 229, 253, 248, 18, 156, 170, 0, 117, 6, 12, 255])

bytes(address_decoded[1])
>>> b'\x8dz\n4a\xe3\x89\x17#\xe5\xfd\xf8\x12\x9c\xaa\x00u\x06\x0c\xff'

Couple of points to note:

The address you have mentioned here is a P2WPKH and has a length 20 bytes. However, P2WSH addresses are 32 bytes (they also begin with "bc1...") as we take the SHA256 of the witnessScript instead of HASH160.
Although version 0 addresses (P2PKH, P2WSH) will have a data payload of 1+20 or 1+32 bytes, BIP173 allows up to 40 bytes in a witness program, for a total of 1+40 bytes.


How new nodes synchronize with ledger ? I read several articles about how Block chain works, but didn't found any explanation about the following issue:

When new nodes (with empty ledger) entered to block chain, how they can check the correctness of the transaction, if their ledger is empty ?

How new nodes get synchronized with the block chain (get the list of the blocks, and all the history of the transactions ) ?

When new nodes (with empty ledger) entered to block chain, how they can check the correctness of the transaction, if their ledger is empty ?

It cannot. It must sync the entire blockchain first.

  How new nodes get synchronized with the block chain (get the list of the blocks, and all the history of the transactions ) ?

A new node will connect to other nodes in the Bitcoin network. It does this through the peer discovery mechanism which uses DNS seeders and seed nodes to find nodes to connect to. From there it requests from its peers the blockchain and is thus able to download the entire blockchain. Of course the new node will also fully verify all blocks and transactions in what it receives to ensure that the data is correct and valid.


Multisig Who puts second signature into the script? I know how the script work together, but the Multisig is still confuse me.

input script:
OP_0 [A's signature] [B's or C's signature] [serialized redeem script]

how the transcation being created,
For example, "A" create a transaction, he can put a signature into the script, but where is the B signature from? A's wallet definally no B private key!

Logically, the transaction must send to B, then B put a signature into the script, right?

After "A" signs the transaction hash the hash gets updated to show his signature. "A" will send this partially signed transaction hash to "B" who will then sign that hash which will then return a third hash reflecting two valid signatures. Assuming only 2 signatures are required to spend, this third hash is what gets broadcast to the network.


How to use bitcoin from command line in Windows? In Windows, how can I get what I get with "bitcoind getinfo" in Linux?

If it's QT:
go to "Help" -> "Debug Window" -> "console"
type rpc command here

Or go from the commandline to the folder your bitcoin daemon is in and run a command from the bitcoin exe. NOTE: you may need to add server=1 to your bitcoin.conf in %APPDATA%


Is it normal for ABE to get "out of sync" whilst re-creating it's blockchain? Is it normal for ABE to get "out of sync" whilst re-creating it's blockchain?

I am concerned that the number on the left does not match the number on the right. I have no idea what those two numbers are, I just know that the examples show them both being the same thing, and that they did indeed start out being the same:

 block_tx 1 1
 block_tx 2 2
 block_tx 3 3

Here's what it looks like now:

This process has been running for a number of hours now, and is only getting further and further "out of sync" with the original number as it does so.

Just curious if I should stop it now and start over?

I am pretty sure I can answer my own question here... the output is literally the total number of blocks, and the total number of transactions witnessed by ABE posted side by side.

Everything seems to be running smoothly. The number of transactions is increasing almost exponentially now by the number of blocks.


Does Bitcoin Blockchain solves Byzantine General Problem? If bitcoin blockchain solves byzantine general problem, can you give an example of how it solves it?

Thanks

The Proof of Work algorithms is a probabilistic solution to the Byzantine General's problem in the case where traitorous generals represent strictly less than 50% of the generals.

To simplify, the main thing a solution to this problem has to guarantee is that all honest generals (honest miners) agree on the same thing.

Let's assume there are 10 miners in the Bitcoin blockchain and a new transaction comes in. This transaction (noted tr1) is broadcasted among all miners. 10 of those miners are traitorous and they broadcast another transaction (noted tr2) where they changed the recipient in tr1.
Each miner will starts to solve a puzzle just after he received his first transaction message. Some will receive tr1 first, others will receive tr2 first.

The puzzle is difficult enough that, on average, a solution will be found every 10 minutes. After 10 minutes, miner M solves the proof of work problem. He broadcasts his solution to the 9 other miners and includes in there the transaction he received first. Upon receiving this solution, each miner adjusts his transaction to the new one received. They then all work on the next puzzle. After 1 hour, the chain has 6 blocks (6 puzzles solved). Each general can evaluate how much CPU was necessary to get solve 6 puzzles in 10 minutes. Each general knows then if the majority of the general contributed to building this chain. If the answer is yes, then they agreed on the transaction inside the initial block of this chain.

Now an interesting point: what if the transaction in the initially mined block is tr2? The solution described here doesn't prevent from agreeing on a false transaction. In the context of the Byzantine Generals problem, it is sufficient for the generals to agree on a false plan as long as they agree.


How many confirmations in litecoin block explorer When I call url http://block-explorer.com/address/[my address]
to see how many litecoin Received by that address, How do I know how many confirmations it has ?

Paste your litecoin address in blockr.io search and then you will get your litecoin address info page. Thare you will see your address balance, total received and total transaction so far.


What kind of private information would a bitcoin "middleman" ask from clients? I don't know much about bitcoin so forgive me for the ignorant title and terminology. My mom recently got into bitcoin and told me she was investing her money in it or something like that and she's been doing these transactions through a company (whom I referred to as "middle men" in the title). These middle men recently asked her to provide pictures of her passport with her in it hold it up and also a pic of her credit card bill with her in it as well ; apparently to verify that she's a resident where we live (in Hong Kong, China).

I thought it was a bit suspicious that they asked for such private information. Is this a normal practice of bitcoin middle men/compamies?

When dealing with established companies as a middelman (usually an exchange), it is common to go through a form of know your customer (KYC). This usually involved some form of national ID, and a bank statement or other proof of residence/address, and is usually done to comply with local laws regarding movement and sale of currencies.

You should, however, be extremely wary of dealing with random companies or people. Make sure you are dealing with a reputable exchange (check review on reddir, yours.org, steem, and other such platforms), and as far as possible, keep any BTC or other crypto in a wallet where you control the private keys (such as electrum, Ledger, Trezor etc). If someone offers to do mining on your behalf, it is almost certainly a scam. If someone says you need to pay to unlock the BTC, it is a scam.

Verify you are dealing with a legitimate entity.


How do BTC payments work at real-world shops? At CoinMap, I can find several coffee- and other brick-and-mortar shops that apparently accept bitcoin payments. How do these transactions work? Do I have to stand at the counter for 10 minutes and wait until transaction gets confirmed, do they use some kind of trick to make the transaction time bearable?

Depends on their infrastructure. If they use an intermediary (like bitpay or something) it will be instantaneus, since bitpay is the one that takes the risk for double spends and accepts payment fast.
In case they have their own infrastructure, it may depend on what they do, if they accept one confirmation for the payment it may not take much otherwise it may take longer. I don't think any of those shops do that by themselfs, most probably the will have an "acquirer" for bitcoins.


Why aren't miners filling up Bitcoin Cash blocks? I see that there are over 100K transactions in the mempool, but most blocks have only a few hundred of transactions.
Can anyone shed some light on this?

The blocks can be seen here: http://blockdozer.com/insight/blocks

Clarifications:

I'm running Bitcoin ABC.
getmempoolinfo returns "size": 101223
getinfo returns "version": 140400

At the time of the question, Bitcoin Cash mempool had 917 transactions, and the Bitcoin mempool only had 8.1k.

  yes from ABC getinfo says "version": 140400

You're running an outdated version of Bitcoin ABC. 140400 translates to Bitcoin ABC 0.14.4, but the current release is Bitcoin ABC 0.14.6. Mandatory two-way replay protection was introduced either with 0.14.5 or 0.14.6. Your older version still considers Bitcoin transactions to be valid, so you're collecting both Bitcoin and Bitcoin Cash transactions in your mempool. Obviously, Bitcoin transactions aren't leaving your mempool though, because they are not being included in blocks. Thus, eventually your node's mempool will consist solely of Bitcoin transactions, assuming that Bitcoin transactions generally have a higher fee level.

Updating to the current version of Bitcoin ABC should resolve the discrepancy.


Fun puzzle: How to generate keypair without anyone seeing the private key? I've been trying to figure out a way for a bitcoin wallet keypair to be created between two or more people without either/any one of them holding the private key afterwards.

Instead, I want the buyer to hold a PGP-encrypted file that has the private key inside it.

The buyer is never, ever, to see that private key... It's the seller's wallet that is encrypted... But the seller can't have the private key yet either, just a public key, and the PGP key to open the PGP-protected file.

I thought about a 3rd man in the middle creating the wallet and putting it there, but then the 3rd guy could cash out the wallet himself later...

So is there a trustless way to put the keypair into a PGP file and send that file to the buyer and the PGP key to the seller?

Enjoy the puzzle!

You are attempting to answer the question you are asking in the question. Let me get to the root of what you are asking.

From what I understand, you would like to create a 2 party escrow - buyer sends money in a way that can't be retrieved unless both parties are satisfied.

This can be done in two ways in Bitcoin - one through the use of multisignature transactions, other - through split-key addresses.

The first approach is to send the money to 2-of-2 multisignature combination of addresses - one held by the buyer, and another - by the seller. When they reach consensus, they create a transaction, each signs it and money is transferred. The disadvantage of this approach is that if they don't reach consensus, there is no way to settle the money dispute. If you would introduce some third party acting like an escrow and create 2-of-3 multisignature address, then you would need a consensus of any 2 involved parties. If the buyer and seller agree on a consensus, escrow service does not get involved and everyone is satisfied. If they can't reach consensus, escrow steps in and mediates the solution with the parties forcing a compromise - it can always break a stalemate by cooperating with one party.

The second approach is for both parties to settle on a public key each by themselves, and then combine it through multiplication or addition, creating a split-key address. They both know the public key and associated address, but none of them know the private key. If they agree on an output, the buyer sends the seller their private key and the seller can create a transaction crediting themselves, or if the seller wishes to return the money to the buyer, they can give them their private key. This approach has a few problems:

One can't be using the same private keys in multiple transactions, as they get shared with third parties
The person that will receive the second private key can dictate any division of money - nothing can stop them
There is no possibility of creating a 2-of-3 escrow

So all in all, use multisignature transactions.


PoS (Proof of Stake) what happens to the coin age of the change after I send an amount? Ok simple scenario I have 100 'whatever' coins in a PoS wallet, they are mature and have a stake weight that is approaching the weight to stake and forge a block.
I send 1 whatever coin to my freind and get 99 back to the change address, is my stake weight consumed or maintained?

I realise using a fictional coin isnt ideal, if its treated differently in different existing coins that would be useful to know.

Their age is reset.

You're creating a transaction with two outputs: sent amount and change. AFAIU, the age for staking is calculated from the confirmation height of the transaction that created them. Since each was newly created in the transaction, the age for both is reset.


How to create a signed transaction offline using electrum? I remember that on Electrum, it used to have a Preview button inside the Send tab. By clicking the Preview button I could export the unsigned transaction, and then sign it.
I cannot find this button anymore, I can only see Pay button, and when I clicked it I got a "Not Enough Funds" error. This is because I am doing this in my offline desktop computer (offline wallet).
Is it still possible to create a signed transaction offline using electrum?

Enter output address, amount and click on pay:

Decide the fee rate and click on finalize:

You can export the transaction hex from bottom-left before or after signing the transaction:

Make sure "Advanced Preview" is active in the preferences:


A friend owes me cash, how can he pay that debt in btc? A friend owes me some money and we agreed to settle that debt in bitcoins. How can he transfer some bitcoins to my account, without me having to pay him for it?

You only have to do a simple transaction. You have to create an address (for example, this one (which is mine): 1CnCc2Dp35BZboHE8AZvoyrQXCFFaHUvTZ) and tell him to transfer Bitcoins to that address.

You dont have to pay anything for the transaction, but your friend need to pay the transaction fee.


sign and verify a message in Bitcoin Core 0.13.1 (OSX)? as a follow up to here:

Verifying a bitcoin trx on the Unix cmd line with OpenSSL?

and here:

How does the ECDSA verification algorithm work during transaction?

I use the pizza trx, and verify at the command line (using openssl), that produces expected result. When I want to check in graphical BITCOIN QT 0.13.1 client, s.th. fails. What I did so far:

I have these values in the files:

pizza.sighex
30450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e

pizza.keyhex
3056301006072a8648ce3d020106052b8104000a034200
042e930f39ba62c6534ee98ed20ca98959d34aa9e057cda01cfd422c6bab3667b76426529382c23f42b9b08d7832d4fee1d6b437a8526e59667ce9c4e9dcebcabb

pizza.hash2
c2d48f45d7fbeff644ddb72b0f60df6c275f0943444d7df8cc851b3d55782669

(Attention: in the original webpage the double hash was given by amaclin in reversed order!)

 $ xxd -r -p <pizza.sighex >pizza.sigraw
 $ xxd -r -p <pizza.keyhex | openssl pkey -pubin -inform der >pizza.keypem
 $ xxd -r -p <pizza.hashhex >pizza.hash2
 $ openssl pkeyutl <pizza.hash2 -verify -pubin -inkey pizza.keypem -sigfile pizza.sigraw

  --> Signature Verified Successfully

now try in Bitcoin Core, the uncompressed public key hashes to this Bitcoin address:

17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ

The signature as base64 encoded string:

$ echo 30450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e | base64 -

  MzA0NTAyMjEwMDk5MDgxNDRjYTY1MzllMDk1MTJiOTI5NWM4YTI3MDUwZDQ3OGZiYjk2ZjhhZGRiYzNkMDc1NTQ0ZGM0MTMyODcwMjIwMWFhNTI4YmUyYjkwN2QzMTZkMmRhMDY4ZGQ5ZWIxZTIzMjQzZDk3ZTQ0NGQ1OTI5MGQyZmRkZjI1MjY5ZWUwZQo=

Entered into the QT client, I always get a "Message verification failed". So I try from scratch, I go to the tab "sign message", and enter this:
pubkey hash:

1DHG9SbeW3SXNpvbRUG3txXm1yDZTPKY9X

hash value:

56cc00a443f7b457ac3ec4bf1cc10ab3fa0c97fb173c27465b35766d313cd18c

and click "sign", to receive a base64 (?) encoded string:

IKWqGIVDCcpTBgFNushFeOlDj/08B4LEzYl4LDrWLLKnPQrqaSjjFYrdeWGXH9eIgHw7F7bkRtPpwC6jOur+R8k=

Now I should be able to enter these three values in the verify tab, so I cut and paste them into the fields, and they fail as well. I couldn't find any relevant information on how to use the Bitcoin Core 13.1 client. I am looking for some description or some reference, that explains underlying logic. Any help appreciated :-)

The message signing function in Bitcoin Core uses a different extra compact format for encoding signatures. The algorithm is also intentionally incompatible (through an extra hashing step) with the one used in transactions, to avoid people being tricked into signing a transaction.


How to import wallet.dat.txt file, to convert a txt document into usable BTC? this will be my first time posting here so please forgive any newbyness.

A friend recently gave me an old thumbdrive with a wallet.dat.txt file on it. He had bought a full BTC but didn't know what he was doing or how to spend it so he said I can keep it if can figure it out.

I'm semi-familiar with BTC but know almost nothing about paper wallets/cold storage. After some research, I discovered I might could import it here: https://blockchain.info/wallet/import-wallet

However, I get the following error message: Unknown File Type wallet.dat.txt

I think perhaps he may have played with it trying to get the BTC, and opened the .dat with a word processor which converted the file to wallet.dat.txt

Is there any way to convert the wallet.dat.txt back into wallet.dat? Or is that even the problem here?

Just trying to get at that free 1 BTC. Please help! Any/all advice is welcome!

I'm not sure how it got renamed with a .txt extension, but if you are in Windows and have the "hide known file extensions" setting on, than the file would appear to be named 'wallet.dat' since it will hide the '.txt' portion.  Remove the ".txt" from the end, and try again to import the wallet file.


Is backward syncing viable for full nodes? Currently, Every Bitcoin Core full node has to download the whole blockchain at least once. This situation is even worse if pruning is enabled - the user has to download the whole gigantic blockchain all over again if a rescan is required (typically after importing privkeys/addresses/wallet.dat).

I once heard that "backward syncing" might help. I also heard that "UTXO commitment" could eliminate the need for downloading old blocks. I wonder what exactly are them? Is there any relationship between them? Is there any technical hurdle that is very hard to overcome?

In bitcoin we add unspent entries to the UTXO when created inside a block, and delete them when they are spent. Syncing “in reverse” would be a messy process that wouldn’t allow for the verification of authenticity of the blocks being imported until the sync was entirely complete, where going forwards we have complete confidence in blocks as they progress.

The software can reverse blocks to undo changes to the state during a block reorganization, but this is excruciating slow as it requires going back to the older blocks using a reference list and reinserting the UTXO entries that were previously removed.

  "UTXO commitment" could eliminate the need for downloading old blocks.

UTXO commitments don’t remove the need for full validation, they introduce a new weaker level of node operation where they trust that miners have included valid commitments.

UTXO commitments also require an extremely large amount of hashing to achieve, which makes them implausible for use in the production network without other changes.

  the user has to download the whole gigantic blockchain all over again if a rescan is required (typically after importing privkeys/addresses/wallet.dat).

BIP157 allows for wallet rescans without the block data being retained.


My bitcoin transaction has not yet gone through. (4 days) I have googled this problem and everyone just keep saying "be patient it will get through sooner or later". Well it has now been 4 days and it still says 0/6 confirmations. I did not send it with a miners fee which is why it's not instant but it feels like 4 days is a long time. I'm using bitcoin-qt wallet on a ubuntu 12.04 computer if that makes any difference. Also when I go to blockchain.info and try to search for my transaction I cant find it. I have right clicked on my transaction and tried to search for everything thats in details but I still cant find my transaction.
Should I just wait and see if its going to get through?

I have read that you can double spend and then send this new one with a miners fee. I have tried to read up about this but I'm quite worried because its a lot of money that I'm sending and I don't want to do anything wrong.

Has the blockchain fully downloaded yet?
If you haven't totally downloaded the chain yet, you wont see any money you have received.
Do you have to create a raw transaction?
https://en.bitcoin.it/wiki/Raw_Transactions

If you are really struggling, send me an email. Maybe we can do SSH or remote desktop, and I can save your bitcoins.
If you run "bitcoind listtransactions" in a terminal and send me the output, I might be able to get you better instructions.


What is type 'pubkey' in a scriptpubkey output from getrawtransaction? Here is an output from getrawtransaction:

{
  ...
  "vout": [
    {
      "value": 12.50000000,
      "n": 0,
      "scriptPubKey": {
    "asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",
    "hex": "2103d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6aac",
    "reqSigs": 1,
    "type": "pubkey",
    "addresses": [
      "mwzWcEU4kBkJPSTgB8LSBfvyaEjdXmyGh7"
    ]
      }
    },
    ...
  ],
  ...
}

What is a pubkey type? I could not find any reference to this.

Here is the output of decodescript on the script:

{
    "result": {
        "asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",
        "reqSigs": 1,
        "type": "pubkey",
        "addresses": [
            "1HUZKBP5wAK3cKz4TZN4MkieiF8vbyNvpE"
        ],
        "p2sh": "3469piMXSTikVAdrSC791pQGxQb8pNXhua"
    },
    "error": null,
    "id": null
}

The script for an output describes the condition that must be satisfied for the money to move.

It means that the public key is contained in the scriptPubKey. Usually, the scriptPubKey only contains a hash of the public key, and relies on the scriptSig to supply the public key.

Explanation of the asm field in decodescript:

"asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG",

The first element is a compressed public key. The second element is OP_CHECKSIG. To spend this output, someone must put a signature in a scriptSig.

See also the P2PK bullet point here: https://bitcoin.stackexchange.com/a/35458/2306


Instantaneous exchange/conversion of bitcoin into cash My question is : how can some exchanges instantaneously convert bitcoins into cash, in light of the fact that it takes 10 minutes to "validate" a bitcoin transaction?
A bitcoin transaction takes 10 minutes to "validate". Yet some exchanges like coinbase allow merchants to instantaneously convert bitcoin payments into cash. In Automatically cash out bitcoin with zero exchange rate risk it mentions that :

When you enable "instant exchanges", bitcoin you receive for merchant
orders will no longer be sent to your Coinbase wallet. Instead they
will be sent directly to Coinbase and exchanged, ensuring that you get
the the exact local currency price that you set in the merchant tools.

When a person buys a product, then even though the purchasers bitcoin is sent directly to Coinbase, will it not be the case that it takes 10 minutes to validate, since it is just another bitcoin transaction? If so then how do exchanges like Coinbase allow one to convert bitcoins to cash immediately?

Because the exchanges are in possession of confirmed bitcoins from the get go. Mtgox makes you wait about a full hour before you are accredited deposited bitcoins to get those 6 confirms. And to exchange it they just decrement the person's account's bitcoin balance and increment the fiat balance (according to whichever market order).

On coinbase they just decrement your account balance and send fiat to your bank account simultaneously.


Bitcoin transactions reserve more coins than needed I have a JavaWebApp wich uses bitcoinj 0.13.2 for sending bitcoins from a wallet to a particular address in a TimerTask. When the job starts, every minute I send 10000 satoshis to the address. The fee of the transaction is 1000 satoshis. Transaction confirmations are 0.

The problem is that I randomly get  InsufficientMoneyException , although there are a lot more funds than 11000 available in the wallet , wich are needed for the transactions.

For example I have successfuly completed 1 job for 30 minutes after that i start another to a different address and on the third transaction i got the exception. Even if the fee is more than 1000 or confirmations set > 0, I can't understand how balance like: 0.10720419 BTC (10720419 satoshis) can be exhausted with two transactions for 10000 satoshis(i tried even with wallet which have balance of 9.43673481 BTC (943673481 satoshis) and it has been exhausted with several transactions too)?

When the transaction is complete everything is normal and the available balance is correct, so i can start another transaction but that can take a lot more time than a minute. I can't understand the reason why so many coins are reserved(unavailable).

If its due confirmations or fees, is there any workaround so transaction per minute goal can be achieved?

I use TestNet3 for testing

I use walletKit.wallet().sendCoins(walletKit.peerGroup(), to, Coin.valueOf(amount)) for sending coins.

Before transaction that trigger the exception, previous one are in kind of stuck state - it appears only in sender tx history and stuck on 0 notifications for like 1-2 hours. When it receive 1 confirmation it appears on the receiver wallet tx history with 0 confirmation and with other create date(time).Tx.ID is same. I cant understand the reason for this behavior !? At the moment in wallets tx history i got :

sender: date - 10/27/2015 11:35 amount - 0.0001 fee - 0.00001 conf - 3 tx.id:8eee2f5e92edc0ba8ab656e9364646507158fa91f74364815c7b36ecac7fdd69;

receiver: 10/27/2015 13:52 amount - 0.0001 fee - 0.00001 conf - 0 tx.id:8eee2f5e92edc0ba8ab656e9364646507158fa91f74364815c7b36ecac7fdd69.

I am new in bitcoinj and bitcoins at all but that seems very unusual and i really want to figure out the reason for this behavior !?

It's due to confirmation times and there's nothing you can do about it. Until a payment confirms, its outputs are not spendable because you cannot be sure the payment will in fact confirm. This includes the "change" outputs from a transaction. You could try to keep a large pool of available unspent outputs available.

Update: The behavior you're describing is not unusual. Until a transaction gets included in a block, it's stuck at zero confirmations. Each payment you make takes one or more of your unspent outputs and consumes it, producing a new unspent output back to you for the "change".

Say you have two unspent outputs, one for 1 Bitcoin and one for 0.4 Bitcoins and you need to make a payment of 1.2 Bitcoins to someone. You make a payment that takes in both your unspent outputs, sends 1.2 Bitcoins to the recipient, and the remaining 0.2 Bitcoins back to you. At the moment, the only Bitcoins you have are that 0.2 Bitcoin "change" output, and it's not yet confirmed.


How to test my Bitcoin QR code without giving my bank account I set up a QR code on my website to receive Bitcoin payments. So now I need to test it. I thought that if I install a Coinbase app it would let me scan it with its QR code scanner to see how my QR code looks like, but after giving Coinbase my address, phone number, DOB and last 4 numbers of my SSN, they now want to have access to my checking account.

Is there an app or some way to test my QR code with a smartphone (iPhone) without signing my life away?

Use another wallet like green wallet or Mycelium and scan the QR code.

Also, you can even verify the content of the QR with Google Lens, or another QR reading app.


Why are there so many large transactions on the blockchain? On block explorer you can see a list of the latest bitcoin transactions. I have watched it for a couple of minutes now, and I have already seen about ten transactions in the range of 250+ bitcoins, which translates to millions of US dollars.

Is there a reason that there are so many large transactions on the blockchain?

It's not always possible to tell, but often times it's been shown that large (100's to 1000's of bitcoin) transactions are related to exchanges settling with multiple clients or simply adjusting their cold storage around.

Exchanges holding coins on behalf of customers who move to take their Bitcoin off the exchange (which many people try to do before hardforks) would have many such transactions.


OP_CHECKSIG NULLFAIL with btcdeb I'm using btcdeb to understand script.
I pick a old random P2PKH transaction form mainnet, and paste unlocking script e locking script inside.
I know that this script is ok, because I can check on blockchain.

Than I Want to try with btcdeb and it works only if add flag

  --modify-flags=-NULLFAIL

I expect the True at the end, instead I get 0x.
Now, I did some research on NULLFAIL, but I don't understand the Problem.
Before BIP 0146 the script could return false?

In order to verify signatures, you need to feed btcdeb the two transactions (the relevant input transaction and the transaction spending the input) for it to be able to calculate the signature hash.

Edit: as of January 18 2020, you can now feed it the signature and pubkey as a pair instead. You can also replace the signature and pubkey in the script with mock values (e.g. "mysig" and "mypubkey").

See https://github.com/kallewoof/btcdeb/blob/master/doc/mock-values.md


How to debug bitcoin core in "real time" I am new to bitcoin core and C++

I downloaded already the project from: https://github.com/bitcoin/bitcoin
and run "makefile" command.
Now I can make all transaction against the blockchain.

I want to have the option to run "getnewaddress" in the command line
and it will stop in a break point in the source code.
but i cann't run the commands "bitcoind" and "getnewaddress", without first building the project.

How can I debug this project?

There is no "makefile" command.

If you don't build the project, there is no way for you to debug it. The released binaries do not contain any debugging symbols so it will be very difficult for you to set breakpoints and see what is going on. So in order to do that, you will need to build the project from the source code that you downloaded. There are instructions for how to do this in the docs folder of the downloaded source code.


Do Miners have to get below the Target or the Bits value? You get a specific Target value when you divide the maximum Target by the Difficulty.

But when you convert the Target in to the Bits format, you're only taking the first 3 bytes of the Target and losing some accuracy.

For example:

Difficulty: 166851513282.78

Original Target: 0x696f3ffffffe0c000000000000000000000000000000000
Target -> Bits: 0x180696f4
Bits -> Target:  0x696f4000000000000000000000000000000000000000000

So when a Miner is trying to get a low enough hash value for the block, are they trying to get below the Bits value or the Target value?

Below the target value that corresponds to the bits field in the block.


When will next halving events occur? I've read in some places that the next halving event will be on 2016. How can this be estimated?

The Bitcoin reward schedule follows a predetermined pattern, see Controlled supply from the Bitcoin wiki.

The next reward drop will happen at block number 420000. The current block number at the time of writing this answer is 318662. There are about 101338 blocks remaining. At approximately 10 minutes per block, there are approximately 1008 blocks per week, and 101338 divided by 1008 is about 100.5. So you can expect the next reward drop approximately 100 weeks from now, or around August 2016.

The http://bitcoinclock.com site does this calculation for you and provides an estimate right at the top. At the time of writing this answer, it says:

  Reward-Drop ETA: 2016-08-05 12:47:44 UTC (100 weeks, 3 days, 17 hours, 40 minutes)


Is there any benefits to a distributed computing architecture outside of cryptocurrencies? I was recently talking to a German start-up that was in an accelerator programme. They are building a product which is a distributed database that they are proposing will have efficiency benefits over companies which keep their data on their own centralized database. They talked about leveraging the computational capacity of different computers in the company to increase efficiency. From what I know about distributed computing, it is more inefficient than having a centralized architecture. Are there scenarios where it provides some efficiency benefits and is this being applied?

The only systems which benefit from being distributed are ones that display the property of being "embarrassingly parallel", or some approximation of it. Tasks which do not require a significant amount of data to be transmitted between operating systems, or those which don't require a significant amount of coordination fit this description well. Typically anything like a database is poorly suited to being distributed due to the need for overall consistency, which is very difficult to achieve across a distance.

Bitcoin is the opposite of a distributed system at the node level, every participant in the system is expected to repeat the process of validation in perfect accuracy with the hundreds of thousands, or millions of previous attempts at synchronization that have happened before it. As the number of nodes increases, there is no change in the amount of computation done in either direction.

Generally speaking anything claiming to improve efficiency by using a decentralized, or distributed network should be met with skepticism, simply because this is typically an uphill battle that is taken on for other reasons despite its inefficiency, not in an attempt to gain efficiency. To exemplify this, Bitcoin would be most efficient, most usable, and most reliable if it ran on a single server, but that would largely defeat the design brief of being trust-less.


Some general questions about blockchain consistency I basically understand the principles of a blockchain, nodes and miners. I also basically understand how transactions are hashed/calculated to be added to the chain but i doesnt understand the dezentralized part.

For example bitcoin has a huge amount of nodes so its impossible to
be connected to all nodes. Is there some kind of
connection broker, root node thats always online or broadcasting that holds a list of nodes?
If a transaction is sucessfully hashed and published, how does it
reach all nodes so that nobody will work on an already added
transaction because he think its not finished yet? Ii think in some businesses its like on the wall street to fight about milliseconds.

For example bitcoin has a huge amount of nodes so its impossible to be connected to all nodes. Is there some kind of connection broker, root node thats always online or broadcasting that holds a list of nodes?

No, there is no hierarchy to the nodes. There is no reason to be connected to all nodes, messages are flooded to the network by peers.

There is a list of DNS seeds that will help a new node find peers to download the blockchain from when they don’t know any peers to connect to, read more here.

  If a transaction is sucessfully hashed and published, how does it reach all nodes so that nobody will work on an already added transaction because he think its not finished yet? Ii think in some businesses its like on the wall street to fight about milliseconds.

The FIBRE network allows miners to have exceptional connectivity, we can see the success of this in the low orphan block rate on the network.


Why can malicious miners not award themselves with any number of bitcoins? Why can malicious miners not award themselves any number of bitcoins? Is that because the award itself is a transaction which has to be confirmed by a random miner? And if so, what if the miner himself will win the race?

Also, why can't any miner that has solved the block broadcast a self-award transaction at any time?

Also, if the award is in a transaction, who is the sender?

A miner is at perfect liberty to create any sort of block he wants and broadcast it to the network.  This could include rewarding himself with an unlimited number of bitcoins, or including transactions without proper signatures.  However, this block means nothing if other miners do not consider the block valid.  If other miners reject the block, then it doesn't matter what the block says.

This creates a situation where a miner is wasting his valuable computational resources if he chooses to do the proof-of-work on an invalid block.  He would be throwing away the money invested into the mining hardware.  Unless he has reason to believe that the majority of hashing power on the network will accept his invalid block, it's in his best interest to follow the rules of the system.  A situation like this is known as a 51% attack.

So long as hashing power is not centralized into the hands of those colluding with one another, Bitcoin is considered safe from this sort of vulnerability.


Where and when should the coinbase transaction(including the miner key) be added? I'm making a simple demonstrator program, pretty much a simplified bitcoin clone based mostly on the original whitepaper.

Please bear with me, because I haven't found a way to describe the problem more concisely.

My blockchain is based on this tutorial.

However, it completely ignores the transaction part, so I've based the transactions on this part of the original documentation:

As specified here, my transactions consist of the next owner's public key and the signature of last transaction signed by the previous owner. I also added the amount being transferred (I'm not using the in/out system for the sake of simplicity).

Since each transaction needs a hash of a previous one, I also created a coinbase transaction. It only contains  the mined amount and the miner's public key (to know whom to give the mined amount). This allows for the first regular transaction in a block to have a previous transaction to hash and sign.

However, that also means that the miner key has to be specified before the first transaction is made (since all future transactions require that the coinbase's hash stays the same).
At the same time, it does not make sense to specify the miner before they have mined a block.
In other words, this would require the transaction user to know a priori who will mine the block with their transaction.

My assumption so far was that a coinbase transaction is added to the unconfirmed transaction list after the previous block is mined, and new transactions refer to it. Then the whole list is put into a block which is then mined. However that assumption led to the aforementioned problems.

The only possible solution which I could come up with is using the last transaction hash from the previous block to sign a new transaction, effectively bypassing the coinbase transaction. But that doesn't seem right to me.

Please, tell me if I'm missing something, or got the wrong idea somewhere.

Where and when should the coinbase transaction(including the miner key) be added?

Or should I scrap that idea completely and use the "bypass" method?

PS. I've already tried searching various wikis and questions, but nothing realy gave me a clear solution to this.
Especially, this answer is too vague

The coinbase transaction is created when the miner creates the template for the block which they attempt to mine. Unlike regular transactions, it does not have regular inputs. The miner simply specifies the outputs to spend the coins, where the sum of the output amounts must be less than or equal to the total amount of fees in the block plus the subsidy. The coinbase is always positioned as the first transaction in the block.

The coinbase transaction has the same structure as regular transactions, but for each txIn it has, any txOutPoint should just have a zero value (there is no previous txid to refer to). The scriptSig can contain arbitrary information, as miners do not need to sign anything. Miners add information to the scriptSig such as their name, or additional source of entropy for mining. Additionally, some consensus rules which have been soft forked into Bitcoin require that the scriptSig contains the block height and a merkle root of wtxids (for segwit).

The process is roughly like this:

Miner creates a coinbase template which spends some not yet known amount of money to one or more outputs.
Miner sorts transactions in the mempool by highest paying fee per weight unit (per byte in original), and picks some number of transactions such that their serialized size plus the serialized size of the coinbase is not greater than the block size limit.
They sum all fees paid in the included transactions and add it to the subsidy to create an amount that the block is worth.
They update the coinbase template with at most this amount being spent (it is possible to not claim the full amount of fees or the subsidy, but overclaiming produces an invalid block).
The miner computes the merkle root of all of these transactions txids (where the txid is the double-SHA of the serialized transaction), taken as a binary tree ordered by the position the transaction is serialized in the block. The coinbase is explicitly the first transaction.
The miner inserts this merkle root into a block header with the 5 other required fields (version, prevBlockHash, target, nonce and timestamp) and serializes it.
The miner repeatedly attempts double-SHA256 on the block header until the resulting digest, when taken as an integer, is numerically less than or equal to what is required by the target in the header. The miner modifies the nonce, or occasionally timestamp for each double-SHA256 attempt so that a different digest is produced, but the other fields of the header remain unchanged.
At some regular interval, if the miner has not yet found a successful hash, or if a new block is received, they compute a new template by starting this process from the beginning, which can take new information and may provide a higher reward. They discard the previous template they were working on. If a new block was found, any transactions which were included in the block are dropped from the mempool.


Send from bitcoin core without downloading blockchain I have bought some bitcoins a while back, and stored them in bitcoin core. Now I try to use them, but I have to download the whole blockchain (1 year and 23 weeks to go) which takes about forever..

I donwloaded the electrum wallet and want to wire the bitcoins to that wallet.

Is this possible without downloading the entire blockchain? It would be the first time I do a transaction with bitcoins so I am a bit careful.. There is a transaction cost I can set (normal - fast) which gives a confirmation in 25 - 1 block. Is this confirmation sent after I downloaded the entire chain?

simple question, but I do not find the answer...

thanks in advance!

My suggestion for your case is you can use a mobile wallet and import the private key of the address which you used to receive Bitcoin and then use your Bitcoin from that mobile (lightweight wallet).

In fact, the mobile wallets will also download the blockchain and keep its database up to date with the Bitcoin database but it will not fully download the whole blockchain so it will be so much faster.


"Hot", "Cold" & "Warm" Storage Wallets? I've seen a number of sites advertise they support "hot", "warm" and "cold" wallet storage solutions (the only thing I haven't seen so far are "frozen" wallets).
What's the difference between the three? I think the difference between "hot" and "cold" wallets are pretty clear. But what makes a wallet "warm" instead of "hot" or "cold"?
P.S
I understand that at some level "warm" wallets are obviously more accessible than cold wallets (hence the name "warm") but how would they differ from a tech perspective - at what point is something hot and at what point is something warm?

In general terms, "hot" wallets store both the wallet address(es) and the private key(s) on a network-connected machine, readily accessible so you can spend your balance any time, with very little effort (and lower security).
Meanwhile, "cold" wallets store your private key(s) in an isolated "hardware wallet," on external storage media (which is a lot less secure, and I would consider a "warm" wallet), or on a piece of paper (search "bitcoin paper wallet"). In this way, the funds are "frozen," because no internet-connected device has the private key. This gives you great security, but is less convenient because you have to transfer the private key to a connected device (or use a connected device to send transaction info to a hardware wallet for off-network signing) before you can spend your balance.
As for "warm" wallets, I've seen descriptions of putting private keys in a separate HDD partition, or an encrypted archive file as "warm" wallets.


Bitcoin unconfirmed trasection to cancel I am new to bitcoin. i use blockchain. info.
i sent vtc to a purse on 15.12.17, but i am stuck still there after 20days.
i determined to cancel the reanection.
please help me.
Transection ID: https://blockchain.info/tx/2bd29e84967f6ee9c392b8bb8cb4cadb7e1560604f92dfbd57d88268b6c99714

please help me to cancel this. Thanks in advance

It is not possible to 'cancel' a published transaction. After you publish a transaction to the network, all of the nodes will relay your transaction, so that eventually they (should) all know of your transaction. If you tried to publish a 'cancel request', you would have no guarantee that every single node would hear about that request, and even if they did, they may not be incentivized to listen to it. So 'cancelling' a transaction is not part of the protocol.

Your transaction included a low fee, and so it has not yet confirmed. Eventually, the network's nodes may all 'forget' about your transaction, so you could then re-spend the coins to an address you control. Take a look at this question for more info on unconfirmed transactions.


how to activate BIP148 in bcoin configuration I cannot find any documentation about activating BIP148 on a bcoin node. Is there anything similar to BIP151=true in the bcoin.conf or is it enabled by default?

You can Update their node software to a BIP148-enforcing version; or
Run a BIP148 border node to filter out invalid blocks, and update their existing mining software to produce blocks with version 1 bit enabled, to vote for Segwit activation.
Signed binaries can be downloaded at BIP148

First, install all necessary dependencies which are mentioned in the official Bitcoin build instructions details UASF


Do I need the bitcoin blockchain for having a simple wallet using the bitcoind (daemon)? I want to start playing around a bit with the technical side of Bitcoins (thinking of setting up an exchange). So I built a bitcoind (daemon) binary from source and now the docs say that when I run that, it will start downloading the blockchain, which is several GBs large and takes a couple hours.

The only thing I want to do however, is create a simple wallet and make transactions from and to it. And because I ultimately want to deploy this to a server, I would prefer to not download several GBs.

So do I really need to download the whole blockchain in order to get a simple bitcoin wallet? Or is there a smarter way than deploying a wallet on a server using the bitcoin daemon?

There are "lightweight" wallets, such as Electrum and mobile wallets, that do not require the blockchain to run.  In exchange for this convenience however, their users rely on a centralized server (or servers) to host the blockchain, which is a bit of a security compromise.

bitcoind is the "Satoshi client" and is not a lightweight wallet.  It won't work without the blockchain.


Multiple mining pool workers or just one I asked a question about What is a worker exactly from Antminer Pool Worker field and got an answer to one of the specific questions within stating that you can generally use a worker name over and over on different machines, and all the work is added together to show the worker's work.

  Question

  What factors should be considered for someone trying to decide whether
  to have a worker setup and dedicated to each individual miner device
  versus having one worker setup for multiple miner devices?

It would seem from a server farm administration perspective at least that managing less workers could help simplify some of the configuration and tracking tasks.

I'm worried doing this one way versus the other could have a negative impact on the ultimate goal to make more money than spent on the electric utility if there's anything applicable that'd affect this.

Multiple mining pool workers or just one?

  It would seem from a server farm administration perspective at least that managing less workers could help simplify some of the configuration and tracking tasks.

The initial task of configuring the pool and miners is certainly simpler with just one worker name, however, the overall job of administration is made more complex by using that method.

By using a separate worker name for each physical miner (even if you enter it three times, once for each pool in the miner configuration) your job of monitoring is simplified since you can then just check on your pool to see that each miner is performing as expected. Some pools even have alerts if a particular worker's performance drops below a threshold.

By using a separate worker name for each miner you can easily identify a) that there is an issue, and b) which miner has the issue.

You could even label the worker name on each miner to simplify this further.


If we know transaction ID can we check more info about it on the web? Just curious?

I mean are there ways to see that info publicly?

Any blockexplorer on the web allows you to enter a transaction ID.

Caveats:

Some are notoriously bad and unreliable. Don't depend on the info they show.
The transaction ID of an unconfirmed transaction may change once it gets confirmed (same transaction, different ID). This is due to malleability.


Unable to createrawtransaction - “Input not found or already spent” I need help. I have createrawtransaction as per the screenshot but then, unable to signrawtransactionwithkey, I have insert WIF Private Key and it state that "Input not found or already spent" - how do I overcome this?
Your thoughts?

You're trying to spend a 25.04826416 BTC output that was created by mining in May 2015, which was spent a few days after its creation: https://blockstream.info/tx/45fd1c838a56798fe027f61bdfdab83845399175a3b9cced397c5a38e669bb49?input:14
Even if you have the private key for the address that output used at the time, the coin can't be spent again.
I don't know what you're trying to do - but spending the same coin twice isn't allowed.


BFGminer can't find my NanoFury! I recently purchased a Nanofury ASIC unit. I tried running it on my Linux system, as I just let the computer sit and run. I couldn't get it to work on Linux, so I decided to give it a try on Windows = but I'm still getting the same problem.

I installed Zadig, found the device, and installed WinUSB to the Nanofury NF1 0.6 device. I could then see it in the Device Manager listed as:

'NanoFury NF1 0.6'

So the device is recognized by Windows, but when I run BFGminer on the -S all option for finding devices, I get this message:

'NO DEVICES FOUND: Press 'M' and '+' to add'

How do I get the NanoFury device to operate properly with Windows? I'd really hate to be out like $150 on something I can't even get to work.

I'm currently running BFGminer 3.9.0 - if that helps at all.

I was able to get my Nanofury working on Linux (rPi raspbian) and bfgminer 3.10.0 with a few permissions changes.  You really have three options:

Run bfgminer as root (undesireable)
Add the user running bfgminer to the "root" group:

usermod -G root -a miner
Change group ownership of the usb device (you will need to determine which one is your Nanofury device):

chgrp dialout /dev/bus/usb/001/006

Option 1 is the easiest, 3 is the most secure.  I went with option 2 as a middle-ground.

I also reverted commit 8383e33 (git revert 8383e33) from the bfgminer git repository, which gets rid of the "reinitializing" warning, and gives me a better hashrate.  I don't know the long-term effect of reverting this commit, though...

To start the miner, I use:

/path/to/bfgminer -S NFY:ALL --set-device NFY:osc6_bits=54

Once you have everything set up, you can write your settings (S, W,  in bfgminer) and you can drop the -S NFY:ALL.  You still need the --set-device, as far as I can tell, though.

Hope this helps!


Trying to send Bitcoins from testnet to my regtest node I send bitcoin regtest server BTC to other bitcoin address of same server. I sent 5 BTC but it shows 50 BTC of that account's associated address. It received 5 BTC.
What's the problem with this account or address?

I used https://tpfaucet.appspot.com/ to get free BTC for regtest server address. I send BTC to many of my addresses but I didn't receive any amount on account associated addresses.
What's the problem on this server or regtest bitcoin?

The regtest system is completely isolated from testnet and only exists on your local machine by default, you won't see the transaction from TPs faucet because it isn't on the same network. Blocks in your regtest setup can be instantly created using bitcoin-cli setgenerate true <number of blocks> each of which will bring into existence 50 BTC in your local wallet for testing with.


Why don't addresses in an (unencrypted) wallet.dat file seem to match addresses that would be generated by the private keys in the wallet? I've been messing around with an empty wallet file using the 'pywallet' utility, and have come across something I can't understand.

A dump of the unencrypted wallet readily reveals a list containing entries such as:

        "addr": "1NpYUPpz2E4fhYfoJRfUApa5hSPcrpCGaT",
        "hexsec": "d38c1f602bc0bc90a54c5d743b3b75460c4aeeb1dc6ad62d3c6758c3714998a0",
        "reserve": 1,
        "sec": "5KRTGtTczAwef7vdDfm9knDyKMoaa8XHJURnMZnQFd5qkWVJtsB"

The second/fourth entries are obviously the private key.  However, if I input this key at (for instance) bitaddress.org, it generates

        1EEYqeJHkubdhcrHvH7ajpSBEALXMygoD8 (address)
        1HoVqjG35pW3AQ7wtYtA72tSpyLyP4vDLp (compressed address)

neither of which match ANY of the other addresses listed in the dump.  I can't find an explanation for this anywhere, and I'm wondering what the ramifications of losing, say, the first address in the key entry ('1NpYUP...')  or the addresses in the pool are if they don't actually correspond to the private keys in the file.

Just a heads up - do not post your private key in public unless you'll no longer be using that Bitcoin address

Thanks in advance!

Perhaps pywallet is misreporting the bitcoin address?

Does your wallet actually show a 1NpYUPpz2E4fhYfoJRfUApa5hSPcrpCGaT bitcoin address?

Here's a method to manually determine the public address for the private key.

http://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses


How transaction becomes confirmed by miners if InputScript has only the Sig Please help me to understand how bitcoind client verifying TX with Input Script which consist only from the Sig.

For example TX 6D5DF6C0D66CFFC25CC1ABA3655952D7B081ED4E9EA3B70FCD964FDBBA01E91E has one input from D9A9C88110775B196CDAF6FC8113B33547C8E33E68519F60D9C9FF306E096473 transaction (8 output) with Input Script 4730440220797681C6711BB3D97AE373FC5CFF47F06EEC928DD46B8A9892D92C30953C9DF3022079C36E9A4C32D4E36B9E3ACCED0D40D70D8F90890C0E9F8F4F9AC083AFFD21B301.

This script has only the Sig (r,s) and has no any representation of Public Key or Address.

As I understand the Sig creates with UnsignedTX doubleSHA256 hash, Random Number and Private Key.

Sig checking by using UnsignedTX doubleSHA256 hash and a Public Key, but here is no any of it.

Also the question is about "Where is stored UnsignedTX doubleSHA256 hash?". Because it is not the transaction hash, because TX hash is for the signed transaction.

Transaction verification requires the previous transaction outputs that the transaction spends from. The output script of the previous transaction outputs is retrieved for each input. The input script is first run through the script interpreter. It's resulting stack is then used as an initial state for the previous transaction output's output script's pass through the script interpreter.

For the particular transaction that you have chosen, then previous transaction output script is of the form

<pubkey> OP_CHECKSIG

and the input is of the form

<sig>

This means that the signature is first pushed to the stack. Then the public key is pushed to the stack and then OP_CHECKSIG is performed on the two stack items. The public key resides in the output script. For other output types, the public key is provided in the input script as part of the spend.

The hash that is signed as the message is produced from the spending transaction itself. It contains data that is provided in the spending transaction and the previous transaction output script so it can be generated on-the-fly. You can check out this question and answer How to tell which part of the previous tx I need to make the hash to sign for an old given tx? which breaks down how that hash is generated for non-segwit inputs.


Lightning, multiple channels to the same node With LND, you can open multiple channels to the same node. Is there any advantages to having multiple channels (to the same node) versus having one channel?

Eg. one channel with a capacity of 1 000 000 sats or two channels with 500 000 sats each?

Not all implementations support multiple channels between two nodes. That is why I would advise against that practice. Also I do not really see an advantage of having two channels. We don't have Atomic multipath routing yet so in general it makes more sense to have larger channels.

Only counter argument I see is that one channel can only have 483 htlcs stimulaniously. So imagine you are an extremely well doing routing node and have a channel to another node of that kind you might want to go beyond 483 htlcs and open up another channel. I would however doubt that this situation will come up in real life as you would probably already have more than 1 lightning node running in such a situation.


Do I need to keep updating Armory version and more? Do I need to keep updating version of Armory when it notifies me of new version. Just wondering if these are security patches or just some new bells and whistles in new armory versions. Seems like it took me forever to DL Armory and to install a new version every few months seems like a huge pain I run linux so that makes it even more difficult because I have manually uninstall and re-install and my newbie self doesnt' even know how to on linux as there is no automated uninstall or install like windows.

What gives?

It really boils down to fixes and any upcoming security issue which are announced with the releases, but in general it's a good idea to upgrade every once in a while (at least it will likely make any mandatory update less painful). The updates should usually be less painful than initial install - sometimes no database rebuilds are even needed, and v0.93 rebuild is very fast too.

Note that sooner or later you will eventually need to upgrade Bitcoin core too. It may be running seamlessly from within Armory but you can also choose to run it yourself as a standalone application - either way updates will be required eventually to pick up the latest changes in the network. Armory updates often comes along with Bitcoin core updates as it need to support any Bitcoin core database changes.

Also if you use an offline wallet, there are some limitations in the version delta you can have between online and offline wallets - Armory will normally warn you loud and clear about them.


If SHA256 produces an alphanumeric hash, how can a hash be "less than a certain value"? I was under the impression that Bitcoin's method for validating a hash involved making sure the hash started with a pre-determined number of zeroes.  However, after reading the docs here, I see the following sentence:

  To prove you did some extra work to create a block, you must create a
  hash of the block header which does not exceed a certain value.  To
  prove you did some extra work to create a block, you must create a
  hash of the block header which does not exceed a certain value. For
  example, if the maximum possible hash value is 2^256 − 1, you can prove
  that you tried up to two combinations by producing a hash value less
  than 2^255.

This is confusing to me, since according to my research the Bitcoin protocol uses the SHA256 hashing algorithm, which produces alphanumeric hashes.  For instance, when I hash an empty file named "foobar.txt", I get "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855".

My question is, how can one alphanumeric hash output be "less than" another?

Not that other answers are wrong here, but just to approach your confusion from another angle:

  SHA256 hashing algorithm, which produces alphanumeric hashes.

That's not true. The hashing algorithm produces a stream of bytes. Only when you display that bunch of bytes on your screen it's common for it to be in hexadecimal (containing "alphanumeric" characters A to F) but that's just for display purposes to make it human-readable.

You may as well display that same bytes as a large decimal number (requires more screen space and doesn't have the advantage that each two digits represent exactly one byte from the original. Or you could display it in binary: 256 zeroes and ones.

  My question is, how can one alphanumeric hash output be "less than" another?

Even disregarding the above, what stops you from sorting a list of words alphabetically? One word will be "less than" another word.


Check status of daemon? I have started bitcoind on my linux box. How can I ask it what its status is? I assume it is downloading the blockchain and will continue to do so for hours or days. How can I find out where it is in this process?

I found the easiest way to do this (version 0.12) is to issue the command (not case sensitive):

bitcoin-cli getblockchaininfo

Then, compare the blocks received field, to the headers field. The blocks received should increase steadily until it matches the headers field, at which point the client is synced.

Once the client is synced you can check if the client is accepting inbound transactions by issuing the command:

bitcoin-cli getconnectioncount

If you have 0 connections, something is wrong. If you have 8 connections, then it means you are only doing outbound connections (which might be the case if you just want to use your client to execute your own personal transactions, not verify everyone else's). If you have more than 8 connections, then it means you are accepting inbound connections and are acting as a full node (good for you).

Two additional ways to get information about your node is to use GetNetTotals which returns information about network traffic, including bytes in, bytes out, and the current time, and GetNetworkInfo which provides information about your connections to other nodes.


Can somebody show me a working gettxoutproof / verifytxoutproof pair? Can somebody please show me a working gettxoutproof / verifytxoutproof pair, I am looking for the input used on bitcoin-cli or console window in Bitcoin Core to make this happen, and the outputs.

For example, TXID: D97A21CF46FD5AFB0BF9EA4237BC4BF5C84E8B47D38D1EEE2BBEB5C0F8A1C625 is included in block 0000000000000a3290f20e75860d505ce0e948a1d1d846bec7e39015d242884b

The input to gettxoutproof should include the txid and the blockhash.