Bitcoin Script, Lightning Network and Wallet Types: Locking Scripts, Multisig and Faster Payments

Blockchain Developer 50 min min read Updated: Nov 17, 2026 Intermediate
Bitcoin Script, Lightning Network and Wallet Types: Locking Scripts, Multisig and Faster Payments
Intermediate Topic 3 of 3

Coins Are Locked With Scripts

Every UTXO has a small program, a locking script, that says what is needed to spend it. To spend, you provide an unlocking script that satisfies it.

Pay to Public Key Hash (P2PKH)

text Locking: OP_DUP OP_HASH160 <pubkey hash> OP_EQUALVERIFY OP_CHECKSIG Unlocking: <signature> <public key>
  • Check that the public key hashes to the stored hash
  • Check that the signature is valid for that public key
  • Script runs on a stack. It is not Turing complete, which keeps it simple and safe

Multisignature (Multisig)

  • Needs M of N signatures, for example 2 of 3
  • Use cases: company treasury, shared savings, escrow, and safer personal backup (keys in different places)
  • One stolen key is not enough to steal funds

Timelocks

Scripts can say 'this coin cannot be spent before block 900,000 or date X'. Useful for inheritance plans and payment channels.

Upgrades in One Line Each

UpgradePurpose
SegWitSeparates signature data, fixes transaction malleability, lowers fees, enables Lightning
TaprootMore privacy and flexibility for complex scripts, using Schnorr signatures

Lightning Network (Layer 2)

Bitcoin's base layer is slow by design. Lightning lets people make many fast, cheap payments off-chain.

  1. Two people open a channel by locking coins in a 2-of-2 multisig on-chain
  2. They send many signed updates between them, instantly and almost free
  3. When finished they close the channel, and only the final balance is written on-chain
  4. Payments can route through other nodes, so you need not open a channel with everyone

Wallet Types in Bitcoin

TypeNote
Full node walletVerifies everything itself. Most private and trustless
Light (SPV) walletAsks servers for data. Lighter, some trust needed
Hardware walletKeys stay in a safe device
Custodial appCompany holds keys

Practice

  1. What does a locking script do?
  2. Why is 2-of-3 multisig safer than one key?
  3. Why does Lightning make small payments cheaper?

Conclusion

Bitcoin coins are locked by simple scripts, multisig adds shared control and Lightning adds fast cheap payments on top of the main chain.

Quick Summary: scripts; P2PKH; multisig; timelock; upgrades; Lightning; wallets.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators