0

For my project it is necessary for smart contract to sign a message (for example, EC-signature) I have not found a way to generate a pair of public and private keys inside the contract so that the private key remains invisible to anyone, and smart contract could sign a line of text with it. Maybe the contract has its own private key that can be used in this way? Thanks in advance for the answer.

  • The private key of your contract is unknown. The contract address is basically generated from a hash of the contract deployer's address and its current nonce. So while this private key exists in theory, it doesn't exist in practice. Why don't you simply pass the private key to the contract function along with the line of text, every time you call it in order to sign that line of text? – goodvibration Nov 23 '19 at 10:01
  • @goodvibration: “Why don't you simply pass the private key to the contract function along with the line of text, every time you call it in order to sign that line of text?” Since in this case the private key will be visible to an outside observer and the meaning of such a signature disappears, since everyone can subsequently fake this signature using this private key. – lfrickel Nov 23 '19 at 11:20
0

Smart contract may generate private key and may sign message with it, but it cannot preserve privacy of this private key. Also, smart contract does not have its own private key, though it has address, but this address is not derived from any private key.

However, smart contract may emit an event and include message, or hash of the message, into parameters parameters of emitted event. The event will be included into the blockchain together with address of the smart contract that emitted it, so anybody will be able verify that this message, or hash of message was actually emitted (or you may call it “signed”) by this smart contract.

| improve this answer | |
  • The purpose of my question was to create a blind signature. Therefore, the proposed method, unfortunately, will not work. – lfrickel Dec 22 '19 at 13:16
  • You should probably give a chance to zero knowledge proofs. Google for “zkSNARKs Ethereum”. – Mikhail Vladimirov Dec 22 '19 at 13:18
  • As an alternative to blind signatures or to integrate blind signatures into a smart contract? – lfrickel Dec 22 '19 at 13:25
0

The purpose of my question was to create a blind signature, independent of the human factor. I completely agree that Smart Contracts are not suitable for this purpose because of their transparency. Nevertheless, since the execution of Smart Contracts is essentially based on a random oracle model, I could imagine the option that the miner / the node (first) executing contract could make this blind signature based on its own private key (or a one-time private key derived from its own). The public keys for verification of the signature could be stored on the blockchain.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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