Published on: 2011-08-11T22:02:09+00:00
Contracts, or smart contracts, are a way to decrease reliance on trusted intermediaries in certain transactions. These contracts eliminate the need for middlemen by using software to automate the process. For example, Kickstarter currently relies on a middleman to collect and aggregate pledges for new projects. However, with the use of smart contracts, artists or game programmers could run the program on their own website and avoid paying fees.The movement of contracts from the memory pool to a chain occurs either through lock time or if every sequence number is UINT_MAX. While contracts may be complex, they serve the valuable purpose of reducing the need for intermediaries and increasing trust in specific types of transactions.In a Bitcointalk thread, Mike Hearn proposed tx filtering as a better method to obtain relevant transactions and merkle branches. This approach ensures that the cost remains proportional to the user's activity rather than system activity, even as blocks increase in size. The discussion then delved into the concept of sequence numbers and their role in contract protocols. Sequence numbers allow for the creation of newer versions of transactions without interaction with other parties. By resigning the input with a higher sequence number, one can establish a chain while preventing rewinding to an earlier point. However, the SIGHASH flags limit the changes that can be made, enabling specific types of contracts within the network's memory pool.For instance, if a participant wants to withdraw from a contract, they can set the output in the same position as their input to reclaim the money they contributed. By signing the input with SIGHASH_SINGLE and broadcasting it with nSequence set to UINT_MAX, they completely remove themselves from the negotiation. It is important to note that this method only allows changes to the scripts of the inputs, not the inputs themselves. The transaction still needs to connect to the same outputs and import the same value as before.
Updated on: 2023-08-01T02:15:46.349045+00:00