-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Privacy Precompile: enables private transactions with extended obfuscated fields #1234
Privacy Precompile: enables private transactions with extended obfuscated fields #1234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may have an issue with mps
ATs, checking that locally.
[ {
"file" : "src/specs/01_basic/extend_private_contract.spec",
"line" : 1,
"col" : 1,
"message" : "Scenario: Extend contract to a new party, creator cancels extension 1%0AStep: <fromNode> cancels <contractName>%0AConcept Execution Failure: 'org.opentest4j.AssertionFailedError: %0AExpecting:%0A <org.web3j.protocol.core.Response$Error@237a1875>%0Ato be equal to:%0A <null>%0Abut was not.'"
} ]
return tx, nil | ||
} | ||
|
||
type mockTransactor struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we generate that mock with an interface?
@@ -581,6 +581,10 @@ func (tx *Transaction) SetPrivate() { | |||
} | |||
} | |||
|
|||
func (tx *Transaction) IsPrivacyMarker() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (tx *Transaction) IsPrivacyMarker() bool { | |
func (tx *Transaction) HasPrivacyMarker() bool { |
many "is privacy marker" changes, I prefer with has, or use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't changed since the PR was originally reviewed. We don't want to make further changes at this late stage now.
return tx, nil | ||
} | ||
|
||
type mockTransactor struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't changed since the PR was originally reviewed. We don't want to make changes at this late stage.
@@ -533,7 +533,7 @@ func (api *SignerAPI) SignTransaction(ctx context.Context, args SendTxArgs, meth | |||
result SignTxResponse | |||
msgs *ValidationMessages | |||
) | |||
if args.IsPrivate { | |||
if args.IsPrivate || args.isPrivacyMarker() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if args.IsPrivate || args.isPrivacyMarker() { | |
if args.IsPrivate || args.hasPrivacyMarker() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't changed since the PR was originally reviewed, so we'd prefer not to make changes now.
@baptiste-b-pegasys this PR requires a change to the atests - I am in the process of preparing that PR |
…r transaction in ABI (#6)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Introduction
Add support for privacy precompiled contract to orchestrate the execution of private transactions. This new approach allows extending the obfuscated fields of a private transaction.
So far
data
field was the only obfuscated field of a private transaction, other fields were visible from non-participants node. This new precompiled contract approach allows to obfuscatedata
,to
, andgasLimit
. In some future enhancement, we could use this same approach to obfuscate thesender
address.This introduces the concept of Privacy Marker Transactions (PMT), which is a standard public transaction sent to the privacy precompiled contract to get private transactions executed
to
field is always be set to privacy precompiled at address0x000000000000000000000000000000000000007a
data
field is set to the Tessera key of the extended private transactionWhen processing a PMT the privacy precompile of participant nodes executes the extended private transaction corresponding to the Tessera key in PMT
data
. The final execution of the private transaction is identical to the usual private transaction in particular it is the private state of participants that is mutated.New JSON-RPC methods
eth_distributePrivateTransaction
enables to push a private transaction payload to Tesseraeth_getPrivacyPrecompileAddress
that returns the precompile address (so far this is fixed to0x000000000000000000000000000000000000007a
)Configuration
"privacyPrecompileBlock": 0,
underconfig
section which defines block number, after which privacy precompiled contract is enabled--privacymarker.enable
flag when starting nodeTransaction flow details
Private Transaction Submission
Node signing
eth_sendTransaction
as normal in particular passingprivateFor
andto
field set to the private contract address (or nil for contract deployment)data
is the private hash of the transaction stored in Tessera.to
is the privacy precompile address0x000000000000000000000000000000000000007a
External signing
privateFor
andto
field set to the private contract address (or nil for contract deployment)eth_distributePrivateTransaction
with the externally signed private transaction. On this call, GoQuorum pushes the private transaction payload to Tessera that encrypts it and returns private tx manager hashdata
should be the private tx manager hash got on previous call toeth_distributePrivateTransaction
to
should be the privacy precompile address0x000000000000000000000000000000000000007a
eth_sendRawTransaction
Transaction Processing
When executing the PMT
data
field as private hash