• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
          • Bip32
            • Bip32-wallet-structure
            • Bip32-key-trees
            • Bip32-key-serialization
              • Bip32-export-key
              • Bip32-deserialize-key
              • Bip32-serialize-key
              • Bip32-serialized-key-p
              • Bip32-import-key
              • Bip32-key-identifier
              • Bip32-serialization-versions
              • Bip32-key-fingerprint
              • Bip32-key-derivation
              • Bip32-executable-attachments
              • Bip32-extended-keys
              • Bip32-master-key-generation
            • Bech32
            • Bip39
            • Bip44
            • Base58
            • Bip43
            • Bytes
            • Base58check
            • Cryptography
            • Bip-350
            • Bip-173
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Bip32-key-serialization

    Bip32-key-fingerprint

    Fingerprint of an extended key.

    Signature
    (bip32-key-fingerprint key) → fp
    Arguments
    key — Guard (bip32-ext-key-p key).
    Returns
    fp — Type (byte-listp 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.

    Definitions and Theorems

    Function: bip32-key-fingerprint

    (defun bip32-key-fingerprint (key)
      (declare (xargs :guard (bip32-ext-key-p key)))
      (take 4 (bip32-key-identifier key)))

    Theorem: byte-listp-of-bip32-key-fingerprint

    (defthm byte-listp-of-bip32-key-fingerprint
      (b* ((fp (bip32-key-fingerprint key)))
        (byte-listp fp))
      :rule-classes :rewrite)

    Theorem: len-of-bip32-key-fingerprint

    (defthm len-of-bip32-key-fingerprint
      (b* ((fp (bip32-key-fingerprint key)))
        (equal (len fp) 4))
      :rule-classes :rewrite)

    Theorem: bip32-key-fingerprint-of-bip32-ext-key-fix-key

    (defthm bip32-key-fingerprint-of-bip32-ext-key-fix-key
      (equal (bip32-key-fingerprint (bip32-ext-key-fix key))
             (bip32-key-fingerprint key)))

    Theorem: bip32-key-fingerprint-bip32-ext-key-equiv-congruence-on-key

    (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)