The Tunnel-TSS-Router is an innovative relaying solution that connects EVM networks with Band Protocol's price feeds data more efficiently than the current Bridge smart contract. It leverages threshold signature technology and a custom signing procedure to minimize proof size and verification operations, resulting in significant gas savings.
The current Bridge smart contract requires extensive EVM operations for lite client verification, leading to high gas consumption. This inefficiency stems from several factors such as:
- Storing and retrieving validators with voting power
- Verifying multiple signatures
- Computing Merkle tree hashes
- Encoding Tendermint structures
These operations result in high gas costs and slower transaction processing. The Tunnel-TSS-Router addresses these issues by implementing a more efficient verification mechanism using threshold signatures.
If you don't have Foundry installed, run the following command to install foundryup, the Foundry toolchain installer:
curl -L https://foundry.paradigm.xyz | bash
Run the following command to execute tests:
forge test -vv
The Tunnel-TSS-Router system consists of multiple coordinated components that work together to securely relay data:
- A Relayer submits data to the
TunnelRouter
- The
TunnelRouter
decodes the message and verifies its sequence to prevent replay attacks - If the sequence is valid, the data and its signature are forwarded to the
TSSVerifier
for signature validation - After successful verification, the message is sent to the
Target Contract
for final processing - The
TunnelRouter
withdraws the relaying fee from theVault
and transfers it to the relayer - If the remaining balance drops below a configured threshold, the Target Contract is marked as inactive to prevent further relaying
Built on threshold signature technology and a custom signing procedure, the project offers several advantages:
-
🔁 Efficient Relaying Process
- The
TunnelRouter
maintains data integrity by decoding messages and validating sequences - The
TSSVerifier
securely validates data authenticity using threshold signatures - Fees are automatically withdrawn from the
Vault
and paid to the relayer - Account owners can securely withdraw tokens from the
Vault
.
- The
-
✅ Reduced Gas Usage
- Compact threshold signature scheme minimizes on-chain verification logic
- Eliminates the need to verify multiple individual signatures
-
⚖️ Flexible Fee Models
- Supports both GasPrice and PriorityFee models
- Ensures fair and flexible compensation for relayers across different network conditions
- Vault-based system manages relayer deposits and withdrawals
-
🛡️ Robust Security
- Uses TSS to guarantee data integrity and authenticity
- Prevents unauthorized withdrawals through vault safeguards
- Sequence tracking prevents message replay and duplication
- Deactivation logic protects underfunded target contracts from exploitation
-
🏛️ Enhanced Decentralization
- Eliminates the need for centralized multisig validators
We welcome and encourage contributions to the project. If you have suggestions or feedback, please open an issue or submit a pull request. We appreciate your contributions and look forward to collaborating to improve the Tunnel-TSS-Router.