Installation and usage of the platform
gRPC: transfer of confidential smart contract data¶
The gRPC ContractPublicService is used to transfer confidential smart contracts data.
The service has a single method described in the confidential_contract_service.proto protobuf file:
The field data types for requests and responses are specified in the protobuf file.
The ConfidentialCall method call is only available when you use an oAuth token with ConfidentialContractUser role or a special api-key.
The ConfidentialCall method accepts the ConfidentialCalRequest containing the following fields:
broadcast– the flag that marks the need to broadcast the generated CallContract transaction; the field defaults to
falsevalue is used to form an atomic container;
commitmentVerification– the flag that marks the necessity of input data commitment reconciliation and the need for the user to provide a key for commitment generation; the field defaults to
falseis set, the node generates the key randomly and calculates the commitment;
sender– the address of the sender of the confidential smart contract data;
contractId– the confidential smart contract identifier;
contractVersion– the confidential smart contract version;
params– when working with CallContract transaction, the field holds input data of the confidential smart contract, represented as an array of objects; data is entered using the following fields:
key– the parameter key;
type– the parameter data type;
value– the parameter value.
timestamp– a timestamp in Unix Timestamp format (in milliseconds) marking the time when the smart contract was invoked;
atomicBadge– the flag that marks if the transaction can be included in an atomic transaction;
fee– the transaction fee;
feeAssetId– fee token identifier;
commitmentKey– the commitment key.
The ConfidentialCall method takes all the data needed to send a CallContract transaction, sends it, and returns a protobuf that includes the CallContract version 6 transaction and the confidentialInput of the confidential smart contract in the response.
The POST /confidential-contracts/call REST method is similar to the ConfidentialCall gRPC method.