Polygon POS chain

Polygon can be accessed with the following coin types

Environment Coin Type Faucet
Polygon Production polygon
Polygon Testnet (Amoy) tpolygon https://faucet.polygon.technology/

Explorer

https://polygonscan.com/

Enterprise fee address

ENTERPRISEID=585c51a5df8380e0e3082e46

curl -X POST \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://app.bitgo-test.com/api/v2/tpolygon/enterprise/$ENTERPRISEID/feeAddressBalance

Polygon is a Layer-2 scaling solution created to help speed up the Ethereum platform and help in adoption. Each enterprise has a fee address which is used to pay for transaction fees on all Polygon wallets in that enterprise. The fee address appears in the dashboard of the BitGo website, and you must fund it before creating a wallet, address, or sending a transaction. If the enterprise fee address has an insufficient balance, you cannot create new wallets, addresses, or send transactions until you fund the fee address. You cannot use one of your own Polygon wallets to fund the fee address if the fee address is too low (because you cannot send transactions from your Polygon wallet). It is best to create and fund a non-BitGo Polygon account, so you can use it to fund your BitGo enterprise fee address. Any open source Polygon wallet can be used to create an account.

Please note that the fee address is a single-signature account, and that BitGo creates and owns the private key. You cannot send assets out of the fee address once you have sent them in.

There is a feeAddress field under the CoinSpecific key for Polygon wallets. Use this address to pay the fees for creating transactions and addresses.

Wallet construction

bitgo
  .coin('tpolygon')
  .wallets()
  .generateWallet({
    label: 'My Test Wallet',
    passphrase: 'secretpassphrase1a5df8380e0e30',
    enterprise: '5612c2beeecf83610b621b90964448cd',
    walletVersion: 2,
  })
  .then(function (wallet) {
    // print the new wallet
    console.dir(wallet);
  });

Polygon wallets can only be created under an enterprise. You must pass in the id of the enterprise to associate the wallet with.

The creation of Polygon wallets requires deployment of contract on the wallet base address. When you create a Polygon wallet, BitGo only generates the base address for the wallet and does not deploy it right away. BitGo sends an initialization transaction on the Polygon network to create the wallet when the address receives an incoming transaction. BitGo initiates wallet initialization on chain after the address receives any amount of assets. While the wallet is not initialized, the wallet has the pendingChainInitialization flag set to true.

bitgo
  .coin('tpolygon')
  .wallets()
  .getWallet({ id: '585c51a5df8380e0e3082e46' })
  .then(function (wallet) {
    return wallet.createAddress();
  })
  .then(function (newAddress) {
    // print new address details
    console.dir(newAddress);
  });

The creation of Polygon addresses/forwarders requires deployment of contract on the address. When you create a forwarder for Polygon wallet BitGo only generates the address for it and does not deploy contract on it right away. BitGo sends an initialization transaction on the Polygon network to create the wallet when the address receives an incoming transaction. BitGo initiates address initialization on chain after the address receives some assets. While the address is not initialized, the address has the pendingChainInitialization flag set to true.

Balances

Each Polygon consists of 1,000,000,000,000,000,000 (1018) wei, so not even a single Polygon can be stored numerically without exceeding the range of Javascript numbers.

For that reason, only string balance properties are available, which are balanceString, confirmedBalanceString, and spendableBalanceString.

Transactions

The BitGo Polygon multisig contract currently only supports one sender and one recipient. That means that the sendMany call only accepts one recipient.