Is it possible/feasible to have a private key stored inside a smart contract and sign transactions with it or would the calculations be to pricey in gas?
For example a smart contract should create signed transactions and the costs should be not much more than the transaction cost itself

2 Answers 2


If you store something in a smart contract, then anyone can see it. It's no longer private, so anyone can take it and sign something. So, technically, you could store a private key inside a smart contract and write the smart contract to sign transactions (which would be fairly expensive), but it would be expensive and insecure since anyone could grab the private key.


I don't think it's possible. The essence of "private" key is that it is "private". You can write it down on a piece of white paper and keep it in a safe. The white paper should never go outside of your sight. The smart contract, however, is exposed to public eyes. Since everybody could see it, we can't call it a private key anymore.

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.