82

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 ...


67

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 ...


47

As Stephen points out it would force people to spend coins. Age is not a proper measure of lostness. A common recommendation for savings accounts is to put them on physical backups such as printed QR codes that you add to while the account itself remains offline. People may even will their Bitcoin savings to their children. To force people to shuffle these ...


41

An unspent output is simply an output of a transaction which isn't yet an input of another transaction. To take the example from ripper234's answer (in which generated coins are immediately spendable, and we don't have to wait 100 blocks for them to mature), where: The first block contained 50 mined BTC in address A (A = 50) The second block contained 50 ...


41

I know this question is old, but I stumbled upon it looking how to teach myself how multisig addresses work, and I imagine others will to. So I’m going to try to explain the typical flow for creating, adding bitcoins to, and eventually spending a multisig address. This explanation is aimed at beginners, so please excuse my lack of brevity. First off, some ...


40

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 (*) ...


39

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 ...


38

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 ...


34

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 ...


33

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....


33

The details are very complex, but the core concept is fairly simple. Ripple solves the double-spend problem by consensus. The analogy I use is an "agreement room". To walk into the room, you have to agree with everyone who is already in there. If you want to disagree, you have to leave and form your own room. Everyone who is honest wants to get into the ...


33

I'll try answering this again in a different way, using small numbers to keep it readable. convert the private key to binary representation, so decimal number 105, which is 0x69 in hex, becomes 01101001. calculate this list of points, by repeatedly doubling the Generator point G: 1*G 2*G = G+G 4*G = 2*G + 2*G 8*G = 4*G + 4*G 16*G = 8*G + 8*G 32*G = 16*G + ...


31

Generated coins can't be spent until the generation transaction has 101 confirmations. Transactions that try to spend generated coins before this will be rejected. The reason for this is that sometimes the block chain forks, blocks that were valid become invalid, and the mining reward in those blocks is lost. That's just an unavoidable part of how Bitcoin ...


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: ...


27

The term "coinbase" is used to mean many different things. But the two you're probably asking about are: The "coinbase transaction" is the transaction inside a block that pays the miner his block reward. Inside the coinbase transaction is a field that is called the "coinbase". It's the generation transaction's equivalent of a scriptsig. Since it doesn't ...


27

The Bitcoin P2P network The Bitcoin P2P network is a randomly-wired gossip network. This means that all nodes make arbitrary connections to other peers (using various ways to discover new addresses) using a custom TCP protocol, usually using port 8333. Typical nodes create 8 outgoing connections, and if publicly reachable, accept up to a few 100 incoming ...


23

In each iteration, you concatenate two subsequent hashes of the previous level, and double-sha256 them. If there is an odd number of hashes, concatenate the last element with itself. This gives you a new list of hashes. Repeat, and stop when one hash remains. This is the merkle root. Assume you have tx hashes Ha1,Ha2,Ha3,Ha4,Ha5,Ha6,Ha7 First iteration: ...


23

main.cpp carries this comment: // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ascii, not valid as UTF-8, and produce // a large 4-byte int at any alignment. unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };


21

What does the bits field represent? First of all, we need to understand what the 'bits' field means. Bits is in 'compact' format. This is kind of like a floating point format, but it represents big integers rather than arbitrary real numbers. The first byte indicates the number of bytes the represented number takes up, and the next one to three bytes ...


20

From the wiki: A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you. Whenever a node connects to another node, it gets a UTC timestamp from it, and ...


20

Bitcoin transactions have a transaction id (txid) formed as a hash over the data involved in the transaction. That suggests that it is a unique identifier for a transaction. However, the tx-id of a transaction is only unique once the exact data in the transaction has been finalized by being incorporated into the blockchain (and confirmed). Until then, there ...


19

The attack allows a group of miners with more than 50% of the network's computational power to change difficulty arbitrarily. When difficulty is adjusted, only the times of the first and last blocks in a retarget period (i.e., the first and last blocks with a certain difficulty) are considered. This attack works by manipulating the timestamp of one of these ...


18

If you want, you can pay $100 for the standard, ANSI X9.62. Or, you can cheat and look at RFC3278, section 8.2. It is in DER format consisting of a SEQUENCE of two INTEGERs. The first INTEGER is r, the second s. If you look at this transaction you can see that one of the signatures is: 3045 0220 ...


18

Bitcoin amounts in the protocol and software are expressed as an integer number of "satoshis". 1 BTC is defined as 10^8 satoshis. So a block reward that is internally represented as 5*10^9 satoshis is displayed in the GUI as 50 BTC. Splitting bitcoins to even smaller fractions will require a change in the protocol and software, and may be done when their ...


17

While the other answers are slightly true, there's another reason. Addresses which have been spent are inherently less secure than unspent addresses. This is because, when spending on an address, you reveal the public key to the address. This means that in order to steal those funds, you only need to find the private key, whereas normally you'd need to break ...


16

The information in David's answer is correct, but it may not answer the actual question -- it's unclear whether the question is about change in general, or specifically sending change to a new address. If the latter, nothing needs to be added. If, however, the question was about the practice of change in general, then yes, it is necessary. The reason for ...


16

No, you can't prevent fractional reserve banking technically. For example, IOUs can circulate just like Bitcoins and there's no technical means to stop it. Essentially, anything worth X Bitcoins (once risk and the like are factored in) can act just like X Bitcoins, even if it's not X Bitcoins. And since it's not Bitcoins, nothing Bitcoins can do can stop it. ...


16

When developing Bitcoin, Satoshi had already come with the idea that no more than 21 million of them will ever be made. However, there was an unsolved issue: how to accomodate all bitcoins in case it was actually used as a worldwide currency? Comparing to the current (2008?) world's M1 supply, it was determined that 8 decimal places was enough to cover the ...


15

Really old versions of Bitcoin did not use checksums in network messages (Satoshi incorrectly assumed that the TCP checksum was sufficient). When Bitcoin was changed to start using its own checksums in network messages, version and verack messages could not be immediately updated to use checksums because old clients would be unable to understand checksum-...


15

At the protocol level, there is no such thing as "balance of an address". There are individual unspent outputs (like coins in a wallet), which must be individually spent. You can't partially spend an output, but you can split/combine it. So for example, you have a 70 BTC output assigned to an address, and a 80 BTC output assigned to the same address. Some ...


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