🚀

Tapyrusネットワークを構築してみる その①

44 min read

#. About

Tapyrusネットワークの本番環境を構築してみる記事。
手順は 公式ドキュメント に沿って進めていきます。
各種用語などの解説はこの記事では省きます。

Tapyrusについて
TapyrusはChaintope社の開発するパブリックブロックチェーンです。詳しくは下記リンクから。

https://www.chaintope.com/chaintope-blockchain-protocol/

Tapyrusは開発途上のサービスであるため、仕様の変更などが予想されます。この記事の内容は執筆時点(2021/09/06)のものであることを留意してください。

1. Define the federation members of the new Tapyrus network

まずはネットワークの構成について決めます。今回は最小の構成で行きたいので、

ノード
Signer 3
Core 1
Seeder 1

とします。

a. Signer

GitHubレポジトリからクローンしてビルドします。

https://github.com/chaintope/tapyrus-signer

サーバーは「さくらのクラウド」を利用します。スペックは 1Core-1GB-CentOS7.9 とし計3台用意します。

環境構築
・さくらのクラウド
シンプルモード選んだらOSとスペック指定してポチポチするだけで簡単に立ちました。省略。

・Rust

bash
# インストール
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# 環境変数
$ echo '# rust' >> ~/.bash_profile
$ echo 'source $HOME/.cargo/env' >> ~/.bash_profile

# 再読み込み
$ source .bash_profile

# 確認
$ rustc --version
rustc 1.54.0 (a178d0322 2021-07-26)

・tapyrus-signer

bash
# git
$ git clone https://github.com/chaintope/tapyrus-signer.git

# build
$ cd tapyrus-signer
$ cargo build --release
$ sudo cp target/release/tapyrus-signerd /usr/bin/

b. Core

レポジトリからクローンしてビルドする方法もありますが

https://github.com/chaintope/tapyrus-core
Docker Imageも配布されているのでそれを利用します。
https://hub.docker.com/r/tapyrus/tapyrusd

サーバーは「さくらのクラウド」を利用します。スペックは 1Core-1GB-CentOS7.9 とし1台用意します。

環境構築
・さくらのクラウド
シンプルモード選んだらOSとスペック指定してポチポチするだけで簡単に立ちました。省略。

・Docker

bash
# インストール
$ curl -fsSL https://get.docker.com/ | sh

# 起動
$ sudo service docker start

・tapyrus-core

bash
# git
$ git clone https://github.com/chaintope/tapyrus-core.git

c. Seeder

https://github.com/chaintope/tapyrus-seeder
公式でAmazonLinuxの利用が推奨されているのでSeerderのみAWS EC2で構築します。

環境構築
その②でやります

2. Choose a Network Id

今回は 54617021 とします。

3. Generate Aggregate public key

Signerネットワークの集約公開鍵を生成します。

a. Generate key pair

Signer毎にpublic_keyとprivate_keyのペアを作成します。

bash
$ cd tapyrus-signer/target/release

$ ./tapyrus-setup createkey
<private_key> <public_key>

生成された秘密鍵は第三者の手に渡らないように保管します。
以降では、Signerを公開鍵でソートしSigner[i] (i=1,2,3...n)と表記します。
ここでは

Signer[i] public_key[i]
Signer[1] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711
Signer[2] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2
Signer[3] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee

となりました。

以降について、長ったらしくてしょうがないので初出以外の値については省略して表記していきます。

b. Generate Node VSS

Node VSSを生成します。

Signer[1]

bash
$ ./tapyrus-setup createnodevss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[1]> \
  --threshold=2
output
<public_key[1]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71102a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb923c6463886993a30100296209270e265187b031db500e3321f4c790964d1afa00a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb923c6463886993a30100296209270e265187b031db500e3321f4c790964d1afa00
<public_key[1]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92cac1907632e380cf79ff33515095102e26218c18deab5a946ccc3b58a682d812a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92cac1907632e380cf79ff33515095102e26218c18deab5a946ccc3b58a682d812
<public_key[1]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71103865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92591ebd63fc335e9df3d504997a1bfa0c09e4096fbdffe1cb24fe878e2fb474e3a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92591ebd63fc335e9df3d504997a1bfa0c09e4096fbdffe1cb24fe878e2fb474e3

