WeAreDevelopers LIVE May 16, 2021

OP_PUSH_TX and its applications in Bitcoin smart contracts

Xiaohui Liu

Lio, creator of sCrypt, proves Bitcoin script is natively Turing complete. Learn how the OP_PUSH_TX pseudo-opcode unlocks stateful, fully on-chain smart contracts without protocol modifications.

Pause
Mute Enter Fullscreen
#1 about 3 min

Introduction to Bitcoin script and OP_PUSH_TX

How the Bitcoin virtual machine evaluates stack-based instructions like OP_PUSH_TX to read transaction state.

#2 about 2 min

Generating sighash preimages for Bitcoin transactions

The process of signing a transaction format containing inputs, outputs, sequence, and spent UTXOs.

#3 about 4 min

Implementing pseudo opcodes using ECDSA signature verification

How checking cryptographic signatures against public keys ensures data integrity for the current transaction preimage.

#4 about 4 min

Controlling transaction spending with OP_PUSH_TX preimages

Practical examples using preimages to implement check lock time verify and pay to script hash without explicit opcode changes.

#5 about 4 min

Maintaining persistent state in Bitcoin smart contracts

Structuring a locking script into immutable code and mutable data parts to propagate counter state across transactions.

#6 about 3 min

Exploring on-chain games and custom token systems

Leveraging arbitrary state data to build cellular automata, non-fungible tokens, and complex financial instruments directly on the blockchain.

#7 about 3 min

Demonstrating a fully on-chain multiplayer game

A live example of a complete Tic-Tac-Toe game where each player move executes as an enforceable transaction on the network.

#8 about 2 min

Resources for building Bitcoin smart contracts

High-level libraries abstract away scripting complexity to enable rapid deployment of decentralized applications.

Matching moments

1:57 min

The Bitcoin SV UTXO smart contract model

Liu Xiaohui · LIVE

5:14 min

Executing Bitcoin scripts on a stack-based architecture

Andreas M Antonopoulos · LIVE

2:20 min

Comparing off-chain javascript execution with bitcoin script

Brenton Gunning · LIVE

4:08 min

Introduction to interoperable apps on Bitcoin

Aaron Russell · LIVE

2:38 min

Emphasizing token utility for network code execution

John Woods John Woods · World Congress 2024

4:21 min

Developing a decentralized tic-tac-toe game with smart contracts

Tim Weingärtner · LIVE

Upcoming sessions on this topic

Open session

World Congress 2026 North America

September 25, 2026 · 10:00–12:00

Stage 10

Insert Coin: Build Live with J.P. Morgan Payments APIs and AI

Alan Torrance

Senior Executive Director of Engineering, JPMorganChase

Alan Torrance
Open session

World Congress 2026 North America

September 25, 2026 · 13:30–14:00

Stage 9

On the Public Clock: Open-Source Defense When You're Not in the Club

Nicholas Muy

VP Engineering Platform and Security at Scrut.io

Nicholas Muy
Open session

World Congress 2026 North America

September 25, 2026 · 12:20–12:50

Stage 4

Give the Agent a Budget, Not a Token

Sachin Malhotra

MTS @Anthropic

Sachin Malhotra
Open session

World Congress 2026 North America

September 25, 2026 · 15:30–15:40

Outdoor Stage

Offloading IoT State: Solving the Memory Crisis on Legacy Hardware

Pravin Nagare

Senior Software Engineer, Roku

Pravin Nagare
Open session

World Congress 2026 North America

September 23, 2026 · 10:45–12:45

Stage 8

SBX 101: Hands-on with Docker Sandboxes

Dan Ndombe

Developer Success, Docker

Dan Ndombe
Open session

World Congress 2026 North America

September 25, 2026 · 11:40–12:10

Stage 7

x402: Building Pay-Per-Request APIs for AI Agents

Brian Whippo

Senior Director Integrations and Developer Tooling, Algorand Foundation

Brian Whippo