3

Private Key Space: Here are some code examples, based on the elliptic curve secp256k1 used by ethereum, as others have noted in order for the 256-bit key to be valid, it must be smaller than the curve's parameter n which is also a 256-bit value which can be written in hexadecimal format as: 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 ...


3

Yes your understanding is correct a node can host multiple accounts. Have a look at : https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts


2

I'm not sure what you need exactly. Uport will be a good alternative if you want to work in mobile browsers as well. But users need to have there mobiles with them to use the dApp. if only to use in PC browsers I recommend Metamask. But with mobile browsers metamask is still in early stage. Check this post. This list might help you as well.


2

It's not so much about whether a smart contract has a private key or not; it's more about the fact that smart contracts can't initiate a transaction. All transactions are started by an EOA to either a smart contract or to another EOA. If a transaction is sent to a contract the contract may include functionality to call another address within the same ...


2

For 1 you may use web3.eth.getCode(address) function of Web3 API. For contract addresses it returns contract byte code, while for non-contract addresses it returns something like "0x". For 3 it depends on what "public" means for you. If you mean whether smart contract has verified source code published at Etherscan.io, then you may use either API call to ...


2

No she can't access your account 1. Because account 1 and account 2 have different pk(private key), but u only gave her account 2 pk so she can't use it to access acount 1. The reason you still have account 2, because she can't change the pk it is link to the account, but u gave her the pk so that mean u already own it in metamask. So unless you delete the ...


2

You will need the ABI. The .methods is an attribute of the contract instance, which you get by using the ABI. If you are using ethers.js, you can use a shorthand ABI to achieve the same goal: let abi = ["function approve(address _spender, uint256 _value) public returns (bool success)"] let provider = ethers.getDefaultProvider('ropsten') let contract = new ...


1

You can npm install keythereum, and then run the following NodeJS script: const fs = require("fs"); const keythereum = require("keythereum"); const KEYSTORE = process.argv[2]; const PASSWORD = process.argv[3]; for (const fileName of fs.readdirSync(KEYSTORE)) { const keyObject = JSON.parse(fs.readFileSync(KEYSTORE + "/" + fileName, "utf8")); const ...


1

If the transactions are created close to each other they are possibly valid transactions. If one transactions has already been processed (mined) and the wallet knows about this then the wallet refuses to even send the second transaction. If both of the transactions are accepted by the wallet they are added to an abstract transaction pool which is basically ...


1

The difference is what RPC method is being called under the hood. From the docs: web3.persal.getAccounts returns a list of accounts the node controls by using the provider and calling the RPC method personal_listAccounts. The results are the same as web3.eth.getAccounts() except that calls the RPC method eth_accounts.


1

You're trying to apply a model that is appropriate for Bitcoin mainly due to its limitations. It will be an awkward strategy for Ethereum that overlooks it's strengths. Bitcoin: Not especially programmable, but easy to sweep funds from multiple accounts. Ethereum: Especially programmable, but not so easy to sweep funds from multiple accounts. Ethereum ...


1

No your account is safe or, better, if you still have the private key of the account you are interested in, your money and your account are safe. You are definitively able to recover them using some other wallet. I use CIPHER on iOS and it is ok. On the other side, simply add a new account in metamask giving the private key when asked for it. Nothing more. ...


1

You can get your accounts back by clicking "Create Account" (once per each account). The accounts are there, however they are not shown until you add them. If the accounts that show up do not match what you are expecting, then you are using an incorrect seed.


1

Infura only supports a subset of the Ethereum JSON-RPC endpoints that web3 knows about. You can see the list in Infura's documentation. The RPC that web3.personal.UnlockAccount is trying to use is called [personal_unlockAccount][2]. The personal module is all about maintaining a local wallet, including signing transactions and messages and creating new ...


1

It is unclear what layer you want to find out this information on (on-chain or off-chain). In general: Is an address a smart contract? This can be checked by seeing if there is associated code at the address. Is this smart contract ERC20 or ERC721 token? Off-chain, you can check this by observing the contract on Etherscan. There are also interfaces ...


1

You can simply check val as a uint. Your code would look as follows: function airdrop(uint val) public payable { require(airdrop == true); if (val == 1){ msg.sender.transfer(1 ether); airdrop = false; } }


1

Only an EOA can sign and send a transaction. It can be addressed to a contract in which case the contracts functions must run. A contract's functions can send messages and/or value to other contracts in which case they also run, or to an EOA which just receives because it has no code. All of this happens approximately instantaneously (after mining) ...


1

The smart contract can only send a transaction to an EOA if the transaction was initiated by an EOA. Smart contracts cannot initiate a transaction because they do not have a private key and cannot sign a transaction, as you said. When value is being sent from a smart contract to an EOA, what is really happening is an EOA sending a transaction to the network ...


1

The following Ethereum web wallets are now seeing increasing use alongside Metamask for various dapps, none of which require installing a chrome extension. Portis Fortmatic Torus Democracy <-- the last one is my project For a comparison of why you might use one wallet over another, and general design considerations that go into making a web wallet, I'...


1

Something that may be of interest is https://squarelink.com/ Other than that, metamask is ahead of everyone else as far as I know.


1

Solved, Ethereum allways uses the same curve secp256k1. Thank you all


1

You are setting accounts = result, which then gets overwritten by the return of the function, which is nothing. Instead, simply return result from the function rather than setting it: var accounts = [] let accounts = await web3.eth.getAccounts((error, result) => { console.log(result); return result; }); console.log(accounts); Another option ...


1

Hardened child keys are the ones using apostrophes (m/44'/60'/0'). By design, hardened child keys cannot be derived from extended public keys, only from private (xprv). To get around this, you derive the part that includes hardened children directly from your private key and leave the last non-hardened part of the path to be derived for each user. var ...


1

Yes, sure, you may recover public key from your transaction using ABDK Toolkit. For this you need your transaction in raw hexadecimal format. You may again use ABDK Toolkit to convert transaction into this format. Your particular transaction in raw format looks like this: 0xf8ac1c850430e2340083015f90942608273b77ef3964ceb1fb488d4b95b30258 ...


1

You could put in useEffect a listenEvent like below: useEffect(() => { async function listenMMAccount() { window.ethereum.on("accountsChanged", async function() { // Time to reload your interface with accounts[0]! accounts = await web3.eth.getAccounts(); // accounts = await web3.eth.getAccounts(); console.log(...


1

I'm working on this as well. There is an opcode called extcodehash. It says The EXTCODEHASH of the account without code is c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 what is the keccack256 hash of empty data So I think there is a possibility to check isContract by using this extcodehash combined with the c5d2460186f72... function ...


1

It is now possible to recover public key from Ethereum transaction without any coding: Open the transaction in Etherscan.io Click on vertical ellipsis in the top-right corner Click on "Get Row TxnHash" in popup menu You will see raw transaction in hex, copy it Open “Recover address” tool from ABDK Toolkit Select "Transaction" radio button Paste raw ...


1

Create an account. $ geth account new Your new account is locked with a password. Please give a password. Do not forget this password. Passphrase: Repeat Passphrase: Address: {168bc315a2ee09042d83d7c5811b533620531f67} Or Creates a new account and prints the address. On the console, use: personal.NewAccount() ... you will be prompted for a password .....


1

EOAs and Contract accounts are indistinguishable by looking at their addresses. Contract accounts are the only type of account with associated bytecode. Private keys are generated only for EOAs while CAs are controlled by the contract.


1

Externally owned account (EOAs): an account controlled by a private key, and if you own the private key associated with the EOA you have the ability to send ether and messages from it. Contract: an account that has its own code, and is controlled by code.


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