Sekai Bridge Node
The Sekai Bridge Node is the core component enabling secure multi-party signing for cross-chain transfers. It leverages the tss-lib library to implement a Multi-Party Threshold Signature Scheme (TSS) for both ECDSA and EdDSA, following the principles of Gennaro and Goldfeder 2020. This design ensures that no single entity controls the entire key.
Deployment
git clone https://github.com/KiraCore/torii.git
cd torii/sekai_bridge
Run Docker
make docker-build
make docker-run
Standalone
make build
make run
Configuration
The configuration file config.yml
sets up the various operational aspects of the bridge service.
common
: Configures general server options for the service. It sets HTTP withenabled
true andport
8885, WebSocket withenabled
false andport
9080, and alog_mode
of debug.p2p
: Manages peer-to-peer communications using saiP2P-go. It defines the main communicationport
as 9000, the number of connectionslot
s as 4, and an HTTPport
for P2P operations as 8886.http
: Specifies the primary API endpoint for the bridge service with aport
of 8080.udp
: Provides settings for fast, low-overhead messaging between nodes. It sets thebufferSize
to 40000 bytes and theinterval
to 100ms.peers
: Specifies the list of peer nodes for P2P communication, intended to be populated with peer addresses as needed.tss
: Configures the Threshold Signature Scheme operations for secure multi-party signing. It includes apublic_key
(e.g., "1"), the number of participating nodes (parties
) set to 3, athreshold
of 2, and a signingquorum
of 2.token
: Provides a security token used for authenticating internal API calls or inter-service communications.debug
: A Boolean flag that toggles detailed logging. When true, it enables extensive diagnostic logs.cache
: Improves performance by temporarily storing data. It defines attl
(time-to-live) of 120 seconds for cache entries and aclean
interval of 240 seconds to purge expired data.sekai
: Integrates the Cosmos-side component (Sekai) of the bridge. It sets the serviceurl
to "http://localhost:1317", specifies thewallet
address used for signing transactions, identifies the targetnetwork
(e.g., "testnet-1"), and configures transaction parameters likegas_limit
(100000) andfee
(750).interaction
: Defines endpoints for cross-chain interactions. It includes anethereum
endpoint (e.g., "http://localhost:8882") and acosmos
endpoint (e.g., "http://localhost:8884").
Api Reference
Get Stats for Node (for Debugging Purposes)
curl --location --request GET 'http://<host:port>' \
--header 'Content-Type: application/json' \
--data-raw '{"method":"stats"}'
Keygen
curl --location --request GET 'http://<host:port>' \
--header 'Content-Type: application/json' \
--data-raw '{"method": "keygen", "data": {}}'
Keysign
curl --location --request GET 'http://<host:port>' \
--header 'Content-Type: application/json' \
--data-raw '{"method": "sign", "data": {"msg":"test"}}'
Keysign One Round
curl --location --request GET 'http://<host:port>' \
--header 'Content-Type: application/json' \
--data-raw '{"method": "sign", "data": {"msg":"test","one_round_signing":true}}'
Verify Signature
curl --location --request GET 'http://<host:port>' \
--header 'Content-Type: application/json' \
--data-raw '{"method": "verify", "data": {"msg":"test","signature":"eyJzaWduYXR1cmUiOiJmK013d0NscTl1OGpmNzJnWEFjTnVqTjU2OWdkMTNod0x6QzQwTFB3RzdnOGVjZU50VFUzY1lmQzFRekNwQ0xGZWxjM0Nkcy9OajRqTzNmL0E3R043UT09Iiwic2lnbmF0dXJlX3JlY292ZXJ5IjoiQVE9PSIsInIiOiJmK013d0NscTl1OGpmNzJnWEFjTnVqTjU2OWdkMTNod0x6QzQwTFB3RzdnPSIsInMiOiJQSG5IamJVMU4zR0h3dFVNd3FRaXhYcFhOd25iUHpZK0l6dDMvd094amUwPSIsIm0iOiJNVEF4TUE9PSJ9"}}'