# 3.5 Request Powerup

# Use cases

Creates a new Did power up request for the given pairwiseDid and of the given amount only after you made a did deposit request.

# Tools

The Sacco library, our own open source tool to sign and send transactions to any Cosmos SDK based blockchain, including Commercio.network.

The CommercioSDK, our own open source tool to format transactions to Commercio.network

# Functions and APIs

  • Wallet derive;
  • IdHelper requestDidPowerUp.

# Background

From Bitcoin Wiki:

Bech32 is a segwit address format specified by BIP 0173. This address format is also known as "bc1 addresses".

From Wikipedia:

Segregated Witness, or SegWit, is the name used for an implemented soft fork change in the transaction format of the cryptocurrency bitcoin.

# Step by step sequence

  1. Request a did deposit (Chapter 3.4);
  2. Generate the pairwiseMnemonic using bip39 and save the value;
  3. Call the wallet derive function using this mnemonic;
  4. Finally, execute the IdHelper requestDidPowerUp function to request the Powerup.

# Code Examples

Here's an example of the implemetation in all the available languages.

# Dart

final pairwiseMnemonic = ['push', 'grace', 'power', 'desk', 'arrive', 'horror', 'gallery', 'physical', 'kingdom', 'ecology', 'fat', 'firm', 'future', 'service', 'table', 'little', 'live', 'reason', 'maximum', 'short', 'motion', 'planet', 'stage', 'second',];
final pairwiseWallet = Wallet.derive(pairwiseMnemonic, networkInfo);

final depositAmount = [const StdCoin(denom: 'ucommercio', amount: '10')];

await IdHelper.requestDidPowerUp(
  pairwiseWallet.bech32Address,
  depositAmount,
  wallet,
);
1
2
3
4
5
6
7
8
9
10

# Kotlin

val pairwiseMnemonic = listOf("push", "grace", "power", "desk", "arrive", "horror", "gallery", "physical", "kingdom", "ecology", "fat", "firm", "future", "service", "table", "little", "live", "reason", "maximum", "short", "motion", "planet", "stage", "second")

val pairwiseWallet = Wallet.derive(
  mnemonic = pairwiseMnemonic,
  networkInfo = networkInfo
)

val depositAmount = listOf(StdCoin(denom = "ucommercio", amount = "10"))

IdHelper.requestDidPowerUp(
  pairwiseDid = Did(pairwiseWallet.bech32Address),
  amount = depositAmount,
  wallet = wallet
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# C#

String pairwiseMnemonicString = "push grace power desk arrive horror gallery physical kingdom ecology fat firm future service table little live reason maximum short motion planet stage second";
List<String> pairwiseMnemonic = new List<String>(pairwiseMnemonicString.Split(" ", StringSplitOptions.RemoveEmptyEntries));

var pairwiseWallet = commercio.sacco.lib.Wallet.derive(pairwiseMnemonic, networkInfo);
List<commercio.sacco.lib.StdCoin> depositAmount = new List<commercio.sacco.lib.StdCoin>();
depositAmount.Add(new commercio.sacco.lib.StdCoin(denom: "ucommercio", amount: "10"));

var res = commercio.sdk.IdHelper.requestDidPowerUp(
 pairwiseWallet.bech32Address,
 depositAmount,
 wallet
);
1
2
3
4
5
6
7
8
9
10
11
12