Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Bitcoin Basic OP_CODEs
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Shun Usami
June 23, 2018
Technology
1
290
Bitcoin Basic OP_CODEs
Let's enjoy Bitcoin OP_CODEs!
Shun Usami
June 23, 2018
Tweet
Share
More Decks by Shun Usami
See All by Shun Usami
Let's Write Bitcoin Script #TokyoBitcoinHackathon
usatie
7
8.2k
SwiftでBitcoinのscriptを書いてみよう
usatie
2
360
CustomCellのためのProtocol
usatie
0
480
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
190
日本語テキストと音楽の対照学習の技術とその応用
lycorptech_jp
PRO
1
420
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.3k
Agile Leadership Summit Keynote 2026
m_seki
1
410
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
180
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
140
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
160
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
140
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
5
2.7k
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
0
740
Large-scale JavaScript Application Architecture
addyosmani
515
110k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to build a perfect <img>
jonoalderson
1
4.9k
Prompt Engineering for Job Search
mfonobong
0
160
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
How to Talk to Developers About Accessibility
jct
2
130
Balancing Empowerment & Direction
lara
5
880
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Believing is Seeing
oripsolob
1
53
Transcript
BITCOIN BASIC OP_CODES @usatie
WHAT IS BITCOIN? WHAT IS BITCOIN? ▸ Q1 : Bitcoinͱʁ
▸ A1 : վ᜵Ͱ͖ͳ͍σʔλϕʔε ▸ Q2 : ԿΛอଘ͍ͯ͠Δʁ ▸ A2 : ৣ͕͔͔ͬͨίΠϯ
LOCK & UNLOCK BITCOIN LOCK & UNLOCK BITCOIN ▸ Lock
Script : ίΠϯʹ伴Λ͔͚ΔͨΊͷεΫϦϓτ ▸ Unlock Script : ίΠϯͷ伴Λղৣ͢ΔͨΊͷεΫϦϓτ ▸ [Unlock Sceript] [Lock Script]ͷॱ൪ʹ࣮ߦͨ݁͠ՌɺTrue ͕ฦͬͯདྷΕͦͷίΠϯ༻Մೳʂ ʢʹScriptPubkeyʣ ʢʹScriptSigʣ
WHAT IS STACK MACHINE? WHAT IS STACK MACHINE? ▸ BitcoinͷεΫϦϓτελοΫϚγϯ্Ͱ࣮ߦ͞ΕΔ
▸ ελοΫϚγϯͱԿ͔ɺҎԼͷྫΛݟͯΈ·͠ΐ͏ʂ ▸ ex. [3] [20] [8] [ADD] [MUL] 8 20 3 28 3 84
SUCCESSFUL UNLOCK SUCCESSFUL UNLOCK ▸ [Unlock script] [Lock script]ͷॱ൪ʹ࣮ߦ͠ɺελοΫͷ࠷ޙʹTRUE͕ ΕίΠϯͷղৣޭʂ
▸ Lock script : [2] [3][ADD] [EQUAL] ▸ Unlock script : [5] 3 2 5 5 5 TRUE
UNLOCK FAILURE UNLOCK FAILURE ▸ Lock script : [19] [2]
[SUB] [EQUAL] ▸ Unlock script : [8] 2 19 8 17 8 FALSE
P2PK SCRIPT PAY TO PUBLIC KEY ▸ OP_CHECKSIG : (sig
pubkey) -> TRUE/FALSE ▸ pubkeyʹରԠ͢Δൿີ伴Ͱॺ໊͞Εͨsig͔Ͳ͏͔ݕূ
P2PKH SCRIPT PAY TO PUBLIC KEY HASH ▸ OP_DUP :
x -> x x ▸ OP_HASH160 : pubkey -> pubkeyHash ▸ OP_VERIFY : Ұ൪্͕TRUE͡Όͳ͔ͬͨΒଈ࠲ʹFail
LOCK UNTIL SCRIPT LOCK UNTIL ▸ OP_CHECKLOCKTIMEVERIFY : time ->
time/Fail ▸ ͠ݱࡏ࣌ࠁ͕timeΑΓલͩͬͨΒଈ࠲ʹFail ▸ OP_DROP : Ұ൪্ͷσʔλΛআ
M-OF-N MULTISIG SCRIPT M-OF-N MULTISIG ▸ OP_CHECKMULTISIG : <sig1>…<sigN> M
<pub1>… <pubN> N -> TRUE/FALSE ▸ Nݸͷpubkeyͷ͏ͪɺͦΕΒʹରԠ͢ΔMݸͷൿີ伴Ͱ ॺ໊Ͱ͖͍ͯΔ͔ݕূ
REFERENCE DOCUMENT AND SOURCECODE ▸ https://en.bitcoin.it/wiki/Script ▸ Bitcoin’s Source code
src/script/interpreter.cpp