105

How Bitcoin Mining Works Bitcoin transactions are mined (processed) by Miners, and Miners want to benefit from their work. By mining transactions with higher fees, they make more money. Some miners can decide to mine all transactions no matter the fee but they still must compete with every other financially motivated miner. Why is it taking so long for my ...


85

In this answer, I will go through the steps necessary to redeem the second output of the transaction listed above. The answer will be limited to redeeming an output of the particular type present in this transaction (an output which requires providing a new transaction signed with a private key whose corresponding public key hashes to the hash in the script ...


69

Note: I went out and learned about how the OP_RETURN opcode works at the byte level in a bitcoin transaction. I’m writing it here so that others can learn quickly. First, a brief history of why we’re even talking about OP_RETURN. Back in 2013 different players in the bitcoin ecosystem were trying to include bits of information into transactions so that they ...


56

The idea (as I understand it) is that the Merkle tree allows for you to verify transactions as needed and not include the body of every transaction in the block header, while still providing a way to verify the entire blockchain (and therefore proof of work) on every transaction. To understand this, first understand the concept of a tree. Consider an 8 ...


45

A multi-signature address is an address that is associated with more than one ECDSA private key. The simplest type is an m-of-n address - it is associated with n private keys, and sending bitcoins from this address requires signatures from at least m keys. A multi-signature transaction is one that sends funds from a multi-signature address. The primary use ...


43

Bitcoin is very resistant to typos because the addresses contain a built-in check code. So if you had simply mistyped a few of the letters or numbers in the address, it's unlikely the client would have let you send them. If, however, you pasted in a different and valid address, the coins are already transferred to it permanently. In this scenario, Bitcoin ...


41

Technically the appropriate term is "pseudonymous" - imagine that your bitcoin address is like an email address or an online alias: how hard it is to trace to your actions depend largely on what you do with it. There is, for example, a bitcoin address in my forum signature that would obviously be VERY traceable back to me. On the other hand if I install the ...


41

No, IP addresses are not stored in the blockchain. But Gavin Andreson indeed notes that Unless you are very careful in the way you use Bitcoin (and you have the technical know-how to use it with other anonymizing technologies like Tor or i2p), you should assume that a persistent, motivated attacker will be able to associate your IP address with ...


41

Here is a possible schema describing transactions from two addresses A and B that contain initially 50 BTC each: (A) 50 btc --tx1-----------------------> 25 btc (C) \ `-> 25 btc (D) --. \ tx3--> 50 btc (*) ...


40

First of all two matching scripts are used in two different transactions, one that transfers funds to an address (Transaction A) and one that spends those funds (Transaction B). The scriptPubKey is created by the user that creates Transaction A. It basically adds a claiming condition to the output that is being created. A user may only claim and thus spend ...


39

Two reasons: So whoever sent to your "A" address can't claim to have sent you 31 bitcoins ("See! Look on block explorer, there are two transactions sending to "A", one for 20 bitcoins and one for 11-- send me back the extra 11!") Using a new change address makes it more difficult for other people to track of how many bitcoins you have or where you're ...


39

The Finney attack is named after Hal Finney, who suggested it in this comment. (Hal happens to be the first recipient of a Bitcoin transaction, and the first person to comment on the release of the Bitcoin source code.) It is a double spending attack with the following features: It only works if the merchant accepts unconfirmed transactions. It still works,...


39

Step-by-step description: We start creating a new transaction which we hash and sign. Add four-byte version field: 01000000 One-byte varint specifying the number of inputs: 01 32-byte hash of the transaction from which we want to redeem an output (reverse order): be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396 Four-byte field denoting the ...


35

I've been playing with Gavin's "bitcointools" (again) to track what happened to the famous "pizza" Bitcoins. It turns out that rather than being rare collector's items, the 10,000 BTC exchanged for two pizzas have spread out to over a million different Bitcoin addresses since buying the pizzas, not counting the dilute fragments that ended up in transaction ...


35

147krm8yWUcVq9Ta25h679TCpsEznzgvRz is the change from the transaction. There was more than one output because you didn't have any previous transactions (sometimes thought of as "coins") that added up the exact amount of the transaction. So your client picked some coins that added up to at least that amount and then created a new address to receive the ...


35

The input of every transaction refers to an output of a prior transaction. An input can't be defined by only the transaction hash. A transaction consists of 1 or more outputs if you only specify the transaction hash there is no way to know which output is being spent.** Since these types of questions often come from a larger misunderstanding of how the ...


34

There are a number of ways one can go about accepting Bitcoin on a web interface. Keep in mind as you review these options that Bitcoin is still a young technology and many of these options aren't what you'd call "friendly" just yet. That said you do have quite a few options depending on your level of expertise and technical requirements: Use a service like:...


34

First, let's clarify the difference between accounts and addresses. "Accounts" are used for the convenience of people to track their funds. This is primarily used to track the source of funds. Since this is just for your tracking, you can move Bitcoins from one account to another just by moving a number from one column to another. No transactions are needed....


34

Taking the sha256 hash of that hash gives 3b a3 ed fd 7a 7b .............. But the real transaction hash according to blockexplorer.com is .............. 7b 7a fd ed a3 3b The answer I was getting was correct, but bytewise reversed. I need to get used to Bitcoin using little-endian storage.


31

The definition of dust is client-specific and not a network rule. Bitcoin Core considers a transaction output to be dust, when its value is lower than the cost of spending it at the dustRelayFee rate. The default value for dustRelayFee is 3,000 satoshi per kilobyte, which results in the same dust values as the dust definition used before Bitcoin Core 0.15.0. ...


30

Sequence numbers aren't shown on the Bitcoin Block Explorer HTML pages because they are not used by the network currently. Non-default sequence numbers would be shown on raw block/tx pages, but I'm not sure whether this has ever happened. Sequence numbers are intended to be used for replacement. Replacement is currently disabled, but how it would work is: ...


30

Yes, there is a way to save a borked transmission. A restart of the wallet and some patience typically fixes the issue. How to stop/reverse a Bitcoin transaction without confirmations: Run bitcoind and with -zapwallettxes. This makes the wallet "forget" any unconfirmed transactions, thus enabling you to reuse their inputs. Create a new transaction to make ...


30

The fee goes to the miner who mines the block that includes your transaction. The fee is based on the size (in bytes) of the transaction and the age of its inputs (how long ago the coins spent were received). Transactions get big if they have to "pull in" a lot of outputs from previous transactions and that raises the fee. So if you got a lot of small ...


29

Bitcoin confirmations represent the number of blocks in the block chain that have been accepted by the network since the block that includes the transaction. In simpler terms it represents the difficulty of a double spend attack. With zero confirmations no proof of work has been done, so you can't tell if anyone considers the transaction valid. Even with a ...


29

I calculated the answer by starting with Gavin's "bitcointools" and modifying it to track account balances. Here's what I found. Each line shows the number of addresses after the specified block was found, at the end of each month. So the 1st line is saying that after block 2543 was found at the end of Jan 2009, there were 2,439 funded addresses, and all ...


29

Most clients on the network have a transaction pool in their memory. The same basically applies to miners: they just dump the top 500KB (or some other value) transactions into a block, sorted by transaction fee (descending, of course). When there aren't many transactions, maybe because of a series of block in a short amount of time, it will be confirmed ...


28

I'm not sure there is an exact definition of dust. The Armory client wiki says: Sending less than 0.01 BTC to any recipient — The network considers these small outputs to be “dust,” and discourages them by requiring a fee. If it was not discouraged, someone could take 1.0 BTC, and create 1,000,000 transactions of 0.000001 BTC each, for free, which would ...


26

I couldn't find the results of the Coin Selection written out anywhere, and just finished piecing it together from the code. It works as David mentioned, but here are more details. The Coin Selection Algorithm logic to transfer Target amount If any of your UTXO² matches the Target¹ it will be used. If the "sum of all your UTXO smaller than the Target" ...


25

If you don't grasp the basic concept, imagine for a second that a network outage split the bitcoin network in half. I could send one transaction giving 30 bitcoins to Abel to one half and one transaction giving those same 30 bitcoins to Fred to the other. Each half would accept that transaction and until the two halves reconnected, you wouldn't know which ...


25

If a full implementation of the scripting language were in place, then pretty much all of the following could be implemented. However, there are serious security concerns with some of these and they warrant further analysis before finding their way into the clients. The referenced Scripts link in the original question contains several script examples ...


Only top voted, non community-wiki answers of a minimum length are eligible