  In recent years, the confidentiality of smart contracts has become a
fundamental requirement for practical applications. While many efforts have
been made to develop architectural capabilities for enforcing confidential
smart contracts, a few works arise to extend confidential smart contracts to
Multi-Party Computation (MPC), i.e., multiple parties jointly evaluate a
transaction off-chain and commit the outputs on-chain without revealing their
secret inputs/outputs to each other. However, existing solutions lack public
verifiability and require O(n) transactions to enable negotiation or resist
adversaries, thus suffering from inefficiency and compromised security. In this
paper, we propose Cloak, a framework for enabling Multi-Party Transaction (MPT)
on existing blockchains. An MPT refers to transitioning blockchain states by an
publicly verifiable off-chain MPC. We identify and handle the challenges of
securing MPT by harmonizing TEE and blockchain. Consequently, Cloak secures the
off-chain nondeterministic negotiation process (a party joins an MPT without
knowing identities or the total number of parties until the MPT proposal
settles), achieves public verifiability (the public can validate that the MPT
correctly handles the secret inputs/outputs from multiple parties and
reads/writes states on-chain), and resists Byzantine adversaries. According to
our proof, Cloak achieves better security with only 2 transactions, superior to
previous works that achieve compromised security at O(n) transactions cost. By
evaluating examples and real-world MPTs, the gas cost of Cloak reduces by 32.4%
on average.
