Skip to content

wallet: Date a new wallet by this computer's clock - #217

Open
BenWestgate wants to merge 3 commits into
gui-before-you-startfrom
claude/project-thread-p319g5
Open

BenWestgate wants to merge 3 commits into
gui-before-you-startfrom
claude/project-thread-p319g5

Conversation

@BenWestgate

Copy link
Copy Markdown
Owner

Requested by Ben · project thread

Follows Ben's review on BenWestgate/Bails#366 (comment): restores use the date the user gives, new wallets use the wall clock. Restores already do (#191). New wallets still imported with "now".

Bug. Core resolves "now" to its tip's median time. On an offline signer that never synced, that's the genesis block. So every new wallet's descriptors are dated genesis, and Bitcoin QR (which now carries the source timestamp) makes the online node rescan from genesis, which a pruned CipherStick can't do.

Change. One line in BitcoinCore.initialize: "now" becomes int(time.time()) - 86400. The day early matches parse_creation_date, so a clock up to a day fast can't make Core skip the wallet's first payments. check_history still skips new wallets. This covers the GUI and ms32 create/wallet --timestamp now.

Checked. On a Core 32.1 regtest signer at genesis, descriptors were dated 1296688602 (genesis) on 6c64411 and clock − 1 day here. The signer still found a 1.25 BTC payment from blocks it synced later. pytest: 659 passed, 2 skipped. The bip32-oracle modules (test_cli, test_generation, test_correction_*, one test_generic_hrp test) couldn't run here because the cloud proxy blocks the pinned GitHub tarball, so CI covers them. ruff and mypy are clean.

Stacked on #113 (#190 → #191 → #113 → this). Needs Ben's security review (recovery path). Bails #332's pin should then move from b045908 to this head.


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T20:56:05.481387Z dfb6905 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Bitcoin Core resolves an import timestamp of "now" to its tip's median
time. On an offline signer that never synced, that is the genesis block,
so every new wallet was born in 2009, and the watch-only copy Bails
exports from it asks the online node to rescan from genesis, which a
pruned node cannot do.

A new wallet now takes this computer's clock, a day early like a
recorded creation date, so a clock running up to a day fast cannot skip
its first payments. Restores keep the recorded date.

On a Core 32.1 regtest signer at genesis, the descriptors were dated
1296688602 (genesis) before and the clock less a day after; the signer
still found a payment from blocks it synced later.

Claude-Session: https://claude.ai/code/session_01N8jLK61uohaW6W7Y8AHnMb
Every page now asks the window to grow, never past the screen's height,
whenever its content is taller than the space it has: on arrival, when a
section opens, and when a message gets longer. A window the operator
shrinks grows back to fit. The scroller stays as the last resort on a
screen too short for the page.

Name-and-value rows (wallet identity, wallet record, new card) are one
line each, value on the right, so the finished page fits the default
880x620 window and reads straight down against the paper record.

The GUI size budget rises by the 13 lines this takes.

Claude-Session: https://claude.ai/code/session_01N8jLK9eptxLjUcNnMk1VGr
@BenWestgate
BenWestgate force-pushed the claude/project-thread-p319g5 branch from 6bcbfa0 to dfb6905 Compare November 17, 2026 20:54
BenWestgate added a commit that referenced this pull request Nov 17, 2026
#223 moved row values into suffix labels in a compact group. Keep that
layout and style those labels like card text instead of the subtitle.

Claude-Session: https://claude.ai/code/session_01N8jLK8HGLaWJq2AJGmxPVe
BenWestgate added a commit that referenced this pull request Nov 17, 2026
A new wallet is dated by this computer's clock less a day. Accepted risk
from Ben's security review of #217: a clock more than a day fast hides a
watch-only copy's first payments until a rescan.

Claude-Session: https://claude.ai/code/session_01N8jLK61uohaW6W7Y8AHnMb

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant