Skip to content

Commit 7ae3818

Browse files
authored
Merge pull request #2 from dusk-network/docs/v01-release-docs
Consolidate v0.1 Wallet + Connect docs
2 parents 2b43987 + a1b8a28 commit 7ae3818

5 files changed

Lines changed: 114 additions & 27 deletions

File tree

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ A tiny, framework-agnostic SDK for **Dusk wallet discovery + dApp integration**.
99
- Includes an **optional connect modal** (conceptually similar to a very small Reown/AppKit)
1010
- Includes an optional **connect button** (`<dusk-connect-button />`) for drop-in UI
1111

12-
This SDK targets the wallet provider described in the
13-
[Dusk Wallet provider API](https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md).
14-
The discovery protocol itself is specified in [docs/wallet-discovery.md](./docs/wallet-discovery.md).
15-
If you're implementing a wallet, start with
16-
[docs/wallet-implementer.md](./docs/wallet-implementer.md).
12+
Canonical v0.1 docs:
13+
14+
- Provider API: [dusk-network/wallet docs/provider-api.md](https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md)
15+
- Discovery protocol: [docs/wallet-discovery.md](./docs/wallet-discovery.md)
16+
- Connect SDK usage: this README
17+
- Wallet implementer guidance: [docs/wallet-implementer.md](./docs/wallet-implementer.md)
18+
- Security/threat model: [dusk-network/wallet docs/SECURITY.md](https://github.com/dusk-network/wallet/blob/main/docs/SECURITY.md)
19+
- v0.1 release checklist: [docs/RELEASE_CHECKLIST_v0.1.md](./docs/RELEASE_CHECKLIST_v0.1.md)
1720

1821
Wallet discovery is **event-based**, not singleton-based:
1922

@@ -508,7 +511,11 @@ Example (served from your own site):
508511
console.log("Dusk Wallet not installed");
509512
} else {
510513
await wallet.connect();
511-
await wallet.sendTransfer({ to: "<base58>", amount: parseDuskToLux("1") });
514+
await wallet.sendTransfer({
515+
privacy: "public",
516+
to: "<base58-public-account-id>",
517+
amount: parseDuskToLux("1"),
518+
});
512519
}
513520
</script>
514521
```

docs/RELEASE_CHECKLIST_v0.1.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# v0.1 Release Checklist
2+
3+
This is the canonical Dusk Wallet + Connect v0.1 release checklist. It links to
4+
the owner docs instead of restating their full specifications.
5+
6+
## Canonical Docs
7+
8+
- [ ] Wallet provider API is current in `dusk-network/wallet/docs/provider-api.md`.
9+
- [ ] Discovery protocol is current in `dusk-network/connect/docs/wallet-discovery.md`.
10+
- [ ] Connect SDK usage is current in `dusk-network/connect/README.md`.
11+
- [ ] Wallet implementer guidance is current in `dusk-network/connect/docs/wallet-implementer.md`.
12+
- [ ] Security/threat model is current in `dusk-network/wallet/docs/SECURITY.md`.
13+
- [ ] Vulnerability reporting contact or private reporting instructions are present and non-placeholder in `dusk-network/wallet/docs/SECURITY.md`.
14+
15+
## Provider Surface
16+
17+
- [ ] Public docs use `dusk_requestProfiles`, `dusk_profiles`, and `profilesChanged`.
18+
- [ ] `shieldedAddress` is documented as present only after explicit approval.
19+
- [ ] Deprecated account-style APIs are absent from v0.1 examples or clearly marked deprecated.
20+
- [ ] Wallet `providerSurface` constants, provider docs, Connect README, and conformance tests agree on RPC methods.
21+
- [ ] Error codes, permissions, limits, and event names match the wallet provider API.
22+
23+
## Verification
24+
25+
- [ ] Wallet conformance tests pass.
26+
- [ ] Connect conformance tests pass.
27+
- [ ] Wallet build passes for supported extension targets.
28+
- [ ] Connect build passes and generated types match source.
29+
- [ ] Remaining v0.1 ambiguities are listed in the release notes or final audit report.
30+
31+
## Release Hygiene
32+
33+
- [ ] Version numbers and package metadata match the intended v0.1 release.
34+
- [ ] Published package contents and extension artifacts are validated from clean builds.
35+
- [ ] Dependency update and security advisory PRs are triaged before release tagging.
36+
- [ ] Vulnerability reporting instructions are checked after branch/tag publication.

docs/wallet-discovery.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Dusk Wallet Discovery Standard
22

3-
This document defines the canonical browser discovery flow for Dusk wallets.
3+
This document is the canonical browser discovery protocol for Dusk wallets.
4+
It deliberately does not duplicate the provider RPC specification. The
5+
provider API is owned by
6+
[dusk-network/wallet docs/provider-api.md](https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md).
47

58
If you want an implementer-oriented walkthrough with a minimal provider fixture,
69
see [wallet-implementer.md](./wallet-implementer.md).
@@ -78,9 +81,17 @@ Expected semantics:
7881

7982
Wallets should keep `uuid` stable across page loads and product versions. dApps should de-duplicate discovered wallets by `uuid`.
8083

81-
## Provider Contract
84+
## Provider Summary
8285

83-
The announced `provider` should expose the Dusk provider API:
86+
Discovery only hands the dApp a provider object. The current v0.1 provider
87+
identity model is profile-based:
88+
89+
- connect with `dusk_requestProfiles`
90+
- read current grants with `dusk_profiles`
91+
- listen for `profilesChanged`
92+
- request a `shieldedAddress` only through explicit user approval
93+
94+
The provider should expose:
8495

8596
- `request({ method, params })`
8697
- `on`, `once`, `off`, `removeListener`, `removeAllListeners`
@@ -90,21 +101,9 @@ The announced `provider` should expose the Dusk provider API:
90101
- `isAuthorized`
91102
- `isDusk === true`
92103

93-
RPC methods remain Dusk-prefixed:
94-
95-
- `dusk_getCapabilities`
96-
- `dusk_requestProfiles`
97-
- `dusk_profiles`
98-
- `dusk_requestShieldedAddress`
99-
- `dusk_chainId`
100-
- `dusk_switchNetwork`
101-
- `dusk_getPublicBalance`
102-
- `dusk_estimateGas`
103-
- `dusk_sendTransaction`
104-
- `dusk_watchAsset`
105-
- `dusk_signMessage`
106-
- `dusk_signAuth`
107-
- `dusk_disconnect`
104+
See the wallet repo's
105+
[provider API](https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md)
106+
for the canonical method, event, error, permission, and limit definitions.
108107

109108
## Selection Rules
110109

docs/wallet-implementer.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Dusk Wallet Implementer Guide
22

33
This guide is for wallet teams that want to expose a Dusk provider compatible
4-
with `@dusk-network/connect`.
4+
with `@dusk-network/connect` and the v0.1 Dusk Wallet provider API.
5+
6+
Canonical source ownership:
7+
8+
- Discovery protocol: [wallet-discovery.md](./wallet-discovery.md)
9+
- Provider API: [dusk-network/wallet docs/provider-api.md](https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md)
10+
- Security/threat model: [dusk-network/wallet docs/SECURITY.md](https://github.com/dusk-network/wallet/blob/main/docs/SECURITY.md)
11+
- Runnable SDK fixture: `examples/reference-wallet/`
12+
- SDK conformance coverage: `src/wallet-implementer.integration.test.ts`
513

614
Discovery is event-based:
715

@@ -56,9 +64,10 @@ type DuskProfile = {
5664
};
5765
```
5866

