zenTP - Technical Details
This page provides a detailed technical overview of how zenTP operates under the hood.
zenTP on GitHub
The zenTP module is located as a module under the zrchain repository. There you can find the available messages and queries for bridging ROCK.
System Architecture
zenTP is built directly on zrchain and works in cooperation with the sidecars and mpc infrastructure. The system consists of the following key components:
- zrChain: Facilitates signature requests to Zenrock's MPC network for minting ROCK on the Solana SPL. Also sidecars notify Zenrock Chain about burn events on Solana SPL which then mint ROCK to the indicated recipient.
- Sidecars: Report the state, and relevant emitted events from the Solana ROCK SPL to Zenrock Chain
- MPC: Zenrock's MPC cluster on zrchain that receives the signature requests to mint ROCK on the Solana SPL for dedicated minting keys on Solana. This ensures no other key is able to mint ROCK on Solana.
Operational Flow
The zenTP system follows a carefully orchestrated process:
Send ROCK from Zenrock Chain to Solana
- A ROCK holder on Zenrock Chain executes MsgBridge, indicating amount, destination network, and recipient. The amount is escrowed until sidecars report back.
- Zenrock Chain verifies the request and makes a sign-transaction request for the minting MPC key on Solana.
- The MPC cluster returns a signature for the request and stores it on Zenrock Chain.
- The Solana relayer assembles the unsigned transaction request with the returned signature and broadcasts the transaction to Solana.
- The transaction executes on Solana, where the MPC key with mint authority mints and sends ROCK to the indicated address. A mint event is emitted by the SPL.
- The sidecars recognize the mint event and broadcast this information to zrchain, where the escrowed funds are burned and the mint process completes.
Send ROCK from Solana to Zenrock Chain
- A ROCK holder on Solana makes an unwrap instruction on the ROCK Solana SPL contract indicating amount and recipient. This emits a burn event
- The Sidecars recognize the burn event, broadcast this information on zrchain where upon consensus ROCK tokens are minted to the indicated address directly from the zenTP module.
zrChain
zrChain is the home of the ROCK token where users can pay for key and signature requests, stake ROCK and by doing so earn yield and vote on governance proposals. It is also the main state layer for the zenTP bridge. A bridge transaction only gets executed if the checks on zrchain are completed. Zenrock Chain also stores the information which keys are allowed to mint ROCK on the Solana SPL. Those keys must be generated by the MPCs to ensure security.
For more detailed information about zrChain, take a look at the zrchain docs. If you want to learn more about our MPCs, take a look at the mpc docs.
Sidecars
The sidecars are a decentralized service to provide external state confirmations to zrChain. Every zrChain validator runs a sidecar alongside their regular validator node. The sidecars are subject to Cosmos SDK's consensus finding and slashing policy. If an oracle reports harmful state, the respective validator gets slashed.
The sidecars are used for various purposes like reporting BTC and ROCK prices to determine voting powers, and in the case of zenTP, the sidecars report mint and burn events of the ROCK SPL on Solana.
MPC Infrastructure
The MPCs handle minting operations of ROCK on Solana based on instructions from Zenrock Chain. The zenTP module holds the minting Solana keys in its params which conduct the mint transactions on Solana. When a request for minting ROCK to a Solana address is published, the zenTP module makes a sign-transaction request with the unsigned mint transaction to the MPC for the key indicated in the params. The returned signature and the unsigned transaction are assembled by the relayers and broadcast to Solana where the transaction gets executed.