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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Shun Usami
June 23, 2018
Technology
300
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.3k
SwiftでBitcoinのscriptを書いてみよう
usatie
2
360
CustomCellのためのProtocol
usatie
0
490
Other Decks in Technology
See All in Technology
OSPN.JPバージョンアップ作業進捗のご報告 / 20260801-osc26kyoto
akkiesoft
0
420
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
300
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
210
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.3k
個人OSSが、机の上から世界に広がるまでの話
shinyasaita
1
370
AIエージェントを前提としたプラットフォーム エンジニアリング:GKEで作るAgent-Ready Golden Path
legalontechnologies
PRO
2
220
モノリス Rails でも日中に rails db:migrate を走らせたい! / Daytime rails db:migrate on Monolithic Rails!
euglena1215
4
550
[しろおび夏祭り2026] チャットするAIから、作業するAIへ - 使われ方の変化と、その裏側で起きていること
kk0n
0
1.7k
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
780
AI駆動開発は個人技からチーム戦へ:組織でAIを使いこなすための実践設計
moongift
PRO
0
480
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
200
システム思考で問題に対処する
yussak
0
210
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
200
Bash Introduction
62gerente
615
220k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
Typedesign – Prime Four
hannesfritz
42
3.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Making the Leap to Tech Lead
cromwellryan
135
10k
Marketing to machines
jonoalderson
1
5.7k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
470
Building AI with AI
inesmontani
PRO
1
1.1k
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