Generate a key tree with (just) a master key from a seed.
(bip32-master-tree seed) → (mv error? tree)
This lifts bip32-master-key from a single key to a singleton tree containing the key at the root, as a master key.
Function:
(defun bip32-master-tree (seed) (declare (xargs :guard (byte-listp seed))) (declare (xargs :guard (and (<= 16 (len seed)) (<= (len seed) 64)))) (b* (((mv error? key) (bip32-master-key seed)) (tree (bip32-key-tree (bip32-ext-key-priv key) 0 0 (list 0 0 0 0) '(nil)))) (mv error? tree)))
Theorem:
(defthm booleanp-of-bip32-master-tree.error? (b* (((mv ?error? ?tree) (bip32-master-tree seed))) (booleanp error?)) :rule-classes :rewrite)
Theorem:
(defthm bip32-key-treep-of-bip32-master-tree.tree (b* (((mv ?error? ?tree) (bip32-master-tree seed))) (bip32-key-treep tree)) :rule-classes :rewrite)
Theorem:
(defthm bip32-key-tree->root-key-of-bip32-master-tree (equal (bip32-key-tree->root-key (mv-nth 1 (bip32-master-tree seed))) (bip32-ext-key-priv (mv-nth 1 (bip32-master-key seed)))))
Theorem:
(defthm bip32-key-tree->root-depth-of-bip32-master-tree (equal (bip32-key-tree->root-depth (mv-nth 1 (bip32-master-tree seed))) 0))
Theorem:
(defthm bip32-key-tree->root-index-of-bip32-master-tree (equal (bip32-key-tree->root-index (mv-nth 1 (bip32-master-tree seed))) 0))
Theorem:
(defthm bip32-key-tree->root-parent-of-bip32-master-tree (equal (bip32-key-tree->root-parent (mv-nth 1 (bip32-master-tree seed))) (list 0 0 0 0)))
Theorem:
(defthm bip32-key-tree->index-tree-of-bip32-master-tree (equal (bip32-key-tree->index-tree (mv-nth 1 (bip32-master-tree seed))) (list nil)))
Theorem:
(defthm bip32-key-tree-priv-p-of-bip32-master-tree (bip32-key-tree-priv-p (mv-nth 1 (bip32-master-tree seed))))
Theorem:
(defthm bip32-master-tree-of-byte-list-fix-seed (equal (bip32-master-tree (byte-list-fix seed)) (bip32-master-tree seed)))
Theorem:
(defthm bip32-master-tree-byte-list-equiv-congruence-on-seed (implies (byte-list-equiv seed seed-equiv) (equal (bip32-master-tree seed) (bip32-master-tree seed-equiv))) :rule-classes :congruence)