Transcript for bitcoinotc 20140916


The pubKey comes from the previous transaction. It specifies what conditions must be met to spend the bitcoins from that transaction, which usually consists of a proof of ownership. The goal of the pubKey section is to ensure that only desired parties may spend the bitcoins in its transaction. The scriptSig comes from the spending transaction.

This section of the program satisfies the conditions imposed by the pubKey. The goal of the scriptSig section is to make the program return "success. The script consists of a list of operators, which come from the raw hex contained in scriptSig and pubKey.

What is Bitcoin Script? The pubKey forms the second part of the combined script. Script The script consists of a list of operators, which come from the raw hex contained in scriptSig and pubKey. These words are used internally for assisting with transaction matching. They are invalid if used in actual scripts. Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction invalid.

The following is a list of interesting scripts. When notating scripts, data to be pushed to the stack is generally enclosed in angle brackets and data push commands are omitted. Non-bracketed words are opcodes.

Note that there is a small number of standard script forms that are relayed from node to node; non-standard scripts are accepted if they are in a block, but nodes will not relay them. This was used by early versions of Bitcoin where people paid directly to IP addresses, before Bitcoin addresses were introduced.

The disadvantage of this transaction form is that the whole public key needs to be known in advance, implying longer payment addresses, and that it provides less protection in the event of a break in the ECDSA signature algorithm. The standard way to mark a transaction as provably unspendable is with a scriptPubKey of the following form:.

Thus the output can be immediately pruned from the UTXO set even if it has not been spent. With some software changes such transactions can be used as a way to donate funds to miners in addition to transaction fees: This mechanism may be used in the future for fidelity bonds to sacrifice funds in a provable way. Anyone-Can-Spend outputs are currently considered non-standard, and are not relayed on the P2P network.

Transaction a4bfa8abae5f25dae9d89e4eb67dfacafc1ddc5abbc31b is an interesting puzzle. To spend the transaction you need to come up with some data such that hashing the data twice results in the given hash. This transaction was successfully spent by 09fbe71fd1db51ffda40cc0e4f8c8c2c4ab1. The required data happened to be the Genesis block , and the given hash in the script was the genesis block header hashed twice with SHA Note that while transactions like this are fun, they are not secure, because they do not contain any signatures and thus any transaction attempting to spend them can be replaced with a different transaction sending the funds somewhere else.

In Peter Todd created scripts that result in true if a hash collision is found. Bitcoin addresses resulting from these scripts can have money sent to them. If someone finds a hash collision they can spend the bitcoins on that address, so this setup acts as an incentive for somebody to do so. See the bitcointalk thread [1] and reddit thread [2] for more details. Retrieved from " https: Technical Vocabulary Bitcoin Core documentation. Navigation menu Personal tools Create account Log in.

Views Read View source View history. Sister projects Essays Source. This page was last edited on 26 May , at Content is available under Creative Commons Attribution 3. Privacy policy About Bitcoin Wiki Disclaimers. An empty array of bytes is pushed onto the stack. This is not a no-op: The next two bytes contain the number of bytes to be pushed onto the stack in little endian order. The next four bytes contain the number of bytes to be pushed onto the stack in little endian order.

If the top stack value is not False, the statements are executed. The top stack value is removed. All blocks must end, or the transaction is invalid. Marks transaction as invalid if top stack value is not true.