• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
        • Bip32
          • Bip32-wallet-structure
            • Bip32-compliant-addresses-for-limit-p
            • Bip32-compliant-accounts-for-limit-p
            • Bip32-compliant-chains-p
            • Bip32-compliant-addresses-p
            • Bip32-compliant-tree-p
            • Bip32-compliant-depth-p
              • Bip32-compliant-accounts-p
            • Bip32-key-trees
            • Bip32-key-serialization
            • 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
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bip32-wallet-structure

    Bip32-compliant-depth-p

    Check if the depth of a key tree complies with the BIP 32 wallet structure.

    According to the figure in [BIP32], the key tree stops at depth 3, i.e. the address keys have no children (and therefore no grandchildren, great-grandchildren, etc.). This is formally expressed by saying that every path in the tree has a length below 4.

    Definitions and Theorems

    Theorem: bip32-compliant-depth-p-necc

    (defthm bip32-compliant-depth-p-necc
      (implies (bip32-compliant-depth-p tree)
               (implies (and (ubyte32-listp path)
                             (bip32-path-in-tree-p path tree))
                        (< (len path) 4))))

    Theorem: booleanp-of-bip32-compliant-depth-p

    (defthm booleanp-of-bip32-compliant-depth-p
      (b* ((yes/no (bip32-compliant-depth-p tree)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: bip32-compliant-depth-p-of-bip32-key-tree-fix-tree

    (defthm bip32-compliant-depth-p-of-bip32-key-tree-fix-tree
      (equal (bip32-compliant-depth-p (bip32-key-tree-fix tree))
             (bip32-compliant-depth-p tree)))

    Theorem: bip32-compliant-depth-p-bip32-key-tree-equiv-congruence-on-tree

    (defthm
        bip32-compliant-depth-p-bip32-key-tree-equiv-congruence-on-tree
      (implies (bip32-key-tree-equiv tree tree-equiv)
               (equal (bip32-compliant-depth-p tree)
                      (bip32-compliant-depth-p tree-equiv)))
      :rule-classes :congruence)