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

Public Member Functions

def __init__ (self, ZethNote note, int address, bytes commitment)
 
Tuple[int, ZethNote] as_input (self)
 
str to_json (self)
 

Static Public Member Functions

ZethNoteDescription from_json (str json_str)
 

Public Attributes

 note
 
 address
 
 commitment
 

Detailed Description

All secret data about a single ZethNote, including address in the merkle
tree and the commit value.

Definition at line 35 of file wallet.py.

Constructor & Destructor Documentation

◆ __init__()

def zeth.core.wallet.ZethNoteDescription.__init__ (   self,
ZethNote  note,
int  address,
bytes  commitment 
)

Definition at line 40 of file wallet.py.

40  def __init__(self, note: ZethNote, address: int, commitment: bytes):
41  self.note = note
42  self.address = address
43  self.commitment = commitment
44 

Member Function Documentation

◆ as_input()

Tuple[int, ZethNote] zeth.core.wallet.ZethNoteDescription.as_input (   self)
Returns the description in a form suitable for joinsplit.

Definition at line 45 of file wallet.py.

45  def as_input(self) -> Tuple[int, ZethNote]:
46  """
47  Returns the description in a form suitable for joinsplit.
48  """
49  return (self.address, self.note)
50 

◆ from_json()

ZethNoteDescription zeth.core.wallet.ZethNoteDescription.from_json ( str  json_str)
static

Definition at line 60 of file wallet.py.

60  def from_json(json_str: str) -> ZethNoteDescription:
61  json_dict = json.loads(json_str)
62  return ZethNoteDescription(
63  note=zeth_note_from_json_dict(json_dict["note"]),
64  address=int(json_dict["address"]),
65  commitment=bytes.fromhex(json_dict["commitment"]))
66 
67 
Here is the call graph for this function:

◆ to_json()

str zeth.core.wallet.ZethNoteDescription.to_json (   self)

Definition at line 51 of file wallet.py.

51  def to_json(self) -> str:
52  json_dict = {
53  "note": zeth_note_to_json_dict(self.note),
54  "address": str(self.address),
55  "commitment": self.commitment.hex(),
56  }
57  return json.dumps(json_dict, indent=4)
58 
Here is the call graph for this function:

Member Data Documentation

◆ address

zeth.core.wallet.ZethNoteDescription.address

Definition at line 42 of file wallet.py.

◆ commitment

zeth.core.wallet.ZethNoteDescription.commitment

Definition at line 43 of file wallet.py.

◆ note

zeth.core.wallet.ZethNoteDescription.note

Definition at line 41 of file wallet.py.


The documentation for this class was generated from the following file:
zeth.cli.zeth_deploy.int
int
Definition: zeth_deploy.py:27
zeth.core.wallet.str
str
Definition: wallet.py:28
zeth.core.proto_utils.zeth_note_from_json_dict
ZethNote zeth_note_from_json_dict(Dict[str, str] parsed_zeth_note)
Definition: proto_utils.py:37
zeth.core.proto_utils.zeth_note_to_json_dict
Dict[str, str] zeth_note_to_json_dict(ZethNote zeth_note_grpc_obj)
Definition: proto_utils.py:28