Fingerprint of an extended key.
(bip32-key-fingerprint key) → fp
The section `Key identifiers' of [BIP32] says that the first 32 bits (i.e. 4 bytes) of a key identifier are the key fingerprint.
Function:
(defun bip32-key-fingerprint (key) (declare (xargs :guard (bip32-ext-key-p key))) (take 4 (bip32-key-identifier key)))
Theorem:
(defthm byte-listp-of-bip32-key-fingerprint (b* ((fp (bip32-key-fingerprint key))) (byte-listp fp)) :rule-classes :rewrite)
Theorem:
(defthm len-of-bip32-key-fingerprint (b* ((fp (bip32-key-fingerprint key))) (equal (len fp) 4)) :rule-classes :rewrite)
Theorem:
(defthm bip32-key-fingerprint-of-bip32-ext-key-fix-key (equal (bip32-key-fingerprint (bip32-ext-key-fix key)) (bip32-key-fingerprint key)))
Theorem:
(defthm bip32-key-fingerprint-bip32-ext-key-equiv-congruence-on-key (implies (bip32-ext-key-equiv key key-equiv) (equal (bip32-key-fingerprint key) (bip32-key-fingerprint key-equiv))) :rule-classes :congruence)