Zeth - Zerocash on Ethereum
0.8
Reference implementation of the Zeth protocol by Clearmatics
|
Public Member Functions | |
def | __init__ (self, Any web3, ProverConfiguration prover_config, Any mixer_instance) |
str | deposit (self, ProverClient prover_client, MerkleTree mk_tree, ZethAddress zeth_address, str sender_eth_address, Optional[bytes] sender_eth_private_key, EtherValue eth_amount, Optional[List[Tuple[ZethAddressPub, EtherValue]]] outputs=None, Optional[EtherValue] tx_value=None) |
str | joinsplit (self, ProverClient prover_client, MerkleTree mk_tree, OwnershipKeyPair sender_ownership_keypair, str sender_eth_address, Optional[bytes] sender_eth_private_key, List[Tuple[int, api.ZethNote]] inputs, List[Tuple[ZethAddressPub, EtherValue]] outputs, EtherValue v_in, EtherValue v_out, Optional[EtherValue] tx_value=None, Optional[ComputeHSigCB] compute_h_sig_cb=None) |
str | mix (self, MixParameters mix_params, str sender_eth_address, Optional[bytes] sender_eth_private_key, EtherValue tx_value, Optional[int] call_gas=None) |
bool | mix_call (self, MixParameters mix_params, str sender_eth_address, EtherValue tx_value, Optional[int] call_gas=None) |
MixParameters | create_mix_parameters_from_proof (self, MixCallDescription mix_call_desc, api.ProofInputs prover_inputs, signing.SigningKeyPair signing_keypair, ExtendedProof ext_proof, List[int] public_data, str sender_eth_address, bool for_dispatch_call=False) |
Tuple[MixParameters, JoinsplitSigKeyPair] | create_mix_parameters_and_signing_key (self, ProverClient prover_client, MerkleTree mk_tree, OwnershipKeyPair sender_ownership_keypair, str sender_eth_address, List[Tuple[int, api.ZethNote]] inputs, List[Tuple[ZethAddressPub, EtherValue]] outputs, EtherValue v_in, EtherValue v_out, Optional[ComputeHSigCB] compute_h_sig_cb=None, bool for_dispatch_call=False) |
Static Public Member Functions | |
Tuple[MixerClient, contracts.InstanceDescription] | deploy (Any web3, ProverClient prover_client, str deployer_eth_address, Optional[bytes] deployer_eth_private_key, Optional[str] token_address=None, Optional[str] permitted_dispatcher=None, Optional[str] vk_hash=None, Optional[int] deploy_gas=None) |
Tuple[api.ProofInputs, signing.SigningKeyPair] | create_prover_inputs (MixCallDescription mix_call_desc) |
Public Attributes | |
web3 | |
prover_config | |
mixer_instance | |
Interface to operations on the Mixer contract.
Definition at line 259 of file mixer_client.py.
def zeth.core.mixer_client.MixerClient.__init__ | ( | self, | |
Any | web3, | ||
ProverConfiguration | prover_config, | ||
Any | mixer_instance | ||
) |
Definition at line 263 of file mixer_client.py.
Tuple[MixParameters, JoinsplitSigKeyPair] zeth.core.mixer_client.MixerClient.create_mix_parameters_and_signing_key | ( | self, | |
ProverClient | prover_client, | ||
MerkleTree | mk_tree, | ||
OwnershipKeyPair | sender_ownership_keypair, | ||
str | sender_eth_address, | ||
List[Tuple[int, api.ZethNote]] | inputs, | ||
List[Tuple[ZethAddressPub, EtherValue]] | outputs, | ||
EtherValue | v_in, | ||
EtherValue | v_out, | ||
Optional[ComputeHSigCB] | compute_h_sig_cb = None , |
||
bool | for_dispatch_call = False |
||
) |
Convenience function around creation of MixCallDescription, ProofInputs, Proof and MixParameters. If for_dispatch_call is set, the parameters are to be passed to the Mixer's `dispatch` call in a later operation (in which proof data is not available), hence proof is omitted from the signature.
Definition at line 545 of file mixer_client.py.
MixParameters zeth.core.mixer_client.MixerClient.create_mix_parameters_from_proof | ( | self, | |
MixCallDescription | mix_call_desc, | ||
api.ProofInputs | prover_inputs, | ||
signing.SigningKeyPair | signing_keypair, | ||
ExtendedProof | ext_proof, | ||
List[int] | public_data, | ||
str | sender_eth_address, | ||
bool | for_dispatch_call = False |
||
) |
Create the MixParameters from MixCallDescription, signing keypair, sender address and derived data (prover inputs and proof). This includes creating and encrypting the plaintext messages, and generating the one-time signature. If for_dispatch_call is set, the parameters are to be passed to the Mixer's `dispatch` call in a later operation (in which proof data is not available), hence proof is omitted from the signature.
Definition at line 500 of file mixer_client.py.
|
static |
Given the basic parameters for a mix call, compute the input to the prover server, and the signing key pair.
Definition at line 439 of file mixer_client.py.
|
static |
Deploy Zeth contracts.
Definition at line 273 of file mixer_client.py.
str zeth.core.mixer_client.MixerClient.deposit | ( | self, | |
ProverClient | prover_client, | ||
MerkleTree | mk_tree, | ||
ZethAddress | zeth_address, | ||
str | sender_eth_address, | ||
Optional[bytes] | sender_eth_private_key, | ||
EtherValue | eth_amount, | ||
Optional[List[Tuple[ZethAddressPub, EtherValue]]] | outputs = None , |
||
Optional[EtherValue] | tx_value = None |
||
) |
str zeth.core.mixer_client.MixerClient.joinsplit | ( | self, | |
ProverClient | prover_client, | ||
MerkleTree | mk_tree, | ||
OwnershipKeyPair | sender_ownership_keypair, | ||
str | sender_eth_address, | ||
Optional[bytes] | sender_eth_private_key, | ||
List[Tuple[int, api.ZethNote]] | inputs, | ||
List[Tuple[ZethAddressPub, EtherValue]] | outputs, | ||
EtherValue | v_in, | ||
EtherValue | v_out, | ||
Optional[EtherValue] | tx_value = None , |
||
Optional[ComputeHSigCB] | compute_h_sig_cb = None |
||
) |
Create and broadcast a transactions that calls the mixer with the given parameters. Requires a ProverClient for proof generation.
Definition at line 346 of file mixer_client.py.
str zeth.core.mixer_client.MixerClient.mix | ( | self, | |
MixParameters | mix_params, | ||
str | sender_eth_address, | ||
Optional[bytes] | sender_eth_private_key, | ||
EtherValue | tx_value, | ||
Optional[int] | call_gas = None |
||
) |
Given a MixParameters object, create and broadcast a transaction performing the appropriate mix call.
Definition at line 379 of file mixer_client.py.
bool zeth.core.mixer_client.MixerClient.mix_call | ( | self, | |
MixParameters | mix_params, | ||
str | sender_eth_address, | ||
EtherValue | tx_value, | ||
Optional[int] | call_gas = None |
||
) |
Call the mix method (executes on the RPC host without creating a transaction). Returns True if the call succeeds. False, otherwise.
Definition at line 400 of file mixer_client.py.
zeth.core.mixer_client.MixerClient.mixer_instance |
Definition at line 266 of file mixer_client.py.
zeth.core.mixer_client.MixerClient.prover_config |
Definition at line 265 of file mixer_client.py.
zeth.core.mixer_client.MixerClient.web3 |
Definition at line 264 of file mixer_client.py.