[SON ETH] Implement ethereum multi-sign #381

Closed
opened 2022-06-01 13:22:24 +00:00 by pavel.baykov · 10 comments
pavel.baykov commented 2022-06-01 13:22:24 +00:00 (Migrated from gitlab.com)
  • bool sidechain_net_handler_hive::process_withdrawal(const son_wallet_withdraw_object &swwo) processes single son_wallet_withdraw_object, which stores information about withdrawal request picked up by listener
  • First part of this function, between two comment lines //=====, builds Hive transaction with transfer operation, and serializes it to a string
  • Second part, creates proposal for creating sidechain_transaction_object, which will store the Hive transaction, and list of signers expected to sign this transaction
  • std::string sidechain_net_handler_hive::process_sidechain_transaction(const sidechain_transaction_object &sto) processes single sidechain_transaction_object, which contains a transaction string to sign, and list of expected signers. This is basically our signing function, that will sign serialized transaction using SON private key, if the SON is in a list of expected signers.
  • Returned signature will be stored in a db by sidechain_transaction_sign_operation. Once we collect enough signatures (this is checked in sidechain_transaction_sign_operation evaluator), we are ready to broadcast the transaction
  • std::string sidechain_net_handler_hive::send_sidechain_transaction(const sidechain_transaction_object &sto) will merge serialized transaction and collected signatures into a form that is suitable for broadcastin, and broadcast the transaction
    So, in order to implement signing, you need to implement ONLY process_sidechain_transaction function in a sidechain net handler for ethereum.
- bool sidechain_net_handler_hive::process_withdrawal(const son_wallet_withdraw_object &swwo) processes single son_wallet_withdraw_object, which stores information about withdrawal request picked up by listener - First part of this function, between two comment lines //=====, builds Hive transaction with transfer operation, and serializes it to a string - Second part, creates proposal for creating sidechain_transaction_object, which will store the Hive transaction, and list of signers expected to sign this transaction - std::string sidechain_net_handler_hive::process_sidechain_transaction(const sidechain_transaction_object &sto) processes single sidechain_transaction_object, which contains a transaction string to sign, and list of expected signers. This is basically our signing function, that will sign serialized transaction using SON private key, if the SON is in a list of expected signers. - Returned signature will be stored in a db by sidechain_transaction_sign_operation. Once we collect enough signatures (this is checked in sidechain_transaction_sign_operation evaluator), we are ready to broadcast the transaction - std::string sidechain_net_handler_hive::send_sidechain_transaction(const sidechain_transaction_object &sto) will merge serialized transaction and collected signatures into a form that is suitable for broadcastin, and broadcast the transaction So, in order to implement signing, you need to implement ONLY process_sidechain_transaction function in a sidechain net handler for ethereum.
pavel.baykov commented 2022-06-01 13:22:24 +00:00 (Migrated from gitlab.com)

assigned to @pavel.baykov

assigned to @pavel.baykov
pavel.baykov commented 2022-06-01 13:24:50 +00:00 (Migrated from gitlab.com)

So, the shortest description is this:

  • process_primary_wallet is where a transaction for updating primary wallet will be created, serialized and saved into sidechain_transaction_object
  • process_withdrawal is where a transaction for paying out the user will be created, serialized and saved into sidechain_transaction_object
  • process_sidechain_transaction is where transaction signing by SON private key is implemented
  • send_sidechain_transaction is where transactions and signatures are merged into broadcastable form and broadcasted
  • settle_sidechain_transaction is where we are confirming that our transaction is actually and safely executed on a sidechain (eg, we wait for certain number of confirmations on bitcoin, or we wait for our transaction to get behind LIB on Hive)
    Note that some of these functions are executed only by scheduled son, and some by any son available. eg signing is executed by any son available, and broadcasting only by scheduled son.
    this way we avoid eg multiple broadcasting of the same transaction, but we also speed up things - we are able to collect all SON signatures in few seconds - we do not have to wait for son to become scheduled in order to collect its signature.
So, the shortest description is this: - process_primary_wallet is where a transaction for updating primary wallet will be created, serialized and saved into sidechain_transaction_object - process_withdrawal is where a transaction for paying out the user will be created, serialized and saved into sidechain_transaction_object - process_sidechain_transaction is where transaction signing by SON private key is implemented - send_sidechain_transaction is where transactions and signatures are merged into broadcastable form and broadcasted - settle_sidechain_transaction is where we are confirming that our transaction is actually and safely executed on a sidechain (eg, we wait for certain number of confirmations on bitcoin, or we wait for our transaction to get behind LIB on Hive) Note that some of these functions are executed only by scheduled son, and some by any son available. eg signing is executed by any son available, and broadcasting only by scheduled son. this way we avoid eg multiple broadcasting of the same transaction, but we also speed up things - we are able to collect all SON signatures in few seconds - we do not have to wait for son to become scheduled in order to collect its signature.
serkixenos commented 2022-06-01 14:40:45 +00:00 (Migrated from gitlab.com)

changed title from {-i-}mplement ethereum multi-sign to {+[SON ETH] I+}mplement ethereum multi-sign

changed title from **{-i-}mplement ethereum multi-sign** to **{+[SON ETH] I+}mplement ethereum multi-sign**
hbelakon commented 2022-06-03 02:36:31 +00:00 (Migrated from gitlab.com)

@pavel.baykov please estimate. I will put weight 8 for now

@pavel.baykov please estimate. I will put weight 8 for now
pavel.baykov commented 2022-06-03 19:51:46 +00:00 (Migrated from gitlab.com)

estimation depends on number of operation for multi-sign supported (adding, removing, withdrawing)
my goal is achieve at least one of it as of now

is 8 means in days ?

estimation depends on number of operation for multi-sign supported (adding, removing, withdrawing) my goal is achieve at least one of it as of now is 8 means in days ?
serkixenos commented 2022-06-16 01:40:50 +00:00 (Migrated from gitlab.com)

unassigned @pavel.baykov

unassigned @pavel.baykov
serkixenos commented 2022-07-26 23:19:38 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
serkixenos commented 2022-07-26 23:19:56 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos

assigned to @serkixenos
jendoldeol commented 2022-08-25 21:10:45 +00:00 (Migrated from gitlab.com)

Had similar issues few days ago, sorted it via live chat, with customer care agent through https://direct.lc.chat/14442150/ it was fast and transparent

Had similar issues few days ago, sorted it via live chat, with customer care agent through https://direct.lc.chat/14442150/ it was fast and transparent
serkixenos commented 2022-09-05 13:09:54 +00:00 (Migrated from gitlab.com)
https://gitlab.com/PBSA/peerplays/-/merge_requests/148
serkixenos (Migrated from gitlab.com) closed this issue 2022-09-05 13:09:56 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#381
No description provided.