# Imports
from erc5564py.stealth_meta_address import generate_stealth_meta_address, generate_stealth_address
from erc5564py.stealth_address import computeStealthAddress, computeStealthKey
from erc5564py.utils import point_from_hex
# Generate Stealth Meta-Address
stealth_meta_address, spending_private_key, viewing_private_key = generate_stealth_meta_address()
# Generate Stealth Address
stealth_address_data = generate_stealth_address(stealth_meta_address)
ephemeral_pub_key_hex = stealth_address_data['ephemeral_pubkey']
# Convert ephemeral public key hex to Point
ephemeral_pub_key = point_from_hex(ephemeral_pub_key_hex)
# Check if the stealth address belongs to the recipient
computeStealthAddress(ephemeral_pub_key, viewing_private_key, spending_private_key.get_verifying_key(), stealth_address_data['view_tag'])
# Compute Stealth Private Key
stealth_private_key = computeStealthKey(ephemeral_pub_key, viewing_private_key, spending_private_key)
print(f"Stealth PK: {stealth_private_key.hex()}, Stealth Meta Addres {stealth_meta_address}, Stealth Address Data: {stealth_address_data}")
-
Notifications
You must be signed in to change notification settings - Fork 1
A python implementation of ERC5564 for Stealth Addresses on Ethereuem as described https://eips.ethereum.org/EIPS/eip-5564
License
mewmix/erc5564py
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A python implementation of ERC5564 for Stealth Addresses on Ethereuem as described https://eips.ethereum.org/EIPS/eip-5564
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published