You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the zk-token-sdk and zk-token-proof program use module and instruction names that are unnecessarily specific to the token extension confidential transfer application. However, the tools in these modules can be used more generally for a wider set of cryptographic and zk applications.
VerifyWithdraw --> remove instruction (instruction not added to zk-sdk)
VerifyTransfer --> remove instruction (instruction not added to zk-sdk)
VerifyTransferWithFee --> remove instruction (instruction not added to zk-sdk)
In place of the removed instructions above, applications can alternatively use combination of validity, equality, and range proof instructions with proof context.
In the sigma module, carry out the following naming changes:
Ideally, it would be much cleaner and nicer to create a separate RangeProof program and a SigmaProof program. The RangeProof program can be a native program that replaces the ZkTokenProof program and the SigmaProof program would be a standard bpf program that makes use of the curve25519 syscalls. Then the RangeProof program will be much simpler and lighter than the current ZkTokenProof program and since the SigmaProof program is a bpf program, the instruction names and description can be adapted specifically for the token-extensions application. However, the SigmaProof program would require additional syscalls for doing the Scalar arithmetic and adding these would greatly delay the activation date for token-extension confidential transfers.
If we do add the Scalar arithmetic syscalls, then it could also be possible to implement RangeProof and SigmaProof programs as SBF programs. This would be a really nice solution for Fierdancer since the zk proofs are not implemented in the validator client code anymore. However, similar to above, going through the process of implementing and activating the Scalar arithmetic syscalls would greatly delay the activation date for token-extension confidential transfers. Also, it is unclear how expensive implementing the range proof verification would be even with runtime support for scalar operations.
Finally, we can consider creating two native programs, the RangeProof and SigmaProof programs. However, this would be creating two native programs that may be outdated by runtime v2. The entire process for adding the native SigmaProof program will also set back the activation date for token-extension confidential transfers greatly as well.
All things considered, it seems like the best route forward right now is to simply carry out the renaming as specified above to make the program be more application-agnostic (i.e. independent of the token-extensions confidential transfers).
The text was updated successfully, but these errors were encountered:
Problem
Currently, the zk-token-sdk and zk-token-proof program use module and instruction names that are unnecessarily specific to the token extension confidential transfer application. However, the tools in these modules can be used more generally for a wider set of cryptographic and zk applications.
Proposed Solution
Carry out the following module name changes:
zk-token-sdk
-->zk-sdk
([zk-sdk] Createzk-sdk
crate #988)zk_token_proof_*
-->zk_elgamal_proof_*
(e.g.zk_token_proof_program
-->zk_elgamal_proof_program
) ([zk-sdk] Add theprogram
module #1188)zk_token_elgamal
-->pod
([zk-sdk] Addpod
module #1169)Carry out the following changes in the zk-token-proof instructions:
VerifyZeroBalance
--> rename toVerifyZeroCiphertext
([zk-sdk] Add error types and zero ciphertext instruction #1453)VerifyFeeSigma
--> rename toVerifyPercentageWithCap
([zk-sdk] Add equality, pubkey validity, and percentage-with-cap instruction data #1467)VerifyWithdraw
--> remove instruction (instruction not added tozk-sdk
)VerifyTransfer
--> remove instruction (instruction not added tozk-sdk
)VerifyTransferWithFee
--> remove instruction (instruction not added tozk-sdk
)In place of the removed instructions above, applications can alternatively use combination of validity, equality, and range proof instructions with proof context.
In the sigma module, carry out the following naming changes:
fee_sigma_proof
-->percentage_with_cap_proof
([zk-sdk] ChangeFeeSigmaProof
toPercentageWithCapProof
#1084)zero_balance_proof
-->zero_ciphertext_proof
([zk-sdk] ChangeZeroBalanceProof
toZeroCiphertextProof
#1085)Alternative Considered
Ideally, it would be much cleaner and nicer to create a separate
RangeProof
program and aSigmaProof
program. TheRangeProof
program can be a native program that replaces theZkTokenProof
program and theSigmaProof
program would be a standard bpf program that makes use of the curve25519 syscalls. Then theRangeProof
program will be much simpler and lighter than the currentZkTokenProof
program and since theSigmaProof
program is a bpf program, the instruction names and description can be adapted specifically for the token-extensions application. However, theSigmaProof
program would require additional syscalls for doing theScalar
arithmetic and adding these would greatly delay the activation date for token-extension confidential transfers.If we do add the
Scalar
arithmetic syscalls, then it could also be possible to implementRangeProof
andSigmaProof
programs as SBF programs. This would be a really nice solution for Fierdancer since the zk proofs are not implemented in the validator client code anymore. However, similar to above, going through the process of implementing and activating theScalar
arithmetic syscalls would greatly delay the activation date for token-extension confidential transfers. Also, it is unclear how expensive implementing the range proof verification would be even with runtime support for scalar operations.Finally, we can consider creating two native programs, the
RangeProof
andSigmaProof
programs. However, this would be creating two native programs that may be outdated by runtime v2. The entire process for adding the nativeSigmaProof
program will also set back the activation date for token-extension confidential transfers greatly as well.All things considered, it seems like the best route forward right now is to simply carry out the renaming as specified above to make the program be more application-agnostic (i.e. independent of the token-extensions confidential transfers).
The text was updated successfully, but these errors were encountered: