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.
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.
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.