出力は<public_key[1]>: <node_vss[i, n]>の形で返されます。
よって

node_vss value
node_vss[1,1] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71102a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb923c6463886993a30100296209270e265187b031db500e3321f4c790964d1afa00a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb923c6463886993a30100296209270e265187b031db500e3321f4c790964d1afa00
node_vss[1,2] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92cac1907632e380cf79ff33515095102e26218c18deab5a946ccc3b58a682d812a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92cac1907632e380cf79ff33515095102e26218c18deab5a946ccc3b58a682d812
node_vss[1,3] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71103865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92591ebd63fc335e9df3d504997a1bfa0c09e4096fbdffe1cb24fe878e2fb474e3a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7118268e20692518070ce6111117ca998827be272f545f141058f2c9a1dfb030bfeff92e11fe7a95b81469795971f380665fb02902ff50c9e9da1344aacc8d7ebc8b5e4acd13f2bf7fb8ef3099df950e68e6d3b764813b639a1ba3f2d1a245fcb92591ebd63fc335e9df3d504997a1bfa0c09e4096fbdffe1cb24fe878e2fb474e3

Signer[2]

bash
$ ./tapyrus-setup createnodevss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[2]> \
  --threshold=2
output
<public_key[1]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be202a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7cbe62d95cd030ceaebb553d91d0f690e0c2f329129df992e30c8a8ba161802c5632d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7cbe62d95cd030ceaebb553d91d0f690e0c2f329129df992e30c8a8ba161802c56
<public_key[2]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c621c5aa8e49ebd15e7dab04e55dfdb604faec03f8fb60ad621f1a48b0edf848432d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c621c5aa8e49ebd15e7dab04e55dfdb604faec03f8fb60ad621f1a48b0edf8484
<public_key[3]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be203865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c05d5dbf4f90cab7d1460230adac925dfdc6a576c817282c93758bd74bc3edcb232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c05d5dbf4f90cab7d1460230adac925dfdc6a576c817282c93758bd74bc3edcb2

よって

node_vss value
node_vss[2,1] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be202a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7cbe62d95cd030ceaebb553d91d0f690e0c2f329129df992e30c8a8ba161802c5632d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7cbe62d95cd030ceaebb553d91d0f690e0c2f329129df992e30c8a8ba161802c56
node_vss[2,2] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c621c5aa8e49ebd15e7dab04e55dfdb604faec03f8fb60ad621f1a48b0edf848432d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c621c5aa8e49ebd15e7dab04e55dfdb604faec03f8fb60ad621f1a48b0edf8484
node_vss[2,3] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be203865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee000232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c05d5dbf4f90cab7d1460230adac925dfdc6a576c817282c93758bd74bc3edcb232d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be22d300a799824cd4ece0bbc258c6ac604b76c039a8786d8719e877118dd6ea9f113ef6b838f6f6506438ad82a23ebe8296db0a5198e2213d76966481c61e2bf88304ce1810287bd58e34d274f1ad357ed6c07fbcd62b3c1d18e941d7ade10da7c05d5dbf4f90cab7d1460230adac925dfdc6a576c817282c93758bd74bc3edcb2

Signer[3]

bash
$ ./tapyrus-setup createnodevss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[3]> \
  --threshold=2
output
<public_key[1]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d525bd957c89d8539cf4212b9960d6a07582a1d50254a29fed58e5c7197be8329d865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d525bd957c89d8539cf4212b9960d6a07582a1d50254a29fed58e5c7197be8329d
<public_key[2]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52a088e2f0992fe23b63f6b31aebbbbf4d1cac062b1e1f8c08ad3f9858cff3397865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52a088e2f0992fe23b63f6b31aebbbbf4d1cac062b1e1f8c08ad3f9858cff3397
<public_key[3]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52e5386e1894da8aa785daac9fca0d77420f3abc30f215193bcc22bf19e163491865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52e5386e1894da8aa785daac9fca0d77420f3abc30f215193bcc22bf19e163491

