Skip to content

Commit

Permalink
fix the mixer_client
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyanho committed Sep 17, 2020
1 parent 1e2e4a7 commit 14f281a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zeth/mixer_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def create_zeth_notes(
trap_r=trap_r0)

rho1 = _compute_rho_i(phi, hsig, 1)
print("rho1: ", rho1.hex())
trap_r1 = trap_r_randomness()
note1 = ZethNote(
apk=ownership_key_as_hex(recipient1),
Expand Down Expand Up @@ -172,9 +173,9 @@ def compute_commitment(zeth_note: ZethNote) -> bytes:
apk = digest_to_binary_string(bytes.fromhex(zeth_note.apk))
first_94bits_apk = apk[:94]
rho = digest_to_binary_string(bytes.fromhex(zeth_note.rho))
first_96bits_rho = rho[:96]
first_94bits_rho = rho[:96]
value = digest_to_binary_string(bytes.fromhex(zeth_note.value))
left_leg_bin = first_94bits_apk + first_96bits_rho + value + "00"
left_leg_bin = first_94bits_apk + first_94bits_rho + value + "00"
left_leg = int(left_leg_bin, 2)
inputs.append(left_leg)
cm_field = poseidon(inputs).to_bytes(32, byteorder="big")
Expand Down Expand Up @@ -478,7 +479,8 @@ def create_mix_parameters_keep_signing_key(
mk_paths = []
for mk_tree in mk_trees:
mk_roots.append(mk_tree.get_root())
print("merkle_roots: ", mk_roots)
print("merkle_root0: ", mk_roots[0].hex())
print("merkle_root1: ", mk_roots[1].hex())
mk_paths.append(compute_merkle_path(inputs[0][0], mk_trees[0]))
mk_paths.append(compute_merkle_path(inputs[1][0], mk_trees[1]))
#mk_paths = [compute_merkle_path(addr, mk_tree) for addr, _ in inputs]
Expand Down

0 comments on commit 14f281a

Please sign in to comment.