jmwallet.commitment_history
jmwallet.commitment_history
Initialize taker commitment history for a data directory's first generated wallet.
Attributes
Functions:
generated_wallet_is_authorized(data_dir: Path, mnemonic: str) -> bool
Require durable affirmative generation evidence, never infer it from absence.
Source code in jmwallet/src/jmwallet/commitment_history.py
38 39 40 41 42 43 44 45 46 | |
history_requires_generation_authorization(data_dir: Path, history: dict[str, object]) -> bool
Retain the restriction even if another client rewrites unknown JSON fields.
Source code in jmwallet/src/jmwallet/commitment_history.py
21 22 23 24 25 | |
initialize_commitment_history_for_new_wallet(data_dir: Path, *, mnemonic: str, wallet_file: Path, first_wallet: bool) -> None
Authorize a generated mnemonic, initializing only a still-unused directory.
Existing automatic histories can admit another freshly generated mnemonic without rewriting commitments. Imports and recovery must never call this. Failure is nonfatal to saving the wallet; it grants no taker authorization.
Source code in jmwallet/src/jmwallet/commitment_history.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
is_first_wallet_in_data_dir(data_dir: Path, wallet_file: Path, *, saved_wallet: bool = False, authorization: Path | None = None) -> bool
Return True if a new wallet file would start an unused data directory.
Call before saving and recheck before initialization, allowing only the exact saved wallet's own artifacts. Unknown files, including hidden wallets and backups, never prove that a directory is unused.
Source code in jmwallet/src/jmwallet/commitment_history.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |