The Scriptpubkey is the puzzle set to a transaction in order for it to be solved and the script sig is the solution to the puzzle that allows it to be spent.
Historically the Scriptpubkey was named so as it contained the public key or address to be spent from – i.e. the address the transaction was locked to.
The scriptsig was called so due to its need to contain the signature – i.e. the private key of the address that wants to spend and to which the address in the scriptpubkey was locked to.
The Bitcoin transaction script language is a stack based execution language – to layman this is a very basic form of language that doesn’t contain loops and is Turing incomplete (i.e. can’t with an unlimited amount of memory, processing power and time solve everything) – it is designed for one purpose. The stack based execution language has a few important benefits such as its simplicity and minimal processing.
The script language processes from left to right. Numbers are pushed onto the stack and then operated acted on by the next function. There are conditional operators which give the result true or false which in the case of validating a transaction are true if the signature is valid.
The below example is the process of a simple pay to public key hash transaction.
The above transaction shows the stack based operating procedure for resolving the transaction – i.e. unlocking it and spending it. To see the process in more detail see our different types of bitcoin transactions and the P2PKH – pay to public key hash transaction type.
- What is a Bitcoin Fork?
- How does a hashing algorithm work?
- How does the Bitcoin Network actually work?
- How does a Bitcoin node verify a transaction?
- How Does Bitcoin Cryptography work?
- How to trade Bitcoin with the Relative Strength Index?
- How to trade Bitcoin and other Crypto Currencies Using an SMA?
- Using VPNs and Password Managers to Secure Your NFTs
- B2Broker Introduces cTrader as a White Label Platform
- CryptoCompare Lists Potential Ethereum Hard Fork Tokens
- Crypto Spot Trading Volumes Reach 20-Month Low
- Binance Leads YTD Crypto Exchange Volumes as Competition Heats Up
- Total Value Locked in DeFi Protocols Plunged 65.7% in Q2
- Crypto Adoption on the Rise: Countries Pioneering Digital Asset Usage
- Meeting FirstByte Media: Comments from Cosmin Mesenschi, CEO & Founder of FirstByte Media
- Meet ZENIQ: The Decentralized Blockchain-Powered Ecosystem
- GAUGECASH Integrates Chainlink Keepers to Decentralize Automation of Novel Liquidity Pool, GAUGEFIELD
This website is only provided for your general information and is not intended to be relied upon by you in making any investment decisions. You should always combine multiple sources of information and analysis before making an investment and seek independent expert financial advice.
Where we list or describe different products and services, we try to give you the information you need to help you compare them and choose the right product or service for you. We may also have tips and more information to help you compare providers.
Some providers pay us for advertisements or promotions on our website or in emails we may send you. Any commercial agreement we have in place with a provider does not affect how we describe them or their products and services. Sponsored companies are clearly labelled.