Skip to content

Commit

Permalink
Removed unecessary paragraph. Updated diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
leoloco committed Apr 10, 2024
1 parent 72ce7b0 commit 12dd669
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 deletions.
46 changes: 4 additions & 42 deletions docs/massaBridge/architecture-security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ To initiate bridging from Ethereum to Massa, a lock transaction is sent to the B

To initiate bridging from Massa to Ethereum, a burn transaction is sent to the Bridge contract on Massa. This burn transaction will transfer the assets from the user's wallet to the Bridge contract, burning them in the process. Once the burn transaction has received enough confirmations, it will be handled by the relayer network; On detecting a burn event, each individual relayer will produce a signature corresponding to this particular bridge operation. During the process, the Massa Bridge UI will query the relayer network for the signatures. Once all of the three relayers have produced their signatures, the Massa bridge UI will prepare the redeem transaction. The user will then sign and send the redeem transaction to the Ethereum blockchain, triggering the release of the tokens.

![Bridge flow](bridge-flow.png)

### Security Measures

The BridgeVault contract on Ethereum holds the assets locked during the bridging process. The only way assets can be redeemed is by sending a message signed by the 3 out of 3 nodes of the relayer network. This ensures that the assets are only released when the relayer network has verified the corresponding burn transaction on Massa. The public keys of the relayer nodes are stored in the Bridge contract on Massa, and can only be updated by a gnosis safe multisig wallet controlled by the bridge operators. Moreover, a 48h timeLock from Openzeppelin is implemented in the Bridge contract on Massa, which requires a 48h delay before the relayer network can update the public keys. This ensures that the bridge operators have enough time to intervene in case of a malicious update of the public keys.
Expand All @@ -38,50 +40,10 @@ Safe proxy address: [0x5d752840501b2d2f4841accf53794d0ed3e2c3eb](https://sepolia
The Bridge contract on Massa is responsible for minting the tokens in response to the locked assets on Ethereum. The Bridge contract can only mint tokens when it receives a message signed by 3 out of 3 nodes of the relayer network. The synthetic token contracts ownership, has yet to be transferred to a multisig wallet after deployment. The public keys of the relayer nodes are hardcoded in the contract and cannot be updated. This contract as well can be paused for maintenance or security.
The Bridge contract can charge fees but have been set to 0.

![On chain architecture](on-chain-architecture.png)

The relayer network is a set of independent nodes responsible for monitoring bridge transactions, verifying events, and facilitating the cross-chain communication necessary for asset transfers. The three nodes are hosted on different cloud providers to avoid common points of failure. For redundancy, each node has a fallback mechanism and redundant RPC connections.

The Massa Bridge smart contracts have undergone security audits conducted by Certik, the report is publicly available [here](https://drive.google.com/file/d/1onla7nqsow26RZYXfJE2ju0vGwdjfttA/view?usp=sharing).


![Bridge flow](bridge-flow.png)

#### Lock-Mint Use Case

##### User Interaction:

- A **User** accesses the **Bridge Website** via a browser connected to wallets.
- The **User** opts to transfer assets from an **EVM blockchain** to the **Massa blockchain**.
- The **User** signs and sends an approval transaction and then a lock transaction to the **EVM blockchain** using their wallet provider.

##### Blockchain and Relayer network Interaction:

- The **EVM blockchain** executes the transaction and notifies the **Relayer network**.
- Each instance receives the lock event and signs transaction data.

##### Massa blockchain interaction:

- Once sufficient **Relayer network** signatures are collected, the **Relayer network** sends the mint transaction to the **Massa blockchain**.
- The **User** receives notification upon successful execution of the transaction on the **Massa blockchain**.

#### Burn-Redeem Use Case

##### User Interaction:

- A **User** accesses the **Bridge website** via a browser connected to wallets.
- The **User** opts to transfer assets from the **Massa blockchain** to an **EVM blockchain**.
- The **User** signs and sends an approval transaction and then sends a burn transaction to the **Massa blockchain** using their wallet provider.

##### Blockchain and Relayer network interaction:

- The **Massa blockchain** processes the burn transaction and notifies the **Relayer network**.
- Each instance receives the burn event and signs a redeem transaction.

##### EVM blockchain interaction:

- Once sufficient **Relayer network** signatures are collected, the **Bridge website** prepares the corresponding transaction.
- The **User** signs and sends the redeem transaction to the **EVM blockchain** using their wallet provider.
- Once the redeem transaction is executed on the **EVM blockchain**, the **User** is notified of its completion.

### On-chain Smart Contracts
![On chain architecture](on-chain-architecture.png)

Binary file modified docs/massaBridge/on-chain-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 12dd669

Please sign in to comment.