145

Recently this article came to my attention that is way more in depth and technical than my more accessible version below. It also walks you through how to generate one on your own. I highly recommend it: https://kobl.one/blog/create-full-ethereum-keypair-and-address/ From the Yellow Paper There are three main steps to get from private -> address: Create ...


50

What is nonce in Ethereum? If you refer to the Glossary at Github Wiki, there are two types of nonce used in Ethereum. Account nonce - It's simply the transaction count of an account Account nonce: a transaction counter in each account. This prevents replay attacks where a transaction sending eg. 20 coins from A to B can be replayed by B over and over to ...


47

To backup your wallet you will need to make a copy of the key file(s) located in your ethereum directory. Linux: ~/.ethereum/keystore Mac: ~/Library/Ethereum/keystore Windows: %APPDATA%/Ethereum The file should look something like this: UTC--2015-09-18T14-07-57.023663538Z--da78c8721e4ede42cf488304551eb596dd5f93e23 I've suggested just saving the keystore ...


47

How to Access the Files to Back Up Using Mist - Backup Accounts Go to the top bar and select ACCOUNTS -> BACKUP -> ACCOUNTS. This will open a folder. Inside this folder there are keystrore files that have long names starting with UTC--2016-04-14....... Each of these files represent an account. Back up these up. Using Mist - Backup Wallet Contracts Go to ...


45

You can if and only if a transaction has been sent from the account. When you send a tx, you sign the transaction and it includes these v r and s values. You parse these from the signed tx and then pass these v r and s values and the hash of the transaction back into a function and it'll spit out the public key. This is actually how you get the from address ...


41

