Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ビットコイン トランザクション色々
Search
suish
July 18, 2017
Technology
2.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ビットコイン トランザクション色々
トランザクション構造と生トランザクション P2PKHのトランザクション署名検証
suish
July 18, 2017
Other Decks in Technology
See All in Technology
なぜAI任せのゲームは面白くならないのか?
hirohasuyoutube
0
330
TiDBファミリーにDWHが新登場!! TiDB最新情報 / TiDB update 202609
yoshiakiyamasaki
0
160
ログラスのマルチプロダクトを 支える認証基盤 〜テナントごとに異なる統制とどう向き合うか〜
dada4386
3
240
手を動かして実感する、Kiro が変える開発体験
inariku
0
420
Meet AgentCore Identity Consent Portal
hironobuiga
2
130
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
140
AI駆動開発で仕様はどこまで書くべきか? ― 人とAIの責務境界から考える開発プロセスの実践
takahiromatsui
1
240
Lambda MicroVMsは常駐サーバーの代わりに なるか? Kiro Crew を動かして検証してみた / Kiro Crew on Lambda MicroVMs
k_adachi_01
2
340
OpenClawでAzure DevOpsのWiki更新を自動化する - クラウドAIだけでは届かない場所へ
yutakaosada
0
130
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
640
Account Factory for Terraformによる 標準化されたアカウント発行の自動化
pensuke628
0
120
IR Today: Theory, Practice, and Agents
dtunkelang
0
260
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
780
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
270
Evolving SEO for Evolving Search Engines
ryanjones
0
300
The SEO Collaboration Effect
kristinabergwall1
1
580
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
480
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
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