ckETH: a canister-issued Ether twin token on the IC

I’m cross posting here since this is where 3 of the NNS canister upgrade proposals were posted. The link shows how the CodeGov neuron voted on each proposal and provides links to our verifications.

1 Like

Hi @dfxjesse

Thank you for your questions!

Can someone clarify if the helper smart contract takes a:

  • Principal?
  • converted principal + subacccount string?
  • or an object of type Account

So the helper smart contract takes an IC principal converted to a 32-byte string (For the conversion you can use the ckETH minter dashboard or the binary principal_to_hex). By IC principal I really mean the 1:1 output of

dfx identity get-principal

In particular the helper smart contract has no notion of subaccount. You can see here how the events from the helper smart contract are minted to ckETH.

I hope this clarified the deposit flow. Feel free to ask more questions if some things are still unclear.

2 Likes

Congratulations!

we encountered a question while adding ckETH to the ICPSwap token list today.

We got basic information through the ckETH canister ID ss2fx-dyaaa-aaaar-qacoq-cai. However, it seems a bit off.

The Transfer Fee is displayed as 20,000, and the Decimals are 8 (while ckSepoliaETH is 18). We initially thought there might be a data retrieval error, and the devs looked into it, but it appears the data is correct.

We’re seeking a double confirmation here: Is this data inaccurate, or should ckETH may have 18 Decimals, making the transfer fee 0.000002 ckETH (matching the proposal Proposal: 126170 - ICP Dashboard saying: “The transfer fee is 2_000_000_000_000, which is around 0.004 USD”)?

4 Likes

Yes, there unfortunately was a mistake in proposal Proposal: 126170 - ICP Dashboard, which did not specify the decimals and memo size. A second proposal has been submitted to correct this mistake: Proposal: 126309 - ICP Dashboard. Note that the wasm is the same, but there are two additional install args specified.

We’re seeking a double confirmation here: Is this data inaccurate, or should ckETH may have 18 Decimals, making the transfer fee 0.000002 ckETH (matching the proposal Proposal: 126170 - ICP Dashboard saying: “The transfer fee is 2_000_000_000_000, which is around 0.004 USD”)?

Right, so to be extra clear, the decimals should have been 18, making the transfer fee ~ 0.004 USD. Please double check proposal 126309.

3 Likes

Got it, Thanks a lot for the answer, Manu!

1 Like

The new proposal is a reinstall of ss2fx-dyaaa-aaaar-qacoq-cai. Can someone use the ckETH ledger between now and the reinstall and create a balance and what would happen to that balance?

@timo no you cannot: there is no minter yet (as Proposal: 126171 - ICP Dashboard is not adopted yet) and it is installed without any initial balances, so there is no way to get any balance on the ledger, so nothing can get lost in the reinstall.

1 Like

All the relevant NNS propsals were adopted, so ckETH is now live!

We’ve updated the README here outlining how you can now convert between ETH and ckETH. I encourage everybody to give this a try and report back if you run into problems. And of course proceed with caution: while ckETH already went through a lot of security review, it’s prudent to treat it as experimental initially.

You can find the ckETH minter dashboard here, showing all the conversions between ETH and ckETH.

12 Likes

When will it be ready to use the converter on NNS?

1 Like

I expect the token support in the NNS FE soon, but not conversions. ICLighthouse has support for ckETH and conversions live, so you could give that a try.

3 Likes

Great news. Thanks for all the hard work! Amazing to have it done, it must have been a lot of work as ckETH is quite a sophisticated system.

I tried it out and these are my comments/questions:

In the principal to bytes conversion on the minter dashboard, the form box where you enter the principal may have some kind of spell-checker on. It may be a browser default setting on the user’s side but maybe there is also a way to turn it off by some html tag. When you paste a principal you make see it underlined in red which means it is not a dictionary word. Just for privacy reasons we would like to have it turned off so the principal isn’t sent around unnecessarily to other OS components.

The README does not mention the minimal withdrawal amount but there is one.
(EDIT: The dashboard mentions it.)

Why is the minimal withdrawal amount so high at 30 mETH? I know that ETH fees are high and lower amounts make little sense. But the fees are not always high. Plus I can imagine that people might want to hold ckETH permanently and when they need to pay something in ETH send it directly via withdrawal, not in two steps. Smaller amounts might be needed in that case.

The README does not mention how long wihtdrawals take. I guess they are just “fast”, that’s why?

When I tried a withdrawal it lost about 1 mETH. The credited amount of ETH plus the ETH transaction fee shown on Etherscan is 1 mETH less then the ckETH that were withdrawn and deducted. Is that a fee that the ckETH ledger kept or where did it go?

EDIT: Fixed two typos in the README but the PRs Fix dfx commands in README.adoc by timohanke · Pull Request #149 · dfinity/ic · GitHub and Fix typo in README.adoc by timohanke · Pull Request #148 · dfinity/ic · GitHub got closed by a bot.