Yes, contracts have nonces. EIP 161 made the contract nonce start at 1, and before EIP 161 the nonce would start at 0. A nonce of a contract is only incremented when that contract creates another contract (@zanzu's YP reference). When a contract invokes a function on another contract, a so called "internal transaction" (in http://live.ether.camp), the ...


41

Edited to add: As predicted, with the launch of the Ethereum Name Service (ENS), users and wallets have gradually begun switching over to using strings like "mywallet.eth" instead of the raw hex addresses. Because that name was not known at the time this answer was written, it refers to the same concept as a "namereg". I can elaborate on this a little bit, ...


38

Accounts are the most basic way to store Ether. They are simple public/private keypairs, which you use to sign transactions. You don't need to do anything to "register" an account with the network, just generate one and send some ether to it. Wallets are smart-contracts that allow for advanced features such as transaction logging, multisig, withdrawal ...


38

"Multisignature" addresses on Ethereum differ from that of Bitcoin. Though both networks allow for arbitrary complex transactions, the concepts are not intrinsically the same: In Bitcoin, there are 2 major classes of transactions: pay to pubkey (addresses starting with "1") pay to script hash (addresses starting with "3", also known as P2SH) The former is ...


29

Crypto currencies and blockchains in general allow you to work with arbitrarily many accounts at the same time. However often people want to have a default/primary account (e.g. miners have a designated mining address, average users will usually use one particular account even if they have multiple one for other purposes). Coinbase or etherbase (they are ...


27

This works: function isContract(address _addr) private returns (bool isContract){ uint32 size; assembly { size := extcodesize(_addr) } return (size > 0); } The assembly language that all Ethereum contracts compile down to contains an opcode for this precise operation: EXTCODESIZE. This opcode returns the size of the code on an address. If ...


26

In truffle console: var accounts; // in web front-end, use an onload listener and similar to this manual flow ... web3.eth.getAccounts(function(err,res) { accounts = res; }); var account1 = accounts[0]; // first account var account2 = accounts[1]; // second account, if exists ... var contract; Contract.deployed() .then(function(response) { contract = ...


23

Using web3 version 1.0.0, the metamask provider exposes an 'update' event you can listen to on it's publicConfigStore. web3.currentProvider.publicConfigStore.on('update', callback); Your callback will be passed an object with 'selectedAddress' and 'networkVersion' whenever those attributes change.


20

You can't remove account. You need to remove them directly from your keystore folder. IT IS IRREVERSIBLE. ~/Library/Ethereum/keystore I feel the need to repeat that once the file is deleted it's Game over.


19

A replay attack is a valid data transmission that is maliciously or fraudulently repeated or delayed. Extending this to blockchains, a replay attack is taking a transaction on one blockchain, and maliciously or fraudulently repeating it on another blockchain. For example, an attacker taking someone's testnet transaction, and repeating it on the "real" ...


18

Yes, both cryptocoins use the same elliptic curve SECP256K1. Perhaps a better alternative is to use a BIP32 wallet. You have a master key that is not directly used for transactions, but it is used to derive child keys than can be used. You can derive separate keys for bitcoin and ethereum. You will always be able to use the master key to sign transactions ...


18

From the MetaMask docs: window.ethereum.on('accountsChanged', function (accounts) { // Time to reload your interface with accounts[0]! }) window.ethereum.on('networkChanged', function (networkId) { // Time to reload your interface with the new networkId }) As @Sr.PEDRO has noted, ethereum.publicConfigStore will not work in the future. In fact, it will ...


18

Ganache allows you to create a private Ethereum blockchain for you to run tests, execute commands, and inspect state while controlling how the chain operates. It gives you the ability to perform all actions you would on the main chain without the cost. Many developers use this to test their smart contracts during development. It provides convenient tools ...


17

PLEASE MAKE SURE TO ALSO BACKUP YOUR PASSWORDS Each key file (as described in @Ethan's answer) is encrypted and only usable with the correct password. Another safety tip: Before deleting any key files, after you have done the backup, please try the import/restore process on another system to make sure you can send a small amount of Ether. (To import, copy ...


17

Updated answer per 4 Jan 2018 Web3.js has full-fledged support for accounts management starting at v1.0.0, including creating a new account. v1.0.0 is still in beta, but is close to production and is already the version released through npm. Thanks Thom Ives for pointing this out. Full example sourced from web3.js documentation: web3.eth.accounts.create();...


17

Each account has a globally accessible nonce which prevents same-chain replay attacks and double spends. The nonce is the sequence number, which miners check, because a block that has a transaction with an incorrect nonce is an invalid block (other miners won't build on top of it). (The nonce does not protect against cross-chain replay attacks.) Second ...


17

Just to clarify: You would like to run a geth node starting up with the accounts all locked as per the default You later want to run a 'geth attach' command to unlock one or more accounts for a period of time You can use use the following command to attach to your geth node to unlock an account using the personal.unlockAccount(...) JavaScript API (https://...


17

This is an Externally Owned Account, so your normal Ethereum address, not a wallet contract. In general, there are two types of accounts: externally owned accounts, controlled by private keys, and contract accounts, controlled by their contract code. https://github.com/ethereum/wiki/wiki/White-Paper


16

An attacker cannot spend your ETH without knowing your password. It is a smart design on the part of Ethereum. You cannot even access the private key using conventional means. Everything you see in the keystore is already encrypted using your password. Spending ETH requires both parts of the puzzle, the keystore and the password. Everything in the keystore ...


16

As mentioned by Peter, a private key is a random 256 bit blob. It is a common oversight that there're no restrictions. It has to be valid for the secp256k1 curve, which means two conditions: cannot be zero must be less than the order of the curve (called n and has a value of ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141) In ...


16

Etherscan adds them on a case-by-case (manual) basis for now. You can add a comment to the address and then contact them asking for it to be added. However, I'm not sure if there is some sort of "importance" threshold you must meet. The initial names that were added were things like Poloneix and Kraken, as it helped users immensely to be able to see that ...


16

Ethereum addresses are 160 bit hashes, meaning there are 2^160 possible hashes. Per the birthday problem, the chance of a collision rises to 50% when there are about 2^80 accounts created. To give you an idea of how unlikely that is, if every person on earth spent all their time doing nothing but generating Ethereum accounts, and they generated one a second,...


16

I haven't yet got to the point where I can test any of these things, but my gut feel is that the Singleton Nonce Manager would be the way to go, with a few enhancements: Make it a singleton transaction sender That has a maximum buffer or 'head' of pending transactions per 'from' address that matches or is less than the maximum number of transactions that ...


15

If you want to build a explore like etherscan.io, you need to crawl all data in ethereum network and save all txs in the db. There is no direct rpc method to obtain all transactions related to the account.


15

Seems like you can unlock it for as long as the geth instance is running using a 0 as duration parameter: web3.personal.unlockAccount("address", "pass", 0);


Only top voted, non community-wiki answers of a minimum length are eligible