Deploying to Mainnet

Once we are familiar with TACo, have successfully prototyped and tested the integration using TACo's Testnet(s), we are ready to swith to TACo Mainnet and deploy our application to production. TACo Mainnet is the fully decentralized version of the TACo encrypt/decrypt API and network. Access to data encrypted under the Mainnet cryptosystem will be managed by a cohort of independent, staked and remunerated TACo nodes.

Ritual generation

In order to use Mainnet TACo, developers must join the beta program.

The first step is to initiate a new TACo ritual. Once the ritual is successfully finished, a cohort of nodes randomly selected from the Threshold Network is associated to this ritual. These nodes are responsible for the decryption of the encrypted data if conditions are met.

[TODO following PRs: explain how a ritual is created in mainnet]

Ritual management

[TODO following PRs: explain how a ritual can be managed, i.e., add encryptors, extend the duration, cohort renewal, etc]

Use of TACo in mainnet

There are no substantial changes in the code when we switch from using testnet domain to mainnet domain. When calling to the encryption or decryption functions, take into account that:

  • The RPC provider URL (Infura, Alchemy, etc) must be changed to from Polygon Amoy (testnet) to Polygon (mainnet) since the L2 of TACo's mainnet domain is the latter.

  • The domain variable must be set to mainnet.

  • The Ritual ID must be set to the ritual generated by you.

import { domains } from "@nucypher/taco"

// This should be a environment variable
const rpcProviderUrl = "https://polygon-mainnet.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

const provider = new ethers.providers.JsonRpcProvider(rpcProviderUrl);
const domain = domains.MAINNET;
const ritualId = 0 // Replace by the Ritual ID

// Encryption
const messageKit = await encrypt(
    provider,
    domain,
    message,
    hasPositiveBalance,
    ritualId,
    encryptorSigner,
);

// Decryption
const decrypted = decrypt(provider, domain, messageKit, conditionContext);

Last updated