Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
zeth_get_verification_key.py
Go to the documentation of this file.
1 # Copyright (c) 2015-2022 Clearmatics Technologies Ltd
2 #
3 # SPDX-License-Identifier: LGPL-3.0+
4 
5 from click import command, option, Context, pass_context
6 
7 from zeth.cli.utils import create_prover_client
8 import json
9 from typing import Optional
10 
11 
12 @command()
13 @option("--vk-out", "-o", help="Output file")
14 @pass_context
15 def get_verification_key(ctx: Context, vk_out: Optional[str]) -> None:
16  """
17  Command help text.
18  """
19 
20  # Get the VK (proto object)
21  client_ctx = ctx.obj
22  prover_client = create_prover_client(client_ctx)
23  vk = prover_client.get_verification_key()
24  vk_json = vk.to_json_dict()
25 
26  # Write the json to stdout or a file
27  if vk_out:
28  with open(vk_out, "w") as vk_f:
29  json.dump(vk_json, vk_f)
30  else:
31  print(json.dumps(vk_json))
zeth.cli.utils.create_prover_client
ProverClient create_prover_client(ClientConfig ctx)
Definition: utils.py:373
zeth.cli.zeth_get_verification_key.get_verification_key
None get_verification_key(Context ctx, Optional[str] vk_out)
Definition: zeth_get_verification_key.py:15
zeth.cli.utils
Definition: utils.py:1