Crypto Academy Week 13 Homework Post for [ @sapwood]. Bandwidth and Energy (Tron) .

in SteemitCryptoAcademy3 years ago (edited)
Today on 10 May 2021 , i am submitting my homework task for @sapwood which is about Bandwidth & Energy (Tron). Without dodging, let's start :

(1) How do I connect my TronLink Wallet to Tronscan.org?(Screenshots needed)


There are two ways of connecting Tronlink wallet and Tronscan. One is through web browser ( example; chrome) and another is through Tronlink wallet. Of these two methods, I find connecting tronscan via wallet simple and easy . So I will demonstrate it step by step:

  • Open Tronlink wallet. At the bottom panel of the main page, click on "Discover".

  • Next a page of DApps will load. look for Tronscan.

  • Click on Tronscan and it will ask you permission to enter into third party agreement. Agree by clicking "Enter" and you will land in main page of Tronscan.

  • Click on top right corner, "Register/ Log in " option is there at top. Click on it.

  • There are 2 ways to log in, one is via e-mail and other is via phone number. Both need an OTP to login. Choose either of two and enter OTP sent to you.

  • Next you will see " Wallet successfully connected" notification.



IMG_20210509_181015.jpg


IMG_20210509_181139.jpg


IMG_20210509_181224.jpg


IMG_20210509_181354.jpg


IMG_20210509_181521.jpg


(2) How do I freeze TRX to obtain Energy? (Screenshots needed)


  • Go to TronLink wallet . On the main page just below TRX balance, we got to see Energy and Bandwidth. As you can see in screenshot below, my energy at the beginning is 305.

  • To obtain more energy, click on energy balance ( encircled on screen shot below).

  • On next page, details like energy, bandwidth etc are shown. Scroll down and we got to see option to enter amount of TRX to be froozen and below that it shows amount of enrgy we get for amount frozen. I wanted to freeze 5 TRX and for 5 TRX frozen , i got 154 TRX.

  • Click on freeze and confirm transaction by entering the TronLink wallet password.

  • Next check your energy balance. In my case, energy before freezing TRX was 305 (approx) and by freezing TRX, i got 154 energy ( approx) . So the collective energy at the end is 460 .
    During this process , 247 bandwidth was consumed. So the bandwidth left will be 247 less than 5000.


1620564796950.jpg


IMG_20210509_182425.jpgIMG_20210509_182438.jpg


IMG_20210509_182950.jpg


IMG_20210509_183105.jpg


IMG_20210509_183121.jpg


IMG_20210509_185128.jpg


(3} How do I freeze TRX to obtain Bandwidth? (Screenshots needed)


  • Again go to TronLink wallet as above. Click on bandwidth this time. I have 4753 Bandwidth at the beginning. Out of 5000 bandwidth that we get every 24 hours, 247 was consumed in obtaining energy'. So we are left with 4753.

  • Next a page will load which shows details like energy, bandwidth. Scroll down and enter the amount of TRX to be frozen to get bandwidth.

  • I tried to freeze 5 TRX to obtain bandwidth and for 5 TRX, it shows 8 bandwidth will be obtained.

  • Confirm transaction with the help of TronLink password.

  • To perform this transaction 245 bandwidth was consumed. So at rhe end of this transaction, i should have bandwidth equal to 4753 + 8 -245 = 4516. That is exactly there in my wallet.


1620567085851.jpgIMG_20210509_190414.jpg


IMG_20210509_190510.jpg


IMG_20210509_190621.jpg


1620567457816.jpg


IMG_20210509_191848.jpg



(4) What types of transaction consumes Bandwidth only and what types of transaction consume both Bandwidth & Energy? Example of both types of your own wallet? (Screenshots needed)


Two types of transactions are there, one is ordinary and other is smart contract transaction. Former one ( ordinary) consume Bandwith only whereas later (smart contract trigger) consumes both Bandwidth & Energy.

