Build a message that describes a generated mnemonic.
When initializing a wallet from an entropy value, a mnemonic is generated, which is a non-empty string of words separated by individual spaces. This mnemonic must be shown to the user, as the result of running the command to initialize the wallet (from an entropy value).
This function builds a message that consists of the list of words, one per line, indented by two spaces.
Function:
(defun mnemonic-message-aux (words) (declare (xargs :guard (string-listp words))) (cond ((endp words) "") (t (msg " ~s0~%~@1" (car words) (mnemonic-message-aux (cdr words))))))
Theorem:
(defthm msgp-of-mnemonic-message-aux (b* ((msg (mnemonic-message-aux words))) (msgp msg)) :rule-classes :rewrite)
Function:
(defun mnemonic-message (mnemonic) (declare (xargs :guard (stringp mnemonic))) (mnemonic-message-aux (strtok mnemonic (list #\Space))))
Theorem:
(defthm msgp-of-mnemonic-message (b* ((msg (mnemonic-message mnemonic))) (msgp msg)) :rule-classes :rewrite)