-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add a notary service #2646
Comments
My questions:
|
|
I think it is possible to allow non-native contracts to have |
A new interoperable function? |
|
Non-native contracts can't be executed safely unless they're limited in GAS. And onPersist can't fail, that's something we can't guarantee for non-native contracts too. |
Summary or problem description
This is a summary , discussed in detail is in issue #1573
In the current system, if a multi-signature operation needs to be completed, manual or third-party websites are required. There is no mechanism in the system that can automatically complete the collection and distribution of multi-signature signatures. So the purpose of this proposal is to add a multi-signature signature automatic collection and sending mechanism to neo.
Structure
The design mainly involves changes to the following components:
Core
Plugin
Details
NotaryContract
Contains the following methods:
deposit
Parameters: uint160(from), uint160(to), integer(amount), integer(till)
The deposit method. User needs to deposit the prepayment first when using the notary service. You can specify the address, amount, and validity period. It cannot be withdrawn before the expiration date. The minimum deposit amount is 2.
withdraw
Parameters: uint160(from), uint160(to)
The withdraw method, after the validity period of the deposit amount expires, the remaining funds can be withdraw.
balanceOf
Parameters: uint160(addr)
Query the balance
expirationOf
Parameters: uint160(addr)
Query the validity period
verify
To verify the validity of the multi-signature transaction using the notary service.Use the notary contract as the signer, which must include one of the signatures of the specified notarynode node, so as to achieve the effect of 1/n
onPersist
Execute when the block is persisted, and distribute the service fee of all legal transactions using the "Notary assisted" attribute to the notary node
NotaryRequest
P2P message type, 2 incomplete transactions are encapsulated inside
mainTx
Contains the "Notary assisted" attribute and the number of corresponding NKEYS. It is the actual multi-signature transaction, but does not contain the complete multi-signature signature
fallbackTx
Contains the "NotValidBefore" attribute and the number of NKEYS with a value of 0, includes the "Conflict" attribute and the corresponding mainTx hash, and includes the "NotValidBefore" attribute and the corresponding transaction effective height
Message verification
Role
Notary nodes, all nodes that have the NotaryService plugin installed and authorized by the governance committee
NotaryService plugin
The plugin installed by the Notary node will actively monitor and collect NotaryRequest requests in the network, and actively send multi-signature transactions that have collected enough signatures within the validity period, and send the corresponding fallback transaction after the validity period
Process
Incentives
If NotaryNode does not work properly, it will not get incentives. If it works normally, it will receive (NKEYS+1)×FEE amount of gas as a service fee. Even if due to certain circumstances, it is not possible to collect enough signatures within the validity period, NotaryNode can also receive a service fee by sending a fallback transaction
Attack
Malicious multi-sign user
Because the user needs to deposit some gas to the multi-signature address first, and this part of the gas is locked, it can only be withdraw after the validity period expires, and each transaction will be charged a service fee regardless of whether it is successful or not, so it can prevent malicious users from sending spam transactions block the network
Malicious notary node
If the malicious notary node does nothing, it will not receive any incentives. When the signature is collected correctly, the incentive obtained is greater than the incentive obtained when the transaction is deliberately delayed,.And we only need one node in Notary node is normal to complete the entire work.
In addition, due to the "conflicting" attribute of the transaction, the malicious NotaryNode cannot send main transaction and fallback transactions at the same time to collect excess incentives.
For more detailed instructions, please refer to the issue #1573
Neo Version
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: