What changed, and why it matters
This change adds a small user-interface convenience to the COLDCARD's 'Check Chain Check' (CCC) spending-policy feature. It lets a user reset the stored blockchain block height back to its default value from the 'Last Violation' debug screen. The change is described by the vendor as an 'Enhancement' in the changelog, not as a security fix. There is no indication in the commit that it corrects a vulnerability.
No security action required. Treat as a normal feature enhancement. If reviewing for release readiness, verify the new test passes and that the confirmation prompt prevents accidental reset.
Security signals we found
No security-relevant signals present in the commit or changelog
Vendor labels change as 'Enhancement: CCC allow to reset block height'
Change is purely UI/UX convenience for an existing spending-policy setting
Evidence from the diff
The patch extends the CCC debug menu (debug_last_fail in shared/ccc.py). Previously the screen only showed the current CCC block height and the last failure reason, and offered key ‘4’ to clear the failure reason. Now, if the stored block_h differs from the chain’s default ccc_min_block, key ‘1’ is offered to reset block_h to that default. A confirmation prompt is shown before the update. Tests are updated to exercise the new flow. No cryptographic, policy-enforcement, or authorization logic is altered beyond adding this reset path.
Changed components
shared/ccc.py: CCCConfigMenu.debug_last_failtesting/test_ccc.py: test_ccc_velocityreleases/Next-ChangeLog.mdInspect captured patch +43 / −8
diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md
index ad26563..9367453 100644
--- a/releases/Next-ChangeLog.md
+++ b/releases/Next-ChangeLog.md
@@ -8,6 +8,7 @@ This lists the new changes that have not yet been published in a normal release.
Navigate to `Advanced/Tools -> Export Wallet -> Key Expression`
- New Feature: Support for v3 transactions
- New Feature: Send keystrokes with all derived BIP-85 secrets
+- Enhancement: CCC allow to reset block height
# Mk4 Specific Changes
diff --git a/shared/ccc.py b/shared/ccc.py
index 5d07c0a..e92d104 100644
--- a/shared/ccc.py
+++ b/shared/ccc.py
@@ -285,7 +285,7 @@ class CCCFeature:
# a very basic and permissive policy, but non-zero too.
# - 1BTC per day
chain = chains.current_chain()
- return SpendingPolicy('ccc', dict(mag=1, vel=144,
+ return SpendingPolicy('ccc', dict(mag=1, vel=144,
block_h=chain.ccc_min_block, web2fa='', addrs=[]))
@classmethod
@@ -399,20 +399,32 @@ class CCCConfigMenu(MenuSystem):
async def debug_last_fail(self, *a):
# debug for customers: why did we reject that last txn?
+ c = chains.current_chain()
+ def_bh = c.ccc_min_block
pol = CCCFeature.get_policy()
bh = pol.get('block_h', None)
+ bh_clear = ''
msg = ''
- if bh:
- msg += "CCC height:\n\n%s\n\n" % bh
+ escape = "4"
+ if bh is not None:
+ msg += 'CCC height:\n\n%s\n\n' % bh
+ if bh != def_bh:
+ bh_clear = 'Press (1) to clear block height. '
+ escape += "1"
lfr = LastFailReason.get()
- msg += 'The most recent policy check failed because of:\n\n%s\n\nPress (4) to clear.' \
- % lfr
- ch = await ux_show_story(msg, escape='4')
+ msg += ('The most recent policy check failed because of:\n\n%s\n\n'
+ '%sPress (4) to clear last fail reason.' % (lfr, bh_clear))
+ ch = await ux_show_story(msg, escape=escape)
if ch == '4':
LastFailReason.clear()
self.update_contents()
+ elif ch == '1':
+ if await ux_confirm("Reset block height to default value %d for %s?" % (def_bh, c.name)):
+ pol.update_policy_key(_quiet=True, _master_only=False, block_h=def_bh)
+
+
async def remove_ccc(self, *a):
# disable and remove feature
diff --git a/testing/test_ccc.py b/testing/test_ccc.py
index ca44de7..4af2aea 100644
--- a/testing/test_ccc.py
+++ b/testing/test_ccc.py
@@ -705,7 +705,9 @@ def test_ccc_whitelist(whitelist_ok, setup_ccc, ccc_ms_setup,
@pytest.mark.bitcoind
@pytest.mark.parametrize("velocity_mi", ['6 blocks (hour)', '48 blocks (8h)'])
def test_ccc_velocity(velocity_mi, setup_ccc, ccc_ms_setup, bitcoind, settings_set,
- policy_sign, settings_get, bitcoind_create_watch_only_wallet):
+ policy_sign, settings_get, bitcoind_create_watch_only_wallet,
+ enter_enabled_ccc, pick_menu_item, cap_story, need_keypress,
+ press_select, press_cancel):
settings_set("ccc", None)
settings_set("chain", "XRT")
@@ -713,7 +715,7 @@ def test_ccc_velocity(velocity_mi, setup_ccc, ccc_ms_setup, bitcoind, settings_s
blocks = int(velocity_mi.split()[0])
- setup_ccc(vel=velocity_mi)
+ c_words = setup_ccc(vel=velocity_mi)
_, target_mi = ccc_ms_setup()
assert settings_get("ccc")["pol"]["block_h"] == 0
@@ -786,6 +788,26 @@ def test_ccc_velocity(velocity_mi, setup_ccc, ccc_ms_setup, bitcoind, settings_s
violation="nLockTime not height"
)
+ enter_enabled_ccc(c_words)
+ pick_menu_item("Last Violation")
+ time.sleep(.1)
+ title, story = cap_story()
+ assert 'Press (1) to clear block height' in story
+ assert int(story.split("\n\n")[1]) == block_height
+ need_keypress("1")
+ time.sleep(.1)
+ title, story = cap_story()
+ assert "Reset block height to default value 0 for Bitcoin Regtest?" in story
+ press_select()
+ time.sleep(.1)
+ pick_menu_item("Last Violation")
+ time.sleep(.1)
+ title, story = cap_story()
+ assert 'Press (1) to clear block height' not in story # not in story when default
+ assert int(story.split("\n\n")[1]) == 0
+ press_cancel() # go back to CCC menu
+ press_cancel() # got home
+
@pytest.mark.bitcoind
def test_ccc_warnings(setup_ccc, ccc_ms_setup, bitcoind, settings_set, policy_sign,
Why this scored 22/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.