Skip to content
Document

Onboarding new BYOC

This article is composed of two guides, the first guide is to help you bring in your own coin as a new ERC20 and its extension tokens to Partisia Blockchains using the PBC bridge. The second guide is about how to verify a new BYOC proposal.

In order for the bridge to work between chains, you must have a contract in the Ethereum, Polygon or BNB smart chain network as well as on the Partisia Blockchain network. We provide a template for anyone to tweak and submit a proposal to add the coin of their choice to Partisia Blockchain. This proposal will go to a vote to our node operator committee. The committee has 7 days to review the proposal and either accept or reject the proposal. If it is accepted, the contract will go live and the token will become available as an asset in the network.

How to propose a new BYOC coin

To create a proposal of a new BYOC coin you need to be have at least 100.000 MPC tokens staked to your own account. Besides being able to stake the MPC tokens you need to do the following technical high level steps to create a proposal for a new coin:

  1. Deploy implementation contract on the chain you want to integrate with.
  2. Deploy configured proxy contract on the chain you want to integrate with.
  3. Propose a vote on Partisia Blockchain to get node operators consent to enable your new BYOC.
  4. When node operators have verified the proposed information and voted yes to the BYOC it will be accepted as a mintable coin on Partisia Blockchain. To understand bridging visit our article about bridging coins to PBC.

The existing BNB bridge is an example of a successful deployment of a new BYOC, see implementation contract and proxy contract.

Before preparing the contracts on the integrated chain some information needs to be collected:

  • Which integrated chain does the coin reside on (Ethereum, Polygon or BNB Smart Chain)
  • What is the current USD value of a single coin

For non-stable coins a Chainlink reference contract on Ethereum that tracks the current price needs to be available. See Chainlink contracts on Ethereum mainnet

For ERC20 tokens the token contract address and the number of decimals is needed.

Generating payloads

The below form helps generate the needed binary transactions for deploying on the external chain and proposing the update on Partisia Blockchain.

The bytecode for the contracts have been populated from the compiled artifacts on GitLab.

These steps specify what information is needed in the below form, each number corresponds to the same number of a field.

  1. Select if the token to be deployed is an ERC20 or a native token
  2. Select the chain where the token resides
  3. Deploy the implementation contract (note the address for usage in step 4)
  4. Fill information needed for initializing the implementation contract
  5. Deploy the ERC197Proxy with initialization of the implementation contract (note the address for usage in step 6 6)
  6. Fill remaining information to prepare a vote on Partisia Blockchain
  7. Take the autogenerated Remote Procedure Call (RPC) and create a vote on Partisia Blockchain by going to the system update contract in the browser create the vote you use the interaction: PollUpdateType$INVOKE_CONTRACT(6) vote with the generated RPC from the below form in field (7).
  8. After the creation of the proposal, we suggest you share your forms details with the community to make it easier for them to verify your proposal.
  9. When node operators have voted, you need to execute the proposal this action costs ~260.000 gas. You can execute the proposal by using the check update interaction on the system update contract.

For step 2 and 4 the form below allows using MetaMask to send the transactions.

1. Deploy implementation contract

2. Deploy configured proxy contract

3. Propose a vote on Partisia Blockchain

How to verify a proposed BYOC

This guide is intended for someone to ensure that a new BYOC proposal is valid. The proposer should have made all the configuration parameters available (The above form is an example of this) for the node operators to check.

Fill out the payload form above with all the received information to be able to verify the payloads, the exact same way as the proposer did, see above. Field 3 and 5 are contract RPC deployed on a foreign chain, you need to find their deployment transaction before you can verify its the same RPC. Field 7 is a transaction to the system contract on PBC. You need to find the initializing transaction of the proposal you are voting on in the system update contract. If no configuration is shared with the community, verifying the proposal is very difficult.

When validating the proposal ensure that the parameters match what is expected:

  • Does the supplied price match the price of the token?
  • Is the name of the token correct?
  • Is the supplied reference contract a chain link reference for the bridged symbol? And does the decimal count match the ones on the contract?
  • Is the supplied ERC20 contract a valid ERC20 contract for the token? And does the decimal count match the decimals on the ERC20 contract?

To sum up, you need to find both of the deployed contracts, lookup the transaction that deployed them, find the payload of the transaction and verify that this matches exactly the payload generated in the form.

Configuration parameters

The bytecode for the contracts on the Ethereum Virtual Machine (EVM) chain should be fetched from GitLab.

For all the files the value in 'bytecode' should be used.

Parameter Value
Implementation contract byte code For ERC20 tokens use WithdrawAndDepositErc20.json, for native token use WithdrawAndDepositEth.json from the GitLab link above
ERC1967Proxy Use ERC1967Proxy.json from the GitLab link above
Current price in USD (price) Need to be supplied
Maximum withdrawal 200000 / price
Minimum withdrawal 25 / price
Maximum deposit 100000 / price
Minimum deposit minWithdrawal
Large oracle address 0x81a19EE43bcF9FF57ab2694B3f435e3354894B3A (Ethereum)
0x3435359Df1D8C126ea1b68BB51E958fdf43F8272 (Polygon)
0x4c4ECb1EFb3BC2a065af1F714B60980a6562C26f (BSC)
Name of token Need to be supplied
Chain link reference contract Need to be supplied
Chain link reference contract decimals Need to be supplied
ERC20 contract Need to be supplied
ERC20 decimals Need to be supplied
Implementation contract address Deployed as part of the proposal
Proxy contract address Deployed as part of the proposal