6 Likes

fantastic feedback @timo, thanks a lot, we’ll get to work on improving the readme. To answer some of the questions now:

Why is the minimal withdrawal amount so high at 30 mETH? I know that ETH fees are high and lower amounts make little sense. But the fees are not always high. Plus I can imagine that people might want to hold ckETH permanently and when they need to pay something in ETH send it directly via withdrawal, not in two steps. Smaller amounts might be needed in that case.

The withdrawal amount needs to at least cover the ETH network fees. In case the ETH network fees become higher than the withdrawal amount, we could end up with a stuck tx that we cannot resubmit with higher fees without the ckETH pot losing ETH (and ckETH not being fully backed anymore). We are thinking about ways to improve this, eg by making it dynamic, but for now we proposed to start with a safe margin. Ideas are welcome of course!

The README does not mention how long wihtdrawals take. I guess they are just “fast”, that’s why?

Yes, if im not mistaken the minter looks every 6 minutes and submits transactions for the requested withdrawals.

When I tried a withdrawal it lost about 1 mETH. The credited amount of ETH plus the ETH transaction fee shown on Etherscan is 1 mETH less then the ckETH that were withdrawn and deducted. Is that a fee that the ckETH ledger kept or where did it go?

Yes, the minter currently charges a higher fee than the real ETH gas fee that occurred, which it eventually can use to pay for its own cycles usage. These are all things that can be changed via upgrade proposals, so this could also be fine-tuned in the future.

Is the ckETH index canister identical in its interface to the ckBTC index canister or are there any differences? (Sorry, can’t find the source code or did files for them, but in candid UI they look identical.)

Is there a standard yet for index canisters for ICRC-1 tokens and do ckETH and ckBTC follow it?

Asking so I can do wallet integration of ckETH.

1 Like

Congratulations again, this really is a great achievement! I think we can expect some really cool stuff to be built using ckETH. For instance, take the ability of canisters to act as decentralised oracles using HTTPS outcalls. That, combined with the new ability of canisters to hold ETH, plus gasless transactions, plus moving in and out of the ETH ecosystem really easily. This opens up. So. Many. New. Possibilities. :boom:

3 Likes

Linking this to the dashboard:

Does “Total unspent transaction fees” refer to what the ledger kept for himself?

And “Total effective transaction fees” refers to what has been spent on the ETH network?

So the sum of the two is what users have spent so far?

1 Like

There is no ICRC standard yet, it looks like there are plans though ICRC-5: Indexing · Issue #5 · dfinity/ICRC · GitHub. But yes the ckBTC and ckETH index canisters have the same interface.

1 Like

Can we get the ckETH logo added to the Internet computer branding page:

2 Likes

Sounds reasonable! I’ll forward the request

edit: @dfxjesse this has been added

1 Like

Hi @timo

Does “Total unspent transaction fees” refer to what the ledger kept for himself?
And “Total effective transaction fees” refers to what has been spent on the ETH network?
So the sum of the two is what users have spent so far?

Basically the current behaviour of a single withdrawal is as follows (happy path). Assume that a user calls withdraw_eth (after having approved the minter) to withdraw withdraw_amount (e.g. 1ckETH) to some address. Then the minter is going to do the following

  1. Burn withdraw_amount on the ledger for the IC principal (the caller of withdraw_eth).
  2. Estimate the maximum current cost of a transaction (21_000 gas) on Ethereum, say max_tx_fee_estimate. This max_tx_fee_estimate is somewhat large enough that it should be valid for the few next blocks.
  3. Issue an Ethereum transaction (via tECDSA) with value withdraw_amount - max_tx_fee_estimate
  4. When the transaction is mined, since on Ethereum transactions are at the cost of the sender, the minter’s account will be charged with (withdraw_amount - max_tx_fee_estimate) + actual_tx_fee == withdrawal_amount - (max_tx_fee_estimate - actual_tx_fee), where actual_tx_fee represents the actual transaction fee (can be retrieved from the receipt) and it’s guaranteed by construction that max_tx_fee_estimate - actual_tx_fee > 0

So all this to now answer your initial question:

  1. actual_tx_fee will be added to “Total effective transaction fees”
  2. The difference max_tx_fee_estimate - actual_tx_fee will be added to “Total unspent transaction fees”. This amount is currently not assigned (not minted back to some fee collector account for example) but we wanted to track it so that we have this option in the future if this is something that would be beneficial for ckETH.
  3. It is correct that the sum of the 2 (actual_tx_fee + (max_tx_fee_estimate - actual_tx_fee)) is max_tx_fee_estimate and corresponds to the cost of a withdrawal for the user.

I have now additional content for the README. I hope this helped but please feel free to reach out if additional clarification is needed.

3 Likes

How much more is the fee?