I am coding an app where users can deposit ether into their accounts and do stuff with it (Im using web3.js and geth). However I would like to have everyone deposit into one single account, and then have a database that knows how much of the total pool of ether in the single account belongs to each person.

I was wondering if there was a feature in Ethereum where users would be able to send a message along side their transactions? So that a specific code could be given to the user who is making a deposite, and once the serverside code of the app sees the code, it can know who sent the ether.

QUESTION: Does this functionality or a similar one exist?

1 Answer 1

web3.eth.sendTransaction(transactionObject [, callback])

If you are using above function for executing the transaction, then there is a parameter available in which you send some message along with transaction as well.

data: String - (optional) Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code.

This shall help you to send a message, along with a transaction.

Check this for more details - https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction

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.