281A1 1 checksig bitcoin 1 0 . 132 4a1 1 0 0 0 1. The aim of this guide to help you understand the logic behind Bitcoin Script. Since there will be too much to cover, the guide will be divided into two parts.
Yes, that sounds very complicated, but it really isn’t. Let’s go through each and every term from reverse. Hence they can’t enter an endless loop. Being Turing Complete means that given the resources and memory, a Turing Complete program will be able to solve any problem. Solidity is an example of a Turing Complete language.
So why isn’t Bitcoin Script Turing Complete? Because it doesn’t need to be. Bitcoin Script doesn’t need to be as complicated as an Ethereum smart contract. According to Wikibooks, they can be logically thought of as linear structure represented by a real physical stack or pile, a structure where insertion and deletion of items take place at one end called top of the stack. The basic idea of stack is LIFO or Last In First Out.
What was the first book that was put on this stack? Cub won’t be the book you take out first, Gardens of the Moon will be the first you take out. The Last book that went on this stack pile will be the first book taken out. Push: The act of adding things into the stack is called pushing.
Pop: The act of removing things from the stack is called popping. As has been mentioned before, the last item which got pushed into the stack gets popped out first. So, now we at least know what script is, let’s understand how Transactions work. How do transactions in a Bitcoin work? Suppose Alice wants to send a certain number of bitcoins to Bob. How does the transaction system in Bitcoin work? Bitcoin transactions are very different from Fiat wallet transactions.
2 to Bob, she would physically take 2 dollars from her wallet and give it to Bob. However, things don’t work like that in Bitcoin. The miners validate your transactions by putting the data inside the mines that they have blocked. In return for giving this service, they charge a transaction fee.
When it comes to FIAT currency, you don’t really keep track of how and where you got that specific note from. Open your wallet right now and take out all the notes and coins in it. Can you tell where exactly did you get each and every specific note and coin from? Ok, so now let’s do a deep dive into how a bitcoin transaction between Alice and Bob takes place. There are two sides to a transaction, the Input, and the Output. This entire Transaction will have a name that we will figure out in the end.