Calculating withdrawal fees

I’m currently working on a payment integration with incognito. The docs and source code have been pretty useful, but I am having trouble finding good documentation in understanding withdrawal fee calculations.

Using the SDK on NodeJS. Stuck on properly calculating the fees for the "bridgeWithdraw" function. How would I calculate the "nativeFee" and "privacyFee" for pETH->ETH and pBTC->BTC withdrawal?
What is the fee beakdown/flow, how to properly calculate the burn fees, internal unshielding fees, and where to append network fees?

Would really appreciate some help or links to point me in the right direction.

Welcome to the community @thisisvitto…create a ticket to @Support and they should pick it up and help you with your inquiry… :sunglasses:

I would like to see this answered publicly… “Why are the fees so high?” is one of the most frequently asked questions and I think vitto is asking for the technical basis of this problem, coincidentally

This has been answered on multiple posts. The fees are from eth gas prices being so high. There are no fees coming from the incognito side

2 Likes

This is a channel dedicated to builders who need help. Answers will be supplied publicly to help future builders as well.

I love your friendly way of greeting every new member :heart:

2 Likes

Nope, he is asking how to calculate the fee amount properly in his code.

He is not asking for why fees are as high as they are. @Thriftinkid is correct in stating that the question about the high fees has been mentioned multiple times, and answered as many times as well. Incognito is not earning from those fees, they go to the miners of the external chain.

I recently started playing an Ethereum based game. All new members get some free assets, costs me $30 to collect my free stuff, due to ETH fees. It is not an Incognito only issue.

Due to Incognito using smart contracts, fees are higher than regular transfers. On the other hand, transfers and trade within the Incognito chain fees are next to nothing. Take advantage of that.

1 Like

Awww shucks… :blush:@Jamie just trying to contribute in what lil way I can for indeed when it comes to some of the technical stuff…well it be above my pay grade… :blush: …by the way I was impressed that you well took on Ace2021 in that other thread cause he has been ranting for days now…I do understand his gripe but well the advice you gave him was reasonable anyway hopefully dev team will address his issue… :sunglasses:

1 Like

Ah my mistake. I misread that completely. Apologies.

2 Likes

To clarify, yes the question is about proper implementation of the fee calculations.
@Tempestblack thanks for the info, I submitted a ticket to support. If they respond in the message, I’ll make sure to update it here and also show a sample implementation for any future devs with the same questions.

For everyone else talking about incredibly high fees, these fees are for shield/unshield transactions that require interacting with other blockchains like bitcoin and ethereum. There is nothing that can be done by anyone anywhere about these fees, it’s just the cost of transacting on these chains. This is why I like the concept of incognito so much. It is a layer-2 solution which allows to transfer, trade, and interact with many coins/tokens outside of the main chains and to keep costs low.

3 Likes

Hi @thisisvitto
Currently the SDK hasn’t yet supported a method for estimating fee for unshield.(bridgeWithdraw).

Give me some more time, I will post a detailed topic to instruct a developer how to make a shield and unshield for ETH/ERC20, as well as how to estimate fee for pBTC.

1 Like