Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
Functions
zecale.core.proto_utils Namespace Reference

Functions

AggregatorConfiguration aggregator_configuration_from_proto (aggregator_pb2.AggregatorConfiguration aggregator_config_proto)
 
aggregator_pb2.NestedTransaction nested_transaction_to_proto (IZKSnarkProvider zksnark, NestedTransaction tx)
 
AggregatedTransaction aggregated_transaction_from_proto (IZKSnarkProvider zksnark, aggregator_pb2.AggregatedTransaction aggregated_transaction_proto)
 

Function Documentation

◆ aggregated_transaction_from_proto()

AggregatedTransaction zecale.core.proto_utils.aggregated_transaction_from_proto ( IZKSnarkProvider  zksnark,
aggregator_pb2.AggregatedTransaction   aggregated_transaction_proto 
)
Convert a generic protobuf AggregatedTransactionRequest to an in-memory
AggregatedTransaction

Definition at line 38 of file proto_utils.py.

39  zksnark: IZKSnarkProvider,
40  aggregated_transaction_proto: aggregator_pb2.AggregatedTransaction
41 ) -> AggregatedTransaction:
42  """
43  Convert a generic protobuf AggregatedTransactionRequest to an in-memory
44  AggregatedTransaction
45  """
46  app_name = aggregated_transaction_proto.application_name
47  extproof = zksnark.extended_proof_from_proto(
48  aggregated_transaction_proto.extended_proof)
49  nested_parameters = list(aggregated_transaction_proto.nested_parameters)
50  return AggregatedTransaction(app_name, extproof, nested_parameters)
Here is the caller graph for this function:

◆ aggregator_configuration_from_proto()

AggregatorConfiguration zecale.core.proto_utils.aggregator_configuration_from_proto ( aggregator_pb2.AggregatorConfiguration   aggregator_config_proto)

Definition at line 13 of file proto_utils.py.

14  aggregator_config_proto: aggregator_pb2.AggregatorConfiguration
15 ) -> AggregatorConfiguration:
16  return AggregatorConfiguration(
17  nested_snark_name=aggregator_config_proto.nested_snark_name,
18  wrapper_snark_name=aggregator_config_proto.wrapper_snark_name,
19  nested_pairing_parameters=pairing_parameters_from_proto(
20  aggregator_config_proto.nested_pairing_parameters),
21  wrapper_pairing_parameters=pairing_parameters_from_proto(
22  aggregator_config_proto.wrapper_pairing_parameters))
23 
24 
Here is the caller graph for this function:

◆ nested_transaction_to_proto()

aggregator_pb2.NestedTransaction zecale.core.proto_utils.nested_transaction_to_proto ( IZKSnarkProvider  zksnark,
NestedTransaction  tx 
)

Definition at line 25 of file proto_utils.py.

26  zksnark: IZKSnarkProvider,
27  tx: NestedTransaction) -> aggregator_pb2.NestedTransaction:
28  assert isinstance(tx, NestedTransaction)
29  tx_proto = aggregator_pb2.NestedTransaction()
30  tx_proto.application_name = tx.app_name
31  tx_proto.extended_proof.CopyFrom( # pylint: disable=no-member
32  zksnark.extended_proof_to_proto(tx.ext_proof))
33  tx_proto.parameters = tx.parameters
34  tx_proto.fee_in_wei = tx.fee_in_wei
35  return tx_proto
36 
37 
Here is the caller graph for this function:
zecale.core.proto_utils.nested_transaction_to_proto
aggregator_pb2.NestedTransaction nested_transaction_to_proto(IZKSnarkProvider zksnark, NestedTransaction tx)
Definition: proto_utils.py:25
zecale.core.proto_utils.aggregated_transaction_from_proto
AggregatedTransaction aggregated_transaction_from_proto(IZKSnarkProvider zksnark, aggregator_pb2.AggregatedTransaction aggregated_transaction_proto)
Definition: proto_utils.py:38
zecale.core.proto_utils.aggregator_configuration_from_proto
AggregatorConfiguration aggregator_configuration_from_proto(aggregator_pb2.AggregatorConfiguration aggregator_config_proto)
Definition: proto_utils.py:13