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

    Bip32-n

    Calculate an extended public key from an extended private key.

    Signature
    (bip32-n private) → extpubkey
    Arguments
    private — Guard (bip32-ext-priv-key-p private).
    Returns
    extpubkey — Type (bip32-ext-pub-key-p extpubkey).

    This is the function \mathsf{N} in [BIP32].

    Definitions and Theorems

    Function: bip32-n

    (defun bip32-n (private)
      (declare (xargs :guard (bip32-ext-priv-key-p private)))
      (b* (((bip32-ext-priv-key private) private)
           (public.key (secp256k1-priv-to-pub private.key))
           (public.chain-code private.chain-code))
        (bip32-ext-pub-key public.key public.chain-code)))

    Theorem: bip32-ext-pub-key-p-of-bip32-n

    (defthm bip32-ext-pub-key-p-of-bip32-n
      (b* ((extpubkey (bip32-n private)))
        (bip32-ext-pub-key-p extpubkey))
      :rule-classes :rewrite)

    Theorem: bip32-n-of-bip32-ext-priv-key-fix-private

    (defthm bip32-n-of-bip32-ext-priv-key-fix-private
      (equal (bip32-n (bip32-ext-priv-key-fix private))
             (bip32-n private)))

    Theorem: bip32-n-bip32-ext-priv-key-equiv-congruence-on-private

    (defthm bip32-n-bip32-ext-priv-key-equiv-congruence-on-private
      (implies (bip32-ext-priv-key-equiv private private-equiv)
               (equal (bip32-n private)
                      (bip32-n private-equiv)))
      :rule-classes :congruence)