Sui

Mysten / SUI

Mysten (Sui) can be accessed with the following coin types:

EnvironmentCoin TypeFaucet
Sui Productionsui
Sui Testnettsuihttps://explorer.sui.io/

Overview

Mysten is a protocol created by former Meta employees. The native currency of the Mysten protocol is Sui. It is an object based protocol, almost UTXO like. We support TSS transactions on SUI.

Generating Wallets

To create an Sui wallet using BitGoJS:

1 2 3 4 5 6 7 8 9 10 11 12 13 bitgo .coin('tsui') .wallets() .generateWallet({ label: 'My Test Wallet', passphrase: 'secretpassphrase1a5df8380e0e30', multisigType: 'tss' enterprise: '234578765432' }) .then(function (wallet) { // print the new wallet console.dir(wallet); });

To create a Sui wallet using the platform API:

1 2 3 4 5 6 7 8 9 LABEL="My Test Wallet" PASSPHRASE="secretpassphrase1a5df8380e0e30" MULTISIG="tss" curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d "{ \"label\": \"$LABEL\", \"passphrase\": \"$PASSPHRASE\", \"multisigType\": \"$MULTISIG\" }" \ http://$BITGO_EXPRESS_HOST:3080/api/v2/tsui/wallet/generate

Staking

For Mysten there is a minimum requirement to stake 1 SUI. After initiating the staking request, there's a warmup period of 1 epoch, and a cooldown period of 1 epoch when you decide to unstake. When deciding to unstake, you must unstake the entire SUI object.

Rewards are automatically compounded.

Receive addresses

SUI has no minimum balance for receive addresses.

In order to create a receive address:

1 2 3 4 5 6 7 8 9 10 11 bitgo .coin('tsui') .wallets() .getWallet({ id: '585c51a5df8380e0e3082e46' }) .then(function (wallet) { return wallet.createAddress(); }) .then(function (newAddress) { // print new address details console.dir(newAddress); });
1 2 3 4 5 WALLET=585c51a5df8380e0e3082e46 curl -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/tsui/wallet/$WALLET/address

Transactions

SUI uses overall object modeling, which is similar to the UTXO model. With SUI, storage is centered around objects. Transactions take objects as input and output new or mutated objects.

You can make use of sendMany() to send transactions. It's also important to note that while SUI does support batch transactions, these cannot be run sequentially. For the batch transactions, you'll need to wait for each to be confirmed on chain before submitting another. If you want to run a series of transactions, it's better to use sendMany.

When sending SUI, you'll need to account for the fact that the base unit of SUI has 9 decimal places (1 SUI = 1000000000 MYST).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 const recipients = [{ address: 'sui-address-1', amount: '10000000000', }, { address: 'sui-address-2', amount: '200000000000', }]; bitgo.authenticateWithAccessToken({ accessToken }); bitgo.unlock({otp: '000000'}) const wallet = await bitgo.coin(coin).wallets().getWallet({ id: walletId }); const response = await wallet.sendMany({ recipients, passphrase, type: 'transfer' });

Gas fees

A SUI transaction must pay a gas fee. SUI's Gas Pricing Mechanism ensures that any transaction pays fees according to both computational and storage costs.

A gas budget must be submitted with a SUI transaction. Gas budgets provide a limit to the amount of gas fees a user will pay. For more, see Gas in Sui.