bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 6쪽 중 2쪽
• Performance. With the objective of optimizing real-time transaction processing involving private
data, having pre-prepared garbled circuits enables nodes participating in the Evaluation phase to
achieve a high transaction throughput. The low-latency characteristic of garbled-circuit-based MPC
ensures that the number of communication rounds between nodes is constant and does not depend on
the number of parties involved or the complexity of the transaction. Crucially, the technologies un-
derpinning both the Garbling and Evaluation phases are ready for implementation on current devices
(including smartphones), without the need for specialized hardware or awaiting significant advance-
ments in research.
• End-user experience . Maintaining an unaltered security experience (as highlighted in the security
discussion), submitting private data to the network resembles sending data over a TLS channel, em-
ploying a symmetric-key encryption scheme. This means devices today are already equipped to inter-
act with the network using standard protocols and widely known software libraries. This compatibility
extends to software operating on personal computers, web browsers, smartphones, smart sensors, and
potentially any IoT device.
This holistic approach to on-chain privacy underscores our dedication to ensuring security, privacy, effi-
ciency, and a user-centric experience, thereby setting a new standard for privacy in the digital domain.
2.2 Introduction of gcEVM
Ethereum virtual machine (EVM) is the leading blockchain-native virtual machine, interleaving computer
architecture aspects with incentive mechanisms, which made it the first state-transition engine for a decen-
tralized and permissionless general system. One of the main obstacles to the mass adoption of the EVM is
its lack of confidentiality, leaving all information public, which is obviously not in par with what businesses,
communities, and individuals expect from a system. To this end, we introduce the gcEVM, an extension
to the EVM that supports confidentiality by offering a series of functionalities for keeping private data and
performing operation on it without ever exposing it (unless required by the execution itself). Because of the
nature of the EVM, where everything is visible, handling ciphertexts must be meticulously done, in order
to protect those ciphertexts from theft, replication, etc. We demonstrate our solution via Garbled Circuit,
hence the extension is called gcEVM.
In the rest of this section we give the necessary background on the EVM and argue about the importance of
confidentiality in the EVM for a real impact. We briefly describe the notion of garbled circuits and garbling
protocols and lastly we describe our EVM extension that relies on a garbling protocol.
6
2.3 Background on the EVM
The EVM’s Accounts and State . At a very high-level, the EVM takes an ordered list of valid transactions
and executes them. Execution of transactions may change the state of the machine and so, in an abstract way,
we refer to this execution process as the state-transition function of the machine. The state of the EVM is
composed of many sub-states, each is associated with an account (also known as address); and these accounts
may be either external or internal. An external account (also known as externally owned account, or EOA)
is an account that may initiate a transaction whereas an internal account (also known as a smart contract)
only reacts to requests that were initiated by EOAs. In the following, we use the terms internal account’
and smart contract’ interchangeably. The sub-state associated with every account contains its balance and
nonce, where balance refers to the number of coins that account owns’ and the nonce refers to the number
of transactions that account has issued so far, such that each newly issued transaction increment that number
by exactly one; the latter is used as a protection from replay attacks so that no transaction may by launched
twice. Since internal accounts (smart contract) cannot really initiate transactions, their nonce is incremented
only when they trigger the creation of a new internal account, thus, the nonce of a smart contract simply
refers to the number of other smart contracts that they have created. While the sub-state associated with an
EOA consists of its balance and nonce only, the sub-state of a smart contract may additionally contain an
arbitrary data structure along with a set of interfaces (or methods) that can change its sub-state (either its
balance, nonce, or the additional data structure).
Transactions may be simple or complex; in a simple transaction an EOA transfers some amount of the
native coin to another account (external or internal); in a complex transaction an EOA may either create a
new smart contract (also referred as smart contract deployment) or call a method of an already existing smart
contract. In the latter, the reaction of the smart contract to that call may involve further calls to methods
of (potentially other) smart contracts, and so on. This way, a complex transaction initiated by an EOA may
trigger a chain-reaction that causes changes in multiple sub-states. On the other hand, a complex transaction
may also cause no change to any sub-state at all. When a method is said to be a view-method it is guaranteed
that it never changes any sub-state, which implies that it can call only other view-methods.
The EVM’s Execution, Memory and Storage . Execution in the EVM is fueled by gas, which is paid
in the native coin (Ether in Ethereum) and serves as a measure of computational effort. This gas is paid
from the balance of the EOA that initiates the transaction. Each operation within the EVM, from arithmetic
calculations to data storage, consumes a certain amount of gas, incentivizing efficiency and preventing
network abuse (e.g., mounting a denial-of-service attack by sending an infinite stream of transactions).
Memory management in the EVM is unique; it maintains a volatile memory store (simply called memory’
hereafter) during execution but does not retain it after the execution completes. This memory is linear
(instantiated with a stack data structure) and expands as needed by a contract’s execution but is wiped
clean after the process ends. For persistent storage, the EVM utilizes a key-value store known as storage’,
which persists between transactions but is significantly more costly in terms of gas to utilize. This design
encourages developers to optimize their use of storage and memory, balancing the need for persistent data
against the gas costs of operations, ensuring that the EVM remains scalable and efficient. The storage is the
one that manages the EVM’s state, and so each sub-state is maintained as an isolated key-value store.
Let us describe a typical execution process: When a smart contract method is called, and it needs to read data
from its storage (e.g., a variable value), the EVM fetches this data from the contract’s storage (a sub-state)
and loads it into memory for quick access during this specific execution. This is done through specific EVM
opcodes such as sload, which reads data from the variable’s location at the storage. The data read is then
available in memory for processing or computation during the contract execution. After the smart contract
7
performs computations or manipulates data within the memory, there may be a need to persist some of this
data back to storage. To store data back from memory to storage, the contract uses opcodes like sstore. This
opcode takes the data from memory and writes it to the specified location in the contract’s storage.
Data Passing Between Smart Contracts. The EVM facilitates data passing from one contract to another via
a function call; it employs a mechanism that allows contracts to interact and invoke functions on each other.
This process is foundational to the composability and interoperability of smart contracts on the Ethereum
platform.
When a contract (caller) wants to invoke a function on another contract (callee), it specifies the callee’s
address and the function to be called, along with any arguments required by that function. This can be
done using op-codes like call and delegatecall. The data passed to the callee includes information about the
function to be executed (identified by its signature) and the arguments for that function. The callee contract
then executes the specified function using the provided arguments. This execution can read from or write
to the callee’s storage, depending on the function’s logic, and eventually gets back to the caller contract
using the opcode ret. A run-time variable, called depth, is incremented on every function call (to a different
contract) and decremented when the function returns to the caller.
Error Handling. The notion of reverting a transaction or a contract call is a fundamental concept designed
to ensure the integrity and security of smart contract operations. A revert operation undoes all changes made
to the state during a transaction or call, except for the consumption of gas, and returns an error message
to the caller. This mechanism is crucial for handling errors and ensuring that failed transactions do not
alter the blockchain state in an unintended manner. A revert error is triggered intentionally by using the
revert statement in Solidity or when conditions specified by require statements are not met. It’s used to
handle logical errors in contract execution, where a certain condition or prerequisite is not satisfied. The gas
consumed up to the point of revert is not refunded, but any remaining gas is.
An assert function is used in Solidity to handle internal errors and to check for invariants within the code.
If an assert statement fails, it indicates a serious bug in the contract code, leading to a panic’ error. Unlike
revert, assert failures consume all the gas provided with the transaction, signaling a more severe form of
error that should not occur during normal operation.
Other types of error are possible in the EVM, like out-of-gas, stack overflow or underflow, invalid opcode,
and more, each has a different cause and consequences on the EVM.
2.4 The EVM’s (lack of) Confidentiality
One of the most controversial properties of the EVM is that everything is public, meaning that the sub-
state of smart contracts, which may include financial, social (and practically any kind of) information, is
completely visible to all. As we argue below, this property of the EVM is a double-edged sword, which, for
a long time, formed a dichotomy between decentralization and adoption.
On the one hand, this fact played as key-contributor to the decentralization of Ethereum (who is the first to
deploy an EVM), as it allows anyone with a computer to run it and take part in the execution of agreed upon
lists of transactions (with an adequate financial incentive mechanism); thereby increasing the validity of the
system’s state, or in other words, increasing the trust that the information laying in the state is the product
of correct execution of the past transactions.
On the other hand, the fact that everything is visible to all poses a significant setback to the usability and
8
adoption of the EVM. To date, the EVM’s prominent use-case is de-fi, which paved the way to collaborative
liquidity pools and automatic movement of funds. In many cases however, de-fi is used by bad actors for
scam (e.g., rug pools’), fraud (e.g., money laundering), and many times is considered as funds streaming
in a loop’ with no real impact. Arguably, one of the reasons for this is the lack of confidentiality, leaving
honest actors (smart contracts, DAOs and users) unable to prove and verify each other’s identity, thereby be-
ing more vulnerable to exploits and manipulations. Furthermore, the lack of confidentiality sets an obstacle
to real social impact, as most real world social activities deal with private information that must be treated
adequately. For example, an election requires the independence of votes and the freedom to vote one’s opin-
ion without fearing any consequences. Sealed bid auction, as another example, requires an independence of
bids as well as their confidentiality, since public bids expose the bidder’s sensitive financial state.
2.5 Garbled Circuits
In this section we use a variation of the notation and definitions from ‘ F oundations of Garbled Circuits’ by
Bellare, Hoang and Rogaway [ BHR12].
2.5.1 Circuits
For simplicity, we consider circuits with fan-in of two, even though our solution is not limited to those.
A circuit is a six-tuple f = ( n, m, q, A, B, G), where n≥ 2 is the number of inputs, m≥ 1 is the number
of outputs, and q≥ 1 is the number of gates. The inputs, wires, outputs, and gates sets are indexed by
Inputs ={1, . . . , n}, Wires ={1, . . . , n + q}, Outputs ={n + q− m + 1, . . . , n + q}, and Gates =
{n + 1, . . . , n+ q}, respectively. Then, the functions A and B are of the form Gates→ Wires\ Outputs,
where A(g) (resp. B(g)) returns the first, or left, (resp. second, or right) incoming wire of gate g. Finally,
G is a function of the form Gates× V 2→ V , where V is the domain of values that wires can take. Here V
is defined abstractly while typically it is defined by finite group, ring or field. For instance, many times V
is instantiated by the domain V = F2 ={0, 1} and the function G, which define a binary (Boolean) gates;
alternatively, it can be defined by V = F for some finite field F and G, which define arithmetic gates over F.
The above embodies the following. Gates have fan-in of two (two inputs), arbitrary functionality, and
arbitrary fan-out (an output wire may serve as an incoming wire to unlimited number of gates). The wires
are numbered 1 to n + q. Every non-input wire is the outgoing wire of some gate. The i-th value of an input
is presented along wire i. The i-th value of an output is collected off wire n + q− m + i. The outgoing wire
of each gate serves as the name of that gate. Output wires may not be input wires and may not be incoming
wires to gates. No output wire may be twice used in the output. Requiring A(g) < B (g) < g ensures that
the directed graph corresponding to circuit f is acyclic, and that no wire twice feeds a gate; the numbering
of gates comprise a topological sort.
Circuit evaluation. The canonical evaluation function evcirc takes a circuit f and a list of inputs x =
x1, x2, . . . , xn and returns a list of outputs xn+q−m+1, . . . , xn+q. See Listing 1 for a formal description:
2.5.2 Garbling Schemes
A garbling scheme is a five-tuple of algorithmsG = (Gb, En, De, Ev, ev), where Gb is probabilistic and the
rest are deterministic. Let f = (n, m, q, A, B, G) be a circuit that we wish to garble. Recall that f represent
a function of the form V n→ V m. On input f and a security parameter κ∈ N, the garbling algorithm
Gb returns the triple (F, e, d)← Gb(1κ, f), where e describes an encoding function, En(e,·), that maps an
initial input x∈ V n to a garbled input X = En(e, x); F describes a garbled circuit, Ev(F,·), that maps
9
Algorithm 1 Canonical Evaluation evcirc(f, x)
1: (n, m, q, A, B, G)← f .
2: for g← n + 1 to g← n + q do
3: a← A(g) and b← B(g)
4: xg← G(g, xa, xb)
5: end for
6: return xn+q−m+1, . . . , xn+q
each garbled input X to a garbled output Y = Ev(F, X); and d describes a decoding function, De(d,·) that
maps a garbled output Y to a final output y = De(d, Y )∈ V m.
Projective garbling schemes. A common approach in existing garbling schemes is for e to consist of a
vector of sets of labels, such that a set of labels Li is associated with the i-th input or output wire ( i∈
{1, . . . , n}∪{ n + q− m + 1, . . . , n+ q}). For example, if the circuit is Boolean then we have V ={0, 1}
and there are two labels for the i-th input wire, namely, Li ={L0i , L1i}. The encoding function En(e,·)
then uses the values x = x1, . . . , xn to select from e = ( L1, . . . , Ln) the subvector X = ( X1, . . . , Xn) =
(Lx11 , . . . , Lxnn ).
2.5.3 Example: Secure Two-Party Computation (2PC) via Garbled Circuits
Garbling schemes were originally designed as a solution for secure two-party computation, which work
as follows. Suppose Alice has nA inputs, denoted xA = ( x1, . . . , xnA) and Bob has nB inputs, denoted
xnA+1, . . . , xnA+nB , where xi ∈ {0, 1} for all i, and n = nA + nB. Alice and Bob wish to securely
compute the circuit f = ( n, m, q, A, B, G) over their joint inputs x1, . . . , xn. Alice and Bob can use a
garbling scheme to do so, as shown in Algorithm 2 in which Alice and Bob take the roles of the Garbler
and Evaluator, respectively. The garbler (Alice) generates the garbled circuit F and its own garbled input
XA, and sends both to the evaluator (Bob). Then, the evaluator obtains its own garbled input XB via a
cryptographic protocol called oblivious transfer (OT). Finally, using the garbled circuit and the garbled
inputs, the evaluator can obtain the garbled output Y and using the decoding information d it can obtain the
actual (plaintext) output y.
Algorithm 2 Secure Two-Party Computation f (xA, xB)
1: Interpret (n, m, q, A, B, G)← f .
2: Alice (the garbler) computes (F, e, d)← Gb(1κ, f) (κ is the security parameter).
3: Alice computes her garbled input XA = En(e, xA).
4: Alice sends F, d and XA to Bob.
5: Alice and Bob invoke a two-party protocol calledoblivious transfer (OT). In this protocol Alice privately
has e and Bob privately has xB, and Bob (and only Bob) obtains the output XB = En(e, xB).
6: Bob computes Y = Ev(F, X) where X is the concatenation of XA and XB.
7: Bob computes y = De(d, Y ) which is the output of the computation. At this stage Bob may share
that output with Alice; in case Bob is suspicious of being malicious other security measurements are in
place.
Security notions of garbling schemes. Garbling schemes may be associated with different security guar-
antees, like privacy, obliviousness, authenticity, and more; in our context we are mostly interested in privacy
and authenticity. In a high level, privacy refers to the fact that the evaluator is unable to tell which actual
10
(plaintext) value passes through wires of the circuit, even after having the garbled circuit and the garbled
inputs (unless it has prior information about those values). Authenticity means that the evaluator cannot
produce garbled output Y ′ that is different than the correct garbled output Y that is obtained through honest
evaluation of the garbled circuit.
Extension to Secure Multiparty Computation (MPC). The above is an example of how to distribute
the computation of f between two parties where each party holds part of the inputs. In our context, we are
interested in secure computation that can be executed by many parties where the private inputs themselves
might not even be theirs, e.g., private input may contain some identity information of a client (who is not
necessarily running an execution node). In a very high level, this is solved by two techniques, the first
is cryptographic secret sharing and the second is multiparty garbling protocol . In such a solution, an
external client is the one who holds the private input and the execution parties are responsible for holding
it securely and performing secure computation over it when needed. 2. The client’s private data is stored by
the execution parties in a way that requires many of them to behave maliciously in order to disclose that
data, otherwise, no information can be inferred about that data. With regard to computation over such secret
shared data, the parties invoke a garbling protocol that can be run by many parties. V arious protocols for
multiparty garbling have been proposed in the literature since the ’90, optimizing for various metrics like
communication rounds, bandwidth and computation complexity. The protocol that we use for the gcEVM
(see next section) is fundamentally different than those protocols, although building on similar techniques.
2.6 The gcEVM
The gcEVM involves extension of the EVM in multiple dimensions. 프로젝트로 돌아가기