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
ビットコイン トランザクション色々
Search
suish
July 18, 2017
Technology
2.5k
1
Share
ビットコイン トランザクション色々
トランザクション構造と生トランザクション P2PKHのトランザクション署名検証
suish
July 18, 2017
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
220
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
160
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
270
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
130
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
410
互換性のある(らしい)DBへの移行など考えるにあたってたいへんざっくり
sejima
PRO
0
470
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
190
CREがSLOを握ると 何が変わるのか
nekomaho
0
320
タスク管理も1on1も、もう「管理」じゃない - KiroとBedrock AgentCoreで変わった“判断の仕事”
yusukeshimizu
0
150
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
0
150
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.3k
GitHub Copilot CLI で Azure Portal to Bicep
tsubakimoto_s
0
300
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
500
Music & Morning Musume
bryan
47
7.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Amusing Abliteration
ianozsvald
0
150
Context Engineering - Making Every Token Count
addyosmani
9
780
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
690
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
870
What's in a price? How to price your products and services
michaelherold
247
13k
Transcript
1
0. 1. 2. 3. 4. P2PKH 5. ※ segwit Tx
2
@sarmases 1 Bitcoin/Ethereum/Rootstock Scala 3
4
? (1/2) Bitcoin ( ) 5
? (2/2) 6
7
4bytes 0x01000000(1 ) Input 1-9bytes(VarInt) 0x02(1 ) Input Output 1-9bytes(VarInt)
0x02(1 ) Output 4bytes 0x00000000 ※ 5 (0x1DCD6500) 0 8
TxID 32bytes UTXO Index 4bytes 0x01000000 Unlocking Script 1-9bytes(VarInt) 0x6B
Unlocking Script 4bytes 0xFFFFFFFF ※ Tx Tx 0xFFFFFFFF 9
8bytes 0x01000000 Locking Script 1-9bytes(VarInt) 0x02 Locking Script satoshi 1satoshi
10
VarInt < 0xFD 1bytes (uint8_t) <= 0xFFFF 3bytes 0xFD 2bytes
(uint16_t) <= 0xFFFF FFFF 5bytes 0xFE 4bytes (uint32_t) <= 0xFFFF FFFF FFFF FFFF 9bytes 0xFF 8bytes (uint64_t) 5 => 0x05 255 => 0xFDFF00 11
( ) TxID Little Endian Big Endian 1 0x01 0x01
65536 0x010000 0x000001 0xF778C5D33453 0x5334D3C578F7 0xF778C5D33453 12
13
TxID( ID) Tx hash256(SHA-256 ) 0100000001c9e72944b5fd2b195085f9e8852e96181b4d4ce4a4b8cd993e 6d7925a0ce1c9b000000006946304302202173dc799db6b7b93b1f9b53f7 74c95aedc57dbe6a4d496bfd78d1e4b220c2db021f67e18545d2eccf7f56 2c8ec71f91e718d2292702aeb880a1d95f44fb8a66ab0121029700d3ba67 e374c699c4e5992a2f69f8a8e9321cefadae0c69eb56dba73d30e2ffffff
ff02f3653a01000000001976a9148e92fcfd113418f75356c5ca77b4463d 1bc099d288ace0673500000000001976a9144fcc9445c2edb970cb1ad427 0dc42b392596176188ac00000000 14
(1/2) Unlocking Script Locking Script 01000000 // 00000001 01 //Input
-c9e72944b5fd2b195085f9e8852e96181b4d4ce4a4b8cd993e6d7925a0ce 1c9b //TxID 00000000 // 69 // Unlocking Script 105bytes 46304302202173dc799db6b7b93b1f9b53f774c95aedc57dbe6a4d496bfd 78d1e4b220c2db021f67e18545d2eccf7f562c8ec71f91e718d2292702ae b880a1d95f44fb8a66ab0121029700d3ba67e374c699c4e5992a2f69f8a8 e9321cefadae0c69eb56dba73d30e2 // ffffffff // 15
(2/2) 02 //Output -f3653a0100000000 // 0x013a65f3 20604403satoshi(0.20604403BTC) 19 //Locking Script
25bytes 76a9148e92fcfd113418f75356c5ca77b4463d1bc099d288ac //Locking Script -e067350000000000 // 0x3567e0 3500000satoshi(0.035BTC) 19 //Locking Script 25bytes 76a9144fcc9445c2edb970cb1ad4270dc42b392596176188ac //Locking Script 00000000 // 16
46 //70bytes PUSH 304302202173dc79...fb8a66ab01 // 21 // 33bytes PUSH 029700d3ba0c69eb...dba73d30e2
// - 0x01- 0x4b PUSH OP_PUSHDATA1 0x4c 1byte PUSH OP_PUSHDATA2 0x4d 2bytes PUSH OP_PUSHDATA4 0x4e 4bytes PUSH 17
76 //OP_DUP a9 //OP_HASH160 14 //20bytes PUSH 8e92fcfd113418f75356c5ca77b4463d1bc099d2//20bytes 88 //OP_EQUALVERIFY
ac //OP_CHECKSIG OP_DUP OP_HASH160 HASH160 OP_EQUALVERIFY OP_CHECKSIG ( ) 1 PUSH 0 PUSH 18
( ) (1/6) 1(True) Tx UTXO 76a914/*899ee4cb09de33f6d7a91827ffdf45d28be998d5*/88ac PUSH (P2PKH) {DATA}
{DATA} OP_DUP OP_HASH160 {DATA} OP_EQUALVERIFY OP_CHECKSIG 1 OK 19
( ) (2/6) /* Unlocking Script */ 46 //70bytes PUSH
3043022...a1d95f44fb8a66ab01 // 21 //33bytes PUSH 029700...e0c69eb56dba73d30e2 // /* Locking Script ( TxID Output Index ) */ 76 //OP_DUP a9 //OP_HASH160 14 //20bytes PUSH 899ee4cb...ffdf45d28be998d5 // HASH160 ( ) 88 //OP_EQUALVERIFY ac //OP_CHECKSIG [ ] // PUSH [ , ] // PUSH [ , , ] // [ , , HASH] // HASH160 [ , , HASH, HASH] // HASH PUSH [ , ] // HASH 20
( ) (3/6) Bitcoin HASH256 (Sig Hash ) 1byte Sig
Hash 21
( ) (4/6) Code SIGHASH_ALL 0x01 Unlocking Script SIGHASH_NONE 0x02
SIGHASH_SINGLE 0x03 SIGHASH_ANYONECANPAY 0x80 ( ) 22
( ) (5/6) OP_CHECKSIG 01 SIGHASH_ALL Tx Hash Type 4bytes
//SigHash Tx 01000000 // 00000001 01 //Input -c9e72944b5fd2b19508...925a0ce1c9b //TxID 00000000 // 19 // Unlocking Script 76a914899ee4cb09de33f6d7a91827ffdf45d28be998d588ac //00 OR Input LockingScript ffffffff // 23
( ) (6/6) Tx HASH256 (ECDSA Secp256k1) 1 0 PUSH
[1] [0] 02 -f3653a0100000000 // 0x013a65f3 20604403satoshi(0.206 19 //Locking Script 25bytes 76a9148e92fcfd113418f75356c5ca77b4463d1bc099d288ac //Locking -e067350000000000 // 0x3567e0 3500000satoshi(0.035BTC) 19 //Locking Script 25bytes 76a9144fcc9445c2edb970cb1ad4270dc42b392596176188ac //Locking 00000000 // 01000000 // SigHash Type 01 SIGHASH_ALL 24
25
Tx TxID ( ) Mt.Gox TxID Sig Hash Type Locking
Script ECDSA (ECDSA s + - ) DATAPUSH 26
- PUSHDATA - 0x01-0x4b PUSH OP_PUSHDATA1 0x4c 1byte PUSH OP_PUSHDATA2
0x4d 2bytes PUSH OP_PUSHDATA4 0x4e 4bytes PUSH PUSHDATA Tx 27
Tx 46 (76bytes PUSH) 3043022...66ab01 ( ) 21 (33bytes PUSH)
029700d...3d30e2 ( ) 4c46 (OP_PUSHDATA1 76bytes PUSH) 3043022...66ab01 ( ) 21 (33bytes PUSH) 029700d...3d30e2 ( ) 1byte Tx TxID 7ba53ceea57f5554a266e0ea8b6ac2a772d5bf81c3753e501be9b95f31d654ea ↓ 7374e545e77f380efe21c0d1808c548b42096c5230c204ce1b5df79b8c836b66 28
P2PKH ( ) TxID ( ) segwit SigHash BIP143 29