2

Does Ethereum have the basic functionality to allow a payment request to be generated which the user can then choose to accept and sign? The application for this is a token auction where the payer's assent to the contract is included in the memo field. Therefore, I wish to be able to pre-populate the memo field in a payment request.

1

Definitely. The transaction can be created in entirety and the user then is given the prompt to sign using their private key (there are various methods for them to do this and is represented by the tx.sign(privatekey) in the code below).

Pre-populating the memo field is possible as well since all data is encoded in the data portion of the transaction.

If your question is rather whether the user's signature can be included in the txn/contract data then that is a different story, although possible, not as straightforward as having the user sign a transaction.

var rawTx = {
    nonce: web3.toHex(nonce),
    gasPrice: web3.toHex(web3.eth.gasPrice),
    gasLimit: web3.toHex(gaslimit),
    from: web3.toHex(fromAddress),
    data: web3.toHex(contractData)
};

var tx = new Tx(rawTx);
tx.sign(privateKey);
var serializedTx = tx.serialize();

return web3.eth.sendRawTransaction("0x" + serializedTx.toString('hex'), callback());

Source

| improve this answer | |

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.