よって

node_vss value
node_vss[3,1] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d525bd957c89d8539cf4212b9960d6a07582a1d50254a29fed58e5c7197be8329d865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d525bd957c89d8539cf4212b9960d6a07582a1d50254a29fed58e5c7197be8329d
node_vss[3,2] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52a088e2f0992fe23b63f6b31aebbbbf4d1cac062b1e1f8c08ad3f9858cff3397865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52a088e2f0992fe23b63f6b31aebbbbf4d1cac062b1e1f8c08ad3f9858cff3397
node_vss[3,3] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52e5386e1894da8aa785daac9fca0d77420f3abc30f215193bcc22bf19e163491865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee6985fa3ee052af72bddc5fd2a477b5ba0ff46cab0cae0a9c43424439a4b2872501b88550532f33e3e81654425d29315a65022e221d5fc2502f94ad840d310cb4e19850ba6f60fec4d02693cfa79b3918e03781ab4bd2844553e8d5fece9767d52e5386e1894da8aa785daac9fca0d77420f3abc30f215193bcc22bf19e163491

c. Generate an Aggregated public key

集約公開回鍵を生成します。

Signer[1]

bash
$ ./tapyrus-setup aggregate \
  --vss=node_vss[1,1] \
  --vss=node_vss[2,1] \
  --vss=node_vss[3,1] \
  --private-key=<private_key[1]>
output
04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801 <node_secret_share[1]>

<aggregated_public_key> <node_secret_share[i]>の形で出力されます。
node_secret_shareは秘密裏に保管します。

Signer[2]

bash
$ ./tapyrus-setup aggregate \
  --vss=node_vss[1,2] \
  --vss=node_vss[2,2] \
  --vss=node_vss[3,2] \
  --private-key=<private_key[2]>
output
04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801 <node_secret_share[2]>

Signer[3]

bash
$ ./tapyrus-setup aggregate \
  --vss=node_vss[1,3] \
  --vss=node_vss[2,3] \
  --vss=node_vss[3,3] \
  --private-key=<private_key[3]>
output
04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801 <node_secret_share[3]>

よって集約公開鍵は

04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801

となりました。

4. Create a new genesis block

tapyrus-coreに含まれるtapyrus-genesisを使用します。ローカルでcoreをビルドしてあるのでそれを使います。

macでのビルド方法
zsh
# xcode
$ xcode-select --install

# ライブラリ
$ brew install automake berkeley-db4 libtool boost miniupnpc pkg-config python qt libevent qrencode
$ brew install librsvg

# BerkeleyDB
$ ./contrib/install_db4.sh .

# git
$ git clone https://github.com/chaintope/tapyrus-core
$ cd tapyrus-core

#build
$ ./autogen.sh
$ ./configure --without-gui
$ make

# check
$ make check

tapyrus-genesis コマンドについて、公式ドキュメントではtime,address両引数を指定していますが、指定すべき内容がよく分からない&help見るとoptionalなのでひとまず指定なしで進めます。

bash
./tapyrus-genesis \
  -signblockpubkey=04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801

ここで、集約公開鍵のフォーマットエラーが出ます。(2021/09/05まで)
Chaintopeの中の人に問い合わせたところ、以下の手順により圧縮することで解決するようです。

irb
require 'tapyrus'
Tapyrus::Key.new(pubkey: '04971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15dec3281e44c6c3bf44c78def8fed54beabd93f4a284b30fbb9539b1db3e0e6801').to_point.to_hex
output
=> "03971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15d"

2021/09/06時点でIssueが建てられPRも作られています。修正後は生成される集約公開鍵が圧縮された状態で出力されるようです。素早い対応非常に感謝...!

ということで圧縮されたものを用い再度実行すると

010000000000000000000000000000000000000000000000000000000000000000000000af7c7b44d2010da555b6fcf028b4344c2d091fac5c631f0d9c9baaf36318015ef619fe6b280a75e8633d8882d091766cf52a4209e298cf70da64a643c9530b3f1bbd3561012103971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15d0001010000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a010000001976a91425ccffac6277962b1dc027568d300a4c4089b56c88ac00000000

