You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Contract: rebuild the AdSense claim in the encoding the AdSense API actually produces #76
startDate.year=2026&startDate.month=7&startDate.day=1, unpadded. This is the only form reports:generate accepts.
extractedParameters
{currency, endDate, revenueUsd, startDate}
{revenueUsd}. The response echoes dates as JSON objects, so one regex group cannot capture 2026-07-01.
What to build
Keep the interface and the nullifier as they are.request_advance(…, window_start: "YYYY-MM-DD", window_end, …) and the nullifier over those strings don't change.
Split each date inside the contract into unpadded ASCII year, month and day. This is fixed-width parsing of 10 bytes; no JSON is involved.
Fill a 7-value template:pub_id, sy, sm, sd, ey, em, ed.
Rebuild extractedParameters as {"revenueUsd":"<x>"}.
Currency stays enforced by the signed "currencyCode": "USD" match in parameters.
One issue, one owner. 2. Branch per issue, named above — not the GitHub-suggested one. 3. MCP Stellar Raven for any Stellar/Soroban fact that gets written down. 4. Merge through PR review by Axel (PM); no self-merge. If an ACC has not arrived within two days on something already verified, merge and say so in the PR. 5. Deploys need evidence: contract address or tx hash on stellar.expert, recorded in docs/deployments.md. 6. Secrets live in .env, gitignored, chmod 600 — never printed, never committed, never pasted into an issue or PR. Only public G… and C… addresses appear anywhere. 7. Issues, commits and PRs in English.
Taken and merged in #79. @Lin1er — you were right, and I checked it against Google's reference before touching anything rather than taking the report on trust.
accounts.reports.generate declares startDate and endDate as object (Date), and Date is {year, month, day} as integers. The REST transport flattens that into startDate.year=2026&startDate.month=7&startDate.day=1, unpadded because they are integers. There is no string date form. ?startDate=2026-07-01 is a request Google cannot serve.
Your proposal is what landed, unchanged:
template is 8 parts / 7 values: pub_id, sy, sm, sd, ey, em, ed
claim::split_date converts YYYY-MM-DD inside the contract — ten bytes, fixed-width, every byte checked, no JSON
extractedParameters is {"revenueUsd":"<x>"} alone
request_advance and the nullifier are byte-identical to before
I also made set_claim_template refuse a four-part template outright, rather than accept it and fail per proof later with a bare ClaimMismatch.
The window and the currency are not weaker now
Worth stating plainly, because "we removed two fields from the signed context" reads alarming:
Was asserted by
Now asserted by
extractedParameters.currency
the "currencyCode": "USD" response match
extractedParameters.startDate / .endDate
the URL
Both live in parameters, which the contract pins and rebuilds. The window is arguably held more tightly: it is now in the thing Google computed the totals from, not in an echo of it.
executable_at 2026-10-21 ~08:50 UTC. After execute_upgrade I re-pin the dev template with the eight new parts and re-run the rehearsal end to end, and post both here.
Heads up on a deliberate gap: the dev contract still has the old four-part template pinned. The moment the new wasm is live its verify_claim refuses everything, until I re-pin. That is intended, not an outage.
Two things I got wrong, for the record
The freeze. I froze a claim shape before any real AdSense response existed, knowing it was a gamble, and wrote that the gamble was contained because the template is admin-settable. It wasn't contained: the arity of the template and the keys of the context were baked into the wasm, so the part I thought one storage write could fix needed a code change, a release and a 24-hour timelock. The lesson is narrower than "don't freeze early" — it is that the part of a freeze describing someone else's API is a guess until it is read against that API. Checking it never needed a live account. The reference page was enough, and nobody opened it.
The fixture.forepay-claim.json was a hand-pasted blob with no generator, so when the encoding went stale there was no mechanism by which anyone would notice — the digest tests would have kept passing against bytes that described nothing. It now comes from tools/make_claim_fixture.py with a CI --check.
Thanks for finding this by reading the document against the API instead of against our own code. That is the only way it could have surfaced before the first real proof, and it would have surfaced at the demo otherwise.
Activity
chore(#76): record the linux wasm hash CI measured for the new encoding
fix(#76): rebuild the claim in the encoding AdSense actually produces (…
docs(#76): the encoding defect, the release, and the two proposed upg…
Lexirieru commentedon Oct 20, 2026
Taken and merged in #79. @Lin1er — you were right, and I checked it against Google's reference before touching anything rather than taking the report on trust.
accounts.reports.generatedeclaresstartDateandendDateasobject (Date), andDateis{year, month, day}as integers. The REST transport flattens that intostartDate.year=2026&startDate.month=7&startDate.day=1, unpadded because they are integers. There is no string date form.?startDate=2026-07-01is a request Google cannot serve.Your proposal is what landed, unchanged:
pub_id, sy, sm, sd, ey, em, edclaim::split_dateconvertsYYYY-MM-DDinside the contract — ten bytes, fixed-width, every byte checked, no JSONextractedParametersis{"revenueUsd":"<x>"}alonerequest_advanceand the nullifier are byte-identical to beforeI also made
set_claim_templaterefuse a four-part template outright, rather than accept it and fail per proof later with a bareClaimMismatch.The window and the currency are not weaker now
Worth stating plainly, because "we removed two fields from the signed context" reads alarming:
extractedParameters.currency"currencyCode": "USD"response matchextractedParameters.startDate/.endDateBoth live in
parameters, which the contract pins and rebuilds. The window is arguably held more tightly: it is now in the thing Google computed the totals from, not in an echo of it.Deployment
v0.3.0, wasmade4687f…5323fbf0ef71…33d30715d56f…593d91a7fa0a…executable_at2026-10-21 ~08:50 UTC. Afterexecute_upgradeI re-pin the dev template with the eight new parts and re-run the rehearsal end to end, and post both here.Heads up on a deliberate gap: the dev contract still has the old four-part template pinned. The moment the new wasm is live its
verify_claimrefuses everything, until I re-pin. That is intended, not an outage.Two things I got wrong, for the record
The freeze. I froze a claim shape before any real AdSense response existed, knowing it was a gamble, and wrote that the gamble was contained because the template is admin-settable. It wasn't contained: the arity of the template and the keys of the context were baked into the wasm, so the part I thought one storage write could fix needed a code change, a release and a 24-hour timelock. The lesson is narrower than "don't freeze early" — it is that the part of a freeze describing someone else's API is a guess until it is read against that API. Checking it never needed a live account. The reference page was enough, and nobody opened it.
The fixture.
forepay-claim.jsonwas a hand-pasted blob with no generator, so when the encoding went stale there was no mechanism by which anyone would notice — the digest tests would have kept passing against bytes that described nothing. It now comes fromtools/make_claim_fixture.pywith a CI--check.Thanks for finding this by reading the document against the API instead of against our own code. That is the only way it could have surfaced before the first real proof, and it would have surfaced at the demo otherwise.
tools(#61): derive the claim template from a real proof, and prove it…
docs: #76 executed and the dev template re-pinned, with a 21,370 XLM …
docs(#81): the borrower-authorisation upgrade, proposed
docs(#102,#94): v0.5.0 executed, claim owner and AdMob template pinned