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

Public Member Functions

def __init__ (self, OwnershipPublicKey a_pk, EncryptionPublicKey k_pk)
 
str __str__ (self)
 

Static Public Member Functions

ZethAddressPub parse (str key_hex)
 

Detailed Description

Public half of a zethAddress.  addr_pk = (a_pk and k_pk)

Definition at line 18 of file zeth_address.py.

Constructor & Destructor Documentation

◆ __init__()

def zeth.core.zeth_address.ZethAddressPub.__init__ (   self,
OwnershipPublicKey  a_pk,
EncryptionPublicKey  k_pk 
)

Definition at line 22 of file zeth_address.py.

22  def __init__(self, a_pk: OwnershipPublicKey, k_pk: EncryptionPublicKey):
23  self.a_pk: OwnershipPublicKey = a_pk
24  self.k_pk: EncryptionPublicKey = k_pk
25 

Member Function Documentation

◆ __str__()

str zeth.core.zeth_address.ZethAddressPub.__str__ (   self)
Write the address as "<ownership-key-hex>:<encryption_key_hex>".
(Technically the ":" is not required, since the first key is written
with fixed length, but a separator provides some limited sanity
checking).

Definition at line 26 of file zeth_address.py.

26  def __str__(self) -> str:
27  """
28  Write the address as "<ownership-key-hex>:<encryption_key_hex>".
29  (Technically the ":" is not required, since the first key is written
30  with fixed length, but a separator provides some limited sanity
31  checking).
32  """
33  a_pk_hex = ownership_key_as_hex(self.a_pk)
34  k_pk_hex = encryption_public_key_as_hex(self.k_pk)
35  return f"{a_pk_hex}:{k_pk_hex}"
36 
Here is the call graph for this function:

◆ parse()

ZethAddressPub zeth.core.zeth_address.ZethAddressPub.parse ( str  key_hex)
static

Definition at line 38 of file zeth_address.py.

38  def parse(key_hex: str) -> ZethAddressPub:
39  owner_enc = key_hex.split(":")
40  if len(owner_enc) != 2:
41  raise Exception("invalid JoinSplitPublicKey format")
42  a_pk = ownership_public_key_from_hex(owner_enc[0])
43  k_pk = encryption_public_key_from_hex(owner_enc[1])
44  return ZethAddressPub(a_pk, k_pk)
45 
46 
Here is the call graph for this function:

The documentation for this class was generated from the following file:
zeth.core.ownership.ownership_key_as_hex
str ownership_key_as_hex(bytes a_sk)
Definition: ownership.py:37
zeth.core.ownership.ownership_public_key_from_hex
OwnershipPublicKey ownership_public_key_from_hex(str key_hex)
Definition: ownership.py:45
zeth.core.encryption.encryption_public_key_as_hex
str encryption_public_key_as_hex(EncryptionPublicKey pk)
Definition: encryption.py:146
zeth.core.encryption.encryption_public_key_from_hex
EncryptionPublicKey encryption_public_key_from_hex(str pk_str)
Definition: encryption.py:150