1

I am trying to generate transactions from a device that will have a copy of my private key, send that over to my node server, which will then just send that over to ethereum.

Are transactions just like JSON blobs that I can relay like that? I just want my server to be a proxy that WRITES whatever transactions the device generates.

1

That's how it works, besides that transactions are no JSON objects, but hexadecimal strings. Your device creates a signed transaction, which requires the private key. Then you pass this signed transaction as a hex string on to your node. Since your node is actually part of the Ethereum network, the transaction has reached the blockchain infrastructure already.

  • So can I just pass this hexadecimal string to my server? The device in this case would be something like Amazons Alexa (smart home hub). I want to generate the transaction there and send it to my server, which will send it to ethereum. Does that make sense? – bigpotato Nov 24 '17 at 22:02
  • Yes, you need to create the transaction, sign it and use function sendRawTransaction to send the hex string resulting from signing the transaction. Please refer to ethereum.stackexchange.com/questions/30682/… for more information. So, yes, what you says makes sense, even though I am not sufficient familiar with Alexa to say if this is possible. – gisdev_p Nov 24 '17 at 22:10
  • But sendRawTransaction is probably dangerous right? Basically anyone who sends a request to my server can create a transaction? Well maybe not... since I would be signing it with the private key and my smart contract would look for the signature... right? – bigpotato Nov 24 '17 at 23:50
  • Exactly, the smart contract will know who sent the transaction, it's written in the 'msg.sender' field, and he will know that the transaction is authentic because it's signed. – gisdev_p Nov 25 '17 at 4:51

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.