• 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-key-derivation
              • Bip32-ckd-priv-pub-nh
              • Bip32-ckd-pub
              • Bip32-ckd-priv-pub
              • Bip32-ckd-priv
              • Bip32-ckd
                • Bip32-n
              • 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-derivation

    Bip32-ckd

    Child key derivation from parent key.

    Signature
    (bip32-ckd parent i) → (mv error? child)
    Arguments
    parent — Guard (bip32-ext-key-p parent).
    i — Guard (ubyte32p i).
    Returns
    error? — Type (booleanp error?).
    child — Type (bip32-ext-key-p child).

    This is the sum of bip32-ckd-priv and bip32-ckd-pub. It maps (extended) parent private keys to (extended) child private keys and (extended) parent public keys to (extended) child public keys. This function does not appear in [BIP32].

    Definitions and Theorems

    Function: bip32-ckd

    (defun bip32-ckd (parent i)
      (declare (xargs :guard (and (bip32-ext-key-p parent)
                                  (ubyte32p i))))
      (bip32-ext-key-case parent :priv
                          (b* (((mv error? child)
                                (bip32-ckd-priv parent.get i)))
                            (mv error? (bip32-ext-key-priv child)))
                          :pub
                          (b* (((mv error? child)
                                (bip32-ckd-pub parent.get i)))
                            (mv error? (bip32-ext-key-pub child)))))

    Theorem: booleanp-of-bip32-ckd.error?

    (defthm booleanp-of-bip32-ckd.error?
      (b* (((mv ?error? ?child)
            (bip32-ckd parent i)))
        (booleanp error?))
      :rule-classes :rewrite)

    Theorem: bip32-ext-key-p-of-bip32-ckd.child

    (defthm bip32-ext-key-p-of-bip32-ckd.child
      (b* (((mv ?error? ?child)
            (bip32-ckd parent i)))
        (bip32-ext-key-p child))
      :rule-classes :rewrite)

    Theorem: bip32-ext-key-kind-of-bip32-ckd

    (defthm bip32-ext-key-kind-of-bip32-ckd
      (equal (bip32-ext-key-kind (mv-nth 1 (bip32-ckd parent i)))
             (bip32-ext-key-kind parent)))

    Theorem: bip32-ckd-of-bip32-ext-key-fix-parent

    (defthm bip32-ckd-of-bip32-ext-key-fix-parent
      (equal (bip32-ckd (bip32-ext-key-fix parent) i)
             (bip32-ckd parent i)))

    Theorem: bip32-ckd-bip32-ext-key-equiv-congruence-on-parent

    (defthm bip32-ckd-bip32-ext-key-equiv-congruence-on-parent
      (implies (bip32-ext-key-equiv parent parent-equiv)
               (equal (bip32-ckd parent i)
                      (bip32-ckd parent-equiv i)))
      :rule-classes :congruence)

    Theorem: bip32-ckd-of-ubyte32-fix-i

    (defthm bip32-ckd-of-ubyte32-fix-i
      (equal (bip32-ckd parent (ubyte32-fix i))
             (bip32-ckd parent i)))

    Theorem: bip32-ckd-ubyte32-equiv-congruence-on-i

    (defthm bip32-ckd-ubyte32-equiv-congruence-on-i
      (implies (acl2::ubyte32-equiv i i-equiv)
               (equal (bip32-ckd parent i)
                      (bip32-ckd parent i-equiv)))
      :rule-classes :congruence)