As for bandwidth is concerned, we get 5000 bandwidth every 24 hours. In between whatever amount of bandwidth we consume will be refilled after 24 hours. It is as for free bandwidth is concerned. The other way to obtain bandwidth is to freeze the TRX. The point to understand here is, if we possess certain amount of bandwidth which is sum of free and frozen ( got by freezing TRX) , than first the frozen bandwidth will be consumed than comes the turn of free bandwidth. Another important point to be kept in mind is that, if bandwidth is not sufficient ( free plus frozen) , than TRX will be burned to accommodate for insufficient bandwidth. We should not confuse the burnt TRX as fee charged by system.

In case of energy, as system doesn't provide free energy unlike free bandwidth (5000 every 24 hours ), the only source of energy is by freezing TRX. If energy available by freezing TRX is not sufficient for a transaction to execute, than the additional amount of energy required will be obtained by burning TRX. Here, we need to be cautious about one thing and that is, if energy required for carrying out a transaction is not met by frozen TRX supplemented energy and available TRX, the transaction will fail even after consuming energy and some TRX.

Ordinary Transfer

For sake of this task, i transferred 10 TRX from TronLink to Binance. To check this transaction, i opened Tronscan , entered my TroLink address into search bar and than details loaded. Scroll down and click on Transfers, under this section, two subcategories are -- TRX & TRC10 Transfer & TRC20 & TRC721. For ordinary transfer, we check under TRX and TRC 10. There i find, first transaction done 4 mins ago, click on hash and details unfolded showing:

IMG_20210510_133734.jpg

Only Bandwidth ( 268) was consumed.

To check for transaction that trigger smart contract and therefore consume both energy and bandwidth, in question 5 answered belowsupply , burrows,
and repay transactions have been explained along with amount of bandwidth and energy consumed. So to avoid repetition, i beg your pardon and request you to go through Q 5 for smart contract details


(5) How do I check "how much Bandwidth and Energy are consumed in a particular transaction"?(Screenshots needed)

  • Go to Tronscan.org

  • In the main page, a search field is provided at the top, enter your Tron Wallet Address.

  • Account details will be fetched.

  • Scroll down to look for "Transfer. "Click on Transfer.

  • Two subcategories are there -- TRX & TRC10 Transfer & TRC20 & TRC721 Transfers. click on TRC20 and TRC721.

  • Next we will look for transactions performed on JustLend last week like Supply (TRX for jTRX) , Burrow (USDT) and repay burrowed
    asset.

IMG_20210510_042415.jpg


IMG_20210510_042522.jpg


IMG_20210510_042607.jpg


Now let's look for transaction hash of all smart contract triggers like, Mint , Borrow , Repay.

Method of calling- Mint(Supply)

I supplied 20 TRX to mint 1999 jTRX tokens

1620601782859.jpg

Txn Hash- dbdd17fc0d870bf856d8e2abcfe0a31f0f2a59e144477e09fbee9ca867d4e09e

Consumption of Bandwidth- 284

Consumption of Energy- 80,377

TRX burned to accommodate Energy- 11.2312


Method of calling- Borrow

I borrowed 1 USDT from JustLend.

1620602166551.jpg

Txn Hash- 49d753d91ec2c0972703c8b7578d3ba316ac3be003cc2b7ae80ecf21974b3f82

Consumption of Bandwidth- 313

Consumption of Energy- 126,818

TRX burned to accommodate Energy- 17.746


Method of calling- Repayment

I repaid 1 USDT.

1620602850242.jpg

Txn Hash- 01ab004c73cd83408845ff975748479984d0bb12f575211be81039c821db37b8

Consumption of Bandwidth- 313

Concumption of Energy- 87 , 314

TRX burned to accommodate Energy- 12.22


(6) How do I avoid burning TRX to accommodate the Energy required for a transaction?

As mentioned above, system doesn't provide free energy unlike free bandwidth (5000 every 24 hours ), so the only source of energy is by freezing TRX. If energy available by freezing TRX is not sufficient for a transaction to execute, than the additional amount of energy required will be obtained by burning TRX. So to avoid burning TRX, we can freeze sufficient quantity of TRX before executing transactions. Freezing TRX for obtaining energy is demonstrated above.

