0

I am trying to create a system using blockchain for a "firm". What I am looking to do is for an employee to enter some data into the system but before it is uploaded have a manager sign off on it being true. Is there a way to make it so that everybody can enter data but it has to be verified by specific people before it is okay? Thank you in advance.

1 Answer 1

0

You can do this by having the manager include a cryptographic signature of that transaction as well. Assuming you're using a smart contract, you could do something like this:

  • Keep a list of addresses of the managers in the contract (e.g., mapping(address => bool) isManager).
  • Before sending the data to the contract, have a manager sign a hash of the employee data.
  • In the function where you add the employee data, take both the data itself and the signature of the manager.
  • Use ecrecover to get the address of the signer, check that it matches one of the manager addresses (e.g., isManager[signer] == true).

You can use something like EIP-712's eth_signTypedData for signing the employee data.

2
  • Thank you for responding! But this would require the manager to be the one to upload the data to the chain right? Is it possible to do it after the data has been deployed to the chain? And by that ensure that the data is not modified by the manager. Commented Apr 21, 2021 at 12:13
  • An employee can upload the data as long as they have the signature of the manager. You can also split it into two functions, one that adds the employee data to the contract, and another where a manager can approve that data (with something like a simple approveData function).
    – Morten
    Commented Apr 21, 2021 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.