Calculate the address for a private key.
(private-key-to-address priv-key) → address
We calculate the public key from the private key, and then use public-key-to-address to calculate the addres.
Function:
(defun private-key-to-address (priv-key) (declare (xargs :guard (secp256k1-priv-key-p priv-key))) (let ((__function__ 'private-key-to-address)) (declare (ignorable __function__)) (public-key-to-address (secp256k1-priv-to-pub priv-key))))
Theorem:
(defthm byte-list20p-of-private-key-to-address (b* ((address (private-key-to-address priv-key))) (byte-list20p address)) :rule-classes :rewrite)
Theorem:
(defthm private-key-to-address-of-secp256k1-priv-key-fix-priv-key (equal (private-key-to-address (ecurve::secp256k1-priv-key-fix priv-key)) (private-key-to-address priv-key)))
Theorem:
(defthm private-key-to-address-secp256k1-priv-key-equiv-congruence-on-priv-key (implies (ecurve::secp256k1-priv-key-equiv priv-key priv-key-equiv) (equal (private-key-to-address priv-key) (private-key-to-address priv-key-equiv))) :rule-classes :congruence)