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
BIP39について
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yasuhiro Shimizu
June 03, 2019
Programming
0
190
BIP39について
Yasuhiro Shimizu
June 03, 2019
Tweet
Share
More Decks by Yasuhiro Shimizu
See All by Yasuhiro Shimizu
Jetpack Composeから始める、頑張らないVRT
yshrsmz
0
1.2k
Kotlin Multiplatform Projectを導入してみて
yshrsmz
1
1.2k
Android Fireside Chatまとめ
yshrsmz
3
2.3k
RxJava1からRxJava2へ
yshrsmz
0
110
Other Decks in Programming
See All in Programming
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
130
Basic Architectures
denyspoltorak
0
680
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
Fragmented Architectures
denyspoltorak
0
160
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
210
ぼくの開発環境2026
yuzneri
0
230
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
The Spectacular Lies of Maps
axbom
PRO
1
520
The Curious Case for Waylosing
cassininazir
0
240
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Test your architecture with Archunit
thirion
1
2.2k
The Language of Interfaces
destraynor
162
26k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Transcript
BIP39について 秘密鍵を安全に保管する
BIP39(Mnemonic Code)とは - 秘密鍵を簡単に覚えられる単語の組み合わせで表現する - 決定性ウォレット(deterministic wallet)のシード値の保存によく 使われる alarm boost
mom torch couple owner myself gift sugar tell ticket panther 27d28fc240b66cff0eb7bb89d9aa99f4dddc43954db4565c25b1226347e0b2a59 dd5281b6ce384606bc30479e3ab0f41702e27fd3442269b7b187f86601e8db1
対応言語 - 英語 - 日本語 - 韓国語 - 中国語(簡体字) -
中国語(繁体字) - フランス語 - イタリア語 ただ、Unicodeのnormalizationが必要な言語も多いので、英語が用いられることが多そ う(個人の感想です)
BIP39のステップ 1. Mnemonic Codeを生成 2. バイナリのシード値に変換
Mnemonic Codeの生成 1. 初期エントロピー(ENT)を取得(暗号学的にランダムな値。 32bits区切りで128-256bits) 2. エントロピーのSHA256ハッシュをとり、その結果の最初の (ENT/32)bitsをチェックサムとする(128bitのENTなら、ハッシュ の最初の4bits) 3.
チェックサムをENTの末尾に連結 4. 11bitsごとに区切る 5. 11bitsの数字をインデックスとして、ワードリストから単語を取得 する
None
Mnemonic Codeからシード値を得る 1. Mnemonic Codeとパスフレーズ(任意) 2. Mnemonic Codeと`mnemonic${パスフレーズ}`を PBKDF2(HMAC-SHA512)でハッシュ化。BIP39では2048回 ハッシュ化を行う(Key
Stretching)い、512bitsのシード値を得 る。 → あとはBIP32とかでよしなに
None
BIP39の派生 そもそもBIP39はElectrumというWalletのmnemonic code生成手 法をベースに、trezorの製造元によって提案された。 Electrumの作者はBIP39には欠点があるとして認めていない
Electrum Seed V1 - BIP39の元になった仕様 - ワードリストは1626(BIP39は2048) - シードとMnemonic Codeを相互変換可能
Electrum Seed V2〜 - BIP39の問題点を改善した実装 - ワードリストはBIP39と同じ - ワードリストなしに入力されたMnemonic Codeの間違いが検
出できる - Mnemonic Codeから生成に使われた仕様のバージョンを取 得できる
Electrum Seed V2でMnemonic Code取得 1. エントロピーの取得(暗号学的にランダムな値) 2. エントロピーとnonce(0から始まる正の整数)からmnemonic codeを取得 3.
mnemonic codeを`hmac_sha_512(b”Seed Version”, mnemonic)`して、バージョン コードが含まれているか確認。 4. 含まれていたら終了。含まれていなかったらnonceをインクリメントして、2-3を繰り 返す。