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
290
1
Share
Bitcoin Basic OP_CODEs
Let's enjoy Bitcoin OP_CODEs!
Shun Usami
June 23, 2018
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
490
Other Decks in Technology
See All in Technology
Purview Endpoint DLP 動かしてみた
kozakigh
0
120
Oracle Cloud Infrastructure presents managed, serverless MCP Servers for Oracle AI Database
thatjeffsmith
0
200
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
120
データモデリング通り #5オンライン勉強会: AIに『ビジネスの文脈』を教え込むデータモデリング
datayokocho
0
210
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
210
MySQL 9.7がやってきた ~これまでのあらすじと基本情報~ @ 日本MySQLユーザ会会2026年04月 / mysql97-yattekita
sakaik
0
180
クラウドネイティブ DB はいかにして制約を 克服したか? 〜進化歴史から紐解く、スケーラブルアーキテクチャ設計指針〜
hacomono
PRO
6
770
エンタープライズの厳格な制約を開発者に意識させない:クラウドネイティブ開発基盤設計/cloudnative-kaigi-golden-path
mhrtech
0
370
古今東西SRE
okaru
1
160
SREの仕事は「壊さないこと」ではなくなった 〜自律化していくシステムに、責任と判断を与えるという価値〜 / 20260515 Naoki Shimada
shift_evolve
PRO
1
100
Agent の「自由」と「安全」〜未来に向けて今できること〜
katayan
0
350
生成AI時代に信頼性をどう保ち続けるか - Policy as Code の実践
akitok_
0
170
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Accessibility Awareness
sabderemane
1
110
First, design no harm
axbom
PRO
2
1.2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
500
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
HDC tutorial
michielstock
2
650
Building Applications with DynamoDB
mza
96
7k
Un-Boring Meetings
codingconduct
0
280
YesSQL, Process and Tooling at Scale
rocio
174
15k
Faster Mobile Websites
deanohume
310
31k
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