Second method is to "Rent energy". For renting energy,

1620631171216.jpg

  • Fill the rental amount and duration, and finally Pay and that is it.

We get 100k energy for 1 day for just 8 TRX. As seen above, that in none of the transactions ( supply, burrows, repay) , TRX burned is less than 8. So this is the cheaper way out.


(7) Include the real example of your interaction with JustLend & Justswap? Indicate how a "swap"(in Justswap) function consumes different "Energy & Bandwidth" than a "borrow" function(in JustLend)? You can trade a small amount(as little as 1 USDT)? (Screenshots needed)

To swap on JustSwap , let's start from TronLink wallet. On the main page, from bottom panel, click on "Discover". Next Dapp page will open. Look for JustSwap. Click on it.

  • Next select the tokens , say TRX and USDT. "From TRX To USDT".

  • Select amount of USDT. I entered 1 USDT.. For 1 USDT 6.96038 TRX has to be paid.

  • Click on swap and select authorisation type and complete transaction with the help of TronLink wallet password.

IMG_20210510_151636.jpg


1620639964117.jpg


IMG_20210510_151750.jpg


IMG_20210510_151829.jpg


IMG_20210510_151910.jpg


IMG_20210510_151926.jpg


IMG_20210510_152002.jpg


Now let's check for the same on TronScan.

IMG_20210510_152801.jpg
Proof from Tronscan

Consumption of Bandwidth- 350

Consumption of Energy- 40 , 377

TRX burned to accommodate Energy- 5.65


Having participated in last week's homework task , so i will just include the final details of burrow transaction for comparison.

1620602166551.jpg

Consumption of Bandwidth- 313

Consumption of Energy- 126,818

TRX burned to accommodate Energy- 17.746


Summary Table

ResourceJustSwapJUstLend
ENERGY40376126 818
BANDWIDTH350313
TRX BURNED5.6517.746

So from above table, we concluded that, bandwidth, energy and TRX burned are more on JustSwap than JustLend. it means burrow function performed on JustLend took more time than swap function on JustSwap because we know 1 Energy - 1 microsecond.


(8) Explore Tronscan(check your own wallet) to identify an "ordinary transfer" & a "Smart-contract-operated transfer"? Indicate the difference between the two?

  • Go to tronscan.org
    In the main page, a search field is provided at the top, enter your TronLink Wallet Address.

IMG_20210510_042415.jpg

  • Tron wallet details will be fetched.

  • Scroll down to look for"Transfer. "Click on Transfer. Two subcategories under transfer are -- TRX & TRC10 Transfer & TRC20 & TRC721 Transfers. click on TRC20 and TRC721. Ordinary transactions are under TRX and TRC10. Smart contract triggers are under TRC20 and 721. However, it is not necessary that all TRC 20 transactions are smart contract triggered.

  • Other simpler way is to click on transaction, than look for transaction type and click on it, a drop down menu will appear , select " Trigger Smart contracts " .

1620636625682.jpg


IMG_20210512_082400.jpg


When we look for any ordinary transaction ( examples, Transfer of TRX, , freezing TRX) we find that only bandwidth is consumed for completing transaction while smart contract transactions consume both energy and bandwidth.

IMG_20210510_142305.jpg
TRC 20 & TRC 721 transaction

IMG_20210510_142439.jpg
TRX and TRC10 transactions

IMG_20210510_133734.jpg
Ordinary transfer

1620601782859.jpg
Smart contract triggered.


Thanks

Sort:  

Very good attempt. Sir you cover all the questions and give answer to all question in detail. I like your work.

(Worst ) i think it is your mistake bro

Thank you for correction. English is not my native language. I keep learning english every moment. Thank you again.

Always check before posting something

 3 years ago 

So great of you to have taken time to go through it.
@affable

Loading...

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.034
BTC 66408.70
ETH 3225.39
USDT 1.00
SBD 4.17