Taproot
Privacy preserving switchable scripting for Bitcoin
Gregory Maxwell による
Taproot 関連 BIP
BIP341: bips/bip-0341.mediawiki at master · bitcoin/bips
Segwit v1 として Taproot を定義している
BIP340: Taproot の署名には Schnorr signature を使う
Taproot とは
Taproot は Segwit v1 である
address is bech32m
bips/bip-0350.mediawiki at master · bitcoin/bips
bech32m は bech32 の脆弱性を直したもの
bech32 は: bips/bip-0173.mediawiki at master · bitcoin/bips
a new witness version is added (version 1), whose programs consist of 32-byte encodings of points Q. Q is computed as P + hash(P||m)G for a public key P, and the root m of a Merkle tree whose leaves consist of a version number and a script. These outputs can be spent directly by providing a signature for Q, or indirectly by revealing P, the script and leaf version, inputs that satisfy the script, and a Merkle path that proves Q committed to that leaf.
witness program が Q である
Q に対応する秘密鍵をもっていれば unlock できる
Q = P + hash(P||m)G
P is pulick key
P = k*G
hash(P||m)*G は hash(P||m) を秘密鍵とする公開鍵と言える
schnorr の場合秘密鍵を足した鍵は、公開鍵を足したものに対応する秘密鍵になっている
if you know k
k + hash(P||m) を計算できる
m を知る必要はない
Q, P, G を知っているので hash(P||m) もわかる
これは Q に対する秘密鍵 になっている
したがって unlock できる
m を示せる場合
script と script path から m を導ける知識がある場合
P, m, マークルパス を使って Q になることを示して、script を使って unlock する
SIGHASH_DEFAULT が導入される
なにが違うのかわかっていない、、
TapScript
従来の Bitcoin Script language から変更点が複数ある
OP_SUCCESSx が追加されている
新しい op code を softfolk を導入するため
OP_SUCCESS が script にあった場合、その時点でその script は有効になる
新しい意味が追加されたときに、それを知らない古いパーサーが無効にしないようにだと思う
scriptPubkey(witness program) はどのような形式になるか
version number 1, and a 32-byte witness program
したがって OP_1||OP_PUSHBYTE_32||<data>
0x51||0x20||<data>
data は tweaked pubkey Q
scriptSig(witness) は?
keyPath と scriptPath で異なる
If there is exactly one element left in the witness stack, key path spending is used:
If there are at least two witness elements left, script path spending is used:
Key derivation は BIP86
bips/bip-0086.mediawiki at master · bitcoin/bips
BDK テスト古いのでは?
[Add support for Taproot and tr() descriptors by afilini · Pull Request #593 · bitcoindevkit/bdk https://github.com/bitcoindevkit/bdk/pull/593/files]
MAST も関係ある
Paul Sztorc (Bip300 ⇔ BTC Maximalism)さんはTwitterを使っています: 「RT @ercwl: @Mario_Gibney @pwuille See this excerpt from the state of discussion around Taproot QC security implications. https://t.co/mMy4a…」 / Twitter
Resources
bitcoinbook/ch07_authorization-authentication.adoc at third_edition_print1 · bitcoinbook/bitcoinbook
Taproot | Bitcoin Optech
Preparing for taproot | Bitcoin Optech
Taproot funds burned on the bitcoin blockchain - Suredbits
Taproot Demonstration | BitMEX Blog
Taproot について - Google スライド
bitcoin-dev Taproot: Privacy preserving switchable scripting
【動画で学ぶブロックチェーン】【Bitcoin】 BIP341 Taproot - 安土 茂亨氏 - GBEC - Blockchain を推進するエンジニアリングコミュニティ -
Taproot Is Coming: What It Is, and How It Will Benefit Bitcoin