Skip to content

docs: modernize smart-wallets references + rewrite guestbook tutorial - #2367

Closed
AshFrancis wants to merge 7 commits into
stellar:mainfrom
AshFrancis:docs/modernize-smart-wallet-references
Closed

AshFrancis wants to merge 7 commits into
stellar:mainfrom
AshFrancis:docs/modernize-smart-wallet-references

Conversation

@AshFrancis

Copy link
Copy Markdown
Contributor

Stellar's smart-wallets docs still point at passkey-kit and Launchtube. Launchtube's repository is archived and the hosted service at launchtube.xyz is offline, so the existing guestbook tutorial can't be completed end-to-end.

Updates the canonical smart-wallets references (smart-wallets.mdx, advanced-patterns.mdx) to point at the current stack: Smart Account Kit, OpenZeppelin Smart Account, and the OpenZeppelin Relayer (Stellar Channels).

Rewrites the 6-page guestbook tutorial (docs/build/apps/guestbook/*) against that stack. Drops the Mercury/Zephyr reverse-lookup indexer (Smart Account Kit keeps credential metadata in IndexedDB) and the Launchtube prerequisite (replaced by an OZ Channels API key). Switches the deploy target from Vercel to Cloudflare Pages so the /api/relay proxy can live alongside the static app.

Companion app updated: https://github.com/AshFrancis/ye-olde-guestbook (live on Testnet: https://ye-olde-guestbook.pages.dev).

Stellar's smart-wallets docs still point at the retired passkey-kit +
Launchtube stack. Launchtube's repo is archived and the hosted service
is offline, so the existing guestbook tutorial can't be completed as
written.

Update the canonical references to the current stack:

- passkey-kit → Smart Account Kit (https://github.com/kalepail/smart-account-kit)
- OpenZeppelin Smart Account contracts (audited signer/policy framework)
- Launchtube → OpenZeppelin Relayer (Stellar Channels plugin)

Changes:

- build/guides/contract-accounts/smart-wallets.mdx: rewrite the Tooling
  section. Lead with the current stack; flag passkey-kit + Launchtube
  as legacy with a pointer at the retirement.
- build/guides/contract-accounts/advanced-patterns.mdx: add Smart Account
  Kit alongside the OZ + Crossmint reference implementations.
- build/apps/guestbook/*: rewrite the 6-page tutorial against the new
  stack. The companion app is now a Cloudflare Pages deployment that
  uses Smart Account Kit + the OZ Channels relayer via a same-origin
  /api/relay proxy, so the API key stays server-side.

The reference app lives at https://github.com/AshFrancis/ye-olde-guestbook
(live: https://ye-olde-guestbook.pages.dev).
Copilot AI balanced review requested due to automatic review settings April 16, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes Stellar smart-wallet documentation and rewrites the Guestbook tutorial so it can be completed end-to-end using the current smart-account stack (Smart Account Kit + OpenZeppelin Smart Account + OpenZeppelin Relayer/Channels), replacing legacy Passkey Kit/Launchtube/Mercury dependencies.

Changes:

  • Updates canonical smart-wallet reference pages to point to OpenZeppelin Smart Account, Smart Account Kit, and OpenZeppelin Relayer (Channels).
  • Rewrites the Guestbook tutorial to use a server-side /api/relay proxy + funder account flow instead of Launchtube/Mercury.
  • Refreshes tutorial snippets and setup steps (bindings, prerequisites, overview) to match the new stack and deployment model.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/build/guides/contract-accounts/smart-wallets.mdx Replaces outdated tooling refs with current smart-account building blocks + notes predecessor tools.
docs/build/guides/contract-accounts/advanced-patterns.mdx Adds Smart Account / Smart Account Kit references to advanced patterns resources.
docs/build/apps/guestbook/setup-passkeys.mdx Rewrites passkey setup around Smart Account Kit + OZ Relayer proxy and new fund endpoint approach.
docs/build/apps/guestbook/passkeys-prerequisites.mdx Updates prerequisites from Launchtube/Mercury to OZ Relayer API key + funder account.
docs/build/apps/guestbook/overview.mdx Updates tutorial overview, repo links, deployment notes, and environment setup guidance.
docs/build/apps/guestbook/frontend.mdx Updates frontend walkthrough to use Smart Account Kit flows and updated transaction patterns.
docs/build/apps/guestbook/bindings.mdx Updates bindings-client snippet and references to the new guestbook repo + initialize script.
docs/build/apps/guestbook/README.mdx Refreshes summary to name the new recommended stack and link to relevant docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/build/apps/guestbook/overview.mdx Resolved
Comment thread docs/build/apps/guestbook/frontend.mdx Resolved
Comment thread docs/build/apps/guestbook/frontend.mdx Resolved
- throw `error(...)` instead of returning it in /api/relay, /api/fund,
  and /read/[id] snippets (SvelteKit's `error()` throws; `return` is
  misleading).
- Add goto/resolve imports to signGuestbook snippet so readers copying
  it don't hit missing imports.
- Overview: "fill in three things" → "two" (matches the .env snippet
  underneath, which has two vars).
- Reword the relayer-key warning: we use Bearer auth, not URL-path
  auth, so the original phrasing was misleading.
Per Copilot feedback: the earlier snippet omitted PRIVATE_RELAYER_BASE_URL
and only mentioned two variables to fill in, even though relayer.ts reads
a third. Include it with its Testnet default so a reader who stays on the
overview page has a complete picture of the relayer-related env vars.
smart-contract.mdx still linked to ElliotFriend/ye-olde-guestbook for
lib.rs/types.rs/test.rs, while every other guestbook page links to
AshFrancis/ye-olde-guestbook. Files are byte-identical in both repos,
but keeping the reader on one repo avoids confusion when they've cloned
the fork and are following along.
@kalepail

Copy link
Copy Markdown
Contributor

This PR still appears to resolve both live smart-wallet/Guestbook defects: main routes readers to legacy Passkey Kit and requires a LaunchTube JWT, while current guidance says LaunchTube is discontinued and Passkey Kit directs new apps to Smart Account Kit. CI is green; could a maintainer review/merge it or identify the remaining blocker?

@kalepail

Copy link
Copy Markdown
Contributor

Following up on my 2026-07-14 note: this PR now shows merge conflicts against main, so the "CI is green" observation no longer holds.

Both defects it fixes are still live on main:

  • the smart-wallet guide routes greenfield readers to Passkey Kit without carrying that package's own unaudited-demo / no-real-value warning or naming Smart Account Kit as the successor; and
  • the Guestbook passkey prerequisites still require a LaunchTube JWT while the OpenZeppelin Relayer page calls LaunchTube discontinued.

@AshFrancis — is this still something you want to carry? No pressure either way. So the defects stay tracked independently of the branch, I've opened #2700; happy to close that the moment this lands.

Resolved the four content conflicts on the guestbook and smart-wallet
pages. Kept this branch's rewrite and took main's title capitalization,
its nested-anchor fix in the overview intro, and its trailing-slash
cleanups on external links.
kalepail/smart-account-kit and kalepail/passkey-kit are both archived and
now live under the stellar org. Point every link at the new homes.

The CLI has no `stellar keys show` subcommand; the one that prints a
secret key is `stellar keys secret`.
Copilot AI review requested due to automatic review settings September 8, 2026 14:12
@kaankacar

Copy link
Copy Markdown
Contributor

🤖 Automated message from Kaan's Automated Triage Bot.

Reviewing because a review was requested by @ElliotFriend.

Decision needed: should this tutorial point at AshFrancis/ye-olde-guestbook (the author's own fork) or stay on ElliotFriend/ye-olde-guestbook? The upstream repo has since moved to smart-account-kit 0.6.2 on adapter-vercel, while this PR documents Cloudflare Pages. @kaankacar @ElliotFriend

Pushed to the branch: a merge of main (4 conflicts, all cosmetic), the SDK links moved to stellar/smart-account-kit and stellar/passkey-kit, and stellar keys show corrected to stellar keys secret.

@kaankacar kaankacar added the bot:needs-decision Bot needs a maintainer decision (listing, scope, policy) label Sep 8, 2026
@AshFrancis

Copy link
Copy Markdown
Contributor Author

Should stay on ElliotFriend/ye-olde-guestbook as this has now been updated in ElliotFriend/ye-olde-guestbook@6b78e46 tutorial may need some updates to reflect @ElliotFriend 's approach here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Suppressed comments (2)

docs/build/apps/guestbook/setup-passkeys.mdx:110

  • Current Smart Account Kit submission methods return a TransactionFailure for expected relayer or on-chain failures instead of throwing. Since all tutorial callers simply await send(), they proceed to redirects/success toasts after a failed submission. Convert unsuccessful results into an exception here so the existing caller catch blocks work.
export async function send<T>(tx: AssembledTransaction<T>) {
  const kit = await loadKit();
  return kit.signAndSubmit(tx);
}

docs/build/apps/guestbook/frontend.mdx:155

  • localStorage.clear() deletes every key owned by this origin, not just the guestbook session. Logging out should not erase unrelated preferences or state; remove only the two yog:* entries this store owns.
  window.localStorage.clear();

:::warning Production checklist

The implementation of this is outside the scope of this tutorial, but be sure to consider these kinds of risks as you prepare for a more production-level deployment.
For production, add rate limiting and origin checking to this endpoint so a bad actor can't burn your relayer credits forwarding arbitrary transactions. Out of scope for this tutorial, but don't skip it before going to Mainnet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated message from Kaan's Automated Triage Bot.

Reviewing because a review was requested by @ElliotFriend.

Not applying this one. The page already tells the reader to add rate limiting and origin checking before Mainnet. Contract allowlisting and fee ceilings go past the scope of a Testnet tutorial that says not to deploy it to Mainnet. The companion app keeps the same origin check.

publicKey: fundKeypair.publicKey(),
signAuthEntry: (auth) => fundSigner.signAuthEntry(auth),
});
export const GET: RequestHandler = async ({ params }) => {
Comment on lines +152 to +156
reset = () => {
this.keyId = null;
this.contractAddress = null;
window.localStorage.clear();
window.location.reload();

What more could you want!?
- a starter `/contracts` directory containing the guestbook Rust contract,
- a pre-configured `package.json` with Smart Account Kit, the OpenZeppelin Relayer client, and SvelteKit's Cloudflare adapter,
* A Stellar RPC server instance. Safe to import from server routes — this is
* the stock stellar-sdk RPC client, with no browser dependencies.
*/
export const rpc = new Server(PUBLIC_STELLAR_RPC_URL);
Comment on lines +239 to +241
// G-address stand-in for the source — stellar-sdk's Account rejects
// C-addresses. signAndSubmit re-signs with its own deployer before
// submitting, so this only affects the initial simulation.

We're setting this up in `src/lib/server/passkeyServer.ts`, for similar reasons we listed above. This gives us an importable `server` instance that can be accessed and used in other server-side logic. Svelte gives us the added benefit of [keeping the code in this directory safe](https://svelte.dev/docs/kit/server-only-modules#Your-modules). When we want to safeguard credentials and secrets, we can put any sensitive code in the `$lib/server` directory.
- **`{ func, auth }`** (Soroban host function + auth entries) → forwarded to OZ Channels, which wraps it in a channel-account transaction and pays fees. This is the sponsored path that user actions take (`kit.signAndSubmit`).
- **`{ xdr }`** (fully-signed envelope) → sent straight to Stellar RPC. Smart Account Kit's wallet-deploy flow takes this path: it signs with its shared deployer keypair (well-known, pre-funded on Testnet). OZ Channels rejects signed envelopes where `tx.fee != tx.sorobanData.resourceFee` — stellar-sdk's default fee includes a safety margin that breaks that strict equality — so we bypass the relayer for this specific case.
@kaankacar

Copy link
Copy Markdown
Contributor

🤖 Automated message from Kaan's Automated Triage Bot.

Reviewing because a review was requested by @ElliotFriend.

@AshFrancis confirmed the tutorial should follow ElliotFriend/ye-olde-guestbook. That app now runs smart-account-kit ^0.6.2 on Vercel. This PR teaches 0.2.10 on Cloudflare Pages, so three parts no longer match it:

  • the funder account and /api/fund route (0.6 has autoFund),
  • the signed-{xdr} deployer bypass (the shared deployer is sign-only),
  • the localStorage session (now kit.events and disconnect()).

Decision needed: re-aim the 6-page tutorial at Elliot's current app, or land the two smart-wallet reference pages alone and rewrite the tutorial separately? @kaankacar @ElliotFriend

I pushed no fix this time. Repointing the links alone would send readers to a repo that has none of these files. Copilot's other six findings are correct and all trace to the 0.2.x semantics above.

@ElliotFriend

Copy link
Copy Markdown
Contributor

superseded by #2837

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

PR Preview: torn down

ElliotFriend added a commit that referenced this pull request Oct 12, 2026
* Modernize smart-wallets references + rewrite guestbook tutorial

Stellar's smart-wallets docs still point at the retired passkey-kit +
Launchtube stack. Launchtube's repo is archived and the hosted service
is offline, so the existing guestbook tutorial can't be completed as
written.

Update the canonical references to the current stack:

- passkey-kit → Smart Account Kit (https://github.com/kalepail/smart-account-kit)
- OpenZeppelin Smart Account contracts (audited signer/policy framework)
- Launchtube → OpenZeppelin Relayer (Stellar Channels plugin)

Changes:

- build/guides/contract-accounts/smart-wallets.mdx: rewrite the Tooling
  section. Lead with the current stack; flag passkey-kit + Launchtube
  as legacy with a pointer at the retirement.
- build/guides/contract-accounts/advanced-patterns.mdx: add Smart Account
  Kit alongside the OZ + Crossmint reference implementations.
- build/apps/guestbook/*: rewrite the 6-page tutorial against the new
  stack. The companion app is now a Cloudflare Pages deployment that
  uses Smart Account Kit + the OZ Channels relayer via a same-origin
  /api/relay proxy, so the API key stays server-side.

The reference app lives at https://github.com/AshFrancis/ye-olde-guestbook
(live: https://ye-olde-guestbook.pages.dev).

* docs: address Copilot review feedback on guestbook tutorial

- throw `error(...)` instead of returning it in /api/relay, /api/fund,
  and /read/[id] snippets (SvelteKit's `error()` throws; `return` is
  misleading).
- Add goto/resolve imports to signGuestbook snippet so readers copying
  it don't hit missing imports.
- Overview: "fill in three things" → "two" (matches the .env snippet
  underneath, which has two vars).
- Reword the relayer-key warning: we use Bearer auth, not URL-path
  auth, so the original phrasing was misleading.

* docs: show PRIVATE_RELAYER_BASE_URL in overview .env snippet

Per Copilot feedback: the earlier snippet omitted PRIVATE_RELAYER_BASE_URL
and only mentioned two variables to fill in, even though relayer.ts reads
a third. Include it with its Testnet default so a reader who stays on the
overview page has a complete picture of the relayer-related env vars.

* docs: follow the moved SDK repos and fix the funder secret command

kalepail/smart-account-kit and kalepail/passkey-kit are both archived and
now live under the stellar org. Point every link at the new homes.

The CLI has no `stellar keys show` subcommand; the one that prints a
secret key is `stellar keys secret`.

* docs: carry over guestbook contract and bindings fixes from #1945

Accuracy fixes that are independent of the smart-account stack, so they
survive the rewrite: the contract uses `__constructor` (not `initialize`),
`DataKey` is an enum, and the deploy command needs its constructor
arguments after the `--` separator.

Refs #1945

Co-Authored-By: Kaan Kacar <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: re-aim the guestbook tutorial at the current app

Ash Francis's rewrite in #2367 targeted smart-account-kit 0.2.10 on
Cloudflare Pages. ye-olde-guestbook now runs ^0.6.2 on Vercel, so point
the pages at what the app actually does: /api/send rather than an
/api/relay Pages Function, smartAccountClient.ts rather than
passkeyClient.ts, the kit's autoFund and fundWallet rather than a funder
G-account, and kit events rather than localStorage.

Correct the indexer story while we're here. The kit defaults to Mercury's
hosted smart-account-indexer, so the reverse lookup did not disappear
with Launchtube, it just stopped being something you deploy yourself.
Draw that boundary explicitly, since conflating the two breaks
returning-user login on an unseen device.

Refs #2367, #1945
Closes #2700

Co-Authored-By: Ash Francis <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: use the workspace protocol for the guestbook bindings package

ye-olde-guestbook keeps its bindings in a pnpm workspace now, so
`pnpm add file:./packages/ye_olde_guestbook` no longer reflects what the
repo does. Use `pnpm add -D ye_olde_guestbook --workspace`, which records
`workspace:*` the way the app's package.json does.

Replace the nested `cd packages/... && pnpm install && pnpm run build`
with the workspace housekeeping initialize.js actually performs: drop the
standalone lockfile the CLI emits, and set a `prepare` script so pnpm
compiles the bindings on install.

Refs #2837

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: match the automated bindings list to what initialize.js does

The manual method now covers the pnpm workspace housekeeping, but the
automated section's bullet list stopped at "generate bindings", so the two
no longer described the same work. Name the prepare script, the dist/
gitignore, and the standalone lockfile removal, and correct the deploy
bullet to mention the compile step.

Refs #2837

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: trim the guestbook frontend walkthrough to the parts that teach

The code blocks reproduced whole Svelte components, so only about 14% of
their lines touched Smart Account Kit or the network. Two blocks (the
sign-page form markup and the read/[id] component) had no Stellar content
at all, and the form markup opened the tutorial's main event.

Drop those two, trim the toast and loading-state ceremony from the rest,
and mark every omission with a `// ...omitted:` comment naming what is
gone. Lessons that the prose was narrating now live in code comments, so
the signup section loses a paragraph that restated its own snippet.

311 code lines become 232 across 11 blocks rather than 13.

Refs #2837

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: keep the guestbook section description short enough to be usable

The stack links were appended to the intro paragraph, which the llms
plugin takes as the page description. That pushed it from 273 to 578
characters and tripped a build warning. Split the stack into its own
paragraph.

Refs #2837

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: tighten the guestbook relayer proxy origin check

Match the origin exactly rather than by substring, and explain why the
forwarded payload is wrapped in `params` when the relayer guide's SDK
examples aren't.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: drop migration framing from guestbook passkey prerequisites

The page spent most of its length contrasting the current setup with the
retired Launchtube and self-hosted Zephyr approach, which means nothing to
a first-time reader. Describe the relayer, the funding helper, and the
hosted indexer in the present tense instead, keeping the point that Mercury
is still doing the credential-to-address lookup even though nobody
configures it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix old-style admonition title

* docs: describe the guestbook tooling without the before-and-after

A first-time reader has no memory of Launchtube or of an earlier draft
of this tutorial, so framing the current setup as a departure from those
only adds noise. One pointer to passkey-kit stays in the overview for
readers arriving from an older demo, and the smart wallets guide still
carries the full predecessor mapping.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: correct what the guestbook relayer proxy passes through

The kit treats a submission as successful only when the response status
is ok and the body carries a top-level `success: true`, so the route
cannot accept a bare transaction result the way the page claimed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: cover the kit's connection-verification failures

connectWallet() verifies provenance, contract code, and signer state
before it connects, and a failed check throws rather than connecting.
"Try again later" is misleading advice for most of them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: compile the guestbook bindings explicitly, not via prepare

pnpm skips lifecycle scripts when an install has no work to do, which
leaves dist/ missing on a warm build cache.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: scope the guestbook testing caveat to the frontend

The smart contract has a test suite; the frontend is the part with no
automated testing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: bound guestbook RPC reads and clarify tutorial claims

* docs: sync guestbook snippets with the SvelteKit 3 app

- move imports to `#lib` and `$app/env/*`, and pass string messages to `error()`
- check the `cause` of wrapped passkey dismissals
- drop the batching caveat now that the app reads in batches of 200

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: describe passkey-kit as a sibling of smart-account-kit

Refs #2700

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Ash Francis <[email protected]>
Co-authored-by: kaankacar <[email protected]>
Co-authored-by: Kaan Kacar <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: kalepail <[email protected]>
@kalepail

Copy link
Copy Markdown
Contributor

Raven verified the fix that replaced this PR. PR #2837 added the documentation changes to main. Its merge commit is 2dd75fef3ea318d19cf8af8a261a2a37c4701982, merged 2026-10-12T20:37:44Z.

Raven rechecked both findings live on 2026-10-13T16:13:13Z. The Guestbook prerequisites page has 0 LaunchTube matches. The smart-wallets guide has 0 archived kalepail/passkey-kit links. It presents Smart Account Kit and Passkey Kit as siblings. An independent reviewer (Codex gpt-6-astra, high) reproduced the result on 2026-10-13. The full recheck is in Raven's resolution comment on #2700.

Raven will retire both findings. Immutable source snapshots:

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

Labels

bot:needs-decision Bot needs a maintainer decision (listing, scope, policy)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants