Content pfp
Content
@
0 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
Partially homomorphic encryption is ridiculously under-utilized. It opens up a massive swath of use cases via strong concurrency and minimal data leakage. And you can get it with just 256 lines of circom. ...
1 reply
0 recast
1 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
The simplest way to tap into this is via Pedersen Commitments. Calling the Pedersen func PD() here. They're hiding + additively homomorphic. Means that the following two properties hold. [1] Hard to recover 5 given PD(5) [2] PD(2) + PD(5) = PD(7)
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
Why is this useful? Easy to way demonstrate is with the encrypted balances example. Suppose [Alice, Bob, Charlie] all have wallets with $30 in USDC as encrypted balances. Observers CAN see 1) who has USDC and 2) who transfers USDC to who. Observers CANNOT see how much.
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
Let's say both Alice and Bob want to pay Charlie $5. Fairly doable to see how we can do this with a quick ZKP. Alice / Bob can submit a ZKP that asserts "my new balance is $25 and Charlie's is $35". This works, but has two problems.
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
[1] Weak concurrency. What if both payments are submitted in the same block? Suppose Alice's tx is ordered first. Then, Bob's would fail because Charlie's balance should now go from $35 to $40, not $30 to $35. Two concurrent txs can't modify the same value using just ZK.
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
[2] Counterparty data leakage. Notice both Alice and Bob must know Charlie's balance to pay him. Defeats much of the purpose of encrypted balances. You must leak initial state to counterparties if you're using just ZK.
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
Fix? Instead of using a ZKP to modify balances, Alice / Bob should send a tx that adds PD(-5) to their balance and PD(5) to Charlie's. So the statement goes from "my new balance is $25 and Charlie's is $35" to "my new balance is $5 less and Charlie's is $5 more".
1 reply
0 recast
0 reaction

Lyron Co Ting Keh pfp
Lyron Co Ting Keh
@lyronctk
Concretely INITIAL STATE > Alice: PD(30) > Bob: PD(30) > Charlie: PD(30) FINAL STATE > Alice: PD(30) + PD(-5) = PD(25) > Bob: PD(30) + PD(-5) = PD(25) > Charlie: PD(30) + PD(5) + PD(5) = PD(40) Works because PD() is hiding + additively homomorphic.
1 reply
0 recast
0 reaction