Stellar

Stellar

Stellar can be accessed with the following coin types:

EnvironmentCoin TypeFaucet
Stellar Productionxlm
Stellar Testnettxlmhttps://www.stellar.org/laboratory/#account-creator?network=test

Explorer

https://stellarchain.io/

Generating wallets

1 2 3 4 5 6 7 8 9 10 11 bitgo .coin('txlm') .wallets() .generateWallet({ label: 'My Test Wallet', passphrase: 'secretpassphrase1a5df8380e0e30', }) .then(function (wallet) { // print the new wallet console.dir(wallet); });
1 2 3 4 5 6 7 8 LABEL="My Test Wallet" PASSPHRASE="secretpassphrase1a5df8380e0e30" curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d "{ \"label\": \"$LABEL\", \"passphrase\": \"$PASSPHRASE\" }" \ http://$BITGO_EXPRESS_HOST:3080/api/v2/txlm/wallet/generate

Before you can use a Stellar wallet, it must be initialized on the Stellar blockchain. A funding transaction must first be sent to the wallet's address. When BitGo detects this funding transaction, it automatically sends another initialization transaction to set up the signers and the home domain of the account.

Until the initialization transaction is confirmed, the wallet is not ready for use, and the receive address is not exposed in the API. This is to protect users from losing funds by sending to a wallet that does not exist on the network.

Warning: Do not use a Stellar wallet while it is being initialized or you may lose funds.

Stellar accounts must maintain a minimum balance. See Stellar Balances.

Required reserve

1 2 3 curl -X GET \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/txlm/requiredReserve

Fetch information about reserve requirements for an account. See Stellar Balances.

HTTP Request

GET /api/v2/:coin/requiredReserve

HTTP Response

FieldDescription
baseFeebase fee used in transaction fees.
baseReservebase reserve used in minimum account balances.
reserveminimum account balance, calculated using base reserve.
minimumFundingminimum funding balance, calculated using reserve and base fee.
heightthe height of the block that provides the base values.

Creating addresses

1 2 3 4 5 6 7 8 9 10 11 bitgo .coin('txlm') .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/txlm/wallet/$WALLET/address

The BIP-32 standard cannot be taken advantage of, and hence generated XLM addresses differ only in their sequentially incrementing memo id components. The memo type used by BitGo is MEMO_ID: a 64-bit unsigned numeric string. Whenever a new address is created, the incremented memoId and the rootAddress are returned in the address' coinSpecific property.

Balances

Lumen (XLM) is the native asset of the Stellar blockchain. The base unit of Lumen is stroop:

  • 1 stroop is 10 -7 or 0.0000001 Lumen.
  • 1 Lumen is 10 7 or 10000000 stroop (10 million).

Balances are supported in string format: balanceString, confirmedBalanceString, spendableBalanceString, and seqIdString.

NOTE: If memoId is provided on the address, balances will only return seqIdString.

All Stellar accounts must maintain a minimum balance of lumens. The minimum balance is calculated using the base reserve, which is currently 0.5 XLM. The absolute minimum balance for an account is 1 XLM, which is equal to (2 + 0 entries) * 0.5 base reserve. Each additional entry reserves an additional 0.5 XLM.

Base fee

Stellar has a base fee determined dynamically using a version of a VCG auction. When you submit a transaction to the network, you specify the maximum base fee you’re willing to pay per operation, but you’re actually charged the lowest possible fee based on network activity.

When network activity is below capacity, you pay the network minimum, which is currently 100 stroops (0.00001 XLM) per operation.

Transactions

Stellar uses an account-based model, similar to XRP. Additionally, due to the use of memo, Stellar transactions only support one input and one output.

BitGo's XLM multisig contract currently only supports one sender and one recipient so the sendMany is not supported.

Federation

BitGo supports the Stellar federation protocol that matches Stellar addresses to Stellar accounts. Additionally, the BitGo federation server provides the next memo id for the wallet. Stellar accounts can be looked up by their Stellar address or their account ID.

Users can create email-like usernames for their Stellar wallets. A Stellar address is conformed by the Stellar username and the account's home domain (e.g. test*bitgo.com).

Stellar usernames are unique, and only accept lower-case letters, numbers and the characters: -_.+@. The home domain is automatically set to bitgo.com. A Stellar username can only be set once the wallet has been initialized, and it cannot be changed. See Update Wallet.