Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Member Functions | Public Attributes | List of all members
zeth.core.mixer_client.MixCallDescription Class Reference

Public Member Functions

def __init__ (self, MerkleTree mk_tree, OwnershipKeyPair sender_ownership_keypair, List[Tuple[int, api.ZethNote]] inputs, List[Tuple[ZethAddressPub, EtherValue]] outputs, EtherValue v_in, EtherValue v_out, Optional[ComputeHSigCB] compute_h_sig_cb=None)
 

Public Attributes

 mk_tree
 
 sender_ownership_keypair
 
 v_in
 
 v_out
 
 compute_h_sig_cb
 
 inputs
 
 outputs
 

Detailed Description

High-level description of a call to the mixer contract. Holds information
used when generating the ProofInputs, ZK-proof and final MixParameters
object.

Definition at line 49 of file mixer_client.py.

Constructor & Destructor Documentation

◆ __init__()

def zeth.core.mixer_client.MixCallDescription.__init__ (   self,
MerkleTree  mk_tree,
OwnershipKeyPair  sender_ownership_keypair,
List[Tuple[int, api.ZethNote]]  inputs,
List[Tuple[ZethAddressPub, EtherValue]]  outputs,
EtherValue  v_in,
EtherValue  v_out,
Optional[ComputeHSigCB]   compute_h_sig_cb = None 
)

Definition at line 55 of file mixer_client.py.

55  def __init__(
56  self,
57  mk_tree: MerkleTree,
58  sender_ownership_keypair: OwnershipKeyPair,
59  inputs: List[Tuple[int, api.ZethNote]],
60  outputs: List[Tuple[ZethAddressPub, EtherValue]],
61  v_in: EtherValue,
62  v_out: EtherValue,
63  compute_h_sig_cb: Optional[ComputeHSigCB] = None):
64  assert len(inputs) <= constants.JS_INPUTS
65  assert len(outputs) <= constants.JS_OUTPUTS
66 
67  self.mk_tree = mk_tree
68  self.sender_ownership_keypair = sender_ownership_keypair
69  self.v_in = v_in
70  self.v_out = v_out
71  self.compute_h_sig_cb = compute_h_sig_cb
72 
73  # Perform some cleaning and minimal pre-processing of the data. Compute
74  # and store data that is not derivable from the ProverInput or Proof
75  # structs (such as the encryption keys for receivers), making it
76  # available to MixerClient calls.
77 
78  # Expand inputs with dummy entries and compute merkle paths.
79  sender_a_pk = sender_ownership_keypair.a_pk
80  self.inputs = \
81  inputs + \
82  [get_dummy_input_and_address(sender_a_pk)
83  for _ in range(constants.JS_INPUTS - len(inputs))]
84 
85  # Pad the list of outputs if necessary
86  if len(outputs) < constants.JS_OUTPUTS:
87  dummy_k_pk = generate_encryption_keypair().k_pk
88  dummy_addr_pk = ZethAddressPub(sender_a_pk, dummy_k_pk)
89  self.outputs = \
90  outputs + \
91  [(dummy_addr_pk, EtherValue(0))
92  for _ in range(constants.JS_OUTPUTS - len(outputs))]
93  else:
94  self.outputs = outputs
95 
96 

Member Data Documentation

◆ compute_h_sig_cb

zeth.core.mixer_client.MixCallDescription.compute_h_sig_cb

Definition at line 63 of file mixer_client.py.

◆ inputs

zeth.core.mixer_client.MixCallDescription.inputs

Definition at line 72 of file mixer_client.py.

◆ mk_tree

zeth.core.mixer_client.MixCallDescription.mk_tree

Definition at line 59 of file mixer_client.py.

◆ outputs

zeth.core.mixer_client.MixCallDescription.outputs

Definition at line 81 of file mixer_client.py.

◆ sender_ownership_keypair

zeth.core.mixer_client.MixCallDescription.sender_ownership_keypair

Definition at line 60 of file mixer_client.py.

◆ v_in

zeth.core.mixer_client.MixCallDescription.v_in

Definition at line 61 of file mixer_client.py.

◆ v_out

zeth.core.mixer_client.MixCallDescription.v_out

Definition at line 62 of file mixer_client.py.


The documentation for this class was generated from the following file:
zeth.core.mixer_client.get_dummy_input_and_address
Tuple[int, api.ZethNote] get_dummy_input_and_address(OwnershipPublicKey a_pk)
Definition: mixer_client.py:241
zeth.core.encryption.generate_encryption_keypair
EncryptionKeyPair generate_encryption_keypair()
Definition: encryption.py:163