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
description: Use when writing tutorial documentation or create-leo-app examples for the Provable SDK (@provablehq/sdk). Covers how to structure runnable templates, write tutorial-style docs, and handle Node.js vs web runtime differences.
3
+
description:
4
+
Use when writing tutorial documentation or create-leo-app examples for the
5
+
Provable SDK (@provablehq/sdk). Covers how to structure runnable templates,
6
+
write tutorial-style docs, and handle Node.js vs web runtime differences.
4
7
---
5
8
6
9
# Provable SDK Tutorial Docs
7
10
8
11
## Overview
9
12
10
13
This skill guides writing two interconnected artifacts for each SDK feature set:
14
+
11
15
1. A runnable **create-leo-app template** demonstrating the features
12
16
2.**Tutorial documentation** that walks readers through the template
13
17
14
-
The template and tutorial are the same content expressed two ways — step numbers, section names, and code structure must correspond exactly.
18
+
The template and tutorial are the same content expressed two ways — step
19
+
numbers, section names, and code structure must correspond exactly.
15
20
16
21
---
17
22
18
23
## Step 0: Gather Inputs Before Writing Anything
19
24
20
25
Require the developer to specify:
21
26
22
-
| Input | Description |
23
-
|-------|-------------|
24
-
|**Feature bucket**| Explicit list of SDK features to demonstrate (e.g. "key caching, offline execution, deployment") |
25
-
|**Target runtimes**|`node`, `web`, or `both`|
26
-
|**Highlight areas**| What concepts readers should leave understanding — not just what the code does, but WHY |
27
-
|**Complexity level**| beginner / intermediate / advanced — determines how much Aleo/ZK background to assume |
|**Feature bucket**| Explicit list of SDK features to demonstrate (e.g. "key caching, offline execution, deployment") |
30
+
|**Target runtimes**|`node`, `web`, or `both`|
31
+
|**Highlight areas**| What concepts readers should leave understanding — not just what the code does, but WHY|
32
+
|**Complexity level**| beginner / intermediate / advanced — determines how much Aleo/ZK background to assume |
28
33
29
34
---
30
35
31
36
## SDK Runtime Context
32
37
33
-
Tutorials must open with context about why someone would use the SDK in this environment. Use the framing below as a guide.
38
+
Tutorials must open with context about why someone would use the SDK in this
39
+
environment. Use the framing below as a guide.
34
40
35
41
### Node.js
36
42
37
43
The SDK runs natively in Node — no WASM worker setup needed. Common use cases:
38
44
39
-
-**Backend servers** that execute web3 functions on behalf of users (e.g. building and submitting transactions server-side)
40
-
-**Hardware wallets** that execute transactions in an offline setting on behalf of users
41
-
-**Command-line tools** and scripts for account management, transaction creation, or record or chain data inspection, or specialized functions such as MPC computations run by web3 service providers
42
-
-**Local testing and prototyping** local testing of dapps or web3 service prototypes
45
+
-**Backend servers** that execute web3 functions on behalf of users (e.g.
46
+
building and submitting transactions server-side)
47
+
-**Hardware wallets** that execute transactions in an offline setting on behalf
48
+
of users
49
+
-**Command-line tools** and scripts for account management, transaction
50
+
creation, or record or chain data inspection, or specialized functions such as
51
+
MPC computations run by web3 service providers
52
+
-**Local testing and prototyping** local testing of dapps or web3 service
53
+
prototypes
43
54
44
55
### Web (Browser)
45
56
46
-
In browser contexts, the SDK is most commonly used to **supplement features that wallet adapters don't yet provide**. The [aleo-wallet-adapter](https://github.com/ProvableHQ/aleo-dev-toolkit/tree/master/packages/aleo-wallet-adaptor) handles account management and basic transaction signing — developers reach for the SDK directly when they need:
57
+
In browser contexts, the SDK is most commonly used to **supplement features that
handles account management and basic transaction signing — developers reach for
61
+
the SDK directly when they need:
47
62
48
-
- Cryptographic hashing (BHP, Pedersen, Poseidon) and mathematics (cryptographic math using the Aleo finite field and groups)
49
-
- Program and program data introspection (parsing program source, inspecting program functions, records and mappings)
50
-
- Arbitrary encryption, decryption and signature operations not exposed by the wallet.
63
+
- Cryptographic hashing (BHP, Pedersen, Poseidon) and mathematics (cryptographic
64
+
math using the Aleo finite field and groups)
65
+
- Program and program data introspection (parsing program source, inspecting
66
+
program functions, records and mappings)
67
+
- Arbitrary encryption, decryption and signature operations not exposed by the
68
+
wallet.
51
69
52
-
**Web tutorials must recommend using `aleo-wallet-adapter` alongside the SDK** for account/signing concerns, transaction execution and should show how the two integrate where relevant. Do not suggest the SDK replaces the wallet adapter on the web.
70
+
**Web tutorials must recommend using `aleo-wallet-adapter` alongside the SDK**
71
+
for account/signing concerns, transaction execution and should show how the two
72
+
integrate where relevant. Do not suggest the SDK replaces the wallet adapter on
73
+
the web.
53
74
54
-
WASM runs in a Web Worker in browsers, this is optional but highly recommend. Every web template should at least suggestion the worker pattern.
75
+
WASM runs in a Web Worker in browsers, this is optional but highly recommend.
76
+
Every web template should at least suggestion the worker pattern.
and for web examples, this should be used to do the following.
110
+
85
111
1. Executing transactions (via the `executeTransaction` method)
86
112
2. Creating new accounts (via the `createAccount` method)
87
113
3. Polling transaction status (via the `transactionStatus` method)
88
-
4. Decrypting ciphertexts from transition inputs and outputs (via the `decrypt` method). Note this does not do arbitrary encryption and decryption schemes, only decryption of transition inputs and outputs.
114
+
4. Decrypting ciphertexts from transition inputs and outputs (via the `decrypt`
115
+
method). Note this does not do arbitrary encryption and decryption schemes,
116
+
only decryption of transition inputs and outputs.
89
117
5. Record scans via the (via the `requestRecords` method)
90
118
6. Executing deployments (via the `executeDeployment` method)
91
119
92
-
React environments should look here for context on how to invoke wallets via react: https://github.com/ProvableHQ/aleo-dev-toolkit/blob/master/packages/aleo-wallet-adaptor/react/src/WalletProvider.tsx
120
+
React environments should look here for context on how to invoke wallets via
Why a developer would use the SDK in this runtime for this use case. Reference the framing from the Runtime Context section above. For web tutorials, mention `aleo-wallet-adapter` and its relationship to the SDK.
Plain-English explanation of each feature before showing code. This is where Highlight Areas from the developer's inputs go. Assume only the complexity level specified — don't assume ZK/cryptography knowledge for beginner tutorials.
Third person replacing "you" with appropriate 3rd party nouns, tutorial style: "callers should notice...", "this tells the SDK to...", "here the keys are cached because...". Not API reference style. Not first person.
0 commit comments