ブロックのHEXが出力されました。
genesisという名前のファイルで保存します。

5. Generate genesis block proof

a. Generate Block VSS

block_vssを生成します

Signer[1]

bash
$ ./tapyrus-setup createblockvss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[1]> \
  --threshold=2
output
<public_key[1]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71102a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71100022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd92aace9595b600e36f386ecdfc58ca34238a64cb25955484b3e9a5b99916058c92702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54cd70a2ba77e14c1281ad1b64073eed57382e14b15490e5a7c4dd0ac2fbfbe9e
<public_key[2]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be200022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd9a34474b5bd07d7f10b21b76098111fd68ad70b07f41339e14cc979e02768ac892702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54bc3725448b46dff2c21c5cb73f00458cd7b50f2e929736a2906deab5ad78245
<public_key[3]>:02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71103865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee00022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd91bdc00121eafa1ab22bc81e16a959c6c2258ec76df888b3b9b263999ed3abf082702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54aafda7ce9eac73d3028b9e0a76c19dc2773c09abd09d879d5bfecaa85ef45ec

出力は <public_key[i]> <block_vss[i,n]> の形です。
よって

block_vss value
block_vss[1,1] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71102a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71100022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd92aace9595b600e36f386ecdfc58ca34238a64cb25955484b3e9a5b99916058c92702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54cd70a2ba77e14c1281ad1b64073eed57382e14b15490e5a7c4dd0ac2fbfbe9e
block_vss[1,2] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be200022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd9a34474b5bd07d7f10b21b76098111fd68ad70b07f41339e14cc979e02768ac892702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54bc3725448b46dff2c21c5cb73f00458cd7b50f2e929736a2906deab5ad78245
block_vss[1,3] 02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c71103865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee00022702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d0d0f6797631767fe68fa8be5da058df2bf8addb7c60509b700b18c85ac1c5d78ffdaede41d4874120f367868e57d3ae3f2a48c5fd37fee9dc4fe50746d156ecee8497124e8d4ac2d7fbefbce7911de83bd9e0928b9abc8ad58fca7965b8185dd91bdc00121eafa1ab22bc81e16a959c6c2258ec76df888b3b9b263999ed3abf082702c6699094c671952ca3ae64597ce6010ba48d2b80571ad1f5a19fc3ef37d02f098689ce898019705741a25fa720d4075224839faf648ff4e737a43e3a24a0125b7cd865d3d226b81e4693b8e0e267dcd37da003a14a07e61e2b952a70328b69a439f745deb7811314614d039183645fded565a657144c2973a2bec19dd0e54aafda7ce9eac73d3028b9e0a76c19dc2773c09abd09d879d5bfecaa85ef45ec

Signer[2]

bash
$ ./tapyrus-setup createblockvss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[2]> \
  --threshold=2
output
<public_key[1]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be202a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cdaeab4d082e69eaac13070fb2a52c5d2daaf8a7d82d618a9a62937aff333c22eedcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a423049b88dd5f06d70c918b76d8108f7b0580521c15fb4bbed046afc49137400aad8
<public_key[2]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cd654ad2b8e65ff3bdca2a7d95b5b3e2918e3591e3a44684e5daa89a5f7ec3693edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a423072f1d82158421fabd72d151f0b39ae2dec1061b5859702d204ce195406466238
<public_key[3]>:0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be203865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cd1bea58699e55fccf814deb78c63b67f571727bef1b2b7f3152bdb9bfca4aaf8edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a42309c2b226cc016ce8e95a2bcbd0d7bac03d2ff020b5672189f9e9fe994988c1998

よって

