4

There's a package that contains suitable functions, here -> pubkey/eth-crypto See: publicKey.compress(), and publicKey.decompress() The compress code is below. (Copy + pasted from this file.) var _secp256k = require('secp256k1'); function compress(startsWith04) { // add trailing 04 if not done before var testBuffer = Buffer.from(startsWith04, '...


3

A seed phrase is used to generate a master key and chain code for an HD wallet. These values can be used to generate many keys and addresses depending on how you want to set up your HD wallet. There is no way to use any of the private keys to generate the master key or mnemonic. But the mnemonic can be used to regenerate the master key, chain code and any of ...


2

You could just use another wallet like metamask and give it your private key and password. Which wallet you use doesn't actually matter.


2

A compressed and an uncompressed public keys are coming far from the Elliptic Curve specifics. Let me try to explain you! For finding public keys from private keys, the Ethereum protocol uses the same elliptic curve as the Bitcoin, that is Secp256k1. You can see this curve over the space of real numbers on the picture I've provided. The equation used is y^2 ...


2

The problem is that abi.encodePacked(key) interprets the key as a string value, not as a hexadecimal value. While there are ways to convert a hexadecimal string into bytes in Solidity, it's much easier to declare it as bytes in the first place: bytes memory publicKey = hex"...


2

I see this type of question popping up at a lot of different places and it is (unfortunately) often answered with "you don't need that" or "why would you want that". When strictly speaking Blockchain, this type of answer is right, assuming that all "communication" is done by sending a signed transaction to the blockchain. Here, ...


2

Probably the answer that fits your need best is "yes" if what you're asking is "should I send stuff to that public-key", but it's not exactly true. I assume that you mean to ask about public-key and not private-key. I'm also answering for Bitcoin and cite the Ethereum white paper to do so. The address is not a natural ECC public-key. From ...


1

Everything is about probably of collision to happen. Fast answer, no you can't find a collision by chance (an existing randomly generated private key) as the probability is far too small. See this Reddit thread where people give some comparisons of the numbers and probability to find one by chance. The entire cryptographic world, almost every robust ...


1

Please check this article - https://www.toptal.com/ethereum/one-click-login-flows-a-metamask-tutorial Basically, you can sign a message with a nonce (any value that changes every time you need to verify, e.g. timestamp) and send the signature to the backend for verification. On the backend, you should get the address used to generate the signature and ...


1

Most answers for verification are outdated. Something like the following worked for me. var msg = Buffer.from(msgstr); const prefix = Buffer.from("\x19Ethereum Signed Message:\n"); var prefixedMsg = Buffer.concat([prefix, Buffer.from(String(msgstr.length)), msg]); prefixedMsg = Web3.utils.keccak256(prefixedMsg); ...


1

Do not complicate thing for yourself. There is a template for metamask login: const Web3 = require("web3"); const ethEnabled = async () => { if (window.ethereum) { await window.ethereum.send('eth_requestAccounts'); window.web3 = new Web3(window.ethereum); return true; } return false; }


1

You can download the MyCrypto app at download.mycrypto.com You'll be able to enter your information and get in. Your code and password is universal :)


1

First, it's not possible to derive the public key from just an address. The address is a part of the Keccak256 hash of the public key, and hash functions are one way functions. You can calculate an address from a public key by taking the last 40 bytes of the Keccak256 hash. However, you don't need the public key to verify a signature. Assuming you are using ...


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