Fix Terra Classic / Keplr: ADR-036 verify + correct frontend signArbitrary #1
Labels
No labels
agent:implement
agent:ready
api
bot
bug
ci
enhancement
ready
security
terra-classic
testing
ux
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-ecosystem-legal#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Make Terra Classic (
TERRA_CLASSIC) signing work end-to-end with Keplr on the web portal, matching ADR-036signArbitrarysemantics on both the frontend and the API verifier.Out of scope for this issue: Telegram, Solana, bot enforcement, WalletConnect / multi-wallet pickers.
Related gap analysis:
gaps/GAP_1786322222.md(Terra / Keplr critical finding).Current codebase
Portal (
web/)web/src/pages/terra.tsenables Keplr oncolumbus-5, obtains an OfflineSigner viagetOfflineSigner, then calls:Keplr’s real API is
window.keplr.signArbitrary(chainId, signerAddress, data), not a 2-arg Offline-signer method. The current call is incorrect against production Keplr.Signature + pubkey are submitted to
POST /api/v1/signatures/walletwithnetwork: "TERRA_CLASSIC".API (
api/)api/src/verify/terra.rsis documented as “ADR-036 stylesignArbitrary” but verifies ECDSA over rawmessage.as_bytes().signArbitrarysigns an ADR-036 amino/JSONsign/MsgSignDatadocument (hashed per cosmos ADR-036), not the bare UTF-8 legal message.api/src/account.rsonly requires aterraprefix (weak bech32 validation).api/src/verify/mod.rs→api/src/routes/signatures.rswallet submit.Message format (shared)
packages/cl8y-clickwrap/src/message.ts/api/src/message.rs(version, effective date, property, network, account, timestamp). That plain-text string is what the user should see in Keplr; ADR-036 wraps that string as the signed data payload.Why this is needed
Terra Classic is an in-scope portal network. Today the path is non-functional against real Keplr: wrong client API and wrong server verify. Integrators and end users following
sign_urls.terra//sign/terra-classiccannot complete acceptance. Leaving it broken erodes trust in the legal portal and blocks CL8Y properties that rely on Terra Classic wallets.Constraints / guardrails
TERRA_CLASSIConly. Do not change Telegram/Solana flows in this issue.columbus-5) unless product explicitly expands; do not silently retarget Terra 2.0.terra…address.keplr.signArbitrarydirectly.Relevant files
web/src/pages/terra.tsapi/src/verify/terra.rsapi/src/verify/mod.rsapi/src/routes/signatures.rs,api/src/signatures.rsapi/src/account.rsapi/src/message.rs,packages/cl8y-clickwrap/src/message.tsweb/e2e/packages/cl8y-clickwrap/src/types.tsRecommended direction
await window.keplr.signArbitrary(TERRA_CHAIN_ID, account.address, message)(orTextEncoderbytes if Keplr requiresUint8Array— match Keplr docs). Submitsignature+pub_key.value(base64) as today.account_id.starts_with("terra").Acceptance criteria
signArbitrary(chainId, signer, data)API.signed_latest: truefor(property, TERRA_CLASSIC, account).columbus-5) remains the target chain.Test plan (functional paths)
POST /signatures/walletwith Terra ADR-036 proof →GET /signatures/statussigned_latest=true./sign/terra-classic?property=…→ Keplr (or mock) → success UI.Test plan (attack / abuse / hack vectors)
property/version_label/accountaccount_idaddress BVerification criteria
cd api && cargo testincludes Terra ADR-036 tests green.test:rust+test:e2e(or new Terra e2e) green.gaps/GAP_1786322222.mdconsidered resolved for portal scope.mentioned in issue #4
marked as related to #4
mentioned in merge request !23
Implemented in !23 (worktree
fix/terra-classic-adr036).window.keplr.signArbitrary(columbus-5, …)signed_latest, Playwright Keplr mockskills/terra-classic-adr036/SKILL.md, gap note updateMerge readiness check (MR !23)
Reviewed tip
6ec0af6against issue #1 acceptance criteria.Acceptance criteria
signArbitrary(chainId, signer, data)signed_latest: truecolumbus-5CI on tip: pipeline #2745946647 green (
test:rust+test:e2e). MR source was stale at74a80e6and has been updated to6ec0af6.Residual / follow-ups (non-blocking)
account_idin body (covered inverify_terraunit path, not a separate HTTP case).fix/terra-classic-adr036.mentioned in commit
03849d3bedMerged
MR !23 merged to
mainas03849d3(source tip6ec0af6).Issue #1 acceptance criteria are satisfied in code + CI (
test:rust,test:e2e). Remaining optional: one manual real-Keplr smoke before production cutover.mentioned in commit
69e117eb88mentioned in merge request !24
mentioned in issue #9
marked as related to #9
mentioned in merge request !29
mentioned in issue #10