SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
マルチシグとは
作:ジョナサン・アンダーウッド
ビットバンク社 技術顧問
・デジタル署名とは
・スクリプトとは
・ビットコインの署名確認「OP_CHECKSIG」
・複数の公開鍵を使った「OP_CHECKMULTISIG」
・Raw Output vs. P2SH
・署名時の取引の扱い
・鍵の管理の問題
・実演
概要
・楕円曲線の場合、 r と s という2つの値を合わせて「デジタル署名」と言います。
・生成アルゴリズム:(楕円曲線の方程式は基本的に大文字=点、小文字=整数を表します。)
  - r = Rx
= kG mod p
  - s = k-1
(z + dr) mod n
      -G, p, n は定数、 z は署名したいメッセージのハッシュ、 d は秘密鍵(整数)
      -k が秘密鍵のような乱数で全ての取引ごとに新しく生成する必要があります。
・この2つの値と公開鍵(Q)を使って確認したい場合は下記のように確認します。
  - w = s-1
mod n
  - u1
= zw mod n
  - u2
= rw mod n
  - R = u1
G + u2
Q
  - Rx
== r ならば OK、 違えば NG
デジタル署名とは
・scriptPubkey - Outputとも呼ばれ、ビットコインを開放するための条件を課すパズルのようなもの。
・scriptSig - Inputとも呼ばれ、ビットコインを施錠する scriptPubkeyの解答を提出するもの。
ビットコインをもらうと、 scriptPubkeyがブロックチェーンに入ります。
ビットコインを送ると、 scriptSigがブロックチェーンに入ります。
なのに承認する時は実行する順番が逆
scriptSig ⇒ scriptPubkey で実行されます。
例:
scriptSig:
①OP_PUSHDATA 304402201e815830e3cdc6854643a96d0784863263a6c81907e3e156b8177bb0e58c1622
02206dd641de7908b832bc907d849f08901db02e46376f50d048183bc9b1e7578ab601
②OP_PUSHDATA 02d7697f67f07afc87e7bb19bdcd08607c7f87fbe934bb83a0af2245fc2725fe66
scriptPubkey:
③OP_DUP ④OP_HASH160 ⑤OP_PUSHDATA f8a60ea80148db1dd98a463151d315eb816d1035
⑥OP_EQUALVERIFY ⑦OP_CHECKSIG
スクリプトとは
スクリプト実行時(イメージ)
OP_CHECKSIG
<SIG_A>
・実行された時、スタックの上にある2つのものを拾って、
1つ目を公開鍵と見なし、2つ目を署名と見なし、
署名の確認作業を行い、正の場合「1」、誤の場合「0」をスタックの上に残します。
①PUSH_DATA <SIG_A> ②PUSH_DATA <PUBKEY_A> ③CHECKSIG
<SIG_A>
<PUBKEY_A>
<SIG_A>は
<PUBKEY_A>
の有効な署名か?
YES
1
NO
0
スタック スタック
1
スタック
OP_CHECKMULTISIG
<SIG_C>
<SIG_A>
<OP_0>
・実行された時、スタックの上にあるOPの数字を拾い、それだけの数のものを
 スタックの上から拾って行き、すべて公開鍵と見なす。
・更にスタックにあるOPの数字を拾い、それだけ(+1)の数のものを拾い、
 有効な署名が足りるまで公開鍵に対して確認し続ける。
  
<OP_0> <SIG_A> <SIG_C> <OP_2> <PUBKEY_A> <PUBKEY_B> <PUBKEY_C> <OP_3> <OP_CHECKMULTISIG>
スタック スタック
<OP_3>
<PUBKEY_C>
<PUBKEY_B>
<PUBKEY_A>
<OP_2>
<SIG_C>
<SIG_A>
<OP_0>
OP_CHECKMULTISIG  2
スタック
<OP_CHECKMULTISIG>
<OP_3>
<PUBKEY_C>
<PUBKEY_B>
<PUBKEY_A>
<OP_2>
<SIG_C>
<SIG_A>
<OP_0>
1 正
2 誤
3 正 2達成!
署名の順番が大事!
? バグがあり、OP_2 + 1して3つのものを
  スタックから拾います。 <OP_0>が主流
1
スタック
Raw Output vs. P2SH
・1つの署名だと公開鍵がハッシュに守られる。
・でもマルチシグになると、公開鍵を全て晒さないといけなかった。
解決法:「scriptPubkeyは後で出すから、このハッシュだけ持っといて。」
それがPay To Script Hash = スクリプトのハッシュに対して支払う = P2SH
Raw Output:
<OP_0> <SIG_A> <SIG_C> <OP_2> <PUBKEY_A> <PUBKEY_B> <PUBKEY_C> <OP_3> <OP_CHECKMULTISIG>
P2SH:
<OP_0> <SIG_A> <SIG_C> <redeemScript> <OP_HASH160> <redeemScriptHash> <OP_EQUAL>
scriptSig scriptPubkey
scriptPubkeyscriptSig
署名時の取引の扱い
・01000000 // バージョン
02 // 入力の数
c16ea48590……. // 参照先の取引ID(ハッシュ)
00000000 // 参照先の出力索引
ここ P2SH: <redeemscript> Raw Output: <scriptPubkey>
ffffffff // Sequence
48590c16ea……. // 参照先の取引ID(ハッシュ)
05000000 // 参照先の出力索引
00 // 現在署名中じゃないためOP_0を1個
ffffffff // Sequence
01 // 出力の数
6aa5090a00000000 // satoshis単位のビットコイン送金額
17a91436347564bb1c2c57a9221ca667191f0b125ff1f487 // scriptPubkey
00000000 // nLockTime
01000000 // SIG_HASH タイプ
鍵の管理の問題
・現在主流のP2SH型マルチシグだと、相手の公開鍵を持っていないと
 redeemscriptを知らないということになり、署名すらできなくなってしまう。
・最近マルチシグを使うウォレットが急増しつつも、ワンフレーズでバックアップ可能な
 シングルシグネチャHDウォレットの利便性の方が高い。
・よって、殆どのサービスは利便性を向上する目的で、公開鍵の生成を
 サーバで行うサービス型マルチシグが多いです。(Bitgo, GreenAddressなど)
・バックアップが一番簡単なマルチシグウォレットは現在、GreenAddress、だが設定
 が複雑で少し信用する必要がある。
・完全非集権型を目指しているマルチシグウォレット:
  Copay  Electrum
使い勝手はよくなりつつあるのだが、まだまだバックアップの利便性が低い。。。
実演
・Androidとパソコンをお持ちの方:「Copay」のアプリを検索して
ダウンロードして、お互いにペアリングして
マルチシグを組んでみましょう。
PC: https://copay.io/
・ペアを組んだら(testnet用ウォレット)、
 ビットコインを少し送ります。
・ビットコインもらったら他のペアなどに送って下さい。
・実演中は歓談スタイルで質疑応答に答えます。
・ある程度の時間になれば三原が懇親会の合図をします。 御清聴ありがとうございました
アンドロイドアプリDLページ

Contenu connexe

Dernier

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 

Dernier (9)

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

ビットコインにおける「マルチシグ」とは