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
{{ message }}
Repository navigation
example: an unshield pays the fee as a private note, and Max is what one payment can take - #66
Makes the example show a withdrawal with a private application fee, and a Max that one payment can actually take, with the API from #65.
Example wallet_screen.dart: Unshield takes a recipient (this account by default) and pays the demo fee as a private output to the collector in the same spend; the balance line shows reserved and free amounts.
Example action_sheet.dart: Max is the largest amount whose fee fits the payment's TokenBalance.limits entry, within the free balance; an amount past it reads "More than one payment can take now".
Example spend_limit.dart: spendLimit picks the narrowest proof width for a spend's private outputs, largestAmount solves amount + fee(amount) <= limit; unit tests in spend_limit_test.dart.
Example texts: a send no longer claims to hide its recipient, and the activity row for sent covers an unshield with a fee.
flutter analyze and flutter test pass in the example; the screens were not run on devnet (no API key here).
Before:main at 70becb6. After: this pull request at 0d9b2fc.
The proof, key loaded, of release builds in AWS Device Farm, by shape (notes → outputs): medians of each phone. Each phone's key load, witness and first runs are in its tables below.
by phone
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
Samsung Galaxy A16 (low)
before
1.18 s
2.02 s
3.66 s
7.07 s
14.96 s
24.88 s
22.09 s
after
1.21 s
2.02 s
3.66 s
7.02 s (-1 %)
14.93 s
25.04 s (+1 %)
21.91 s (-1 %)
Samsung Galaxy A56 (mid)
before
0.34 s
0.58 s
1.06 s
2.00 s
3.90 s
6.08 s
5.80 s
after
0.35 s
0.59 s
1.07 s
1.98 s
3.75 s (-4 %)
6.05 s
5.79 s
Samsung Galaxy S25 (high)
before
0.20 s
0.32 s
0.58 s
1.12 s
2.22 s
3.47 s
4.65 s
after
0.21 s
0.35 s
0.62 s
1.22 s (+8 %)
3.04 s (+37 % !)
4.15 s (+20 %)
3.79 s (-18 %)
iPhone 12 (low)
before
0.37 s
0.59 s
1.03 s
1.93 s
3.69 s
6.12 s
6.17 s
after
0.37 s
0.60 s
1.11 s (+7 %)
2.05 s (+6 %)
3.93 s (+7 %)
6.36 s (+4 %)
6.44 s (+5 %)
iPhone 15 (mid)
before
0.36 s
0.59 s
1.04 s
1.96 s
3.70 s
5.70 s
5.59 s
after
0.32 s
0.50 s (-14 %)
0.91 s (-13 %)
1.70 s (-13 %)
3.16 s (-14 %)
5.38 s (-6 %)
5.53 s (-1 %)
iPhone 17 Pro (high)
before
0.21 s
0.34 s
0.62 s
1.16 s
2.12 s
3.54 s
3.47 s
after
0.21 s
0.37 s
0.63 s
1.19 s
2.18 s (+3 %)
3.56 s
3.51 s
Samsung Galaxy A16, Android 14, low tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
5.70 s (download: 2.93 s, 8.8 MiB)
11.62 s (download: 7.03 s, 15.6 MiB)
20.85 s (download: 12.52 s, 28.9 MiB)
35.07 s (download: 19.04 s, 55.9 MiB)
79.30 s (download: 47.51 s, 109.5 MiB)
124.29 s (download: 73.63 s, 171.6 MiB)
116.09 s (download: 68.53 s, 165.0 MiB)
after
5.65 s (download: 2.76 s, 8.8 MiB) (-1 %)
11.47 s (download: 6.90 s, 15.6 MiB) (-1 %)
20.23 s (download: 11.95 s, 28.9 MiB) (-3 %)
41.17 s (download: 24.97 s, 55.9 MiB) (+17 %)
77.60 s (download: 47.67 s, 109.5 MiB) (-2 %)
131.49 s (download: 80.06 s, 171.6 MiB) (+6 %)
120.40 s (download: 72.70 s, 165.0 MiB) (+4 %)
warm
before
1.23 s
2.12 s
3.72 s
7.19 s
15.23 s
26.02 s
22.91 s
after
1.28 s (+4 %)
2.09 s
3.72 s
7.16 s
15.37 s (+1 %)
25.67 s (-1 %)
22.33 s (-3 %)
first run after restart
before
1.15 s
2.18 s
3.80 s
7.49 s
15.63 s
25.46 s
23.25 s
after
1.19 s
2.22 s
3.92 s (+3 %)
7.39 s (-1 %)
15.45 s (-1 %)
26.25 s (+3 %)
22.60 s (-3 %)
repeated after restart
before
1.23 s
2.07 s
3.76 s
7.17 s
15.24 s
25.41 s
21.93 s
after
1.23 s
2.03 s
3.77 s
6.91 s (-4 %)
15.21 s
25.21 s (-1 %)
22.15 s (+1 %)
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.05 s
0.11 s
0.14 s
0.20 s
0.35 s
0.58 s
0.65 s
after
0.08 s
0.11 s
0.15 s
0.24 s
0.33 s
0.50 s (-13 %)
0.67 s
witness
before
0.03 s
0.03 s
0.05 s
0.13 s
0.24 s
0.23 s
0.15 s
after
0.02 s
0.04 s
0.08 s
0.11 s
0.21 s
0.36 s (+55 % !)
0.08 s (-46 % !)
prove
before
1.18 s
2.02 s
3.66 s
7.07 s
14.96 s
24.88 s
22.09 s
after
1.21 s
2.02 s
3.66 s
7.02 s (-1 %)
14.93 s
25.04 s (+1 %)
21.91 s (-1 %)
Samsung Galaxy A56, Android 15, mid tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
7.69 s (download: 6.80 s, 8.8 MiB)
5.23 s (download: 3.78 s, 15.6 MiB)
9.34 s (download: 6.71 s, 28.9 MiB)
17.51 s (download: 12.56 s, 55.9 MiB)
27.23 s (download: 17.46 s, 109.5 MiB)
41.59 s (download: 25.96 s, 171.6 MiB)
40.64 s (download: 25.75 s, 165.0 MiB)
after
2.43 s (download: 1.55 s, 8.8 MiB) (-68 % !)
3.72 s (download: 2.27 s, 15.6 MiB) (-29 % !)
7.06 s (download: 4.40 s, 28.9 MiB) (-24 % !)
13.04 s (download: 8.11 s, 55.9 MiB) (-26 % !)
26.17 s (download: 16.57 s, 109.5 MiB) (-4 %)
42.22 s (download: 26.98 s, 171.6 MiB) (+2 %)
41.34 s (download: 26.65 s, 165.0 MiB) (+2 %)
warm
before
0.34 s
0.59 s
1.05 s
2.01 s
3.90 s
6.14 s
5.79 s
after
0.36 s
0.57 s
1.06 s
2.02 s
3.73 s (-4 %)
6.12 s
5.84 s (+1 %)
first run after restart
before
0.56 s
0.65 s
1.17 s
2.16 s
4.24 s
6.41 s
6.11 s
after
0.59 s
0.67 s
1.14 s
2.16 s
4.15 s (-2 %)
6.52 s (+2 %)
6.17 s (+1 %)
repeated after restart
before
0.35 s
0.60 s
1.07 s
2.04 s
3.93 s
6.14 s
5.92 s
after
0.35 s
0.60 s
1.08 s
2.00 s
3.77 s (-4 %)
6.11 s
5.86 s (-1 %)
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.08 s
0.03 s
0.06 s
0.09 s
0.17 s
0.21 s
0.18 s
after
0.12 s
0.03 s
0.05 s
0.09 s
0.16 s
0.23 s
0.19 s
witness
before
0.00 s
0.01 s
0.01 s
0.02 s
0.05 s
0.06 s
0.05 s
after
0.00 s
0.01 s
0.01 s
0.02 s
0.04 s
0.06 s
0.05 s
prove
before
0.34 s
0.58 s
1.06 s
2.00 s
3.90 s
6.08 s
5.80 s
after
0.35 s
0.59 s
1.07 s
1.98 s
3.75 s (-4 %)
6.05 s
5.79 s
Samsung Galaxy S25, Android 15, high tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
1.70 s (download: 1.19 s, 8.8 MiB)
2.41 s (download: 1.63 s, 15.6 MiB)
4.35 s (download: 2.99 s, 28.9 MiB)
8.33 s (download: 5.80 s, 55.9 MiB)
16.14 s (download: 11.26 s, 109.5 MiB)
26.40 s (download: 18.61 s, 171.6 MiB)
25.67 s (download: 18.09 s, 165.0 MiB)
after
1.56 s (download: 1.09 s, 8.8 MiB) (-8 %)
2.31 s (download: 1.52 s, 15.6 MiB) (-4 %)
4.19 s (download: 2.88 s, 28.9 MiB) (-4 %)
9.24 s (download: 6.79 s, 55.9 MiB) (+11 %)
15.71 s (download: 10.75 s, 109.5 MiB) (-3 %)
25.05 s (download: 17.09 s, 171.6 MiB) (-5 %)
23.41 s (download: 15.46 s, 165.0 MiB) (-9 %)
warm
before
0.20 s
0.32 s
0.57 s
1.09 s
2.14 s
3.43 s
3.31 s
after
0.19 s
0.31 s
0.56 s
1.10 s
2.17 s
3.50 s (+2 %)
3.77 s (+14 %)
first run after restart
before
0.29 s
0.35 s
0.63 s
1.26 s
2.50 s
3.80 s
6.47 s
after
0.35 s (+20 % !)
0.42 s (+19 %)
0.74 s (+18 %)
1.42 s (+12 %)
4.43 s (+78 % !)
5.17 s (+36 % !)
5.03 s (-22 % !)
repeated after restart
before
0.20 s
0.35 s
0.63 s
1.22 s
2.41 s
4.83 s
6.16 s
after
0.24 s
0.41 s (+18 %)
0.75 s (+19 %)
1.38 s (+13 %)
4.04 s (+68 % !)
4.98 s (+3 %)
3.94 s (-36 % !)
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.04 s
0.01 s
0.02 s
0.05 s
0.09 s
0.13 s
0.28 s
after
0.05 s
0.02 s
0.03 s
0.05 s
0.14 s (+68 % !)
0.17 s
0.14 s (-48 % !)
witness
before
0.00 s
0.01 s
0.01 s
0.03 s
0.05 s
0.08 s
0.08 s
after
0.00 s
0.01 s
0.02 s
0.03 s
0.07 s
0.08 s
0.06 s
prove
before
0.20 s
0.32 s
0.58 s
1.12 s
2.22 s
3.47 s
4.65 s
after
0.21 s
0.35 s
0.62 s
1.22 s (+8 %)
3.04 s (+37 % !)
4.15 s (+20 %)
3.79 s (-18 %)
iPhone 12, iOS 18.5, low tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
1.59 s (download: 0.56 s, 8.8 MiB)
2.26 s (download: 0.72 s, 15.6 MiB)
5.37 s (download: 2.81 s, 28.9 MiB)
9.40 s (download: 4.54 s, 55.9 MiB)
20.31 s (download: 10.84 s, 109.5 MiB)
24.74 s (download: 9.00 s, 171.6 MiB)
22.70 s (download: 7.18 s, 165.0 MiB)
after
1.52 s (download: 0.55 s, 8.8 MiB) (-4 %)
2.14 s (download: 0.72 s, 15.6 MiB) (-6 %)
3.86 s (download: 1.26 s, 28.9 MiB) (-28 % !)
7.45 s (download: 2.42 s, 55.9 MiB) (-21 % !)
15.08 s (download: 5.03 s, 109.5 MiB) (-26 % !)
23.73 s (download: 7.33 s, 171.6 MiB) (-4 %)
23.28 s (download: 7.09 s, 165.0 MiB) (+3 %)
warm
before
0.33 s
0.56 s
0.94 s
1.78 s
3.37 s
5.71 s
6.03 s
after
0.32 s
0.54 s
0.98 s
1.90 s (+6 %)
3.62 s (+7 %)
6.04 s (+6 %)
6.33 s (+5 %)
first run after restart
before
0.40 s
0.72 s
1.25 s
2.27 s
4.21 s
6.90 s
6.67 s
after
0.40 s
0.71 s
1.25 s
2.34 s (+3 %)
4.41 s (+5 %)
7.32 s (+6 %)
7.00 s (+5 %)
repeated after restart
before
0.38 s
0.65 s
1.13 s
2.12 s
3.97 s
6.47 s
6.33 s
after
0.41 s
0.68 s
1.21 s (+7 %)
2.23 s (+5 %)
4.85 s (+22 % !)
6.72 s (+4 %)
6.59 s (+4 %)
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.02 s
0.03 s
0.05 s
0.10 s
0.18 s
0.22 s
0.25 s
after
0.02 s
0.03 s
0.06 s
0.11 s
0.18 s
0.26 s
0.25 s
witness
before
0.00 s
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
after
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
0.01 s
prove
before
0.37 s
0.59 s
1.03 s
1.93 s
3.69 s
6.12 s
6.17 s
after
0.37 s
0.60 s
1.11 s (+7 %)
2.05 s (+6 %)
3.93 s (+7 %)
6.36 s (+4 %)
6.44 s (+5 %)
iPhone 15, iOS 18.5, mid tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
1.44 s (download: 0.51 s, 8.8 MiB)
2.20 s (download: 0.68 s, 15.6 MiB)
3.93 s (download: 1.24 s, 28.9 MiB)
10.39 s (download: 5.45 s, 55.9 MiB)
14.24 s (download: 4.65 s, 109.5 MiB)
21.41 s (download: 7.19 s, 171.6 MiB)
21.11 s (download: 6.95 s, 165.0 MiB)
after
1.27 s (download: 0.47 s, 8.8 MiB) (-12 %)
1.86 s (download: 0.67 s, 15.6 MiB) (-15 %)
3.37 s (download: 1.22 s, 28.9 MiB) (-14 %)
6.46 s (download: 2.33 s, 55.9 MiB) (-38 % !)
12.62 s (download: 4.55 s, 109.5 MiB) (-11 %)
21.15 s (download: 7.34 s, 171.6 MiB) (-1 %)
20.07 s (download: 6.91 s, 165.0 MiB) (-5 %)
warm
before
0.36 s
0.55 s
1.03 s
1.96 s
3.36 s
5.51 s
5.78 s
after
0.30 s (-18 %)
0.46 s (-16 %)
0.85 s (-17 %)
1.61 s (-18 %)
3.02 s (-10 %)
5.18 s (-6 %)
5.12 s (-11 %)
first run after restart
before
0.39 s
0.63 s
1.09 s
1.98 s
4.20 s
6.37 s
5.80 s
after
0.34 s
0.57 s (-11 %)
1.02 s (-7 %)
1.88 s (-5 %)
3.44 s (-18 %)
5.56 s (-13 %)
6.13 s (+6 %)
repeated after restart
before
0.35 s
0.59 s
1.06 s
2.17 s
4.11 s
5.93 s
5.64 s
after
0.33 s
0.55 s
0.97 s (-8 %)
1.81 s (-17 %)
3.32 s (-19 %)
5.40 s (-9 %)
6.36 s (+13 %)
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.01 s
0.02 s
0.04 s
0.07 s
0.17 s
0.24 s
0.22 s
after
0.01 s
0.02 s
0.03 s
0.06 s
0.10 s (-40 % !)
0.16 s (-32 % !)
0.17 s
witness
before
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
0.01 s
after
0.00 s
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
prove
before
0.36 s
0.59 s
1.04 s
1.96 s
3.70 s
5.70 s
5.59 s
after
0.32 s
0.50 s (-14 %)
0.91 s (-13 %)
1.70 s (-13 %)
3.16 s (-14 %)
5.38 s (-6 %)
5.53 s (-1 %)
iPhone 17 Pro, iOS 26.3.1, high tier
by scenario
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
first run, including download
before
0.85 s (download: 0.31 s, 8.8 MiB)
4.51 s (download: 3.62 s, 15.6 MiB)
7.27 s (download: 5.62 s, 28.9 MiB)
9.10 s (download: 6.16 s, 55.9 MiB)
24.38 s (download: 18.77 s, 109.5 MiB)
12.56 s (download: 3.11 s, 171.6 MiB)
14.32 s (download: 5.07 s, 165.0 MiB)
after
0.96 s (download: 0.45 s, 8.8 MiB) (+13 %)
1.62 s (download: 0.73 s, 15.6 MiB) (-64 % !)
2.79 s (download: 1.22 s, 28.9 MiB) (-62 % !)
5.60 s (download: 2.59 s, 55.9 MiB) (-38 % !)
10.37 s (download: 4.60 s, 109.5 MiB) (-57 % !)
16.51 s (download: 7.04 s, 171.6 MiB) (+31 % !)
16.12 s (download: 6.80 s, 165.0 MiB) (+13 %)
warm
before
0.20 s
0.33 s
0.58 s
1.12 s
2.05 s
3.50 s
3.44 s
after
0.20 s
0.34 s
0.62 s
1.17 s
2.15 s (+5 %)
3.54 s
3.52 s (+2 %)
first run after restart
before
0.23 s
0.38 s
0.68 s
1.23 s
2.27 s
3.70 s
3.63 s
after
0.23 s
0.39 s
0.68 s
1.24 s
2.32 s
3.74 s
3.63 s
repeated after restart
before
0.22 s
0.37 s
0.65 s
1.20 s
2.23 s
3.62 s
3.53 s
after
0.22 s
0.37 s
0.65 s
1.21 s
2.23 s
3.62 s
3.55 s
by stage
1 → 2
2 → 2
4 → 2
8 → 2
16 → 2
24 → 2
merge 24 → 1
key load
before
0.01 s
0.01 s
0.02 s
0.03 s
0.06 s
0.09 s
0.09 s
after
0.00 s
0.01 s
0.02 s
0.03 s
0.06 s
0.09 s
0.09 s
witness
before
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
0.01 s
after
0.00 s
0.00 s
0.00 s
0.01 s
0.01 s
0.01 s
0.01 s
prove
before
0.21 s
0.34 s
0.62 s
1.16 s
2.12 s
3.54 s
3.47 s
after
0.21 s
0.37 s
0.63 s
1.19 s
2.18 s (+3 %)
3.56 s
3.51 s
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
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.
Makes the example show a withdrawal with a private application fee, and a Max that one payment can actually take, with the API from #65.
wallet_screen.dart: Unshield takes a recipient (this account by default) and pays the demo fee as a private output to the collector in the same spend; the balance line shows reserved and free amounts.action_sheet.dart: Max is the largest amount whose fee fits the payment'sTokenBalance.limitsentry, within the free balance; an amount past it reads "More than one payment can take now".spend_limit.dart:spendLimitpicks the narrowest proof width for a spend's private outputs,largestAmountsolvesamount + fee(amount) <= limit; unit tests inspend_limit_test.dart.sentcovers an unshield with a fee.flutter analyzeandflutter testpass in the example; the screens were not run on devnet (no API key here).