Casper

Casper

Casper can be accessed with the following coin types:

EnvironmentCoin TypeFaucet
Casper Productioncspr
Casper Testnettcsprhttps://integration.cspr.live/tools/faucet

Generating wallets

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

Before you can use a Casper wallet, it must be initialized on the Casper 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 Casper wallet while it is being initialized or you may lose funds.

Casper accounts must maintain a minimum balance. See the Balance section below.

Required reserve

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

Fetch information about reserve requirements for an account. See the Balance section below.

HTTP Request

GET /api/v2/:coin/requiredReserve

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.
heightHeight of the block that provides the base values.

Creating addresses

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

Casper wallet addresses differ by a sequentially incremented transferId (because they cannot leverage the BIP-32 standard). The transferId type used by BitGo is TRANSFER_ID: a 64-bit unsigned numeric string.

When a new address is created, the incremented transferId and the rootAddress are returned in the coinSpecific property.

Balances

Casper (CSPR) the native asset of the Casper blockchain. The base unit of Casper is the mote:

  • 1 mote is 10-9 or 0.000000001 Casper.
  • 1 Casper is 109 or 1000000000 motes (1 billion).

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

Casper accounts must maintain a minimum balance which is calculated by adding a base reserve and a base fee. Currently, the base reserve is 2.5 CSPR and the base fee is 1 CSPR so the minimum balance required is 3.5 CSPR.

Transactions

Casper uses an account-based model like XLM and XRP. But instead of using XLM's memo or XRP's destination tag, Casper uses transferId.

Currently, the fixed fee is 10,000 motes (0.0001 CSPR). And the minimum amount for a transaction is 2.5 CSPR.

Staking

Casper provides staking service via smart contracts. Staking and unstaking requests require an active validator and an amount greater or equal to 2.5 CSPR to be provided.

Currently, the fees for staking and unstaking are 5 CSPR for both.