Host function support for confidential tokens #1779
Replies: 3 comments 15 replies
-
|
I have a few questions regarding the token interface, or rather, whether it's possible to implement it a bit differently given the proposed set of cryptographic function (or whether something is impossible or requires some additional functions).
|
Beta Was this translation helpful? Give feedback.
-
|
Coming back to the host functions specifically, we seem to be pretty opinionated here in terms of which specific primitives are used (say, SHA-512 and e.g. not keccak-512, not to mention much more impactful algorithm choices like homomorphic encryption and ZK-proofs). Can we end up in a situation where ecosystem wants to build something, but we don't support that, so we need to do pretty much same work again (as in the BLS vs BN case)? On the other hand, is there maybe a way to leverage the 'opinionated' approach and come up with higher level, simpler to use functions? |
Beta Was this translation helpful? Give feedback.
-
I've checked the prototype and I don't see this being used, which would make sense as encryption on-chain is pretty meaningless. Is this actually necessary for anything? I guess I'm generally looking forward to the final list of the proposed functions, but this one in particular really stands out. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Confidential transfer refer to transactions where the transferred amount and balances are hidden, while the identities of the transacting parties remain visible. It can be realized as a extension on top of a standard token contract.
Representative work include Zether and PGC, both of which rely on a similar suite of cryptographic primitives and protocols.
This discussion proposes a baseline set of host functions to enable efficient on-chain confidential transfers, and discuss their technical merits and tradeoffs. These may not be the only (or even the optimal) set of design choices, but rather as widely used, well-studied building blocks that can be refined over time.
Proposed Functions
Homomorphic encryption (e.g., ElGamal / Twisted ElGamal in the Ristretto255 group):
mand randomnessr, compute the ciphertextCand decryption handle (opening)D.Hashing
Range Proof verification
We have built an initial working token contract prototype (will soon be migrated to stellar/stellar-confidential-token), with all cryptography on the guest side. The contract size is around 138kb, and the cpu instructions is 2 order of magnitude higher than the current network limit. (Tagging contributors @bboston7, @iftachh)
(tracking issue: stellar/rs-soroban-env#1585)
Beta Was this translation helpful? Give feedback.
All reactions