Hi! I’m a developer interested in building confidential defi.
Currently fhevm supports upto uint64. So to do confidential defi (dark pool, private lending / borrow, …) we need to wrap plain ERC20 into encryptedERC20 while scaling them, for instance reducing decimals to lower numbers from 18.
While above specific example in fact does not really need division with two encrypted input, it is not hard to imagine the circumstance such operation is needed (e.g., minting/burning 4626 token). So it would be great to make it possible.
I found similar discussion in fhevm telegram chat but it was several months ago so I would like to know if there is any update. Thank you!
Hi you do not need to divide by a ciphertext to implement this feature so I am not sure to understand the title “ETA on Div(Enc,Enc)”, unless I am missing something. You just need Div(Enc,Plaintext) which is already available in fhevm.
That being said, the idea of implementing a wrapper to convert a regular plaintext ERC20 on 18 decimals (or on x decimals where x could be any value) to an EncryptedERC20 on euint64 balances is a great idea and there is already an issue opened for this, it could constitute a very welcomed first contribution so do not hesitate to open a PR if you want to do it : https://github.com/zama-ai/fhevm-contracts/issues/32
Even for ERC4626 I am not sure you need to divide by a ciphertext. Most of the time for rebasing tokens to distribute the rewards, the new price is made public anyways because all depositors get same new price.