Learn Bitcoin← Home

Steps Used by Your Wallet to Sign a Transaction

Step 1 — Transaction is Created

Your wallet builds a transaction containing:

  • The UTXO being spent
  • The recipient's address
  • The amount
  • The transaction fee

Step 2 — Transaction Data is Hashed

Before signing, the wallet creates a hash of the transaction using a cryptographic hash function:

  • SHA-256 (often applied twice — double SHA-256)
  • This produces a fixed-length transaction digest

Step 3 — Wallet Signs the Hash

The wallet signs the transaction hash using:

  • The private key
  • The ECDSA algorithm

This generates the digital signature:

Signature = Sign(Transaction Hash, Private Key)

The private key never leaves the wallet.

Step 4 — Signature is Added to the Transaction

The transaction now includes:

  • The digital signature
  • The public key

This information is placed in the unlocking script (scriptSig). The signed transaction is then broadcast to the Bitcoin network.