block_vss value
block_vss[2,1] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be202a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c7110002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cdaeab4d082e69eaac13070fb2a52c5d2daaf8a7d82d618a9a62937aff333c22eedcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a423049b88dd5f06d70c918b76d8108f7b0580521c15fb4bbed046afc49137400aad8
block_vss[2,2] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be20002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cd654ad2b8e65ff3bdca2a7d95b5b3e2918e3591e3a44684e5daa89a5f7ec3693edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a423072f1d82158421fabd72d151f0b39ae2dec1061b5859702d204ce195406466238
block_vss[2,3] 0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be203865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0002edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72d684bf0fead7b581f78e57df9dd5768cfb2714b4d22dd1032d05868370373970ddca105b67c333fd0dc764ce2cbcd73b94243451ec716d92a9a10211cc365b1f060621847689ff6a84bb46216b523509831eb025562f1316f95a4c4a2c5f6e6cd1bea58699e55fccf814deb78c63b67f571727bef1b2b7f3152bdb9bfca4aaf8edcb358629ffe82b7c28e5b4c3c9f754826fde4cb8eabed297dc80a9e4b01a72297b40f015284a7e0871a820622a897304d8eb4b2dd22efcd2fa797b8fc8c2bf6d277fc5bf4a5734a5ab249f3497c3dc26be7e314091ff22d37c3e48c4c541326d6f383150463760933a745ad845fb62fcb45b820079deaa01a05540744a42309c2b226cc016ce8e95a2bcbd0d7bac03d2ff020b5672189f9e9fe994988c1998

Signer[3]

bash
$ ./tapyrus-setup createblockvss \
  --public-key=<public_key[1]> \
  --public-key=<public_key[2]> \
  --public-key=<public_key[3]> \
  --private-key=<private_key[3]> \
  --threshold=2
output
<public_key[1]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44d4d231852c6f2261b1db6ce2158805ba1a41f53fbc42e7781bb22a61231f57c5305235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b65797645e9062a2e8c8b2ed4a61e059c8bcb3aa062175a6c4bbe0dc5f867bc5a64cb
<public_key[2]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44dfb78e4be4d8c2065884b4b8126fc0d1a1052a2f91b4d4a590b3f72f7d3f549d405235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b65798b591df394b544e710cb9cfd953dc1bfad2cc92d21e83c268691c9fc08aa7868
<public_key[3]>:03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44da9ceb129d4261aaff2dfc8e0f577be93c1d7150fc3237cf49b89e150a5bed61405235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b6579a06c52e0ff3bfd42f2c293dd24def7b41fb93042e9642c8eff5d9b9054fa8c05

よって

block_vss value
block_vss[3,1] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44d4d231852c6f2261b1db6ce2158805ba1a41f53fbc42e7781bb22a61231f57c5305235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b65797645e9062a2e8c8b2ed4a61e059c8bcb3aa062175a6c4bbe0dc5f867bc5a64cb
block_vss[3,2] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44dfb78e4be4d8c2065884b4b8126fc0d1a1052a2f91b4d4a590b3f72f7d3f549d405235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b65798b591df394b544e710cb9cfd953dc1bfad2cc92d21e83c268691c9fc08aa7868
block_vss[3,3] 03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee000205235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e7567001407fdde57f598db0acfc72f69c40ce45968b0e7818e9b11fa7550bbfd1e0832ccdce48413f6bf767867afcb96059269b2c323f4a07ffe78822612da40feae4b71bc438ca3e62af45db012b8af545b55f4e69dcfb21b018da3e184523d5ae44da9ceb129d4261aaff2dfc8e0f577be93c1d7150fc3237cf49b89e150a5bed61405235348c54e44fa11d1da4279f511493cd124d5ba70e5d18ba81a3a8e756700ebf80221a80a6724f53038d0963bf31ba6974f187e7164ee058aaf4302e1f3fde14694bbbef09c8087f158009e63932e1fadf22503b33c566e6c23d470f74a6ca3340f4fae33fd6028ac5446e9ba452a44db19c5c03906e853d8e787289b6579a06c52e0ff3bfd42f2c293dd24def7b41fb93042e9642c8eff5d9b9054fa8c05

b. Sign block locally

ローカルで署名します

引数に渡す集約公開鍵は圧縮/非圧縮どちらでも出力内容に差異はありませんでした。

Signer[1]

