Adapt Dotify for Product DevNet - #108
Merged
Merged
Conversation
✅ Deploy Preview for muzinga ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Jul 26, 2026
knzeng-e
marked this pull request as ready for review
August 3, 2026 13:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Adds the first Product DevNet-compatible Dotify slice while preserving the standalone Netlify/Fly web path. The same UI can now run as a regular browser app or as a Product-hosted
.dotapp, with explicit host detection, a Product account identity option, canonical Product room links, and documented deployment/config boundaries.This is a baseline, not the full Product SDK port. It intentionally keeps contract writes, protected key access, room media, and upload custody on the current proven Dotify boundaries until the Product host adapters prove stronger guarantees.
Issue and context
Refs #85.
Local scope docs:
docs/backlog/polkadot-product-readiness-and-killer-dapp-roadmap.mddocs/explanation/product-devnet-architecture.mddocs/operations/product-devnet-deployment.mddocs/reference/environment-variables.mdIssue #85 asks Dotify to run as a first-class Polkadot Product through a host-mediated boundary while keeping ordinary browser access. Before this PR, Dotify assumed the standalone web environment: injected EVM wallets, direct Vite envs, Fly API/signaling, Netlify hosting, and Socket.IO/WebRTC rooms.
The Product DevNet changes the host contract. Product accounts are app-scoped host identities, not EIP-1193 wallets. Product publication uses
pad/Bulletin/DotNS-style static assets, and host capabilities may be missing outside the Product container. Dotify's north star still requires a room to feel like sharing a link, so Product mode cannot make wallet or host approval mandatory for room guests.The deploy target is now
dotify-test01.dot/https://dotify-test01.dev-dot.libecausedotify.dotcurrently requires full personhood on Product DevNet. The docs keep that reason explicit so operators do not retry the blocked name by accident.Architecture and key concepts
The PR introduces an adaptive host layer instead of replacing the current production path.
Key boundaries:
web/src/features/productHost/productHost.tsis the only Product SDK adapter in this slice.VITE_PUBLIC_APP_URL, so shared links are stable outside the host container.How it works
In standalone browser mode, Dotify behaves as before. The existing wallet modal still offers the injected EVM path, catalog loading still uses the configured API/read model, and rooms still use the Fly signaling server.
In Product mode,
VITE_PRODUCT_HOST_MODEcontrols host behavior:off: never probe Product host APIs;auto: detect Product host support and show Product identity when available;required: fail explicitly when the host is missing or unsupported.When a user clicks the Product option in the wallet modal, Dotify requests the app-scoped Product account through the host. The resulting SS58 identity is converted into a deterministic H160-shaped local identity so existing session/room UI can show a stable participant identity. The wallet provider deliberately leaves
createEvmClientabsent for this method, which keeps publish/payment/protected-key flows from accidentally treating the Product account as an EVM private key.The Product build uses
web/vite.product.config.ts,web/.env.product-devnet, andweb/polkadot-app-deploy.config.ts. Publication is prepared withnpm run build:product-devnetandnpm run deploy:product-devnet, but the PR does not deploy anything by itself.Design decisions and tradeoffs
The chosen design is dual-mode because Dotify already has a working production spine on Netlify/Fly and because Product SDK/Host APIs are still a moving, prototype-grade boundary. A hard switch to Product SDK would risk breaking first sound, room joins, and protected key custody.
Alternatives considered:
pallet-revive/PolkaVM CDM flows, while Dotify's current writes use Hardhat Solidity ABIs and viem on Asset Hub EVM.Security, failure, and operations
Security invariants:
Operational boundaries:
CATALOG_SNAPSHOT_PATHremains optional to boot, but recommended on a durable Fly volume for production catalog persistence.VITE_PUBLIC_APP_URLshould behttps://dotify-test01.dev-dot.lifor Product publication so room links do not leak an internal/container URL..dotownership/registration, andpad --env devnetpublication.Review guide
Suggested order
web/src/features/productHost/productHost.tsandproductHost.test.ts- verify lazy host detection, Product account connection, identity derivation, and fail-closed errors.web/src/app/providers/WalletProvider.tsx,web/src/hooks/useWallet.ts,web/src/components/WalletModal.tsx- verify Product identity is surfaced without becoming an EVM signer.web/src/hooks/useSession.ts,web/src/features/rooms/roomState.test.ts,web/src/shared/config/deploymentSafety.ts- verify Product-origin room links and public URL validation.services/api/src/config.ts,services/api/src/app.ts,services/api/src/cors.test.ts,services/api/fly.toml,web/fly.signal.toml- verify multi-origin CORS behavior.web/vite.product.config.ts,web/.env.product-devnet,web/polkadot-app-deploy.config.ts,web/package.json- verify Product build/deploy wiring and pinned tooling.docs/explanation,docs/operations,docs/reference,docs/backlog, plusdocs/index.html- verify the public architecture story does not overclaim delivered Product-native capabilities.Verify carefully
Validation
git diff --checkcd web && npm run fmt:checkcd web && npm run lintApp.tsxandArtistShell.tsx.cd web && npm run test:unitcd web && npm run test:signalcd services/api && npm testdotify-test01.dev-dot.li.cd web && npm run buildcd web && npm run build:product-devnetdist-productwith relative asset paths and thedotify-test01.dotprofile.cd services/api && npm run buildnode scripts/backlog-sync.mjs --check --offlineKnown limitations and follow-ups
This PR should remain
Refs #85, notCloses #85.Remaining before #85 can close:
Metadata checklist
Dotify sprints)knzeng-edotify-backlog,product-sdk