Secure Operations and Gas
Secure operations are supported via our gcEVM extension, which is implemented through a set of precompiled contracts.
To bring a new private datum into the gvEVM the function's signature should include an argument of type Inputtext
. Then, inside the function, it is necessary to call ValidateCiphertext
, which returns a Garbledtext
if verification succeeds and an error otherwise. Then, the contract is free to save private data temporarily in Memory, by calling Offboard
on the relevant Garbledtext.
This returns a private datum of type Ciphertext
that awaits other commands, namely, the Ciphertext
type cannot serve as an operand to secure operations, rather it should be Onboarded
again and turn into a Garbledtext
first; alternatively, the Ciphertext
may be stored permanently by simply assigning it to a state variable of the contract.
List of Operations and Their Required Gas
Each operation within the network requires a specific amount of gas. It's important to note that the following gas allocations are intended to be proportional and serve as initial estimates. The final determination of gas requirements will be made at a later stage, taking into account various factors such as network performance, usage patterns, and protocol optimizations.
List of operations supported on Garbledtext
and their required gas prices
Operation | Bool | gtUint8 | gtUint16 | gtUint32 | gtUint64 |
---|---|---|---|---|---|
| 12005 | 12040 | 12080 | 12160 | 12320 |
| 12005 | 12042 | 12084 | 12169 | 12339 |
| 12000 | 12000 | 12001 | 12003 | 12006 |
| 12037 | 12080 | 12167 | 12340 | |
| 12080 | 12165 | 12337 | 12679 | |
| 12620 | 14571 | 22467 | 54233 | |
| 12969 | 15960 | 28009 | 76377 | |
| 12969 | 15960 | 28009 | 76377 | |
| 12010 | 12121 | 12249 | 12503 | 13012 |
| 12010 | 12121 | 12249 | 12503 | 13012 |
| 12005 | 12080 | 12166 | 12337 | 12679 |
| 12010 | 12121 | 12249 | 12503 | 13012 |
| 12005 | 12080 | 12165 | 12337 | 12679 |
| 12010 | 12122 | 12249 | 12503 | 13012 |
| 12000 | 12037 | 12079 | 12164 | 12334 |
| 12000 | 12037 | 12079 | 12164 | 12334 |
| 100 | 100 | 100 | 100 | |
| 100 | 100 | 100 | 100 | |
| 12000 |
Other Special Function and Their Required Gas
A more detailed explanation on the functionality of these functions can be found in the following link.
Operation | gtBool | gtUint8 | gtUint16 | gtUint32 | gtUint64 |
---|---|---|---|---|---|
| 12000 | 12000 | 12001 | 12003 | 12006 |
| 12000 | 12000 | 12001 | 12003 | 12006 |
| 47039 | 47039 | 47039 | 47039 | 47039 |
| 47039 | 47039 | 47039 | 47039 | 47039 |
| 47039 | 47040 | 47040 | 47042 | 47045 |
| 47039 | 47040 | 47040 | 47042 | 47045 |
| 6000 | 6000 | 6000 | 6000 | 6000 |
| 6000 | 6000 | 6000 | 6000 | 6000 |
| 12005 | 12041 | 12083 | 12166 | 12332 |
| 12201 | 12413 | 12837 | 13685 | |
| 12301 | 12619 | 13255 | 14527 |
Last updated