59-
## RPC Methods
67+
## RPC Method Summary
6068

61-
Wallets should expose the Dusk Send provider methods:
69+
The wallet repo's provider API is the canonical source for method parameters,
70+
permissions, errors, and limits. Wallets should expose these v0.1 methods:
6271

6372
- `dusk_getCapabilities`
6473
- `dusk_requestProfiles`

src/discovery.conformance.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ function extractSectionBacktickedBullets(markdown: string, sectionTitle: string)
3636
return out;
3737
}
3838

39+
function extractCallObjectArgs(source: string, callName: string): string[] {
40+
const out: string[] = [];
41+
const re = new RegExp(`${callName}\\s*\\(\\s*\\{([\\s\\S]*?)\\}\\s*\\)`, "g");
42+
43+
for (;;) {
44+
const match = re.exec(source);
45+
if (!match) break;
46+
out.push(match[1] ?? "");
47+
}
48+
49+
return out;
50+
}
51+
3952
describe("Discovery Conformance", () => {
4053
it("docs/wallet-discovery.md matches exported discovery events and info fields", async () => {
4154
const docPath = path.resolve(process.cwd(), "docs", "wallet-discovery.md");
@@ -88,4 +101,27 @@ describe("Discovery Conformance", () => {
88101
}
89102
}
90103
});
104+
105+
it("README documents the canonical v0.1 doc owners", async () => {
106+
const readmePath = path.resolve(process.cwd(), "README.md");
107+
const md = await readFile(readmePath, "utf8");
108+
109+
expect(md).toContain("Provider API");
110+
expect(md).toContain("Discovery protocol");
111+
expect(md).toContain("Connect SDK usage");
112+
expect(md).toContain("Wallet implementer guidance");
113+
expect(md).toContain("Security/threat model");
114+
expect(md).toContain("v0.1 release checklist");
115+
});
116+
117+
it("README sendTransfer examples include required transfer privacy", async () => {
118+
const readmePath = path.resolve(process.cwd(), "README.md");
119+
const md = await readFile(readmePath, "utf8");
120+
const examples = extractCallObjectArgs(md, "sendTransfer");
121+
122+
expect(examples.length).toBeGreaterThan(0);
123+
for (const example of examples) {
124+
expect(example, example).toMatch(/\bprivacy\s*:\s*["'](?:public|shielded)["']/);
125+
}
126+
});
91127
});

0 commit comments

Comments
 (0)