Skip to content

Conversation

@bigspider
Copy link
Collaborator

@bigspider bigspider commented Oct 14, 2025

Experimental PR to assess a possible improvement to the protocol:

  • whenever a code page is evicted, the VM sends an HMAC for the page for future use
  • if a code page for which the vanadium client has an HMAC is requested, send the HMAC instead of the Merkle proof.

This saves some bandwidth for repeated pages, especially on large/complex apps and on devices with smaller caches.

@bigspider
Copy link
Collaborator Author

For an e2e flow in the bitcoin V-App, the total transmitted data on Nano S+ goes from 407015+12927 to 321793+27053, about 17% reduction. For Nano X, from 767079+56228 to 567042+71809, about a 22% reduction.

So not sure it's worth the added complexity at this time.

Gains could be bigger if a model where the V-App is first installed (producing the hmac for all the code pages) is adopted.

@bigspider bigspider force-pushed the fast_proofs branch 2 times, most recently from d9d2d47 to dd054f3 Compare October 14, 2025 14:59
@bigspider bigspider changed the title [DRAFT] Implement hmac for repeated pages [DRAFT] Implement hmac for proving repeated code pages Oct 14, 2025
Incomplete: using a placeholder instead of the actual HMAC
(that should use a private key, possibly key deterministically
crated from the app hash (this would allow stored HMACs to
remain valid for future executions of the app).

Exploratory commit to modify the protocol to compute an hmac
before dropping a code page, so that the required data for pages
sent multiple times is reduced; moreover, the client could (in
principle) store it permanently for future executions of the
V-App).
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.

2 participants