0

Is it possible to send private key signed transactions directly from the contract? The thing I want to do is to create a similar function

function sendTransactionForUser(_signedData, contractAddress){ sendSignedTrx(contractAddress, signedData) }

the main point is that the user would sign data -> send it to the owner -> owner would send transaction on behalf of the user, and pay gas for the user.

1

Your title and description mix up some important concepts.

In Ethereum, all activity starts with a transaction signed by an externally owned account. A contract has no known private key and cannot sign a transaction.

But, you don't want the contract to sign. You want the original sender to sign and pass the siged transaction to someone else (you said, the owner).

Good news. If the sender signs the transaction, then anyone can relay it.

Hope it helps.

0

In short, yes, you can, but why would you sign with a contract? You would need to give your private key to it, and anyone would be able to see it.

  • I don't want it to sign with a contract. I want to pass in already signed data and send transactions on behalf of a user – JustinZ Feb 12 at 10:02

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.