This page describes the different actors that are part of the Medusa system in the context of the programmatic onchain access control project.

Actors

Medusa Nodes

The Medusa nodes are the actual nodes that form a threshold network and react to onchain events. They communicate together on a libp2p gossiping network. They communicate with the chain by listening to events on the oracle smart contract and by pushing transactions to the contract when needs be.

Note they only need to communicate with one smart contract, namely the oracle smart contract, regardless of the number of endusers.

Oracle Smart Contract

The threshold oracle smart contract is the central gateway between Medusa nodes and external endusers of Medusa.

The contract serves to:

Oracle Factory Smart Contract

This smart contract is where a Medusa nodes connect at the beginning when he wishes to join a network. For the purpose of the demo it is at the moment very simple. The admin of the contract can create via the factory a new oracle smart contract and all Medusa nodes will join the new oracle smart contract to start a new threshold network.

Application Smart Contract

Any smart contract can use the Medusa network by communicating with the oracle smart contract. The application can submit ciphertexts to the oracle smart contract (they are not being processed at this moment, it’s just for recording). For reencryption, the logic is pretty similar to the notion of oracle onchain: the application issues reencryption requests towards a specific key by asking the oracle smart contract and giving it a callback address.

Workflow

Setup

  1. Setup an oracle factory: This factory is only responsible for creating new oracle smart contract on demand