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
## 2. Create-Leo-App - Zero-Knowledge Web App Examples
39
39
<ahref="https://www.npmjs.com/package/create-leo-app"> <imgalt="Create Leo App"src="https://img.shields.io/npm/l/create-leo-app?label=NPM%20-%20Create-Leo-App&labelColor=green&color=blue"></a>
Copy file name to clipboardExpand all lines: create-leo-app/template-offline-public-transaction-ts/README.md
+13-17Lines changed: 13 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Offline Transaction Builder
2
2
3
3
## 1. Overview
4
-
### 1.1 Proving Keys for ZeroKnowledge Function Execution
5
-
To achieve zeroknowledge execution, all Aleo functions require a `ProvingKey` and `VerifyingKey` in order to build a
6
-
zeroknowledge ZkSnark proof of execution. If a user does not possess these keys for a function, they are normally
4
+
### 1.1 Proving Keys for Zero-Knowledge Function Execution
5
+
To achieve zero-knowledge execution, all Aleo functions require a `ProvingKey` and `VerifyingKey` in order to build a
6
+
zero-knowledge zk-SNARK proof of execution. If a user does not possess these keys for a function, they are normally
7
7
downloaded from the internet when the function is called.
8
8
9
9
### 1.2 Key Providers
@@ -21,31 +21,27 @@ the internet for it. This provides a way to build Aleo execution transactions wi
21
21
This pathway is suitable for use-cases such as hardware wallets or air-gapped machines used
22
22
for building secure transactions.
23
23
24
-
### 1.4 Assumptions
24
+
### 1.4 Transaction Types
25
25
26
-
The key material in this example is assumed to be pre-downloaded onto the machine performing the
27
-
construction of the offline transaction.
26
+
Several types of transactions can be built and executed using this template:
27
+
28
+
`bond_public`
29
+
`unbond_public`
30
+
`claim_unbond_public`
28
31
29
32
## 2. Usage
30
33
31
-
### 2.1 Pre-Download the Keys
32
-
First run this command online to download the key material to disk:
34
+
`npm run build`
33
35
34
-
`npm start`
36
+
`npm run dev`
35
37
36
38
Once this command is run, all proving keys for the `transfer_public`, `bond_public`, `unbond_public`, and
37
-
`claim_unbond_public` functions will be downloaded to the `./keys` folder. The machine can then be disconnected from
39
+
`claim_unbond_public` functions will be downloaded to the `dist/keys` folder. The machine can then be disconnected from
38
40
the internet and the `OfflineKeyProvider` will search this directory for the function proving keys when building the
39
41
transaction instead of connecting to the internet. Alternatively you can skip the online step entirely by adding the proving key creating this directory manually and
40
42
adding the key material yourself.
41
43
42
-
### 2.2 Build the Transaction Offline
43
-
44
-
Once the key material is downloaded, turn off your internet connection and run the following command:
45
-
46
-
`npm start`
47
-
48
-
You should see the transactions being built and the resulting transaction IDs printed to the console.
44
+
Once the keys are downloaded to your local machine, the offline transactions will be built without requiring an internet connection.
0 commit comments