Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &

Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &
Key item features Ultimate Security: Generates a private key that remains on the card, safeguarding crypto and NFTs from hackers with EAL6+ certification and audited firmware. Versatile Compatibility: Manages over 13,000 tokens across 70+ blockchains, supporting DeFi, NFTs, and DeEx without wires, Bluetooth, or USB. Effortless Operation: Utilizes NFC for secure transactions via a mobile device and the Tangem app, enabling buying and selling crypto with various payment methods. Smart Backup: Features a second Tangem Wallet as a backup, eliminating the need for paper, pictures, or seed phrases for recovery. Durable Design: Boasts IP68 protection against environmental conditions, ensuring longevity and robust physical security. Comprehensive Support: Compatible with Bitcoin, Ethereum, Solana, XRP, USDT, and over 6,000 cryptocurrencies, integrating with dApps and WalletConnect.

LBANK

EVM Key derivation

Starting from Nostr private and public keys, is it possible to derive equivalent EVM keys?

It's easy to use the Nostr private key as the seed to generate an EVM priv/pubkey pair, but given someone's Nostr pubkey, is it possible to derive the same pubkey that the other party would derive from their private key?

Nostr private keys are converted into pubkeys using BIP340

/// Produces the public key from a private key
///
/// Takes privateKey, a 32-bytes hex-encoded string, i.e. 64 characters.
/// Returns a public key as also 32-bytes hex-encoded.
String getPublicKey(String privateKey) {
  var d0 = BigInt.parse(privateKey, radix: 16);
  ECPoint P = (secp256k1.G * d0)!;
  return P.x!.toBigInteger()!.toRadixString(16).padLeft(64, "0");
}

Currently I can do this using the following dart code:

EthPrivateKey getEthCredentials(String nostrPrivateKey) {
  return EthPrivateKey.fromHex(hex.encode(hex.decode(nostrPrivateKey)));
}

EthereumAddress getEthAddressFromPublicKey(String bip340PublicKey) {
  final ecCurve = ECCurve_secp256k1();
  Uint8List publicKeyBytes = Uint8List.fromList(hex.decode(bip340PublicKey));

  // Ensure the public key is in the correct format
  if (publicKeyBytes.length == 32) {
    // Add the 0x02 prefix for compressed public key
    publicKeyBytes = Uint8List.fromList([0x02] + publicKeyBytes);
  } else if (publicKeyBytes.length == 64) {
    // Add the 0x04 prefix for uncompressed public key
    publicKeyBytes = Uint8List.fromList([0x04] + publicKeyBytes);
  }

  // Decode the public key
  final ecPoint = ecCurve.curve.decodePoint(publicKeyBytes);
  final uncompressedPublicKey =
      ecPoint!.getEncoded(false).sublist(1); // Remove the prefix byte

  // Generate Ethereum address from the uncompressed public key
  return EthereumAddress.fromPublicKey(uncompressedPublicKey);
}

But this doesn't allow me to derive new addresses, so these would be single-use addresses.



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/PUfhF9I
via IFTTT

Popular posts from this blog

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Nigerian SEC Partners With Police To Tackle Crypto Ponzi Schemes – Details