I am being asked to enter my Ethereum address, but I don't know what to put there and I already created an Ethereum account.
[Ethereum] an Ethereum address
accountsaddresses
Related Solutions
Yes but the 0x should already be there. You should not be typing addresses in manually because they currently do not have checksums and mistakes can be costly: more details here specifically be "careful to always include the "0x" on the front of the raw ones (which you should be doing anyways)".
When transferring any large amounts, don't forget to test with a small amount first. Similarly, if you are copying+pasting and the 0x isn't already there (maybe some blockchain explorers don't have the 0x), be careful if you add the "0x".
With Ethereum ICAP addresses, the 0x should not be added.
If I understand your question correctly you want to be able to see who has deposited Eth to your contract address. This is what event logs are for.
(1) Create a contract where there is an event every time there is a transaction. e.g something like:
contract someContract {
address public owner;
// Set the owner of the contract to be the creator of the contract i.e. you
function someContract() {
owner = msg.sender;
}
// This is an event
event DepositMade(address _from, uint value);
event WithdrawalMade(address _to, uint value);
//Catch all function
function() {
// generate an event when someone sends you Eth
if (msg.value > 0)
DepositMade(msg.sender, msg.value);
}
// Only the owner of the site can withdraw Eth
modifier admin { if (msg.sender == owner) _ }
function withdraw(uint amount, address recipient) admin {
if(recipient.send(amount))
WithdrawalMade(msg.sender, msg.value);
else throw;
}
}
The important bits are defining an event type event DepositMade(address _from, uint value)
and generating an event when something happens DepositMade(msg.sender, msg.value);
these events are stored in the event log associated with the address of the deployed contract instance.
(2) You retrieve the events on this contract using rpc eth_newFilter
or web3.eth.filter
e.g something like:
var filter = web3.eth.filter({fromBlock:0, toBlock: 'latest', address: contractAddress, 'topics':['0x' + web3.sha3('DepositMade(hexstring,uint256)')]});
filter.watch(function(error, result) {
if(!error) console.log(result);
})
Best Answer
Ethereum address is a sequence of 20 bytes which are calculated from public key by performing this algorithm:
After the computation, addresses basically look like this: