这是我透过bingchatgpt产生的private key产生public address
的eth python code
如下
import hashlib
import ecdsa
# Generate a private key
#private_key =
"f4e5d767e3e044f852dee70037d8d3555549614c8b62a4899e60bcf85472c380"
private_key =
ecdsa.SigningKey.from_string(bytes.fromhex("f4e5d767e3e044f852dee70037d8d3555549614c8b62a4899e60bcf85472c380"),
curve=ecdsa.SECP256k1)
# Derive the public key from the private key
public_key = private_key.get_verifying_key().to_string()
# Derive the Ethereum address from the public key
keccak = hashlib.sha3_256()
keccak.update(public_key)
address = "0x" + keccak.hexdigest()[24:]
# Print the results
print("Private key:", private_key.to_string().hex())
print("Public key:", public_key.hex())
print("Address:", address)
可以成功算出一个public address 但是就是跟myetherwallet算出的不一样
我已经试了三四个版本的code写出来都跟myetherwallet算出的不一样
有没有高手能指点一下那里出错了