Why Every Input in a Bitcoin Transaction Needs Its Own Signature
Understand the necessity of multi-input signatures in Bitcoin transactions, avoid common misunderstandings, and learn the basics of P2PKH signing, SDK usage, and what signatures actually protect.
Ethan Lin
technical_editor
In a Nutshell
Signing each input means providing the unlocking proof that satisfies the locking script for every UTXO being spent in a transaction. A transaction can have multiple inputs, each spending a different previous output, so every input must independently prove the right to spend its corresponding UTXO.

Why Not Just Sign Once?
Newcomers often assume a single signature covers an entire transaction, but the reality depends on the number of inputs. If a transaction has three inputs:
Then each input must satisfy the locking conditions of the UTXO it references. These UTXOs may belong to the same private key, different private keys, or even use different script types. A signature is not a simple "stamp" on the whole transaction—each input needs to complete its own unlocking logic.
The P2PKH Signing Logic
The locking script of a standard P2PKH output looks roughly like this:
You must provide:
- A public key.
- A signature.
And:
- The public key hash must equal the hash locked in the output.
- The signature must be verifiable by that public key.
When spending this output, the input's unlocking script typically contains <signature> <public key>. During validation, the unlocking script and the previous output's locking script are combined and evaluated; if the result is true, that input is considered valid.
Creating a Signature Template with the SDK
In the official low-level examples, a P2PKH input uses unlockingScriptTemplate: new P2PKH().unlock(privateKey). A complete snippet looks like:
This step does not immediately produce the final signature; instead, it tells the SDK that this input should be unlocked using the P2PKH template with the given private key. Later, when you call await tx.sign(), the SDK generates the corresponding unlocking scripts for the inputs that need signing.
What Does the Signature Protect?
The purpose of the signature is not just to prove "I know a private key." It also binds critical parts of the current transaction together to prevent anyone from modifying the transaction and reusing your signature. For example, if the signature didn't cover the outputs, an attacker could change the recipient address to their own; if it didn't cover the amount or script context, validation could be bypassed. Bitcoin transaction signatures follow specific sighash rules—while you don't need to memorize all the details at the beginner stage, you should know that the signature is tied to the current transaction structure and cannot be understood in isolation from the transaction context.
Signing Order for Multi-Input Transactions
When constructing a multi-input transaction, the typical sequence is:
- Select inputs
- Create outputs
- Add change
- Calculate the fee
- Sign each input
- Verify the transaction
- Serialize or broadcast
If you modify outputs after signing, the signatures may become invalid because signatures usually commit to the transaction's content. Do not treat signing as a step after which you can freely alter the transaction.
Wallet Signatures vs. Low-Level Private Key Signatures
In the BSV tech stack, Stage 7 uses WalletClient, where the wallet manages signatures and the application never directly touches private keys. Stage 8 explores low-level signing to understand the mechanism. Real user applications should still prefer the wallet interface, keeping private keys inside the wallet.
The differences:
- WalletClient signing: The private key stays in the wallet; the application requests the wallet to create or sign actions. This is suitable for user-facing apps.
- Low-level private key signing: The code directly holds the private key, and the developer manually constructs and signs transactions. This is suitable for learning, testing, dedicated backends, or low-level tools.
Low-level signing helps you understand transactions, but putting user private keys into application code is not a production pattern.
Verifying Signatures
After signing, use the SDK's verification method to check whether the transaction structure is correct:
Common reasons for verification failure include:
- The private key doesn't match the address of the previous output.
- The source transaction or output index is incorrect.
- The amount or script information is wrong.
- The transaction content was modified after signing.
- The fee or change leads to an unexpected structure.
A successful verification does not guarantee that broadcasting will succeed—network policies and service status also matter—but verification is a crucial check before broadcasting.
Common Beginner Misconceptions
- A transaction does not necessarily have just one signature; each input may require its own unlocking proof.
- Signing is not just signing the txid; it binds transaction content according to specific rules.
- P2PKH unlocking needs a signature and a public key, not just an address.
- Do not arbitrarily modify the transaction after signing—changing outputs, amounts, or scripts can invalidate signatures.
- Private keys must never appear in frontend code, logs, screenshots, or tutorial repositories. Example WIFs must be placeholders or test-only.
References
Collection
BSV Basics
Part 39 of 43
A curated series covering BSV, blockchain fundamentals, protocol capabilities, and ecosystem knowledge.
Previous part
Bitcoin Transaction Fees: Calculation, Influencing Factors, and Practical Guidelines for BSV
Next part
BSV Transaction Serialization: From Object to Broadcast
Reading path
Progress 39/43
- 01Read articlePart 1
Why BSV Still Matters for Long-Term Settlement
A compact note on settlement design, data permanence, and why builders keep looking at BSV.
Apr 30, 20265 min read - 02Read articlePart 2
P2P Electronic Cash: What Is Peer-to-Peer Electronic Cash?
Peer-to-peer electronic cash is the starting point for understanding Bitcoin and BSV. It emphasizes transferring digital value directly through transactions, signatures, and a public ledger, rather than relying on central platform accounts. This article explains peer-to-peer, cash, double spending, UTXOs, and why BSV emphasizes low fees, high-frequency transactions, and on-chain data.
May 19, 202615 min read - 03Read articlePart 3
Timestamp Server: Why Is Blockchain a Time-Ordered Record?
Blockchain is not just a ledger; it is also a public time-ordering machine. This article explains what the timestamp server means in Bitcoin/BSV, the role of block height and confirmations, and the value of timestamps in double-spend prevention and data attestation.
May 20, 202615 min read - 04Read articlePart 4
Proof of Work: Why Can Miners Order Transactions?
Proof of Work uses a mechanism that is expensive to compute and cheap to verify, allowing miners to compete for new blocks in an open network and using accumulated work to determine the ordering of transaction history. This article explains how PoW works, why miners can order transactions, its security significance, and the miner-economic logic behind BSV’s focus on large blocks, low fees, and high transaction volume.
May 20, 20265 min read - 05Read articlePart 5
How the BSV Network Works: Transactions, Blocks, Fees, and Miner Incentives
This article explains the basic mechanics of the BSV network: how transactions are constructed, how blocks organize them, how miners are incentivized, and why BSV places special emphasis on low fees, large blocks, and high-throughput on-chain transactions.
May 20, 202615 min read - 06Read articlePart 6
Introduction to SPV: Why Lightweight Clients Do Not Need to Download the Full Chain
SPV (Simplified Payment Verification) allows lightweight clients to verify that a transaction is included in a block without downloading the full blockchain. This article explains how SPV works, the role of Merkle proofs, what SPV can and cannot prove, and why SPV is a core capability in the BSV architecture.
May 20, 202615 min read - 07Read articlePart 7
How BSV’s Roadmap Differs from BTC and BCH: Why It Emphasizes On-Chain Scaling, Low Fees, and Enterprise Data
BTC, BCH, and BSV all come from Bitcoin, but their technical roadmaps differ significantly. This article explains why BSV chooses a low-fee, high-volume, large-scale on-chain scaling approach, through the lenses of on-chain scaling, low fees, a stable protocol, SPV, enterprise data, and real-world challenges.
May 20, 202615 min read - 08Read articlePart 8
WIFs, Mnemonic Phrases, and HD Wallets: An Introduction to Key Management in BSV Wallets
WIFs, mnemonic phrases, and HD wallets all relate to key storage, recovery, and derivation, but they mean different things. This article explains their differences, the role of xpubs, and security practices for BSV wallets and application development.
May 20, 202625 min read - 09Read articlePart 9
What Is the Difference Between BSV Mainnet and Test Environments?
Mainnet carries real value, while test environments are for learning and development. This article explains the differences between BSV mainnet and test environments, common risks, SDK usage considerations, and practical environment-separation recommendations for project configuration.
May 24, 20265 min read - 10Read articlePart 10
A Wallet Is Not an Account System: BSV Wallets Manage Keys and UTXOs
A BSV wallet is not a traditional account system. There is no single on-chain balance field; instead, the wallet calculates balances and creates transactions by managing private keys, UTXOs, inputs, outputs, signatures, and related data. This distinction is essential for understanding change, multiple inputs, non-custodial wallets, and application authorization.
May 24, 202615 min read - 11Read articlePart 11
BRC-100: A Standard Interface Between Wallets and Applications
BRC-100 is an interface standard in the BSV ecosystem that describes how applications and wallets communicate. It emphasizes that applications express business intent while wallets retain control of keys, helping non-custodial applications request transaction creation, signing, and returned results in a safer and more consistent way.
May 24, 20268 min read - 12Read articlePart 12
What Is a Transaction Input? Understanding BSV Transaction Inputs and UTXO References
A transaction input is the funding source of a BSV transaction. It references a specific unspent output from a previous transaction and provides unlocking data. Understanding inputs helps explain the UTXO model, outpoints, double-spend conflicts, fee calculation, and transaction debugging.
May 26, 202615 min read - 13Read articlePart 13
Understanding BSV Transaction Outputs: Amounts, Locking Scripts, and UTXOs
A transaction output is a new unit of value created by a BSV transaction, usually consisting of an amount and a locking script. Outputs can represent payments and change, but they can also carry OP_RETURN data, token state, or business records. Understanding outputs, UTXOs, and output indexes is fundamental to understanding BSV transactions and application protocol design.
May 26, 202615 min read - 14Read articlePart 14
What Is a TXID? Its Role, Common Misunderstandings, and Design Tips in BSV
A TXID is the most common transaction identifier in BSV. It can be used to look up transactions, reference outputs, store business records, and build SPV proof flows. But a TXID identifies the whole transaction, not a specific output, and it does not mean the transaction is final. Real applications should store it together with the output index, status, raw transaction, and proof materials.
May 26, 202615 min read - 15Read articlePart 15
Understanding Change Outputs in BSV Transactions: Why They Must Be Explicitly Included
A change output is a key concept in BSV’s UTXO model: old UTXOs must be spent in full, and any unspent amount must be returned to the payer through a new output. This article explains how change works, how it relates to fees, change addresses, privacy, and practical UTXO management.
May 26, 202615 min read - 16Read articlePart 16
How BSV Transaction Fees Are Calculated: Total Inputs Minus Total Outputs
BSV transaction fees are not stored as a separate field. They are calculated as total inputs minus total outputs. Understanding this rule helps developers handle change correctly, estimate fees, manage UTXOs, and avoid accidentally turning remaining balance into fees.
May 26, 202615 min read - 17Read articlePart 17
What Is a Raw Transaction? The Basics of BSV Transaction Serialization, TXIDs, and Signatures
A raw transaction is the original byte representation of a transaction after protocol-compliant serialization, usually shown as a hexadecimal string. It is central to TXID calculation, signing, broadcasting, and debugging, and is a key concept for understanding how BSV transactions work at the protocol level.
May 26, 202610 min read - 18Read articlePart 18
Endian Issues in BSV Transaction Debugging: Why TXIDs Can Look Reversed
Endian is a common byte-order issue when debugging BSV transactions, especially in raw transactions, TXIDs, outpoints, numeric fields, and Merkle proofs. Understanding the difference between display format and serialized bytes helps avoid false “TXID mismatch” or “proof calculation failed” conclusions.
May 26, 202612 min read - 19Read articlePart 19
What Is a UTXO? Understanding the Foundation of the BSV Transaction Model
A UTXO, or “unspent transaction output,” is the basic unit of the BSV transaction model. A wallet balance is not an on-chain account field, but the sum of controllable UTXOs. Understanding UTXOs helps explain BSV inputs, outputs, change, fees, double-spending, Script, and parallel processing.
May 27, 202615 min read - 20Read articlePart 20
In BSV, Spending Means Consuming Old UTXOs and Creating New Ones
In BSV, spending does not update a balance. It consumes old UTXOs and creates new ones. Understanding this model helps explain payments, change, transaction chains, and the basic logic behind tokens and application state transitions.
May 27, 202612 min read - 21Read articlePart 21
One Address Can Have Many UTXOs: Understanding Addresses, Balances, and Transaction Construction in BSV
In BSV’s UTXO model, an address is not an account or a single balance slot. The same address can be associated with multiple UTXOs, and a wallet balance is simply the sum of those outputs. Understanding this is essential for transaction construction, fee handling, UTXO fragmentation, and privacy.
May 27, 20265 min read - 22Read articlePart 22
Why the UTXO Model Is Suitable for Parallel Processing – The Technical Foundation of BSV Scaling
The UTXO model splits state into independent outputs, allowing transaction verification to proceed in parallel, providing a key data structure foundation for BSV's on-chain scaling and high throughput. This article compares the account model with the UTXO model, explains the principles of parallelism, practical limitations, and its relationship with Teranode and application design.
Jun 2, 20264 min read - 23Read articlePart 23
Understanding Bitcoin Double Spend: Why the Same UTXO Cannot Be Spent Twice
Double spending is a core problem for digital cash systems. This article explains the principle, transaction structure, miner's role, 0-conf risk, signatures and double spend, and engineering best practices.
Jun 2, 20264 min read - 24Read articlePart 24
Understanding Locking Script in BSV: The Core Mechanism of Spending Conditions
Locking script is an essential part of a BSV transaction, defining the conditions under which a UTXO can be spent. This article starts from the basics, gradually explaining the location of locking scripts, their relationship with addresses, how they are expressed, and their importance in applications.
Jun 2, 20264 min read - 25Read articlePart 25
Deep Dive into Unlocking Script: The 'Key' to Spending Blockchain Transactions
Unlocking script is the unlocking material in a transaction input that satisfies the locking conditions of a previous output. This article comprehensively explains the concept, location, working principle, and common misconceptions.
Jun 2, 20264 min read - 26Read articlePart 26
P2PKH: BSV's Most Common Payment Script Template Explained
P2PKH (Pay to Public Key Hash) is the most basic payment script in Bitcoin/BSV. This article breaks down its core logic, workflow, relationship with addresses, unlocking conditions, and why BSV developers need to understand it.
Jun 2, 20264 min read - 27Read articlePart 27
OP_RETURN: A Beginner's Guide to Writing Data on the BSV Blockchain
Learn the basics of OP_RETURN, how it differs from regular payments, data format requirements, privacy considerations, and use cases.
Jun 2, 20263 min read - 28Read articlePart 28
Understanding Bitcoin Script: A Stack-Based Scripting Language and Its Execution Model
Bitcoin Script is a stack-based scripting language used to verify transaction spending conditions. This article starts with the concept of a stack, illustrates its execution process with examples, and explores key points such as P2PKH, restricted design, and BSV applications, helping readers understand the core mechanism of this on-chain verification language.
Jun 2, 20263 min read - 29Read articlePart 29
Standard Scripts vs Non-Standard Scripts: The Easily Overlooked Boundary in BSV Development
A transaction that is valid under consensus rules may not be processed by the network. Understand standard scripts and miner policies to avoid broadcast failures.
Jun 2, 20264 min read - 30Read articlePart 30
Getting Started with @bsv/sdk: Installation, Verification, and First Steps
Introduces the installation, project setup, and verification process for @bsv/sdk, helping developers quickly enter the BSV development environment and understand the SDK's role in the tech stack.
Jun 15, 20264 min read - 31Read articlePart 31
WalletClient: The Communication Entry Point Between Applications and Wallets
WalletClient is a standardized client for connecting wallets in BSV applications. It enables applications to describe transaction intent while the wallet handles authorization, signing, and UTXO management, thereby isolating complexities like private keys, UTXOs, and signing.
Jun 15, 20264 min read - 32Read articlePart 32
Creating Your First BSV Transaction with createAction(): A Beginner's Guide
createAction() is the core method in the BSV SDK, allowing applications to describe transaction actions via a high-level interface while the wallet handles signing, fees, and broadcasting. This article explains its principles, parameters, and practical usage.
Jun 15, 20264 min read - 33Read articlePart 33
Auto-Select Inputs, Change, and Fees: How the Wallet Builds a Complete Transaction for You
When using the high-level SDK, the wallet automatically selects spendable UTXOs, generates change outputs, and calculates fees. This article explains how this process works, its benefits, and potential risks.
Jun 15, 20264 min read - 34Read articlePart 34
Writing Data to the BSV Blockchain: From OP_RETURN to Application Protocols
BSV transactions can do more than transfer satoshis. By including data outputs, you can record text, hashes, or business events on-chain. This article starts with the first Hello BSV transaction, explains the difference between data outputs and payment outputs, how to construct an OP_RETURN using the SDK, the reason for hex encoding, and how to move toward structured protocol design.
Jun 16, 20264 min read - 35Read articlePart 35
Viewing BSV Transactions with WhatsOnChain: A Complete Guide from txid to On-Chain Structure
This article teaches you how to use the block explorer WhatsOnChain to view transaction details, understand core concepts like inputs, outputs, scripts, and fees, and leverage the explorer to infer the underlying logic of the SDK.
Jun 16, 20264 min read - 36Read articlePart 36
Getting started with BSV transactions: the right way to manually specify inputs
In BSV's UTXO model, manually specifying transaction inputs is a must-have skill for advanced development. This article explains the essence of inputs, the required information, code examples, and common pitfalls, helping you avoid the mental trap of "debiting an address."
Jun 18, 20264 min read - 37Read articlePart 37
Manually Specifying Transaction Outputs: A Key Step in Designing BSV Applications
Learn how Bitcoin transaction outputs work by constructing transactions manually. This article covers output types, change rules, index ordering, and common pitfalls, helping you advance from “sending transactions” to “designing BSV applications.”
Jun 18, 20263 min read - 38Read articlePart 38
Bitcoin Transaction Fees: Calculation, Influencing Factors, and Practical Guidelines for BSV
Transaction fees are not an explicit field but the difference between total inputs and total outputs. Understanding the fee calculation logic, factors affecting transaction size, and BSV network policies is essential for building on-chain applications.
Jun 18, 20264 min read - 39Read articlePart 39Current
Why Every Input in a Bitcoin Transaction Needs Its Own Signature
Understand the necessity of multi-input signatures in Bitcoin transactions, avoid common misunderstandings, and learn the basics of P2PKH signing, SDK usage, and what signatures actually protect.
Jun 18, 20264 min read - 40Read articlePart 40
BSV Transaction Serialization: From Object to Broadcast
Understanding transaction serialization is key to connecting application development with the blockchain network. This article explains why serialization is needed, the standard transaction structure, the role of hex, serialization and deserialization in the SDK, the relationship with txid, and common misconceptions, helping you move from calling the SDK to debugging on-chain data.
Jun 18, 20264 min read - 41Read articlePart 41
BSV Transaction Broadcasting: A Complete Guide from Construction to Submission
In BSV development, constructing a transaction is only the first step. This article explains the significance of transaction broadcasting, common misconceptions, pre-broadcast checks, how to interpret the return value, and failure reasons, helping developers correctly submit transactions to the network.
Jun 18, 20264 min read - 42Read articlePart 42
Transaction Chains: How a Transaction Spends a Freshly Created UTXO
To truly grasp the Bitcoin white paper's definition of a coin as a chain of digital signatures, you must understand transaction chains. This article starts from the simplest model to explain how UTXOs transfer between transactions and why transaction chains are essential for state management in BSV applications.
Jun 18, 20264 min read - 43Read articlePart 43
The Bitcoin Block Header: The 80‑Byte Foundation for SPV and Light Clients
The block header is an 80‑byte summary of a Bitcoin block. It does not contain full transactions, yet it is the critical structure linking the proof‑of‑work chain and committing to the transaction set. This article explains the header fields, Merkle root, and SPV principles, helping you understand how BSV enables massive scaling.
Jun 20, 20265 min read
Recommended articles
BlockchainJun 18, 2026
BSV Transaction Serialization: From Object to Broadcast
Understanding transaction serialization is key to connecting application development with the blockchain network. This article explains why serialization is needed, the standard transaction structure, the role of hex, serialization and deserialization in the SDK, the relationship with txid, and common misconceptions, helping you move from calling the SDK to debugging on-chain data.
BlockchainJun 18, 2026
Bitcoin Transaction Fees: Calculation, Influencing Factors, and Practical Guidelines for BSV
Transaction fees are not an explicit field but the difference between total inputs and total outputs. Understanding the fee calculation logic, factors affecting transaction size, and BSV network policies is essential for building on-chain applications.
BlockchainJun 18, 2026
BSV Transaction Broadcasting: A Complete Guide from Construction to Submission
In BSV development, constructing a transaction is only the first step. This article explains the significance of transaction broadcasting, common misconceptions, pre-broadcast checks, how to interpret the return value, and failure reasons, helping developers correctly submit transactions to the network.