bash
./tapyrus-setup sign \
  —block-vss=<block_vss[1,1]> \
  —block-vss=<block_vss[2,1]> \
  —block-vss=<block_vss[3,1]> \
  —aggregated-public-key=<aggregated_public_key> \
  --node-secret-share=<node_secret_share[1]> \
  —private-key=<private_key[1]> \
  —block=<さっき作ったブロックのHEX> \
  —threshold=2
output
9393733cb3ed85698370d04416c0d9b85f47ffe863aead8ec7e32664defbe96aa09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711

Signer[2]

bash
./tapyrus-setup sign \
  —block-vss=<block_vss[1,2]> \
  —block-vss=<block_vss[2,2]> \
  —block-vss=<block_vss[3,2]> \
  —aggregated-public-key=<aggregated_public_key> \
  --node-secret-share=<node_secret_share[2]> \
  —private-key=<private_key[2]> \
  —block=<さっき作ったブロックのHEX> \
  —threshold=2
output
e49e4f56835e02932ea74b914780bee815cb82d12b1f28b8119cb1b5aa3d2354a09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2

Signer[3]

bash
./tapyrus-setup sign \
  —block-vss=<block_vss[1,3]> \
  —block-vss=<block_vss[2,3]> \
  —block-vss=<block_vss[3,3]> \
  —aggregated-public-key=<aggregated_public_key> \
  --node-secret-share=<node_secret_share[3]> \
  —private-key=<private_key[3]> \
  —block=<さっき作ったブロックのHEX> \
  —threshold=2
output
35a92b7052ce7fbcd9ddc6de7840a41911a028d3434703a59b83de79a5481bfda09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee

よって

local_sig[i] value
local_sig[1] 9393733cb3ed85698370d04416c0d9b85f47ffe863aead8ec7e32664defbe96aa09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec02a8081a4fd452c7e9278697c1551771fe6a18b2cd866112aa1d9769f68943c711
local_sig[2] e49e4f56835e02932ea74b914780bee815cb82d12b1f28b8119cb1b5aa3d2354a09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec0332d52f282d2d2a14715347d10ab0ab82a8e1df6cbd3d7c82bec09d57e3ed4be2
local_sig[3] 35a92b7052ce7fbcd9ddc6de7840a41911a028d3434703a59b83de79a5481bfda09b677a852f4799cc58bb0771dcf1cd54cc084efc8e03c0e7e100d2f37ba1ec03865f73ceb05164b1792c75f21a770b9bf021375e668afd0ec8c302f641b479ee

c. Compute the signature of the genesis block

ジェネシスブロックのシグネチャを計算します。

Signer[1]

bash
./tapyrus-setup computesig \
  --sig=<local_sig[1]> \
  --sig=<local_sig[2]> \
  --sig=<local_sig[3]> \
  --private-key=<private_key[1]> \
  --block=<block> \
  --block-vss=<block_vss[1, 1]> \
  --block-vss=<block_vss[2, 1]> \
  --block-vss=<block_vss[3, 1]> \
  --node-vss=<node_vss[1, 1]> \
  --node-vss=<node_vss[2, 1]> \
  --node-vss=<node_vss[3, 1]> \
  --aggregated-public-key=<aggregated_public_key> \
  --node-secret-share=<node_secret_share[1]> \
  --threshold=2
output
010000000000000000000000000000000000000000000000000000000000000000000000af7c7b44d2010da555b6fcf028b4344c2d091fac5c631f0d9c9baaf36318015ef619fe6b280a75e8633d8882d091766cf52a4209e298cf70da64a643c9530b3f1bbd3561012103971abe66a7e79a65aa12125a17bf5b2be25ae41c659a93696dd0331e72dfd15d40e5c7fa3dbec865623572b9648dc76f9692c7768f5a97ee410a1eba890ae9c98242889722e47d083fd83a54f6e600f488a8c47cff9c3e32657e299b1413baaf8001010000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a010000001976a91425ccffac6277962b1dc027568d300a4c4089b56c88ac00000000

この値を genesis.54617021 という名前のファイルで保存します。

#. End

きりがいいのでその①はここまで!!
その②ではSeederを構築してネットワークを完成させたいです(願望)

Discussion

ログインするとコメントできます