Compare commits

...

1862 Commits

Author SHA1 Message Date
Daniil Polyakov
fb083ce91e
Merge pull request #402 from logos-blockchain/arjentix/fix-docker-permissions
Use docker volumes and cache docker Rust builds
2026-03-23 16:59:58 +03:00
Daniil Polyakov
f9071d492c feat: cache rust builds in docker to speed up subsequent builds 2026-03-20 18:39:58 +03:00
Daniil Polyakov
c5950bd08a feat: use docker volumes instend of mounts for runtime data directories 2026-03-20 17:40:59 +03:00
jonesmarvin8
6f77c75b9c
Issue 257 - update ds and add ds to commitment (#397)
* initialize branch

* minor errors

* update artifacts and lint

* lint fix
2026-03-20 10:39:04 -04:00
Daniil Polyakov
fe368f2b48
Merge pull request #394 from logos-blockchain/arjentix/sequencer-rpc-server-refactor
Replace manual Sequencer RPC implementation with jsonrpsee
2026-03-20 01:53:28 +03:00
Daniil Polyakov
3913446cd2 fix: some wallet default config fixes after rebase 2026-03-20 01:21:50 +03:00
Daniil Polyakov
7b50c68550 chore: move nssa dependency of amm to dev-dependencies 2026-03-20 00:48:04 +03:00
Daniil Polyakov
05c2c3a56d fix: encode transactions with borsh in sequencer rpc 2026-03-20 00:48:04 +03:00
Daniil Polyakov
7b20a83379 fix: fixes after rebase & address comments 2026-03-20 00:48:04 +03:00
Daniil Polyakov
325960d696 feat: remove override_rust_log from wallet config 2026-03-20 00:48:04 +03:00
Daniil Polyakov
b631ef02c6 fix: final fixes & polishing 2026-03-20 00:47:37 +03:00
Daniil Polyakov
9d87e3b046 fix: fix lints 2026-03-20 00:41:05 +03:00
Daniil Polyakov
b254ebb185 feat: refactor sequencer RPC client-side 2026-03-20 00:41:05 +03:00
Daniil Polyakov
be94e133fa feat: refactor sequencer RPC server-side 2026-03-20 00:41:05 +03:00
Daniil Polyakov
bffc711470 refactor: move sequencer_ directories into sequencer 2026-03-20 00:36:07 +03:00
jonesmarvin8
666353d7df
Merge pull request #356 from logos-blockchain/marvin/bip-32-comp
Key protocol compatibility with BIP-032/Keycard
2026-03-19 11:59:01 -04:00
Daniil Polyakov
c40c62a484 fix: satisfy clippy 2026-03-19 18:03:23 +03:00
jonesmarvin8
83ef789002 lint issues 2026-03-18 18:44:07 -04:00
jonesmarvin8
4fdefd3557 fix typo 2026-03-18 16:53:07 -04:00
jonesmarvin8
ce729f112d Merge branch 'main' into marvin/bip-32-comp 2026-03-18 16:47:39 -04:00
jonesmarvin8
be4f6c0c78
Merge pull request #334 from logos-blockchain/marvin/nonce
update nonce mechanism
2026-03-18 14:36:47 -04:00
jonesmarvin8
2cecf71c93 additional lint fixes 2026-03-18 14:06:56 -04:00
jonesmarvin8
b81b725bd1 fmt 2026-03-18 13:47:21 -04:00
jonesmarvin8
5d9980cf63 lint fixes 2026-03-18 13:10:36 -04:00
jonesmarvin8
0bcb626adc lint fixes 2026-03-18 10:28:52 -04:00
Moudy
0586e98c61
Merge pull request #388 from logos-blockchain/moudy/justfile 2026-03-18 15:12:19 +01:00
Moudy
82fb5781fe
Merge pull request #395 from logos-blockchain/moudyellaz-patch-3 2026-03-18 14:57:48 +01:00
Daniil Polyakov
e42c62fc21
Merge pull request #396 from logos-blockchain/arjentix/versioning
Add versioning docs & publish images on every version
2026-03-18 16:55:52 +03:00
jonesmarvin8
a83725512d Merge branch 'main' into marvin/nonce 2026-03-18 07:59:55 -04:00
Pravdyvy
821cb891d5
Merge pull request #374 from logos-blockchain/Pravdyvy/indexer-final-state
Final state caching
2026-03-18 09:49:28 +02:00
Pravdyvy
de3d17c7f8 fix: fmt 2026-03-18 09:16:36 +02:00
Pravdyvy
94faaa6d64 Merge branch 'main' into Pravdyvy/indexer-final-state 2026-03-18 09:15:45 +02:00
Pravdyvy
b94b58ceb1
Merge pull request #370 from logos-blockchain/Pravdyvy/matched-retry-on-inscription
Branched retry on inscriptions
2026-03-18 08:58:07 +02:00
Pravdyvy
d71805abb6 fix: merge updates 2026-03-18 08:24:39 +02:00
Pravdyvy
b3b5337b92 Merge branch 'main' into Pravdyvy/matched-retry-on-inscription 2026-03-18 08:12:30 +02:00
jonesmarvin8
82e8e8601d
Merge pull request #338 from logos-blockchain/marvin/refactor-amm-state-tests
Refactor AMM state tests
2026-03-17 19:24:42 -04:00
jonesmarvin8
bd79e982fd fix additional main merge errors 2026-03-17 19:23:27 -04:00
jonesmarvin8
ba8fdf4f29 fix conflicts from merging main 2026-03-17 19:16:09 -04:00
jonesmarvin8
1035893fd9 fix lint 2026-03-17 19:09:25 -04:00
jonesmarvin8
a12d1e5912 fixed merge issue with main 2026-03-17 18:01:00 -04:00
jonesmarvin8
8dd5037e28 Merge branch 'main' into marvin/nonce 2026-03-17 16:45:08 -04:00
jonesmarvin8
7481b54cf8 fixed lint and artifacts 2026-03-17 16:20:32 -04:00
Daniil Polyakov
2dbacdaff1 doc: add versioning documentation 2026-03-17 23:08:48 +03:00
Daniil Polyakov
dbc2e7c327 feat: run publish_images workflow on release tags 2026-03-17 23:08:33 +03:00
jonesmarvin8
f5ba922b70 Merge branch 'main' into marvin/refactor-amm-state-tests 2026-03-17 15:59:12 -04:00
jonesmarvin8
b544b919a6 combine test files 2026-03-17 15:51:25 -04:00
Daniil Polyakov
a304f3ad13
Merge pull request #391 from logos-blockchain/arjentix/new-clippy-lints
New clippy lints, dependecies & rust bump
2026-03-17 22:11:52 +03:00
jonesmarvin8
66d501e4d7 fixed tests 2026-03-17 14:50:21 -04:00
Daniil Polyakov
d79ac3f9a8 fix: formatting 2026-03-17 21:25:30 +03:00
Daniil Polyakov
65ce23b9e1 chore: rebuild artifacts 2026-03-17 21:25:30 +03:00
Daniil Polyakov
252848a145 feat: update rust to 1.94.0 2026-03-17 21:25:30 +03:00
Daniil Polyakov
3b0e842a42 feat: update dependencies 2026-03-17 21:25:30 +03:00
Daniil Polyakov
147fff957a feat: add cargo clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
6e79ce0941 feat: add style clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
90412f9590 feat: add suspicious clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
5bf4495709 feat: add perf clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
3e1cc2e58e feat: add complexity clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
222e68ac0b feat: add correctness clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
aa462b66eb feat: add nursery clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
e3b93b6e9a feat: add restriction clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
efe8393ba0 feat: add pedantic clippy lints 2026-03-17 21:25:30 +03:00
Moudy
3998a2562c
Clarify privacy handling in programmability section 2026-03-17 14:59:40 +01:00
jonesmarvin8
b44e066e84 fix constructor 2026-03-17 09:29:00 -04:00
Pravdyvy
2fb8c2c87f fix: suggestions fix 2 2026-03-17 15:18:12 +02:00
Pravdyvy
8a8c7f722b fix: suggestions fix 2026-03-17 15:10:12 +02:00
Daniil Polyakov
756f2f4135 feat: add workspace lints to every crate 2026-03-17 15:13:44 +03:00
jonesmarvin8
dd64f0b1f8 Merge branch 'main' into marvin/nonce 2026-03-16 11:22:24 -04:00
jonesmarvin8
d665540495
Merge pull request #357 from logos-blockchain/marvin/issue_295
[Issue 295] ensure! in public transaction
2026-03-16 09:49:52 -04:00
jonesmarvin8
620dd3ad10 Merge branch 'main' into marvin/refactor-amm-state-tests 2026-03-16 09:37:24 -04:00
jonesmarvin8
6e74cca512 fixed unit test 2026-03-16 09:12:29 -04:00
fryorcraken
d941fd3b8b
Merge pull request #365 from logos-blockchain/hex
fix: display HashType as hex string in Debug output
2026-03-16 16:21:16 +11:00
fryorcraken
55c930d784
update artifacts 2026-03-16 14:35:29 +11:00
fryorcraken
e20860ea97
fix: use base58 encoding for program_owner instead of hex
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:04:17 +11:00
fryorcraken
546c3d0986
fix: remove unused bytemuck dep and apply nightly fmt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 13:46:20 +11:00
fryorcraken
339c0dc048
Prefer hex string to vector of number for stdout 2026-03-13 13:46:19 +11:00
fryorcraken
5f2d33f90e
fix: display HashType as hex string in Debug output
The derived Debug impl printed HashType as a raw byte array, while
Display (and the sequencer logs) used hex encoding. Replace the derived
Debug with a custom impl identical to Display so both representations
are consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 13:46:19 +11:00
Daniil Polyakov
3464d15d89
Merge pull request #364 from logos-blockchain/bash-completion
Bash completion for `wallet`
2026-03-10 22:55:35 +03:00
Daniil Polyakov
3256e3d470
Merge pull request #381 from logos-blockchain/weboko/pinata-auth-transfer
feat: ensure pinata recipient initialized
2026-03-10 22:29:40 +03:00
Daniil Polyakov
0b66903cb9
Merge pull request #376 from logos-blockchain/moudyellaz-explorer
Revise README for sequencer and node setup
2026-03-10 22:29:26 +03:00
jonesmarvin8
b5d0d2d0c1 fmt and lint 2026-03-09 13:05:29 -04:00
jonesmarvin8
b1747548b2 fix nullifer typo 2026-03-09 12:23:57 -04:00
jonesmarvin8
d029def7c7 add ensure test 2026-03-09 12:21:44 -04:00
jonesmarvin8
a5119dc3f3 fix wallet configs 2026-03-09 11:50:37 -04:00
jonesmarvin8
1cfc710024 Merge branch 'main' into marvin/bip-32-comp 2026-03-09 05:23:24 -04:00
Moudy
2d04946a64 added remove rocksdb from main 2026-03-07 17:00:54 +01:00
Sergio Chouhy
1e3b60feae
Merge pull request #385 from logos-blockchain/arjentix/fix-unrecognized-commitment-set-digest-error
Fix unrecognized commitment set digest error
2026-03-07 11:51:27 -03:00
Daniil Polyakov
7f0d41104d fix: replace old keys with new ones in configurations 2026-03-07 15:41:47 +03:00
Daniil Polyakov
7a9d02af31 feat: adjust just clean command 2026-03-06 22:41:27 +03:00
Daniil Polyakov
39d8c89c17
Merge pull request #384 from logos-blockchain/Pravdyvy/shared-secret-receiver-usage-fix
Shared secret receiver usage fix
2026-03-05 21:59:16 +03:00
Daniil Polyakov
0aec6028f6 fix: remove unused serde_json dev-dependency from key_protocol 2026-03-05 21:14:25 +03:00
Pravdyvy
4950c1277c fix: suggestions fix 2026-03-05 17:25:53 +02:00
Pravdyvy
fa406e7a86 fix: removed redundant logging 2026-03-05 15:20:22 +02:00
Pravdyvy
cf92157728 fix: artifacts updates 2026-03-05 14:41:52 +02:00
Daniil Polyakov
a7607b4525
Merge pull request #383 from logos-blockchain/arjentix/explorer-blocks-right-order
feat: sort blocks from latest to oldest in explorer
2026-03-05 15:24:57 +03:00
Pravdyvy
cb57baaa36 fix: integartion test on claiming path for token updated 2026-03-05 14:13:13 +02:00
Pravdyvy
e3764e1911 fix: shared secret receiver fix 2026-03-05 12:35:18 +02:00
Daniil Polyakov
ec1018deac feat: sort blocks from latest to oldest in explorer 2026-03-04 21:54:36 +03:00
Daniil Polyakov
db5d1e5cf7
Merge pull request #382 from logos-blockchain/Pravdyvy/pinata-buff
Pinata Buff
2026-03-04 21:36:29 +03:00
Pravdyvy
06665160c6 fix: updated pinata balance 2026-03-04 17:47:38 +02:00
Pravdyvy
44a11bd3f1 fix: state interactions fix 2026-03-04 14:12:39 +02:00
Sasha
ddecae8c40
feat: ensure pinata recipient initialized 2026-03-03 23:21:18 +01:00
Pravdyvy
9df121704f
Merge pull request #380 from logos-blockchain/Pravdyvy/block-sorting-while-resubmit
feat: block ordering while resubmit
2026-03-03 10:13:13 +02:00
Moudy
9d7cf58f6f
Revise README for sequencer and node setup
Updated instructions for running the explorer
2026-03-03 01:29:42 +01:00
jonesmarvin8
7daf32611a add necessary typo back in 2026-03-02 16:42:32 -05:00
jonesmarvin8
6000d61bf2 artifacts update 2026-03-02 16:27:11 -05:00
jonesmarvin8
181d43e6d2 test fixing 2026-03-02 16:13:23 -05:00
jonesmarvin8
84abe02573 add serialize/deserialize impls 2026-03-02 11:54:41 -05:00
Pravdyvy
ed299932c5 fear: final state field 2026-03-02 18:25:22 +02:00
jonesmarvin8
71d07ccdf7 fmt 2026-03-02 10:51:30 -05:00
jonesmarvin8
d863b763d1 Merge branch 'main' into marvin/nonce 2026-03-02 10:49:07 -05:00
jonesmarvin8
227f006179 add clone property and shift feature restriction 2026-03-02 10:15:55 -05:00
Pravdyvy
416f16bfc6 feat: block ordering while resubmit 2026-03-02 14:22:11 +02:00
Pravdyvy
2e5a1d29ad fix: branched retry on inscriptions 2026-03-02 09:30:13 +02:00
jonesmarvin8
ab41bff5cc update config files 2026-02-27 18:30:54 -05:00
Daniil Polyakov
226ebe3e0e
Merge pull request #369 from logos-blockchain/arjentix/fix-indexer-docker-startup
fix: fix docker builds and runs
2026-02-27 22:20:43 +03:00
Daniil Polyakov
7d4409fdf9 fix: fix docker builds and runs 2026-02-27 21:20:22 +03:00
Daniil Polyakov
4e112bc520
Merge pull request #368 from logos-blockchain/Pravdyvy/http-retries-in-seq-client
HTTP retries in sequencer client
2026-02-27 21:19:34 +03:00
Pravdyvy
9dc6025537 fix: http retries 2026-02-27 19:11:26 +02:00
jonesmarvin8
5a0ef060fd Merge branch 'main' into marvin/bip-32-comp 2026-02-27 11:32:30 -05:00
jonesmarvin8
157495ad59 fix lint 2026-02-27 10:49:00 -05:00
jonesmarvin8
87c251b6e2 incorporate lip_supply_init to this refactoring 2026-02-27 10:24:47 -05:00
Moudy
bdeca0185f
Merge pull request #367 from logos-blockchain/schouhy/fix-sequencer-config-npk
Update sequencer config npks
2026-02-27 16:08:03 +01:00
jonesmarvin8
3c677ce78c Merge branch 'main' into marvin/refactor-amm-state-tests 2026-02-27 09:34:13 -05:00
Andrea Franz
71de2f7754
Merge pull request #359 from logos-blockchain/fix/amm-initial-lp
chore(programs/amm): fix initial LP supply calculations
2026-02-27 14:33:52 +01:00
Sergio Chouhy
d5c75cbd98 update public account ids 2026-02-27 10:25:07 -03:00
Sergio Chouhy
99069c84b1 update sequencer config npks 2026-02-27 10:06:54 -03:00
Daniel Sanchez
10770bd99e
Merge pull request #366 from logos-blockchain/dsq/nix-circuits-deps
chore(nix): Add circuits dependency
2026-02-27 12:18:09 +00:00
danielSanchezQ
6887131364 Add circuits dependency 2026-02-27 12:13:25 +00:00
Andrea Franz
fee1ab30e9 chore(programs/amm): fix initial LP supply calculations
ift-ts:sc:logos:2026q1-amm-core-improvements:fix-initial-lp-calc
2026-02-27 09:21:43 +01:00
fryorcraken
d9b2b0c824
update zsh completion 2026-02-27 15:26:57 +11:00
fryorcraken
e2175132f5
Add bash completion script 2026-02-27 15:23:03 +11:00
Pravdyvy
18d9d80105
Merge pull request #354 from logos-blockchain/Pravdyvy/indexer-explorer-integration-fixes
Indexer<->Explorer integration fixes
2026-02-26 21:39:15 +02:00
Pravdyvy
1ea3aab3f1 fix: limts fix 2026-02-26 20:42:39 +02:00
Daniil Polyakov
51a21c42fc
Merge pull request #360 from logos-blockchain/arjentix/fix-indexer-image
fix: add r0vm and logos circuits in indexer image
2026-02-26 21:41:06 +03:00
Daniil Polyakov
1f01f7c06a fix: add r0vm and logos circuits in indexer image 2026-02-26 21:06:39 +03:00
Pravdyvy
c622f3540a fix: logging, config 2026-02-26 20:05:16 +02:00
jonesmarvin8
b9324bf03b Merge branch 'main' into marvin/bip-32-comp 2026-02-26 12:41:50 -05:00
jonesmarvin8
3c10263023 Merge branch 'main' into marvin/issue_295 2026-02-26 12:41:00 -05:00
Daniil Polyakov
67f49697f7
Merge pull request #358 from logos-blockchain/arjentix/standalone-sequencer-deploy
Standalone sequencer deploy
2026-02-26 20:19:26 +03:00
Pravdyvy
5eb4e0af1f fix: downgrades of logs 2026-02-26 19:18:41 +02:00
Pravdyvy
3c8e81c11c Merge branch 'main' into Pravdyvy/indexer-explorer-integration-fixes 2026-02-26 17:14:11 +02:00
Sergio Chouhy
f48b116754
Merge pull request #350 from logos-blockchain/schouhy/compress-proofs
Compress R0 proofs
2026-02-26 11:54:14 -03:00
Sergio Chouhy
70471f0a54 compress proofs 2026-02-26 11:19:55 -03:00
Daniil Polyakov
9bb4d95f0b feat: optimize r0vm installation for sequencer docker image for x86_64 platform 2026-02-26 17:06:45 +03:00
Daniil Polyakov
ea7beaaaef feat: build standalone sequencer docker image 2026-02-26 17:06:45 +03:00
Daniil Polyakov
c59d3efbcc
Merge pull request #353 from logos-blockchain/arjentix/configurable-block-size
Configurable block size & human-readable config values
2026-02-26 17:05:50 +03:00
Daniil Polyakov
72ce3ff1e4 chore: rebuild artifacts 2026-02-26 16:35:07 +03:00
Daniil Polyakov
184d378c90 docs: add just command docs 2026-02-26 16:25:24 +03:00
Daniil Polyakov
529dfce413 fix: ensure wallet data is fully synced with fs 2026-02-26 16:25:24 +03:00
Daniil Polyakov
803708ea1e fix: set wallet-ffi default features to false in workspace to fix tps test 2026-02-26 16:25:24 +03:00
Daniil Polyakov
437e5addb4 feat: use human-readable byte sizes and durations 2026-02-26 16:25:24 +03:00
Daniil Polyakov
8b5524901c feat: configurable block size limit 2026-02-26 16:21:43 +03:00
Moudy
84c23e8680
Merge pull request #324 from logos-blockchain/moudyellaz-program-deployment-readme
Update README.md
2026-02-26 14:19:05 +01:00
Sergio Chouhy
f8661b24e4
Merge pull request #331 from logos-blockchain/Pravdyvy/bedrock-parsing-from-start-of-a-channel
Indexer correct startup
2026-02-26 10:09:30 -03:00
Sergio Chouhy
487027d98f
Merge pull request #308 from logos-blockchain/Pravdyvy/indexer-state-management
Indexer state management
2026-02-26 09:53:46 -03:00
Pravdyvy
6e61698ff8 fix: complete fixes 2026-02-26 13:46:38 +02:00
Pravdyvy
b2ae6317d2 fix: naming changes 2026-02-26 09:40:31 +02:00
jonesmarvin8
3ed6ce3f1c fix wallet json 2026-02-25 19:00:01 -05:00
jonesmarvin8
6209317cd4 fmt and artifacts 2026-02-25 17:37:49 -05:00
jonesmarvin8
d58df166e7 initialize branch 2026-02-25 15:32:31 -05:00
jonesmarvin8
85dd5fae86 initialize bip-032 changes 2026-02-25 15:18:27 -05:00
Pravdyvy
fb2709f96c fix: docker fix 2026-02-25 17:14:42 +02:00
Pravdyvy
24271b398e fix: possibly fixed tx accounts 2026-02-25 17:13:48 +02:00
Pravdyvy
fe5db24620 Merge branch 'schouhy/compress-proofs' into Pravdyvy/indexer-explorer-integration-fixes 2026-02-25 15:38:15 +02:00
Pravdyvy
818eebb99f fix: recent blocks fix 2026-02-25 14:19:51 +02:00
jonesmarvin8
82966e652d fix nssa import issue with programs::amm 2026-02-24 18:18:23 -05:00
Pravdyvy
c8bd5b3679 fix: cleanup instructions fix 2026-02-24 18:52:32 +02:00
Daniil Polyakov
767b5afd38
Merge pull request #343 from logos-blockchain/arjentix/some-refactor
Move tutorial to docs & add more `just` commands
2026-02-24 19:43:07 +03:00
Moudy
7ba888ce7d
Merge pull request #351 from logos-blockchain/dsq/ffi-build-macos-fix
fix(ffi): Fix nix build on macos
2026-02-24 15:37:33 +01:00
Daniel
9a61e64ccf Fix nix build 2026-02-24 15:27:39 +01:00
Sergio Chouhy
a64c16b8c9 compress proofs 2026-02-24 10:34:03 -03:00
Moudy
3f2d9ed0f4
Merge pull request #349 from logos-blockchain/dsq/default-prove-ffi
fix(ffi): Fix r0 build with default prove
2026-02-24 13:26:21 +01:00
danielSanchezQ
0c90d42a0f Fix r0 build 2026-02-24 12:14:25 +00:00
Moudy
55388e30a2
Merge pull request #348 from logos-blockchain/dsq/default-prove-ffi
chore(ffi): Default prove feature
2026-02-24 12:25:16 +01:00
Pravdyvy
548e4c8d9a fix: node db not empty fix 2026-02-24 12:27:47 +02:00
danielSanchezQ
ccfc14cac1 Default prove 2026-02-24 08:16:59 +00:00
Daniil Polyakov
e71f2fe16a feat: add useful just commands 2026-02-23 17:57:56 +03:00
Pravdyvy
2bad85b217 Merge branch 'Pravdyvy/indexer-state-management' into Pravdyvy/bedrock-parsing-from-start-of-a-channel 2026-02-23 16:12:43 +02:00
Pravdyvy
6101d791e3 fix: suggestions fix 2026-02-23 16:10:56 +02:00
Daniil Polyakov
3855bf2399 chore: move tutorial to docs 2026-02-23 16:10:01 +03:00
Pravdyvy
a0e2e06cc1
Apply suggestions from code review
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2026-02-23 14:47:23 +02:00
Pravdyvy
35bb85ebaf fix: suggestions fix 1 2026-02-23 11:39:04 +02:00
Pravdyvy
cda22a3a2b Merge branch 'Pravdyvy/indexer-state-management' into Pravdyvy/bedrock-parsing-from-start-of-a-channel 2026-02-23 11:22:11 +02:00
Pravdyvy
56c6abe08f fix: suggestions fix 1 2026-02-23 10:55:00 +02:00
Pravdyvy
801f2c46c8
Apply suggestions from code review
Docstrings updated, derives sorted.

Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2026-02-23 10:11:40 +02:00
Daniel Sanchez
bc84d5cf31
Merge pull request #340 from logos-blockchain/dsq/pinata-ffi
feat(ffi): Add pinata to wallet-ffi
2026-02-20 17:21:19 +01:00
Pravdyvy
d1265af406 fix: config updates 2026-02-20 17:15:50 +03:00
Pravdyvy
feb66e6a18 fix: tests unignored 2026-02-20 17:14:57 +03:00
Pravdyvy
f39fd9ee53 fix: fmt 2026-02-20 17:14:11 +03:00
Pravdyvy
6f979786e7 feat: tip polling 2026-02-20 17:13:59 +03:00
Pravdyvy
77f1be59b0 feat: start search corerct 2026-02-20 17:12:18 +03:00
Pravdyvy
de1aa99fd4 feat: updated block streaming 2026-02-20 17:11:08 +03:00
Pravdyvy
b7f44ffd65 feat: search for channel start 2026-02-20 17:11:08 +03:00
Daniil Polyakov
683722edbd fix: fix some small compile errors 2026-02-20 17:10:31 +03:00
Daniil Polyakov
9f0f3713c7 Merge branch 'schouhy/fine-tuning' into Pravdyvy/indexer-state-management 2026-02-20 14:52:47 +03:00
Daniil Polyakov
0194376fe2 chore: remove k parameter for resubmitting blocks & adjust config 2026-02-20 14:45:43 +03:00
Sergio Chouhy
78eaac59f6 wip 2026-02-20 14:45:43 +03:00
Sergio Chouhy
c2d4e717e4 small changes 2026-02-20 14:44:40 +03:00
Sergio Chouhy
80c0356fac wip 2026-02-20 14:44:40 +03:00
danielSanchezQ
e99c92543e Cargo fmt 2026-02-20 11:21:21 +00:00
danielSanchezQ
78233308cc Include pinata en ffi 2026-02-20 11:20:30 +00:00
jonesmarvin8
abfb707900 fixed test 2026-02-19 20:07:55 -05:00
jonesmarvin8
8095408e1b initialize branch 2026-02-19 19:15:04 -05:00
jonesmarvin8
c0d4a98f3c fixed unit test 2026-02-19 19:09:19 -05:00
Pravdyvy
0297791f23 fix: instructions configs 2026-02-19 10:21:51 +02:00
Sergio Chouhy
89ce9f322a
Merge pull request #296 from logos-blockchain/feat/label-extensions
feat: add `--label` option to `wallet account new` sub command
2026-02-18 10:10:02 -03:00
Pravdyvy
0201a39bcf fix: deny fix 2026-02-18 15:04:20 +02:00
r4bbit
6c2bdb1b20
feat: add --label option to wallet account new sub command
Following the work done in
https://github.com/logos-blockchain/lssa/pull/292 and the comment on
extending the work
https://github.com/logos-blockchain/lssa/pull/292#pullrequestreview-3672282664,
this commit introduces a new `--label` option to the `wallet account
new` sub command.

**Usage**:

```
wallet account new public --label "Public test account"
wallet account new private --label "Private test account"
```

Labels have to be unique across all accounts in the wallet storage.

The commit also adds tests, which make use of the `WalletSubCommand`
trait functions (hence the change to make it a `pub trait`).
2026-02-18 12:30:17 +01:00
Pravdyvy
992fd26bcd Merge branch 'main' into Pravdyvy/indexer-state-management 2026-02-18 11:40:16 +02:00
Daniel Sanchez
27f31cf3d0
Merge pull request #336 from logos-blockchain/dsq/new-wallet-ffi-calls
feat(wallet-ffi): Update wallet ffi with transfer calls
2026-02-18 09:31:40 +01:00
Moudy
dee3f7fa6f
Merge pull request #337 from logos-blockchain/schouhy/standalone-sequencer-with-mock
Add `standalone` feature for running sequencer without Bedrock and indexer services.
2026-02-18 09:11:15 +01:00
jonesmarvin8
b3e2162d71 fix machete and unit test 2026-02-17 19:56:35 -05:00
jonesmarvin8
946a45b8a3 added test for new nonce mechanism 2026-02-17 19:10:35 -05:00
jonesmarvin8
fa6a99192e Merge branch 'main' into marvin/nonce 2026-02-17 18:26:48 -05:00
Sergio Chouhy
b008982eeb update readme 2026-02-17 19:37:44 -03:00
Sergio Chouhy
01dc41cc47 fix 2026-02-17 19:32:43 -03:00
Sergio Chouhy
964800f765 add standalone feature for running sequencer without bedrock using mocked components 2026-02-17 18:59:26 -03:00
Sergio Chouhy
f1293ec77b
Merge pull request #335 from logos-blockchain/fix/add-amm-to-rpc-endpoint
fix(sequencer_rpc): add AMM program id
2026-02-17 14:57:00 -03:00
r4bbit
76af23f386
fix(sequencer_rpc): add AMM program id
This adds the AMM program ID to the `get_program_ids` RPC endpoints,
as it's currently missing while still being predeployed.
2026-02-17 14:55:46 +01:00
danielSanchezQ
b2ef5e915c Update wallet ffi with transfer calls 2026-02-17 11:54:55 +00:00
Pravdyvy
f7f69f9f7b fix: commented all indexer tests 2026-02-17 08:32:15 +02:00
Pravdyvy
f11d374ae7 Merge branch 'main' into Pravdyvy/indexer-state-management 2026-02-17 08:06:16 +02:00
jonesmarvin8
8cf73c00a9
Merge pull request #246 from logos-blockchain/marvin/private_keys
private key protocol fixes
2026-02-16 21:00:53 -05:00
jonesmarvin8
bf8c47b9b7 format fixes 2026-02-16 20:50:14 -05:00
jonesmarvin8
33084300ad fix ipk -> vpk 2026-02-16 20:39:00 -05:00
jonesmarvin8
70a2f9ce4e artifact fixes 2026-02-16 20:13:47 -05:00
jonesmarvin8
a821f04fb8 Merge branch 'main' into marvin/nonce 2026-02-16 19:56:44 -05:00
jonesmarvin8
f8dfcac17a Merge branch 'main' into marvin/private_keys 2026-02-16 19:55:09 -05:00
jonesmarvin8
889326d2ad clean up and fixed tests 2026-02-16 19:53:32 -05:00
jonesmarvin8
25084b5669 fix config file 2026-02-16 19:48:43 -05:00
Sergio Chouhy
2ac5d8d7de
Merge pull request #332 from logos-blockchain/schouhy/finish-auth-transfer-ffi-functionality
Add auth transfer FFI full functionality
2026-02-16 16:25:24 -03:00
Sergio Chouhy
32c36af126 fmt, clippy 2026-02-16 15:56:28 -03:00
Sergio Chouhy
177235a2c7 add prove feature 2026-02-16 12:28:31 -03:00
Sergio Chouhy
26d6286b8c revert prove feature 2026-02-16 11:52:31 -03:00
Sergio Chouhy
2954faa5ec add prove feature 2026-02-16 11:34:58 -03:00
jonesmarvin8
d965b7c25d Merge branch 'main' into marvin/nonce 2026-02-16 09:27:34 -05:00
Sergio Chouhy
5a96eb451c minor refactor 2026-02-16 11:24:07 -03:00
Sergio Chouhy
d8537ea3f0 add wallet ffi auth-transfer private method 2026-02-16 11:24:06 -03:00
Sergio Chouhy
2c89e17896 add wallet ffi auth-transfer deshielded method 2026-02-16 11:16:48 -03:00
Sergio Chouhy
c3ca6c7563 add wallet ffi auth-transfer shielded method 2026-02-16 11:16:48 -03:00
Sergio Chouhy
707ea7d379 add get private account and init private account ffi methods 2026-02-16 11:16:46 -03:00
jonesmarvin8
08e65d8332 update artifacts 2026-02-16 08:11:34 -05:00
jonesmarvin8
6a89ca0a7f Merge branch 'main' into marvin/private_keys 2026-02-16 08:02:37 -05:00
Sergio Chouhy
d8a8bdfc97
Merge pull request #333 from logos-blockchain/arjentix/fix-sequencer-msg-id
Fix sequencer data synchronization problems
2026-02-16 08:32:50 -03:00
Pravdyvy
a4fc1dd570 fix: ci fix 1 2026-02-16 10:34:41 +02:00
Pravdyvy
344430a8f2 Merge branch 'arjentix/fix-sequencer-msg-id' into Pravdyvy/indexer-state-management 2026-02-16 10:16:25 +02:00
Daniil Polyakov
85d2a13148 chore: update keccak 2026-02-14 00:48:39 +03:00
Daniil Polyakov
8b16318c38 fix: use base58 encoding for account in Explorer & some formatting chores 2026-02-14 00:23:34 +03:00
Sergio Chouhy
439392cf26 fix: sequencer does not submit newly created blocks & fix to resubmit first pending block logic 2026-02-14 00:23:24 +03:00
Pravdyvy
97502f3baa Merge branch 'arjentix/fix-sequencer-msg-id' into Pravdyvy/indexer-state-management 2026-02-13 17:42:29 +02:00
Pravdyvy
5255f4df0c fix: correct ports destinations 2026-02-13 17:41:28 +02:00
Daniil Polyakov
91e57bbf1b fix: resubmit just one pending block 2026-02-13 15:44:16 +03:00
Pravdyvy
7ea8a85be9 fix: indexer config updated 2026-02-13 13:59:06 +02:00
Pravdyvy
5d228c6d80 Merge branch 'arjentix/fix-sequencer-msg-id' into Pravdyvy/indexer-state-management 2026-02-13 13:37:10 +02:00
jonesmarvin8
77f2fb6994 update nonce mechanism 2026-02-12 19:22:03 -05:00
Daniil Polyakov
c63ecd6aba fix: initiate sequencer with chain height from db and not from config genesis id 2026-02-13 02:05:55 +03:00
Daniil Polyakov
f64b7ba0ef chore: ignore bedrock_signing_key 2026-02-13 01:56:10 +03:00
Daniil Polyakov
9d35cf4ea8 chore: adjuct docs and configs for manual run 2026-02-13 01:55:36 +03:00
Daniil Polyakov
c663ad1a56 chore: better error messages 2026-02-13 01:54:40 +03:00
Daniil Polyakov
2acc388ae9 chore: rename get_schema endpoint to more common getSchema 2026-02-13 01:49:20 +03:00
Daniil Polyakov
d4494c1f21 fix: use private account for private account test in wallet_ffi 2026-02-12 19:38:04 +03:00
Daniil Polyakov
d2ce0cd51b fix: run async runtime when dropping TestContext in BlockingTestContext 2026-02-12 19:35:07 +03:00
jonesmarvin8
c78f74e50b update artifacts 2026-02-12 10:52:38 -05:00
jonesmarvin8
943efd1433 Merge branch 'main' into marvin/private_keys 2026-02-12 10:33:00 -05:00
Daniil Polyakov
378d53f152 fix: don't delete finalized blocks but only mark them 2026-02-12 18:20:25 +03:00
Daniil Polyakov
9b51fd1fc2 fix: make InternalError more descriptive 2026-02-12 17:49:59 +03:00
Daniil Polyakov
51ab510e71 fix: retrieve last bedrock message id from db 2026-02-12 17:49:59 +03:00
Daniil Polyakov
d0f26744eb fix: sync last_bedrock_msg_id even if posting to Bedrock failed 2026-02-12 17:49:59 +03:00
Daniil Polyakov
0a8d6f1eb4 fix: always store latest block hash in db 2026-02-12 17:49:59 +03:00
Daniil Polyakov
cb6fb881ac
Merge pull request #316 from logos-blockchain/arjentix/full-bedrock-integration
Full bedrock integration
2026-02-12 17:47:47 +03:00
Daniil Polyakov
9bf3edbaad chore: remove risc0-zkvm dep from wallet 2026-02-12 16:39:23 +03:00
Daniil Polyakov
6d7ca887e3 chore: rebuild artifacts 2026-02-12 16:35:58 +03:00
Daniil Polyakov
0d0bb87bf3 feat: split tests job into unit-tests and integration-tests 2026-02-12 16:31:34 +03:00
Daniil Polyakov
70bae9158c fix: free disk space in CI before running tests 2026-02-12 16:31:34 +03:00
Daniil Polyakov
60be2b6d00 chore: satisfy CI 2026-02-12 16:31:34 +03:00
Daniil Polyakov
4b59782924 fix: construct Sequencer with zeroized last message id instead of genesis message id 2026-02-12 16:31:14 +03:00
Daniil Polyakov
fdcaabf761 chore: remove useless optional account in explorer 2026-02-12 16:31:13 +03:00
Daniil Polyakov
09debfa74f feat: implement all-in-one docker compose 2026-02-12 16:31:13 +03:00
Daniil Polyakov
dae1d92253 chore: remove outdated deploy ci workflow 2026-02-12 16:31:13 +03:00
Daniil Polyakov
843ca0b00d feat: Publish indexer_service and explorer_service docker images 2026-02-12 16:31:13 +03:00
Daniil Polyakov
c753373434 chore: apply recommended wallet config from #328 for integration tests 2026-02-12 16:31:13 +03:00
Daniil Polyakov
975cfb9ec6 feat: fully integrate Sequencer, Indexer and Explorer with Bedrock 2026-02-12 16:31:13 +03:00
jonesmarvin8
818fc5e601
Merge pull request #306 from logos-blockchain/marvin/refactor-amm-program
refactor amm program
2026-02-11 19:42:41 -05:00
jonesmarvin8
d40232abcc Merge branch 'main' into marvin/refactor-amm-program 2026-02-11 19:05:16 -05:00
jonesmarvin8
3facbbcc1f fixed artifacts 2026-02-11 18:53:31 -05:00
jonesmarvin8
9e52d41090 minor fixes from merging main
ipk -> vpk
IncomingViewingPublicKey -> ViewingPublicKey
2026-02-11 12:11:35 -05:00
jonesmarvin8
6a399ac36c Merge branch 'main' into marvin/private_keys 2026-02-11 11:49:57 -05:00
jonesmarvin8
c042361544 fix test issue 2026-02-11 11:43:23 -05:00
jonesmarvin8
a0ebd73f48
Merge pull request #249 from logos-blockchain/marvin/public_keys
public key protocol to match specs
2026-02-11 11:07:32 -05:00
jonesmarvin8
4ad56ded89 update artifacts 2026-02-11 10:10:45 -05:00
Pravdyvy
e5f908d241 Merge branch 'main' into Pravdyvy/indexer-state-management 2026-02-11 15:53:01 +02:00
Danish Arora
879dd61189
Increase wallet polling timeout for bedrock pipeline latency (#328) 2026-02-11 09:33:58 +05:30
jonesmarvin8
68254a835d fix license for amm and machete issue 2026-02-10 20:54:42 -05:00
jonesmarvin8
5f800ba9d9 Merge branch 'main' into marvin/refactor-amm-program 2026-02-10 20:40:13 -05:00
jonesmarvin8
7c930415a6 Merge branch 'main' into marvin/public_keys 2026-02-10 20:31:02 -05:00
jonesmarvin8
74e7bf321e update artifacts 2026-02-10 20:29:10 -05:00
jonesmarvin8
0930e4dd86 Merge branch 'main' into marvin/refactor-amm-program 2026-02-10 20:28:13 -05:00
Daniil Polyakov
6c77939c62
Merge pull request #315 from logos-blockchain/arjentix/explorer
Implement Explorer
2026-02-11 02:36:07 +03:00
Daniil Polyakov
72c45be083 feat: implement Explorer 2026-02-11 02:06:40 +03:00
jonesmarvin8
f891f57cab Merge branch 'main' into marvin/public_keys 2026-02-10 09:19:45 -05:00
jonesmarvin8
b0f00b2751
Merge pull request #310 from logos-blockchain/marvin/public_account_id
Update domain sep for public account ids
2026-02-10 09:02:13 -05:00
Pravdyvy
c3aa3a5495 fix: some ci fix 2026-02-10 15:54:57 +02:00
Daniel Sanchez
cb1b6f14f6
Merge pull request #320 from logos-blockchain/feat/nixify
feat: Nixify
2026-02-10 14:51:34 +01:00
Pravdyvy
92d254b66e feat: indexer block and public state tests 2026-02-10 15:29:23 +02:00
danielSanchezQ
042854653c Merge branch 'main' into feat/nixify
# Conflicts:
#	wallet-ffi/wallet_ffi.h
2026-02-10 12:38:04 +00:00
Pravdyvy
56ff66ccc1 feat: first indexer integration test 2026-02-10 14:03:56 +02:00
Pravdyvy
36407c1d43 Merge branch 'arjentix/full-bedrock-integration' into Pravdyvy/indexer-state-management 2026-02-10 09:14:24 +02:00
Daniil Polyakov
bdd7c7f599 chore: remove useless optional account in explorer 2026-02-10 00:27:47 +03:00
Daniil Polyakov
f248cf2ae0 feat: implement all-in-one docker compose 2026-02-10 00:27:47 +03:00
Sergio Chouhy
5884ad84fe
Merge pull request #330 from logos-blockchain/schouhy/fix-RUSTSEC-2026-0009
Fix RUSTSEC-2026-0009
2026-02-09 10:37:18 -03:00
Daniil Polyakov
90c70a7f76 chore: remove outdated deploy ci workflow 2026-02-09 16:19:45 +03:00
Daniil Polyakov
343bf003a4 feat: Publish indexer_service and explorer_service docker images 2026-02-09 16:19:27 +03:00
Sergio Chouhy
01d33788e5 update time dep 2026-02-09 10:09:55 -03:00
Pravdyvy
db0de3a53f fix: db tests 2026-02-09 15:05:01 +02:00
Daniil Polyakov
470c62b04a chore: apply recommended wallet config from #328 for integration tests 2026-02-09 15:15:53 +03:00
jonesmarvin8
8959b1652c Merge branch 'marvin/public_keys' into marvin/public_account_id 2026-02-08 14:00:14 -05:00
Sergio Chouhy
e3b59a117a
Merge pull request #326 from logos-blockchain/fryorcraken/zsh-completion-update
chore: add label to zsh auto-completion
2026-02-06 15:06:34 -03:00
Pravdyvy
4afe687e4c Merge branch 'main' into Pravdyvy/indexer-state-management 2026-02-06 17:42:32 +02:00
Daniil Polyakov
fdb2979f66 feat: fully integrate Sequencer, Indexer and Explorer with Bedrock 2026-02-06 16:24:35 +03:00
fryorcraken
94d4ccad80
chore: add label to zsh auto-completion 2026-02-06 14:53:48 +11:00
Daniil Polyakov
5b11234335
Merge pull request #293 from logos-blockchain/arjentix/refactor-token-program
refactor: split token program into crates
2026-02-06 01:16:34 +03:00
Daniil Polyakov
9909f02803 refactor: split token program into crates 2026-02-06 00:08:43 +03:00
Sergio Chouhy
ce29ca2fd0
Merge pull request #318 from logos-blockchain/schouhy/add-wallet-ffi-tests
Wallet FFI Tests
2026-02-05 13:58:38 -03:00
Sergio Chouhy
e0caa7838d destroy wallet in tests and add variant numbers to the error enum 2026-02-05 12:25:21 -03:00
Sergio Chouhy
709f189aa1 remove print line 2026-02-05 12:14:32 -03:00
Moudy
3b6446ff86 added instrc for sequencer 2026-02-05 15:37:39 +01:00
Moudy
e323387238
Merge pull request #322 from logos-blockchain/moudyellaz-LEZ-tutorials
LEZ testnet v0.1 tutorial
2026-02-05 15:34:57 +01:00
Moudy
c63279c5eb
Merge pull request #323 from logos-blockchain/moudyellaz-readme-update
Update README.md
2026-02-05 15:33:06 +01:00
Moudy
c87b716425 rm bedrock_signing_key 2026-02-05 15:30:18 +01:00
Moudy
25b3cd620a changed files names 2026-02-05 15:24:47 +01:00
Pravdyvy
357e0f1444 feat: all methods populated 2026-02-05 16:21:08 +02:00
Moudy
78f3d1cb7d removed ⁨ characters 2026-02-05 15:19:15 +01:00
Sergio Chouhy
2fc1ec0fdc Merge branch 'main' into schouhy/add-wallet-ffi-tests 2026-02-04 20:48:36 -03:00
Sergio Chouhy
b1840ca68a add test wallet ffi auth-transfer init call 2026-02-04 20:24:57 -03:00
Sergio Chouhy
4b50676ebc add wallet ffi base58 conversion tests 2026-02-04 16:08:04 -03:00
Sergio Chouhy
7c3182d903 add wallet ffi get private keys test 2026-02-04 15:29:36 -03:00
Sergio Chouhy
70d3b3a3e6 add FfiU128 struct 2026-02-04 14:58:43 -03:00
Moudy
0b77a1e7cf
Update README.md
fixed some weird characters
2026-02-04 17:08:06 +01:00
Sergio Chouhy
fdeb1f971c add get account keys test 2026-02-04 12:11:57 -03:00
Sergio Chouhy
5ac9953488 add ffi get account test 2026-02-04 11:36:10 -03:00
Sergio Chouhy
01f7d254c9
Merge pull request #325 from logos-blockchain/schouhy/fix-bytes-vuln-rustsec-2026-0007
Update bytes to v1.11.1 (RUSTSEC-2026-0007)
2026-02-04 10:13:46 -03:00
Pravdyvy
dc5b5ba278 feat: api methods population 2026-02-04 14:57:38 +02:00
Sergio Chouhy
2b07c02129 update bytes to v1.11.1 2026-02-04 09:42:56 -03:00
Moudy
a08a7824c0
update README.md
updated the introduction to include LEZ and LEE and rewrite some parts.
2026-02-04 13:32:40 +01:00
Moudy
9a7c851dcf
updated the sequencer part 2026-02-04 13:08:07 +01:00
Moudy
b509817038
Update README.md
just removed the sequencer part as it has changed and replaces NSSA. I think this should be polished and moved under tutorials
2026-02-04 12:58:02 +01:00
Moudy
f64d7f8dd3
Update README.md
removed tutorials
2026-02-04 12:31:01 +01:00
Moudy
61ffca07e2
amm program 2026-02-04 12:29:26 +01:00
Moudy
e0f1d528b8
custom tokens 2026-02-04 12:10:50 +01:00
Moudy
cf374a1422
token transfer 2026-02-04 11:50:05 +01:00
Moudy
9db96d1736
LEZ testnet v0.1 wallet setup tutorial 2026-02-04 09:20:56 +01:00
davidrusu
dac773fa03
Merge pull request #317 from logos-blockchain/drusu/license
Add Licensing + cargo deny check to ensure all dependencies are compliant
2026-02-04 08:55:03 +04:00
Sergio Chouhy
50b253fa00 move ffi tests to integration tests 2026-02-03 19:07:13 -03:00
Sergio Chouhy
35b469d738 add tests 2026-02-03 19:07:13 -03:00
Sergio Chouhy
629a3d1ef6 scaffolding 2026-02-03 19:07:13 -03:00
Alejandro Cabeza Romero
29dfa0b2e3
Gitignore lint. 2026-02-03 15:41:15 +01:00
Alejandro Cabeza Romero
67ada15c1b
Improve names. 2026-02-03 15:40:40 +01:00
Alejandro Cabeza Romero
0126791537
Remove artifact library. 2026-02-03 15:40:36 +01:00
Alejandro Cabeza Romero
81e4cfcba6
Add devshell to flake. 2026-02-03 15:40:06 +01:00
Alejandro Cabeza Romero
ed60e06ae2
Nixify 2026-02-03 15:40:06 +01:00
Sergio Chouhy
ec1424cd8e
Merge pull request #319 from logos-blockchain/dsq/wallet-ffi-runtime-fix
fix(wallet-ffi): Initialize runtime automatically when needed
2026-02-03 08:54:33 -03:00
Pravdyvy
efac8639c3 fix: merge fix 2026-02-03 11:36:07 +02:00
danielSanchezQ
9bb94c5df5 Initialize runtime automatically when needed 2026-02-03 09:23:20 +00:00
Pravdyvy
e1df915357 Merge branch 'arjentix/full-bedrock-integration' into Pravdyvy/indexer-state-management 2026-02-03 11:11:19 +02:00
Daniil Polyakov
71a7905a58 Integrate Indexer Service into integration tests 2026-02-02 19:07:24 +03:00
Daniil Polyakov
321f31a54b Reimplement subscriptions 2026-02-02 17:10:21 +03:00
fryorcraken
a5240925fc
Merge pull request #292 from logos-blockchain/fryorcraken/labels
add `wallet account label` feature
2026-02-02 14:30:33 +11:00
Sergio Chouhy
6ca020d547 fix deadlock in subscriptions 2026-01-31 19:05:27 -03:00
Sergio Chouhy
d14aeb6cc1 fix genesis msg id 2026-01-31 18:12:59 -03:00
David Rusu
a939ceecad chore(artifacts): rebuild artifacts 2026-02-01 00:28:41 +04:00
David Rusu
c45f560790 chore(circuits): Install circuits in CI 2026-02-01 00:21:08 +04:00
David Rusu
ac449427b2 feat(license): remove unnecessary cargo deny config 2026-01-31 23:59:38 +04:00
David Rusu
729ff6673c feat(license): add cargo deny step to workflow 2026-01-31 23:15:43 +04:00
David Rusu
38f1f68030 feat(license): MIT/Apache2 license and add cargo deny config 2026-01-31 23:13:36 +04:00
Sergio Chouhy
0ae327d934 fix config 2026-01-30 20:20:30 -03:00
Daniil Polyakov
f4e9a6606d Add log about parsed L2 blocks 2026-01-31 01:50:30 +03:00
Daniil Polyakov
a87db600cf Fix some errors 2026-01-31 01:39:59 +03:00
Daniil Polyakov
71787a70f7 Implement block subscription 2026-01-30 21:53:01 +03:00
Daniil Polyakov
2d0525ab31 Adjust Indexer RPC for Sequencer and Explorer needs only 2026-01-30 21:53:01 +03:00
Daniil Polyakov
e0729a1725 Integrate indexer client into sequencer 2026-01-30 21:53:01 +03:00
Daniil Polyakov
616159f936 Remove async_trait comments 2026-01-30 21:53:01 +03:00
Daniil Polyakov
c1d2b625ea Add IndexerCore to IndexerService 2026-01-30 21:53:01 +03:00
Daniil Polyakov
22a6195eca Move BasicAuth to common::config and remove SequencerClient from IndexerCore 2026-01-30 21:52:43 +03:00
Daniil Polyakov
9cac2e7487 Move indexer_core and indexer_service into indexer 2026-01-30 21:52:43 +03:00
Daniil Polyakov
fcb2917c21 Remove post_indexer_message() 2026-01-30 21:52:43 +03:00
Daniil Polyakov
8a00d8d8d4 feat: implement Explorer 2026-01-30 21:49:45 +03:00
Pravdyvy
8fa8cc33d8 fix: config fix 2026-01-30 14:58:41 +02:00
Daniel Sanchez
e4634b6edb
Merge pull request #301 from logos-blockchain/dsq/wallet-ffi
feat(wallet-ffi): Add wallet-ffi crate
2026-01-30 12:05:04 +01:00
Pravdyvy
0efc522837 feat: full integration try 1 2026-01-30 12:51:18 +02:00
danielSanchezQ
45a4063aea Merge branch 'main' into dsq/wallet-ffi
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-01-30 10:39:25 +00:00
Pravdyvy
17a1be5b0c feat: db exposed 1 2026-01-30 10:25:34 +02:00
Pravdyvy
3cb7f17aaf Merge branch 'main' into Pravdyvy/indexer-state-management 2026-01-30 08:13:55 +02:00
Sergio Chouhy
29ad41a645
Merge pull request #302 from logos-blockchain/schouhy/sequencer-retries-pending-blocks
Add pending block resubmit loop to the sequencer
2026-01-29 16:23:53 -03:00
Sergio Chouhy
2e071b538f drop retry pending block handle on Drop 2026-01-29 15:56:06 -03:00
Sergio Chouhy
df02c59310 minor rename 2026-01-29 15:26:29 -03:00
Sergio Chouhy
de54744893 use own type MantleMsgId 2026-01-29 15:21:15 -03:00
Sergio Chouhy
476dc50482 handle comments 2026-01-29 13:47:39 -03:00
Sergio Chouhy
e44eade97b fix error message 2026-01-29 12:25:48 -03:00
Sergio Chouhy
22290c05fb add docs and unit tests 2026-01-29 12:09:18 -03:00
Sergio Chouhy
95a58faf94 add delete blocks test 2026-01-29 12:07:52 -03:00
Sergio Chouhy
1e3e551ee7 add state serialization unit test 2026-01-29 11:17:30 -03:00
Pravdyvy
c7c646136f feat: staet breakpoints 2026-01-29 16:09:44 +02:00
Sergio Chouhy
22258435ff Merge branch 'main' into schouhy/sequencer-retries-pending-blocks 2026-01-29 10:13:22 -03:00
Sergio Chouhy
81921c3406 build artifacts 2026-01-29 09:54:01 -03:00
Pravdyvy
0ed41ba9f2 Merge branch 'main' into Pravdyvy/indexer-state-management 2026-01-29 14:53:13 +02:00
Sergio Chouhy
fb1221d985 fix indexer service types 2026-01-29 09:51:11 -03:00
Pravdyvy
d9839ea5a4
Merge pull request #282 from logos-blockchain/Pravdyvy/block-parsing-validation of
Indexer block parsing
2026-01-29 14:37:28 +02:00
Sergio Chouhy
d6df9a7796 minor refactor 2026-01-29 00:57:27 -03:00
Sergio Chouhy
deca3ffe69 fmt 2026-01-29 00:41:38 -03:00
Sergio Chouhy
ab2b16956e minor refactor 2026-01-28 15:53:29 -03:00
Sergio Chouhy
c606e7fe75 Merge branch 'main' into schouhy/sequencer-retries-pending-blocks 2026-01-28 14:39:53 -03:00
jonesmarvin8
ff13c34027 update secret_holder
Removed definition of outgoingviewingsecretkey
2026-01-28 11:01:48 -05:00
fryorcraken
636a3daedc
add wallet account label feature
- can add a label to own account via `wallet` CLI
- labels are displayed with `wallet account get` command
- labels are displayed with `wallet account list` command
- labels are persisted.
2026-01-28 15:19:09 +11:00
Pravdyvy
1b04c5326a fix: arts fix 2026-01-28 05:50:49 +02:00
Pravdyvy
e6b603ba44 Merge branch 'main' into Pravdyvy/block-parsing-validation 2026-01-28 05:32:03 +02:00
jonesmarvin8
a64fad8ff8 updated state tests 2026-01-27 18:35:31 -05:00
jonesmarvin8
19a53ed44e Merge branch 'main' into marvin/refactor-amm-program 2026-01-27 18:28:36 -05:00
jonesmarvin8
8d5e6a37e6 various fixes 2026-01-27 18:24:03 -05:00
jonesmarvin8
819bb1b7f3 Merge branch 'main' into marvin/private_keys 2026-01-27 16:30:11 -05:00
jonesmarvin8
f94eae0583 updated artifacts 2026-01-27 16:25:07 -05:00
jonesmarvin8
1dd0f16a5c fixed edge case 2026-01-27 16:19:56 -05:00
jonesmarvin8
752ad89ac7 fixed with unified approach 2026-01-27 16:00:42 -05:00
Sergio Chouhy
37c85de38d clippy 2026-01-27 16:06:51 -03:00
Sergio Chouhy
bc2350b349 fix start_from_config function 2026-01-27 16:03:21 -03:00
Daniil Polyakov
bbef426f86
Merge pull request #309 from logos-blockchain/arjentix/indexer-service
feat: implement Indexer Service skeleton
2026-01-27 21:16:55 +03:00
Sergio Chouhy
561b4a2dcf Merge branch 'main' into schouhy/sequencer-retries-pending-blocks 2026-01-27 14:48:09 -03:00
Sergio Chouhy
e78d6a59a0 add tokio task to retry pending blocks in bedrock 2026-01-27 13:27:52 -03:00
Sergio Chouhy
d7cac557af fix test 2026-01-27 10:52:43 -03:00
Pravdyvy
4667424215 feat: first diff modification 2026-01-27 13:36:49 +02:00
Pravdyvy
c0ad223b7c Merge branch 'Pravdyvy/block-parsing-validation' into Pravdyvy/indexer-state-management 2026-01-27 10:02:15 +02:00
Pravdyvy
c0e879edae fix: suggestions fix 1 2026-01-27 09:46:31 +02:00
Pravdyvy
4c4e30864b fix: dep updated, merge fix 2026-01-27 08:13:53 +02:00
Pravdyvy
516feee101 Merge branch 'main' into Pravdyvy/block-parsing-validation 2026-01-27 07:57:41 +02:00
Sergio Chouhy
fe4a89191c add state to rocksdb 2026-01-27 01:20:17 -03:00
jonesmarvin8
9a92aa1553 updates and fmt 2026-01-26 18:38:41 -05:00
jonesmarvin8
a2d3d5ae0d Merge branch 'marvin/public_keys' into marvin/public_account_id 2026-01-26 16:08:33 -05:00
jonesmarvin8
c81ce363c1 Merge branch 'main' into marvin/public_keys 2026-01-26 16:06:40 -05:00
Daniil Polyakov
2288a725d2 feat: implement indexer service skeleton 2026-01-26 23:31:28 +03:00
jonesmarvin8
3205e69e11
Update programs/amm/src/new_definition.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2026-01-26 15:15:04 -05:00
Sergio Chouhy
f4c81f5e78
Merge pull request #286 from logos-blockchain/schouhy/adapt-sequencer-to-bedrock
Adapt sequencer to post block data to Bedrock
2026-01-26 15:02:20 -03:00
Sergio Chouhy
e897fd6076 fix parent when resubmitting pending blocks 2026-01-26 14:51:39 -03:00
Sergio Chouhy
e680544ca3 use context 2026-01-26 13:46:47 -03:00
Sergio Chouhy
02702213dc
Update sequencer_core/src/block_settlement_client.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2026-01-26 13:34:38 -03:00
Sergio Chouhy
ab31a1fd2d Merge branch 'schouhy/adapt-sequencer-to-bedrock' into schouhy/sequencer-retries-pending-blocks 2026-01-26 12:25:47 -03:00
Sergio Chouhy
ded6e8123d Merge branch 'main' into schouhy/adapt-sequencer-to-bedrock 2026-01-26 11:38:42 -03:00
Sergio Chouhy
eaab2e042a
Merge pull request #270 from logos-blockchain/Pravdyvy/indexer-client
Bedrock client adoption
2026-01-26 11:03:07 -03:00
Daniil Polyakov
3752c39bad
Merge pull request #311 from logos-blockchain/arjentix/fix-ci-nextest-installation
fix: install cargo-nextest with locked option
2026-01-26 16:56:16 +03:00
Daniil Polyakov
6e745494c2 fix: install cargo-nextest with locked option 2026-01-26 16:25:06 +03:00
Daniel
82d5ce403c Remove oncecell dep from workspace Cargo.toml 2026-01-26 10:53:17 +01:00
Daniel
addc65933f Fmt happy in nightly 2026-01-26 10:45:51 +01:00
Daniel
272cbfe400 Remove unused dependency once_cell from Cargo.toml 2026-01-26 10:43:53 +01:00
Daniel
26a39bb005 Fmt happy 2026-01-26 10:36:30 +01:00
Daniel
c44e8d6a89 Refactor runtime initialization 2026-01-26 10:36:14 +01:00
Daniel
a97066c41d Re-structure errors and clippy happy 2026-01-26 10:29:37 +01:00
Daniel
6d883d5528 Use bytearray instead of hi/lo for u128 2026-01-26 10:15:23 +01:00
jonesmarvin8
e2d7906930 fixed hardcoded account ids 2026-01-24 10:28:41 -05:00
jonesmarvin8
d22354a485 update wallet configs 2026-01-24 08:47:09 -05:00
jonesmarvin8
0939b7e1c6 update public account id domain separator 2026-01-23 20:45:47 -05:00
jonesmarvin8
7a395d07c4 remove redundant dependency 2026-01-23 17:14:00 -05:00
jonesmarvin8
55b13a6f41 fmt 2026-01-23 16:58:25 -05:00
jonesmarvin8
7c231ae955 artifacts fixes 2026-01-23 16:56:53 -05:00
jonesmarvin8
15d78527fe fixed fmt 2026-01-23 16:35:18 -05:00
jonesmarvin8
2367bf343b refactor AMM 2026-01-23 16:30:54 -05:00
Sergio Chouhy
7d48fe70b5
Merge pull request #303 from logos-blockchain/bug/conflicting-flags
bug(wallet): conflicting flag -h for transaction info
2026-01-23 17:55:59 -03:00
Pravdyvy
b00e990eb2 feat: indexer storage added 2026-01-23 14:09:10 +02:00
Pravdyvy
b117073237 fix: artifacts updated 2026-01-23 11:04:07 +02:00
Pravdyvy
505e653ff0 fix: machete update 2026-01-23 10:54:32 +02:00
Pravdyvy
df58511bf0 Merge branch 'main' into Pravdyvy/block-parsing-validation 2026-01-23 10:49:16 +02:00
Pravdyvy
9896cd3767 fix: updates, added test 2026-01-23 10:39:34 +02:00
jonesmarvin8
e4e476fde9 begin refactoring 2026-01-22 20:48:05 -05:00
jonesmarvin8
ffe1034c0d update artifacts 2026-01-22 18:51:16 -05:00
jonesmarvin8
6e18f46965 additional lint fix 2026-01-22 18:25:57 -05:00
jonesmarvin8
d1a2234cc5 lint fix 2026-01-22 18:24:19 -05:00
jonesmarvin8
74fa7c9435 fmt 2026-01-22 18:06:03 -05:00
jonesmarvin8
cfebb9d8b4 update account id domain separator 2026-01-22 17:53:00 -05:00
jonesmarvin8
8b6443aa89 update wallet accounts 2026-01-22 17:51:17 -05:00
Daniil Polyakov
652be426ae refactor: split token program into crates 2026-01-23 00:53:21 +03:00
Pravdyvy
2a2fe1347a fix: new model rewrite 2026-01-22 14:44:48 +02:00
Václav Pavlín
a8f41838ac
bug(wallet): conflicting flag -h for transaction info 2026-01-22 09:29:54 +01:00
Sergio Chouhy
2218ad1c64 add functionality to resubmit pending transactions and delete finalized blocks 2026-01-22 02:01:02 -03:00
jonesmarvin8
cabb4ab257 fix integration test wallet 2026-01-21 19:31:27 -05:00
jonesmarvin8
27cd0d068f minor fix 2026-01-21 18:31:08 -05:00
jonesmarvin8
2c9219bb0f relabel ipk to vpk 2026-01-21 17:58:45 -05:00
jonesmarvin8
d204f386bb fmt 2026-01-21 17:48:10 -05:00
jonesmarvin8
c6aa0c41b6 update tests 2026-01-21 17:27:23 -05:00
jonesmarvin8
877f879af3 cargo fmt 2026-01-21 17:11:51 -05:00
jonesmarvin8
75beecc6b9 update tests
Update tests for LEE domain separator.
2026-01-21 17:03:43 -05:00
jonesmarvin8
0b8b1c89b8 Merge branch 'main' into marvin/private_keys 2026-01-21 16:52:11 -05:00
Sergio Chouhy
f04b299b1a minor changes 2026-01-21 11:47:28 -03:00
Daniel
ec6caee2dc Missing fmt 2026-01-21 15:38:50 +01:00
Daniel
17b36b924e Vibecoded wallet-ffi 2026-01-21 15:22:38 +01:00
Daniil Polyakov
fb62143398
Merge pull request #259 from logos-blockchain/arjentix/multi-chain-calls-in-private-tx
Implement private multi chain calls
2026-01-21 16:55:49 +03:00
Sergio Chouhy
56295d12d8 use anyhow for block settlement client error handling 2026-01-21 10:38:18 -03:00
Pravdyvy
eb77217318 fix: suggestions 1 2026-01-21 14:50:29 +02:00
Sergio Chouhy
e397d6c576 add bedrock status flag to blocks and last_finalized_block metadata info to sequencer db 2026-01-20 11:52:02 -03:00
Pravdyvy
66d01d69d7 fix: dep fix 2026-01-20 10:26:22 +02:00
Daniil Polyakov
60822c7f03
Merge pull request #290 from logos-blockchain/fryorcraken/zsh-completion
Add zsh completion script for wallet CLI
2026-01-20 03:35:52 +03:00
Daniil Polyakov
173945a170
Merge pull request #289 from logos-blockchain/fryorcraken/wallet-acc-ls-rm-commas
Remove trailing commas on `wallet account ls` output
2026-01-20 03:35:31 +03:00
Sergio Chouhy
654e92f0d7 clippy 2026-01-19 14:26:48 -03:00
Daniil Polyakov
2b2a52d0b8 feat: error on unclaimed modified accounts 2026-01-19 17:29:59 +03:00
Pravdyvy
b143beef37 fix: ci fix 1 2026-01-19 14:10:16 +02:00
Pravdyvy
f3dcda346c fix: ci test 1 2026-01-19 13:55:31 +02:00
Pravdyvy
bec78ae70f Merge branch 'schouhy/adapt-sequencer-to-bedrock' into Pravdyvy/block-parsing-validation 2026-01-19 13:22:43 +02:00
Daniil Polyakov
67d5a3e9f4 fix: check public account authorization in privacy preserving circuit 2026-01-17 02:28:31 +03:00
Daniil Polyakov
78a6ff72ee test: add unit test for private multi chain calls 2026-01-17 02:28:31 +03:00
Daniil Polyakov
a097ff9d49 chore: rebuild artifacts 2026-01-17 02:28:31 +03:00
Daniil Polyakov
4e46dbbdf4 feat: implement private multi chain calls in wallet (nssa) 2026-01-17 02:28:31 +03:00
Daniil Polyakov
5d7f44aa3e feat: implement private multi chain calls in circuit 2026-01-17 02:28:31 +03:00
Daniil Polyakov
82a8e551b9
Merge pull request #280 from logos-blockchain/fryorcraken/display-ipk-npk
add wallet account keys command to display ipk/npk
2026-01-17 01:56:03 +03:00
Sergio Chouhy
4105eecace fix msg id in mantle tx 2026-01-16 19:50:54 -03:00
Pravdyvy
342809c830 fix: machete fix for indexer 2026-01-16 16:19:59 +02:00
Pravdyvy
b96865ab89 fix: indexer update 2026-01-16 16:15:21 +02:00
fryorcraken
b8821693a8
Return keys for uninitialized accounts too 2026-01-16 11:31:11 +11:00
fryorcraken
9267cb59af
Return keys for public accounts 2026-01-16 11:31:11 +11:00
fryorcraken
562ab63735
Move the feature to get --keys 2026-01-16 11:31:10 +11:00
fryorcraken
6484e0121c
Remove trailing commas on wallet account ls output
The trailing commas is inconvenient:

1. For users trying to select an account id by double-clicking it in a terminal: the comma gets included in the selection
2. For dev parsing the `wallet account list` output: the commas needs to be handled
2026-01-16 11:30:11 +11:00
fryorcraken
f4978c1bde
add wallet account keys command to display ipk/npk
ipk and npk are needed to receive funds from an external account on a private account.

They are currently only displayed at account creation (`wallet account new private`). With this command, it is now possible to print them at any time.
2026-01-16 11:29:49 +11:00
fryorcraken
47e76c9f85
Added support for --long 2026-01-16 11:26:58 +11:00
fryorcraken
5a4111bcc8
Update readme 2026-01-16 11:23:54 +11:00
fryorcraken
d789ccba46
add more commands 2026-01-16 11:23:54 +11:00
fryorcraken
bb54d08f02
Add zsh completion script for wallet CLI 2026-01-16 11:23:54 +11:00
Pravdyvy
c2e09031e1 fix: integration updates 2026-01-15 15:44:48 +02:00
Pravdyvy
b6a0e62871 Merge branch 'schouhy/adapt-sequencer-to-bedrock' into Pravdyvy/block-parsing-validation 2026-01-15 14:03:23 +02:00
Sergio Chouhy
8da515da6b fmt 2026-01-15 00:29:45 -03:00
Sergio Chouhy
aeb3fd3932 replace unwrap with expect 2026-01-15 00:28:40 -03:00
Sergio Chouhy
3dbe31501c fix merge 2026-01-14 23:45:58 -03:00
Sergio Chouhy
26806daedc fix config 2026-01-14 23:32:45 -03:00
Sergio Chouhy
ae5fe0a2a5 Merge branch 'main' into schouhy/adapt-sequencer-to-bedrock 2026-01-14 23:30:06 -03:00
Sergio Chouhy
ccce2213da sequencer posts blocks to bedrock 2026-01-14 23:25:18 -03:00
Sergio Chouhy
72a3e406b8 add r0vm binary to runtime stage 2026-01-14 23:25:18 -03:00
Daniil Polyakov
4f5c3a831e fix: skip tps_test in ci 2026-01-14 23:25:18 -03:00
Daniil Polyakov
f9032a676a chore: fix cargo machete 2026-01-14 23:25:18 -03:00
Daniil Polyakov
529ca9a643 feat: introduce parallel integration tests, wallet without global vars and etc 2026-01-14 23:25:18 -03:00
Danish Arora
deb6e9d839 fix: program deployment tutorial (#277) 2026-01-14 23:25:18 -03:00
fryorcraken
7e2a8f4491 add wallet account list --long option
Display account details in the `account list` output when using the `-l|--long` option.
2026-01-14 23:25:18 -03:00
jonesmarvin8
eaee772c86
Update key_protocol/src/key_management/key_tree/keys_public.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2026-01-14 10:51:11 -05:00
jonesmarvin8
537eeb63dc
Update key_protocol/src/key_management/key_tree/keys_public.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2026-01-14 10:50:59 -05:00
Pravdyvy
de5201e212 feat: ci test 1 2026-01-14 16:16:45 +02:00
Sergio Chouhy
54cc214c33
Merge pull request #284 from logos-blockchain/schouhy/fix-wallet
Fix wallet build
2026-01-14 10:44:09 -03:00
Daniil Polyakov
78e593285d
Merge pull request #281 from logos-blockchain/chore/use-flag-instead-of-key
chore(wallet): use --all instead of fake option name all
2026-01-14 00:59:39 +03:00
Pravdyvy
bbbb1c1a23 fix: indexer core added to all objects 2026-01-13 15:11:51 +02:00
Pravdyvy
1fd6651121 fix: lock update 2026-01-13 11:20:44 +02:00
Pravdyvy
36eaed5936 Merge branch 'Pravdyvy/indexer-client' into Pravdyvy/block-parsing-validation 2026-01-13 11:20:32 +02:00
Pravdyvy
af19d7ad93 Merge branch 'main' into Pravdyvy/indexer-client 2026-01-13 11:18:10 +02:00
Sergio Chouhy
8e131713de add tokio macros feature to wallet deps 2026-01-12 20:12:37 -03:00
jonesmarvin8
874aa09b82 fixes 2026-01-12 17:27:44 -05:00
Sergio Chouhy
71b59af774
Merge pull request #271 from logos-blockchain/schouhy/fix-dockerfile
Add r0vm binary to docker runtime stage
2026-01-12 19:23:56 -03:00
Daniil Polyakov
2fcde81301
Merge pull request #262 from logos-blockchain/arjentix/refactor-integration-tests
Big integration tests refactor
2026-01-13 00:32:04 +03:00
jonesmarvin8
ab37740348 Merge branch 'main' into marvin/public_keys 2026-01-12 16:02:56 -05:00
Pravdyvy
aa6da018eb feat: indexer crate reding and parsing 2026-01-12 15:51:24 +02:00
Danish Arora
2022f28228
fix: program deployment tutorial (#277) 2026-01-12 13:13:34 +05:30
Pravdyvy
3473602efc fix: try new branch of client 2026-01-09 17:06:13 +02:00
Pravdyvy
324eec24df fix: indexer crate 2026-01-09 15:10:38 +02:00
fryorcraken
1b5521b5c9
Merge pull request #279 from logos-blockchain/fryorcraken/detailed-account-ls
add `wallet account list --long` option
2026-01-09 09:16:17 +11:00
Václav Pavlín
040dc9eff7
chore(wallet): use --all instead of fake option name all 2026-01-08 10:03:11 +01:00
Pravdyvy
6f8a7295c2 fix: deployment updates 2026-01-08 10:13:47 +02:00
Pravdyvy
0a95e3ee62 fix: ci run 3 2026-01-08 09:32:24 +02:00
Pravdyvy
fc179dcb51 fix: ci try 2 2026-01-08 09:29:43 +02:00
Pravdyvy
6b9eec61e5 fix: ci try 1 2026-01-08 09:26:11 +02:00
Pravdyvy
f400684d59 fix: fmt 2026-01-08 09:10:45 +02:00
Pravdyvy
f817279d33 fix: client as dependency 2026-01-08 09:10:00 +02:00
jonesmarvin8
4620219408
Update key_protocol/src/key_management/key_tree/keys_public.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2026-01-07 18:10:02 -05:00
Pravdyvy
1a033af5f2 fix: adapting http client 2026-01-07 16:29:37 +02:00
fryorcraken
76839dd59a
add wallet account list --long option
Display account details in the `account list` output when using the `-l|--long` option.
2026-01-07 16:10:38 +11:00
Sergio Chouhy
5db00ceab3 add r0vm binary to runtime stage 2026-01-06 16:57:03 -03:00
Pravdyvy
149b00d2a3 init: initial structure 2026-01-06 15:09:03 +02:00
Daniil Polyakov
f98c645642 fix: skip tps_test in ci 2025-12-31 13:50:11 +03:00
Daniil Polyakov
e7ee114d9f chore: fix cargo machete 2025-12-31 04:33:18 +03:00
Daniil Polyakov
7296088005 feat: introduce parallel integration tests, wallet without global vars and etc 2025-12-31 04:30:22 +03:00
Daniil Polyakov
1d09afd9e0
Merge pull request #245 from logos-blockchain/Pravdyvy/amm-wallet-integration
AMM-wallet integration (Public part)
2025-12-26 23:52:10 +03:00
Daniil Polyakov
2d1ee4b279 Merge branch 'main' into Pravdyvy/amm-wallet-integration 2025-12-26 23:07:48 +03:00
Daniil Polyakov
f2235548da
Merge pull request #237 from logos-blockchain/Pravdyvy/token-burn-mint-wallet-update
Token burn mint wallet update
2025-12-26 22:48:27 +03:00
Daniil Polyakov
48d1d0e858 fix: adjust to a new token vec instruction 2025-12-26 20:56:34 +03:00
Daniil Polyakov
bece9a9108 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-26 13:38:34 +03:00
Daniil Polyakov
f4a8429461
Merge pull request #232 from logos-blockchain/marvin/nfts
initialize nft branch
2025-12-26 01:00:50 +03:00
Daniil Polyakov
9d37a88069 fix: proper type for token program instruction 2025-12-26 00:24:55 +03:00
Daniil Polyakov
de751952af fix: fmt and lints 2025-12-25 17:05:06 +03:00
Daniil Polyakov
e81d7f099d Merge branch 'main' into marvin/nfts 2025-12-25 17:01:46 +03:00
Daniil Polyakov
5d30de695f fix: use u128::MAX instead of overflowing 2.pow(128) 2025-12-25 16:59:49 +03:00
Daniil Polyakov
cecf39cecd
Merge pull request #254 from logos-blockchain/schouhy/amm-wallet-integration-readme
Add amm section to the readme
2025-12-24 23:20:35 +03:00
Daniil Polyakov
28b64e87f5
Merge pull request #152 from logos-blockchain/simple_amm
initialize amm program PR
2025-12-24 23:03:14 +03:00
Daniil Polyakov
2e82d2ddb8 chore: fix lints, fmt and artifacts 2025-12-24 03:39:39 +03:00
jonesmarvin8
e6a73a02b5 artifacts commitment 2025-12-23 18:03:00 -05:00
jonesmarvin8
065eeac3b2 minor clean up and fmt 2025-12-23 17:42:30 -05:00
jonesmarvin8
9f753c0333 clean up and fmt/clippy 2025-12-23 17:40:47 -05:00
jonesmarvin8
c6531aaab4 accountid removed conflict 2025-12-23 17:36:58 -05:00
jonesmarvin8
c25e93edd5 cargo fmt and clippy 2025-12-23 17:31:03 -05:00
jonesmarvin8
fcdd6e96a5 clippy and fmt 2025-12-23 17:26:38 -05:00
jonesmarvin8
c5e640d56c Merge branch 'main' into marvin/nfts 2025-12-23 14:01:28 -05:00
jonesmarvin8
56151e9d3d remove unused file from merge
Accidental inclusion
2025-12-23 11:06:18 -05:00
jonesmarvin8
8289c07b28 Merge branch 'main' into simple_amm 2025-12-23 11:03:11 -05:00
jonesmarvin8
a84057561e various fixes from comments 2025-12-22 19:52:39 -05:00
jonesmarvin8
072cf5cd0f various fixes from comments 2025-12-22 19:51:41 -05:00
jonesmarvin8
ed373067fb fixed private keys 2025-12-22 19:50:03 -05:00
jonesmarvin8
3c21f4418f public key protocol fixed 2025-12-22 19:47:59 -05:00
jonesmarvin8
5baa759283
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 18:26:33 -05:00
jonesmarvin8
ca7cc10f7c
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 18:26:19 -05:00
jonesmarvin8
c49a3afec7
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 18:25:21 -05:00
jonesmarvin8
fe3c11fd3e
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 18:24:59 -05:00
Pravdyvy
639c282c61 fix: suggestions fix 2 2025-12-22 19:34:47 +02:00
jonesmarvin8
05d34bf9ec
Update nssa/program_methods/guest/src/bin/amm.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 11:41:44 -05:00
jonesmarvin8
32de4e2990
Update nssa/program_methods/guest/src/bin/amm.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-22 11:41:19 -05:00
Pravdyvy
0a1bbb9d21 fix: merge fix 2025-12-22 05:12:48 +02:00
Pravdyvy
22c60cb97f fix: lock update 2025-12-22 05:01:04 +02:00
Pravdyvy
22f6d92ca6 Merge branch 'main' into Pravdyvy/amm-wallet-integration 2025-12-22 05:00:50 +02:00
Pravdyvy
c1a999c02e fix: new artifacts 2025-12-22 04:55:15 +02:00
Pravdyvy
4f15237446 fix: suggestions fix 2025-12-22 04:42:32 +02:00
Pravdyvy
e351279278 fix: merge ci fix 2025-12-22 04:14:54 +02:00
Pravdyvy
c95c4b2f16 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-22 04:04:09 +02:00
Pravdyvy
f6c787e15f fix: suggestions fix 2025-12-22 04:02:12 +02:00
jonesmarvin8
c30ba4be1a various fixes 2025-12-19 20:08:05 -05:00
jonesmarvin8
9601e0053e removed enums 2025-12-19 20:05:42 -05:00
Sergio Chouhy
9adc88f8c8 add lp fees note 2025-12-19 17:32:38 -03:00
Sergio Chouhy
5a03ad431d nit 2025-12-19 17:21:26 -03:00
Sergio Chouhy
3581c97424 add amm section to the readme 2025-12-19 17:10:33 -03:00
Daniil Polyakov
9b37a2a8b7
Merge pull request #248 from logos-blockchain/arjentix/build-docker-image
Publish sequencer_runner Docker image with CI
2025-12-19 21:05:28 +03:00
Pravdyvy
d427d49c65 fix: suggestions added 2025-12-19 19:12:58 +02:00
Pravdyvy
1b0dea11f6
Update wallet/src/cli/programs/amm.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-12-19 19:02:39 +02:00
Sergio Chouhy
a280551ee3
Merge pull request #241 from logos-blockchain/schouhy/add-program-deployment-example-pda
Add example and instructions for pda and privacy tail calls
2025-12-19 13:41:26 -03:00
Daniil Polyakov
10b6cfcf93 fixup! fix: commit Cargo lock 2025-12-19 18:48:19 +03:00
Daniil Polyakov
6997a8da54 fix: give permissions to non-root docker user 2025-12-19 18:48:19 +03:00
Daniil Polyakov
621b7c0bfa fix: commit Cargo lock 2025-12-19 18:48:19 +03:00
Daniil Polyakov
45670902d1 fix: build risc0 bins to different target directories 2025-12-19 18:48:19 +03:00
Daniil Polyakov
56f8df1d2b fix: add ref to CI checkout action 2025-12-19 18:48:19 +03:00
Daniil Polyakov
6075e03d06 feat: more granular tests in CI 2025-12-19 18:48:19 +03:00
Daniil Polyakov
172b13d03a feat: add logs for program pre_states and output 2025-12-19 18:48:19 +03:00
Daniil Polyakov
9b729d6c3e feat: use nextest in CI 2025-12-19 18:48:19 +03:00
Daniil Polyakov
d6d722c016 fix: fix token program unit test in debug mode 2025-12-19 18:48:19 +03:00
Daniil Polyakov
0ac7b5c702 feat: publish sequencer_runner docker image with CI 2025-12-19 18:48:13 +03:00
Daniil Polyakov
dc38b8ea2d feat: add artifacts of program_methods and remove no_docker feature 2025-12-19 18:30:40 +03:00
Daniil Polyakov
d425d70d4c feat: use actions/checkout@v5 2025-12-19 18:30:40 +03:00
Daniil Polyakov
ddf6e707ec feat: add cargo machete check to CI 2025-12-19 18:30:40 +03:00
Daniil Polyakov
d126dac303 feat: make CI more granular 2025-12-19 18:30:40 +03:00
Daniil Polyakov
081a366c16 feat: add programs check in ci 2025-12-19 18:30:40 +03:00
Daniil Polyakov
87f45b8215 feat: move all crates into workspace 2025-12-19 18:30:40 +03:00
Daniil Polyakov
90a1ee994f refactor: move program_methods to the root of repo 2025-12-19 18:30:40 +03:00
Sergio Chouhy
44f6f44fa2 Merge branch 'main' into schouhy/add-program-deployment-example-pda 2025-12-19 10:45:48 -03:00
jonesmarvin8
e73e4b0558
Merge pull request #250 from logos-blockchain/main
merge main into simple amm
2025-12-19 08:36:08 -05:00
Pravdyvy
144c037114 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-19 12:13:43 +02:00
Pravdyvy
7d12502542
Merge pull request #239 from logos-blockchain/Pravdyvy/merge-template-update
fix: template update
2025-12-19 11:32:50 +02:00
jonesmarvin8
a5496eb5d5 various comments addressed 2025-12-18 18:45:57 -05:00
Daniil Polyakov
2b15bed3fa
Merge pull request #240 from logos-blockchain/arjentix/private-acc-init-with-is-authorized
Allow private authorized uninitialized accounts
2025-12-19 01:39:15 +03:00
Daniil Polyakov
f729072fae feat: allow private authorized uninitialized accounts 2025-12-18 21:48:37 +03:00
Sergio Chouhy
ef97fade99 feat: unzip init proofs from nsk 2025-12-18 17:57:13 +03:00
Daniil Polyakov
2975d9d878 chore: make more clear error messages in authenticated_transfer 2025-12-18 17:57:13 +03:00
Pravdyvy
c1283d4a0c fix: public execution finalized 2025-12-18 11:44:38 +02:00
Pravdyvy
cde11e75d6 fix: state test update 2025-12-17 15:58:25 +02:00
Daniil Polyakov
8dc709a6e0
Merge pull request #247 from logos-blockchain/arjentix/fix-macos-rocksdb
fix: add `bindgen-runtime` feature of rocksdb
2025-12-17 16:34:29 +03:00
Pravdyvy
92b5dffec2 fix: public swaps 2025-12-17 14:21:36 +02:00
Pravdyvy
b3dca76b67 fix: intercommit 2025-12-17 11:44:52 +02:00
jonesmarvin8
74327bcec6 added tests for public keys (master and non-harden child keys 2025-12-16 20:47:55 -05:00
jonesmarvin8
b7a6fda00a Added test for master keys 2025-12-16 20:46:16 -05:00
Daniil Polyakov
cd99318bf0
Merge pull request #231 from logos-blockchain/arjentix/ci-deploy
feat: deploy with ci
2025-12-17 01:28:49 +03:00
Daniil Polyakov
bbc02f0cf3 fix: add bindgen-runtime feature of rocksdb 2025-12-17 01:10:25 +03:00
Pravdyvy
d4a471e948 feat: swaps, add/rem liq 2025-12-16 14:05:34 +02:00
Moudy
e52e7d9ee9
Merge pull request #227 from fryorcraken/chore/rocksdb
Upgrade rocksdb
2025-12-16 11:53:16 +01:00
Pravdyvy
c5cca4376e Merge branch 'simple_amm' into Pravdyvy/amm-wallet-integration 2025-12-16 09:27:34 +02:00
jonesmarvin8
c3cd110688 data field fixes 2025-12-15 18:55:38 -05:00
jonesmarvin8
d78d97c815 Reapply "Merge branch 'main' into simple_amm"
This reverts commit 2419d4a1126afa9882b3fefbe518582ae130a817.
2025-12-15 18:13:31 -05:00
jonesmarvin8
2419d4a112 Revert "Merge branch 'main' into simple_amm"
This reverts commit 8dd1c2d84677aa5efe00ca820ec634a19b73de07, reversing
changes made to 2e37e20014fc8ddaa4559cbdf2c13ec8eb356f24.
2025-12-15 17:53:20 -05:00
jonesmarvin8
8dd1c2d846 Merge branch 'main' into simple_amm 2025-12-15 17:41:45 -05:00
jonesmarvin8
2e0450bfcd private key protocol fixes 2025-12-15 17:24:59 -05:00
Pravdyvy
4389364b55 fix: last md update 2025-12-15 15:39:26 +02:00
Pravdyvy
bb6cf322a0 Merge branch 'main' into Pravdyvy/amm-wallet-integration 2025-12-15 10:40:46 +02:00
Pravdyvy
93b616a434 fix: lock updates 2025-12-15 10:00:19 +02:00
Pravdyvy
1599bd41ce Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-15 09:52:10 +02:00
jonesmarvin8
de1bf770f0 update comments 2025-12-12 19:09:59 -05:00
Sergio Chouhy
165e331aea clippy 2025-12-12 20:10:10 -03:00
Sergio Chouhy
5fe29016b7
Merge pull request #233 from logos-blockchain/schouhy/add-program-deployment-example
Program deployment tutorial and examples
2025-12-12 20:07:46 -03:00
jonesmarvin8
3acc51ac87 rebased with main token program 2025-12-12 16:50:13 -05:00
jonesmarvin8
e76800e283 Merge branch 'main' into marvin/nfts 2025-12-12 16:35:23 -05:00
jonesmarvin8
aa81a311ac Update token.rs 2025-12-12 16:30:54 -05:00
jonesmarvin8
213e8dfb82
Merge pull request #224 from logos-blockchain/marvin/token_burn_mint
add burn and mint to Token Program
2025-12-12 16:29:07 -05:00
jonesmarvin8
ae50ff65fa fixed conflicts with token rs from main 2025-12-12 16:27:27 -05:00
jonesmarvin8
fac1dc19e2 merge main minus token rs 2025-12-12 16:13:13 -05:00
jonesmarvin8
30b4c8036e
Merge pull request #238 from logos-blockchain/marvin/privacy_nonce_rearrangement
Rearrange nonce increment for privacy transactions
2025-12-12 15:53:58 -05:00
Sergio Chouhy
a360df29bf Merge branch 'schouhy/add-program-deployment-example' into schouhy/add-program-deployment-example-pda 2025-12-12 17:35:01 -03:00
Sergio Chouhy
40bb718527 fmt 2025-12-12 17:04:51 -03:00
Sergio Chouhy
63f102643b add instructions to get the hello world program id in hex 2025-12-12 14:30:36 -03:00
Sergio Chouhy
77fd189010 refactor to use privacy tail calls from send_privacy_preserving_tx and add the example runner 2025-12-12 14:21:07 -03:00
Sergio Chouhy
89c1a97798 add example and instructions for pda 2025-12-12 13:00:16 -03:00
Sergio Chouhy
7453734dbe add important note 2025-12-12 10:55:03 -03:00
Sergio Chouhy
3e3ee9ba36 taplo fmt 2025-12-12 10:30:57 -03:00
Pravdyvy
31405af143 fix: template update 2025-12-12 14:49:24 +02:00
Pravdyvy
5212d456ab fix: integration tests 2025-12-12 13:40:56 +02:00
jonesmarvin8
9f443b92a8 modifications 2025-12-11 19:19:22 -05:00
Sergio Chouhy
bb58f7dd0a revert changes 2025-12-11 21:15:57 -03:00
Sergio Chouhy
8c92a58bbc add program deployment examples 2025-12-11 20:59:37 -03:00
Daniil Polyakov
d019c26578 feat: deploy with ci 2025-12-11 17:28:26 +03:00
jonesmarvin8
2d8722b7d0 nonce code shifting 2025-12-11 08:59:28 -05:00
Pravdyvy
0be88d4343 fix: fmt 2025-12-11 14:47:11 +02:00
Pravdyvy
f77481f3b5 feat: mint and burn 2025-12-11 14:46:16 +02:00
Sergio Chouhy
abb1fc5e45
Merge pull request #151 from logos-blockchain/schouhy/implement-privacy-preserving-tail-calls
Implement privacy preserving tail calls
2025-12-11 08:08:23 -03:00
Pravdyvy
7e8b8c7624 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-11 12:06:47 +02:00
Sergio Chouhy
1b2962fa03 add missing check on pre_states for privacy tail calls 2025-12-10 23:10:25 -03:00
jonesmarvin8
1b7afbecdc updates 2025-12-10 20:21:11 -05:00
Sergio Chouhy
33ee1fc72e
Merge pull request #236 from logos-blockchain/schouhy/move-modified-transfer-to-test-methods
Move modified transfer program to test programs
2025-12-10 18:13:47 -03:00
Sergio Chouhy
d7f0346671 fix test 2025-12-10 15:57:43 -03:00
Sergio Chouhy
5276cc8f07 Merge branch 'schouhy/move-modified-transfer-to-test-methods' into schouhy/implement-privacy-preserving-tail-calls 2025-12-10 14:51:46 -03:00
Sergio Chouhy
e9c9058827 move modified transfer program to test programs 2025-12-10 14:07:06 -03:00
Sergio Chouhy
c6f0782d26
Merge pull request #221 from logos-blockchain/schouhy/add-wallet-deploy-command
Add deploy program command to wallet
2025-12-10 13:57:12 -03:00
jonesmarvin8
340c9c4ce6 redundant underflow check added 2025-12-10 08:12:17 -05:00
Sergio Chouhy
9637b8b666 Merge branch 'main' into schouhy/add-wallet-deploy-command 2025-12-10 09:58:45 -03:00
Daniil Polyakov
cd2430c2ee
Merge pull request #229 from logos-blockchain/arjentix/iss-186-fix-wallet-sync-print-spam
Remove print spam when running wallet account sync-private
2025-12-10 14:24:26 +03:00
Pravdyvy
0ac5cbb35d
Merge pull request #215 from logos-blockchain/Pravdyvy/tree-ux-updates
KeyTree UX updates
2025-12-10 11:33:06 +02:00
Pravdyvy
45e3223d51 fix: merge fix 2025-12-10 10:25:33 +02:00
Pravdyvy
81316f6766 Merge branch 'main' into Pravdyvy/tree-ux-updates 2025-12-10 10:18:07 +02:00
Pravdyvy
81393925d0
Merge pull request #211 from logos-blockchain/Pravdyvy/private-definition-token
Private TokenDefinition support
2025-12-10 10:03:42 +02:00
Pravdyvy
dc277b7e71
Merge pull request #153 from logos-blockchain/Pravdyvy/keys-restoration-from-mnemonic
Keys restoration from mnemonic
2025-12-10 10:02:47 +02:00
Pravdyvy
8e2b1c5993 Merge branch 'Pravdyvy/keys-restoration-from-mnemonic' into Pravdyvy/tree-ux-updates 2025-12-10 08:46:39 +02:00
Pravdyvy
1309185ecc Merge branch 'main' into Pravdyvy/keys-restoration-from-mnemonic 2025-12-10 08:34:01 +02:00
Sergio Chouhy
f54cdf4a4c Merge branch 'main' into schouhy/implement-privacy-preserving-tail-calls 2025-12-09 23:53:27 -03:00
jonesmarvin8
22440cf95d initialize nft branch 2025-12-09 17:38:02 -05:00
jonesmarvin8
2e37e20014 format 2025-12-09 15:36:46 -05:00
jonesmarvin8
70c228dbec fixed formatting and added overflow/underflow 2025-12-09 15:28:32 -05:00
jonesmarvin8
471611f848 fixed new definition 2025-12-09 14:42:58 -05:00
jonesmarvin8
8c493a0155
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-09 13:31:44 -05:00
jonesmarvin8
cf4d7ba80b
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-09 13:31:13 -05:00
jonesmarvin8
17f77f9ae7
Update nssa/program_methods/guest/src/bin/token.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-09 13:31:02 -05:00
Daniil Polyakov
1ff5de1443
Merge pull request #220 from logos-blockchain/arjentix/iss-190-tx-size-limit
Account data size limit
2025-12-09 21:27:45 +03:00
Sergio Chouhy
79b4dc0333 Merge branch 'schouhy/add-wallet-deploy-command' of github.com:logos-blockchain/lssa into schouhy/add-wallet-deploy-command 2025-12-09 15:22:30 -03:00
Sergio Chouhy
ab6ea1f4c0 use pathbuf and context 2025-12-09 15:18:48 -03:00
Sergio Chouhy
8cfb586bee
Update wallet/src/cli/mod.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-09 14:55:12 -03:00
Daniil Polyakov
31e7016948 feat: introduce parameter to data_changer and add test for account data 2025-12-09 20:26:02 +03:00
Daniil Polyakov
4574acfc49 feat: introduce account data size limit 2025-12-09 20:26:02 +03:00
Daniil Polyakov
f6e2bcaad7
Merge pull request #228 from logos-blockchain/arjentix/wallet-basic-auth
Add basic auth to wallet
2025-12-09 20:25:35 +03:00
Daniil Polyakov
2518199be2
Merge pull request #223 from logos-blockchain/arjentix/fix-token-native-minting-bug
Fix token native minting bug
2025-12-09 20:23:44 +03:00
Daniil Polyakov
e5cbd82343 fix: add overflow check for balance sum validation 2025-12-09 18:28:58 +03:00
Daniil Polyakov
46ac451284 feat: add basic auth to wallet 2025-12-09 18:20:50 +03:00
jonesmarvin8
e0c6baf1ff added mint overflow protection 2025-12-09 08:11:15 -05:00
Pravdyvy
e1eff07478 fix: layered autobalancing 2025-12-09 11:51:44 +02:00
Pravdyvy
eed485bd2c fix: tomil fix 2025-12-09 11:10:40 +02:00
Pravdyvy
47ff7f0b64 fix: layered automatization 2025-12-09 11:09:15 +02:00
Pravdyvy
26fb822da1 Merge branch 'Pravdyvy/keys-restoration-from-mnemonic' into Pravdyvy/tree-ux-updates 2025-12-09 10:46:28 +02:00
Pravdyvy
d0064a4b0b Merge branch 'main' into Pravdyvy/tree-ux-updates 2025-12-09 10:40:35 +02:00
jonesmarvin8
5169e8fda4 cargo fix 2025-12-08 22:12:02 -05:00
jonesmarvin8
6bc983d50b added pda support 2025-12-08 22:05:51 -05:00
Daniil Polyakov
80a188e6a3 feat: remove print spam when running wallet account sync-private 2025-12-09 00:07:10 +03:00
jonesmarvin8
65681a5b74 minor fixes (does not run/test) 2025-12-08 13:19:30 -05:00
Pravdyvy
ea19ad0c1f fix: comments fix 2025-12-08 13:00:03 +02:00
Pravdyvy
ddeeab7d80
Apply suggestions from code review
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-12-08 12:50:41 +02:00
Pravdyvy
f1760b67ee fix: revert difficulty 2025-12-08 12:46:43 +02:00
Pravdyvy
01f7acb4d6 fix: remove unused enum 2025-12-08 12:13:03 +02:00
Pravdyvy
40991cf6d1 fix: layered cleanup 2025-12-08 12:11:11 +02:00
fryorcraken
beab5f9e96
fix ci for rocksdb 2025-12-08 18:09:10 +11:00
fryorcraken
ad7f773632
chore: upgrade rocksdb
To avoid issues with gcc 14+
2025-12-08 18:09:01 +11:00
jonesmarvin8
d77185ded4 uses burn/mint/AccountPostState 2025-12-07 20:34:26 -05:00
jonesmarvin8
4bcfbb9bee Merge branch 'marvin/token_burn_mint' into simple_amm 2025-12-07 20:31:16 -05:00
jonesmarvin8
5a1d37d607 update burn/mint to use AccountPostState 2025-12-07 20:29:25 -05:00
jonesmarvin8
c6e68ff9b1
Merge pull request #226 from logos-blockchain/main
main into burn
2025-12-07 20:27:27 -05:00
jonesmarvin8
8506f5948f Merge branch 'main' into simple_amm 2025-12-06 20:07:12 -05:00
jonesmarvin8
a11155e441 Merge branch 'simple_amm' of https://github.com/logos-blockchain/lssa into simple_amm 2025-12-06 20:03:14 -05:00
jonesmarvin8
3a3c6f5507 state tests fixed and clean up 2025-12-06 20:03:05 -05:00
jonesmarvin8
106b33a57f
Merge pull request #225 from logos-blockchain/marvin/token_burn_mint
Marvin/token burn mint
2025-12-06 16:45:11 -05:00
jonesmarvin8
ea27eeb929 fixed add and remove logic, and tests 2025-12-06 14:52:18 -05:00
jonesmarvin8
1ae10f553b test: add test for malicious program performing balance overflow attack 2025-12-06 21:28:45 +03:00
jonesmarvin8
c6cde35203 added burn/mint and tests 2025-12-05 21:01:36 -05:00
Sergio Chouhy
7825f69e06 remove unused import 2025-12-05 17:57:48 -03:00
Sergio Chouhy
cc08e0a614 add deploy program command 2025-12-05 17:54:51 -03:00
Sergio Chouhy
3e303f2c95
Merge pull request #202 from logos-blockchain/schouhy/implement-pda-for-public-accounts
Implement PDA for public executions
2025-12-05 15:15:37 -03:00
Sergio Chouhy
7e971a6c4d Merge branch 'main' into schouhy/implement-pda-for-public-accounts 2025-12-05 10:00:23 -03:00
Sergio Chouhy
09116830c9
Merge pull request #214 from vacp2p/schouhy/fix-claiming-mechanism-on-chained-calls
Fix claiming mechanism on chained calls
2025-12-05 09:37:37 -03:00
Pravdyvy
80d9ce8553
Merge pull request #216 from vacp2p/Pravdyvy/correct-token-names-print
Correct tokens names
2025-12-05 14:20:44 +02:00
Pravdyvy
d2dc255bc5 fix: merge fix 2025-12-05 09:36:53 +02:00
Pravdyvy
f0066bc2aa Merge branch 'main' into Pravdyvy/keys-restoration-from-mnemonic 2025-12-05 09:32:54 +02:00
Pravdyvy
29c3737704 fix: lint fix comments addressed 2025-12-05 07:46:59 +02:00
jonesmarvin8
97f2e93f8a initialize branch 2025-12-04 21:55:12 -05:00
jonesmarvin8
b1ad51f5b9 logic fixes and streamlining examples
fixed remove_liquidity logic and added enum/constructors for examples
2025-12-04 21:53:58 -05:00
Sergio Chouhy
7236a7074c
Merge pull request #204 from vacp2p/schouhy/add-readme-explainers
Add readme explainers
2025-12-04 21:39:46 -03:00
Sergio Chouhy
925ae8d0c1 fmt 2025-12-04 21:34:47 -03:00
Sergio Chouhy
a84b18f22c remove unnecessary type annotation 2025-12-04 16:46:43 -03:00
Sergio Chouhy
b5589d53bb use filter 2025-12-04 16:29:00 -03:00
Sergio Chouhy
cf9c567e29 remove pub attribute 2025-12-04 16:26:40 -03:00
Daniil Polyakov
f1aed0b632
Merge pull request #217 from vacp2p/arjentix/iss-188-fix-wallet-long-sync 2025-12-04 22:13:14 +03:00
Sergio Chouhy
35bf943244 Merge branch 'main' into schouhy/implement-pda-for-public-accounts 2025-12-04 16:03:23 -03:00
Pravdyvy
926a292c9c fix: constraint added 2025-12-04 16:49:10 +02:00
Sergio Chouhy
068bfa0ec5 add docstrings. Remove unused method 2025-12-04 10:10:01 -03:00
Sergio Chouhy
686eb787c9 fix test names 2025-12-04 10:02:29 -03:00
fryorcraken
95ddea9fb0
Merge pull request #218 from vacp2p/fix/fedora
Add instructions for Fedora
2025-12-04 23:43:22 +11:00
Pravdyvy
fe83a20c4d fix: suggestion 1 2025-12-04 14:34:11 +02:00
Pravdyvy
2453ae095f fix: cleanup fixing 2025-12-04 14:31:52 +02:00
Daniil Polyakov
1412ad4da4 refactor: remove redundant request and response types 2025-12-04 14:55:58 +03:00
Daniil Polyakov
03e911ecd5 feat: apply base64 encoding for large binary data transfer 2025-12-04 14:55:58 +03:00
Daniil Polyakov
6b26811229 feat: implement multiple blocks polling 2025-12-04 14:55:45 +03:00
fryorcraken
4ed86ce182
Add instructions for Fedora 2025-12-04 21:00:29 +11:00
Sergio Chouhy
3393c55768 fix program deployment integration test 2025-12-03 19:59:58 -03:00
Sergio Chouhy
ed949c07b1 nit 2025-12-03 17:38:45 -03:00
Sergio Chouhy
44b4c53d04 add test that initialized accounts cannot be claimed 2025-12-03 17:36:53 -03:00
Sergio Chouhy
91fe8ced6e add test 2025-12-03 17:07:31 -03:00
Sergio Chouhy
8a269858c5 improve struct interface 2025-12-03 16:54:57 -03:00
Sergio Chouhy
d677db7f4e add account post state struct with claiming request field 2025-12-03 15:17:33 -03:00
Daniil Polyakov
91c898f19c refactor: split block polling 2025-12-03 18:30:22 +03:00
Pravdyvy
282b932a8e fix: correct feature 2025-12-03 14:30:23 +02:00
Pravdyvy
78ce57e19b fix: correct tokens names 2025-12-03 13:50:10 +02:00
Pravdyvy
b81aafbc23 feat: UX improvements 2025-12-03 13:10:07 +02:00
Pravdyvy
33264ba59a Merge branch 'main' into Pravdyvy/keys-restoration-from-mnemonic 2025-12-03 07:13:35 +02:00
Pravdyvy
5affa4f9fd fix: suggestions fix 2025-12-03 07:05:23 +02:00
jonesmarvin8
90d6580377 simplified swap logic
removed branching logic from swap logic, and adjusted tests accordingly.
2025-12-02 17:21:49 -05:00
jonesmarvin8
c0c1228e10 fixed accountId 2025-12-02 15:20:16 -05:00
Sergio Chouhy
d16908d463 remove pinata instructions 2025-12-02 16:48:12 -03:00
Sergio Chouhy
c360db9698 Merge branch 'main' into schouhy/add-readme-explainers 2025-12-02 16:40:26 -03:00
Sergio Chouhy
407c3f3c95 improve expect message 2025-12-02 16:27:22 -03:00
jonesmarvin8
3e9f0f9384 fixed omitted vault checks
Previous versions mistakenly used token_definition instead of vault account id to check for vaults.

Functions and corresponding tests fixed.

Minor error in arithmetic in state.rs for remove_liquidity fixed.
2025-12-02 13:40:54 -05:00
jonesmarvin8
863ed888ad minor fix to remove_liquidity
Fixed line 2767 to use delta_lp in liquidity_pool_cap
2025-12-02 13:40:54 -05:00
jonesmarvin8
93ee75a339 additional tests
Tests for chain_calls included in amm.rs,
All tests in state.rs
2025-12-02 13:40:53 -05:00
jonesmarvin8
352b97910a state tests written 2025-12-02 13:40:11 -05:00
jonesmarvin8
0a645281c6 token_program non-deterministic issue 2025-12-02 13:40:11 -05:00
jonesmarvin8
9da684b7c6 fixed some deterministic issues 2025-12-02 13:40:11 -05:00
jonesmarvin8
5547f0635c attempted test functions in state.rs
Additional minor clean up in amm.rs
2025-12-02 13:40:10 -05:00
jonesmarvin8
2166bbfe03 test fixes and comments 2025-12-02 13:37:40 -05:00
jonesmarvin8
853d4d6b59 Tests written 2025-12-02 13:36:07 -05:00
jonesmarvin8
a426839b3b Updated based on chain calls fixes 2025-12-02 13:36:07 -05:00
jonesmarvin8
10d42f352b AMM functions written 2025-12-02 13:33:00 -05:00
jonesmarvin8
e8f1bca17e initialize amm program PR 2025-12-02 13:31:38 -05:00
Sergio Chouhy
2d34925725
Merge pull request #163 from vacp2p/schouhhy/expand-readme
Update Readme with documentation
2025-12-02 12:20:58 -03:00
Sergio Chouhy
dcef017f9b nit 2025-12-02 12:12:56 -03:00
Sergio Chouhy
468b39bc32
Merge pull request #203 from vacp2p/schouhy/add-init-function-to-token-program
Add init function to the token program
2025-12-02 12:11:49 -03:00
Sergio Chouhy
ce9cadc46d Merge branch 'schouhy/implement-pda-for-public-accounts' of github.com:vacp2p/nescience-testnet into schouhy/implement-pda-for-public-accounts 2025-12-02 10:50:43 -03:00
Sergio Chouhy
fdc53927ca
Update nssa/src/program.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-12-02 10:50:06 -03:00
Sergio Chouhy
3d529d19fa solve comments 2025-12-02 10:48:21 -03:00
Pravdyvy
2fd4a37ee4 fix: private definition support 2025-12-02 15:27:20 +02:00
Pravdyvy
4fb6ba9530 Merge branch 'main' into Pravdyvy/private-definition-token 2025-12-02 07:53:47 +02:00
Daniil Polyakov
04ab7444a4
Merge pull request #205 from vacp2p/arjentix/iss-200-wallet-compute-pinata-solution
Refactor wallet & compute pinata solution in wallet
2025-12-02 02:42:28 +03:00
Daniil Polyakov
df88d8bad6 feat: compute pinata solution in wallet 2025-12-02 01:21:34 +03:00
Daniil Polyakov
4afbd65e3b feat: add transaction output after pinata call 2025-12-01 17:08:07 +03:00
Daniil Polyakov
0c44785a07 refactor: small adjustments to privacy preserving tx sending 2025-12-01 17:08:07 +03:00
Daniil Polyakov
55fc4e9777 refactor: implement program interactions as facades 2025-12-01 17:08:07 +03:00
Daniil Polyakov
df64f8864f refactor: implement universal interface for privacy-preserving transactions 2025-12-01 17:08:07 +03:00
Daniil Polyakov
aee6f45a8b refactor: move some stuff to a more suitable place 2025-12-01 17:08:07 +03:00
Sergio Chouhy
500e0862f3 s/address/account_id/ 2025-12-01 10:48:43 -03:00
Sergio Chouhy
ed38be57bb add explainers 2025-12-01 10:42:59 -03:00
Sergio Chouhy
c937cb591e wip 2025-12-01 10:25:23 -03:00
Pravdyvy
b1b7bc4463 fix: fmt 2025-12-01 14:19:25 +02:00
Pravdyvy
38acb89b93 Merge branch 'main' into Pravdyvy/private-definition-token 2025-12-01 14:19:01 +02:00
Pravdyvy
28c20f4d21 Merge branch 'main' into Pravdyvy/keys-restoration-from-mnemonic 2025-12-01 14:02:02 +02:00
Pravdyvy
fa73a0a704
Merge pull request #149 from vacp2p/Pravdyvy/deterministic-key-derivation
Deterministic key derivation
2025-12-01 13:59:55 +02:00
Pravdyvy
0f617a8601 Merge branch 'Pravdyvy/deterministic-key-derivation' into Pravdyvy/keys-restoration-from-mnemonic 2025-12-01 12:01:45 +02:00
Daniil Polyakov
5801073f84 feat: compute pinata solution in wallet 2025-11-30 03:56:24 +03:00
Daniil Polyakov
2cf60fff10 feat: add transaction output after pinata call 2025-11-30 03:56:12 +03:00
Daniil Polyakov
a8abec196b refactor: small adjustments to privacy preserving tx sending 2025-11-30 03:55:27 +03:00
Daniil Polyakov
777486ce2c refactor: implement program interactions as facades 2025-11-30 03:16:54 +03:00
Daniil Polyakov
41a833c258 refactor: implement universal interface for privacy-preserving transactions 2025-11-30 03:16:54 +03:00
Daniil Polyakov
c94d353b54 refactor: move some stuff to a more suitable place 2025-11-30 03:16:54 +03:00
Sergio Chouhy
7ab44507f5 test 2025-11-29 00:06:06 -03:00
Sergio Chouhy
640ed18f90 Merge branch 'main' into schouhy/add-readme-explainers 2025-11-28 23:38:43 -03:00
Sergio Chouhy
bfbd50e8cb add docs 2025-11-28 17:09:38 -03:00
Sergio Chouhy
c7bcd20a38 add init function to the token program 2025-11-28 14:16:54 -03:00
Sergio Chouhy
ed00876800 Merge branch 'schouhy/add-init-function-to-token-program' into schouhy/implement-pda-for-public-accounts 2025-11-28 14:16:26 -03:00
Sergio Chouhy
dd5db5b32c add init function to the token program 2025-11-28 11:52:02 -03:00
Sergio Chouhy
1989fd25a1 add pinata token example and test 2025-11-28 11:10:00 -03:00
Pravdyvy
c7ce31d00c fix: fmt 2025-11-28 09:49:05 +02:00
Pravdyvy
46515ce695 Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-28 09:18:02 +02:00
Pravdyvy
64e2fb73a8 fix: merge update 2025-11-28 08:48:11 +02:00
Sergio Chouhy
e61a971790 add test and refactor chain_caller program 2025-11-27 13:53:25 -03:00
Sergio Chouhy
449ba3e3a9 Merge branch 'main' into schouhy/implement-pda-for-public-accounts 2025-11-27 13:10:57 -03:00
Sergio Chouhy
3fbf1e1fec add pda mechanism 2025-11-27 13:10:38 -03:00
Sergio Chouhy
702882c6ee
Merge pull request #161 from vacp2p/schouhy/add-multi-chain-calls
Add multi chain calls
2025-11-27 12:39:23 -03:00
Sergio Chouhy
d82f06593d add pda_seeds field 2025-11-27 12:08:27 -03:00
Sergio Chouhy
a3e07347a4 Merge branch 'schouhy/add-multi-chain-calls' into schouhy/implement-pda-for-public-accounts 2025-11-27 12:05:09 -03:00
Sergio Chouhy
409ec19959 fix concatenation of call stack 2025-11-27 10:53:25 -03:00
Sergio Chouhy
f46d7ee426 nit 2025-11-27 10:46:35 -03:00
Sergio Chouhy
aba1d844f8 consume call stack from the other end 2025-11-27 10:42:58 -03:00
Sergio Chouhy
103332f6cd nit 2025-11-27 09:56:52 -03:00
Sergio Chouhy
577fad6d5f refactor call stack execution loop 2025-11-27 09:54:14 -03:00
Daniil Polyakov
6a507fdad1
Merge pull request #198 from vacp2p/arjentix/iss-185-wallet-list-all-accounts
feat: add list account subcommand
2025-11-27 15:08:38 +03:00
Pravdyvy
055c5388e0 Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-27 13:49:00 +02:00
Pravdyvy
6c409b6fb1 Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-27 13:46:35 +02:00
Pravdyvy
a99aec05eb
Merge pull request #166 from vacp2p/Pravdyvy/iss131-error-handling
Borsh derivation in place of previous manual encodings
2025-11-27 11:45:53 +02:00
Pravdyvy
b26b972d3d
Merge pull request #199 from vacp2p/Pravdyvy/fix-main
Fmt fix
2025-11-27 11:41:23 +02:00
Pravdyvy
00386eba24 fix: fmt 2025-11-27 06:03:43 +02:00
Pravdyvy
bce0ac79cb fix: fmt fix 2025-11-27 05:55:25 +02:00
Pravdyvy
72d389a7c3 Merge branch 'main' into Pravdyvy/iss131-error-handling 2025-11-27 05:53:03 +02:00
Daniil Polyakov
d7331455fc feat: add list account subcommand 2025-11-27 04:22:49 +03:00
Sergio Chouhy
d1d2292028 fmt 2025-11-26 20:13:23 -03:00
Sergio Chouhy
1df24eb11f call write_nssa_outputs function once 2025-11-26 17:41:49 -03:00
Sergio Chouhy
bc24f006ef use window 2025-11-26 17:37:22 -03:00
Sergio Chouhy
12e21c935c Merge branch 'main' into schouhy/add-multi-chain-calls 2025-11-26 17:12:35 -03:00
Sergio Chouhy
97209caa9c Merge branch 'main' into schouhy/implement-privacy-preserving-tail-calls 2025-11-26 16:37:23 -03:00
Pravdyvy
d78c83b7d3
Merge pull request #196 from vacp2p/Pravdyvy/commenting-of-troublesome-test
Turn off test test_success_private_transfer_to_another_owned_account_cont_run_path
2025-11-26 20:54:33 +02:00
Daniil Polyakov
8568302f38
Merge pull request #195 from vacp2p/arjentix/toolchain-and-fmt-improvements 2025-11-26 21:35:28 +03:00
Pravdyvy
c9b911836b fix: test commented 2025-11-26 15:13:40 +02:00
Pravdyvy
30f19b245d fix: suggestions fix 3 2025-11-26 14:53:26 +02:00
Pravdyvy
77570c48e9 fix: suggestions 2 2025-11-26 14:27:09 +02:00
Pravdyvy
e9d7e224b0 fix: ci test 1 2025-11-26 13:34:58 +02:00
Pravdyvy
fc531021fb fix: comments fix 1 2025-11-26 07:32:35 +02:00
Pravdyvy
0d11c3688e fix: suggestions hotfix 2025-11-26 07:18:25 +02:00
Pravdyvy
463942df80
Apply suggestions from code review 1
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-11-26 07:07:58 +02:00
Pravdyvy
4d1d765cbe Merge branch 'main' into Pravdyvy/iss131-error-handling 2025-11-26 06:49:46 +02:00
Daniil Polyakov
a714e3c563 feat: enhance rustfmt config 2025-11-26 00:33:09 +03:00
Daniil Polyakov
72d20a3546 feat: setup current stable toolchain 2025-11-26 00:27:26 +03:00
Daniil Polyakov
1910d68430
Merge pull request #184 from vacp2p/arjentix/iss-134-rename-address-to-account-id
refactor: rename `Address` to `AccountId`
2025-11-25 23:31:29 +03:00
Pravdyvy
819f96da6c fix: try other tests 2025-11-25 21:01:00 +02:00
Daniil Polyakov
ea9c659fb1 refactor: rename Address to AccountId 2025-11-25 21:38:07 +03:00
Sergio Chouhy
a3061afebe replace unwrap with expect 2025-11-25 15:15:14 -03:00
Sergio Chouhy
ba556bee0b nit 2025-11-25 15:03:17 -03:00
Sergio Chouhy
58933a8270 Merge branch 'schouhy/implement-privacy-preserving-tail-calls' of github.com:vacp2p/nescience-testnet into schouhy/implement-privacy-preserving-tail-calls 2025-11-25 14:52:16 -03:00
Sergio Chouhy
3f636465f6 avoid using manual indexing in vector 2025-11-25 14:51:28 -03:00
Sergio Chouhy
8e1c53bd4e use instruction_words from read in pinata 2025-11-25 14:51:02 -03:00
Sergio Chouhy
425f0ccc1b
Update nssa/program_methods/guest/src/bin/privacy_preserving_circuit.rs
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-11-25 14:20:56 -03:00
Pravdyvy
3779372674 fix: ci test 2025-11-25 17:14:19 +02:00
Pravdyvy
a0e1bdb963 fix: more extension for test 2025-11-25 14:45:37 +02:00
Sergio Chouhy
893011e7bf hot fix for integration test 2025-11-25 09:37:46 -03:00
Pravdyvy
4fc01afbaa fix: test time extension test 2025-11-25 10:40:55 +02:00
Pravdyvy
46fad3c5e7 fix: comments fix 1 2025-11-25 09:40:46 +02:00
Pravdyvy
adcf70da76 fix: test run 2025-11-25 08:58:15 +02:00
Sergio Chouhy
8af6365c5d noop 2025-11-24 08:47:33 -03:00
Sergio Chouhy
8c9b46b0df hot fix for integration test 2025-11-24 08:01:23 -03:00
Sergio Chouhy
0054ce5847 nit 2025-11-22 18:39:02 -03:00
Sergio Chouhy
d73fcbd2b3 add docstrings 2025-11-22 18:30:15 -03:00
Sergio Chouhy
47a7656ec4 add asserts in test 2025-11-22 17:48:43 -03:00
Sergio Chouhy
386d958c88 fmt, clippy 2025-11-22 16:40:16 -03:00
Sergio Chouhy
bfe38b012e small refactor 2025-11-22 16:39:34 -03:00
Sergio Chouhy
b59cd0da92 wip 2025-11-22 15:16:43 -03:00
Daniil Polyakov
3355d23218
Merge pull request #167 from vacp2p/iss145-fix-mempool-locks
Fix locking on high transaction amount, refactor sequencer & mempool
2025-11-21 13:22:10 +03:00
Pravdyvy
dc57f6b027 fix: ci test 5 2025-11-21 09:22:23 +02:00
Pravdyvy
05e01f3a76 fix: ci test 4 2025-11-21 09:06:30 +02:00
Pravdyvy
effbfac7d9 fix: ci test 3 2025-11-21 08:49:56 +02:00
Pravdyvy
8839edc377 fix: ci test 2 2025-11-21 08:27:16 +02:00
Pravdyvy
e3ce522588 Merge branch 'main' into Pravdyvy/iss131-error-handling 2025-11-20 15:49:27 +02:00
Daniil Polyakov
110589d332 refactor: remove RpcRollingConfig 2025-11-20 15:40:32 +03:00
Daniil Polyakov
95ec42bba7 chore: left some comments 2025-11-20 15:40:32 +03:00
Daniil Polyakov
d15d208ad3 fix: typo 2025-11-20 15:40:32 +03:00
Daniil Polyakov
c1fabb2181 refactor: sequencer & mempool 2025-11-20 15:40:32 +03:00
Daniil Polyakov
6280110c9f refactor: rename helperstruct to response 2025-11-20 15:40:32 +03:00
Sergio Chouhy
b90837edb6 add test wip 2025-11-20 01:40:05 -03:00
Sergio Chouhy
1214bf6e7e Merge branch 'main' into schouhhy/expand-readme 2025-11-20 00:21:15 -03:00
Pravdyvy
e3d095464c Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-19 18:45:56 +02:00
Pravdyvy
4847c84347
Merge pull request #148 from vacp2p/Pravdyvy/wallet-personalization
Wallet personalization
2025-11-19 18:44:56 +02:00
Pravdyvy
899b1b79a5 fix: ci test 1 2025-11-19 17:05:20 +02:00
Pravdyvy
2f07853975 fix: borsh integrated into transactions 2025-11-19 14:28:18 +02:00
Pravdyvy
e44c0a8250 Merge branch 'main' into Pravdyvy/wallet-personalization 2025-11-19 14:05:20 +02:00
Pravdyvy
7ace27c4f9
Merge pull request #147 from vacp2p/Pravdyvy/default-wallet-config-path
Default wallet config path
2025-11-19 14:04:27 +02:00
Pravdyvy
30bcd20ac5 fix: privacy-preserving test 2025-11-19 09:00:32 +02:00
Pravdyvy
ef73336aa5 fix: borsh derivation on publci transactions 2025-11-18 17:52:46 +02:00
Sergio Chouhy
4f650e939f add instruction to the program output 2025-11-18 01:38:47 -03:00
Sergio Chouhy
38490a6163 wip 2025-11-18 00:04:53 -03:00
Sergio Chouhy
fd4ebde1fb fix account passing mechanism 2025-11-17 15:43:01 -03:00
Pravdyvy
10731e326d fix: suggestion upfix 2025-11-17 14:43:44 +02:00
Pravdyvy
20a31bd364 fix: suggestion fix 2025-11-17 14:43:33 +02:00
Sergio Chouhy
0ad6d290ae fix 2025-11-15 02:27:06 -03:00
Sergio Chouhy
f2fb98608a Add pinata program instructions 2025-11-15 02:21:57 -03:00
Sergio Chouhy
521ba5adbd add commands 2025-11-15 01:50:01 -03:00
Sergio Chouhy
ee47d98300 add section token program 2025-11-15 01:28:00 -03:00
Sergio Chouhy
e707b1b74f add tutorial sections 2025-11-13 22:18:39 -03:00
Sergio Chouhy
0ea46f5048 update Readme 2025-11-13 17:50:15 -03:00
Sergio Chouhy
c7b415b2f4 add max depth reached error for chained calls 2025-11-12 19:55:02 -03:00
Sergio Chouhy
a94440fa1f rename 2025-11-12 19:18:04 -03:00
Sergio Chouhy
2e582e7874 add multi chain calls 2025-11-12 19:08:46 -03:00
Pravdyvy
e92ad2132f feat: keys restoration from mnemonic 2025-11-12 08:26:25 +02:00
Pravdyvy
6cbc5028cf feat: tree construction 2025-11-11 17:25:08 +02:00
Pravdyvy
fcb3993a47 fix: merge fix 2025-11-11 15:41:32 +02:00
Pravdyvy
a8462ab5a3 Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-11 15:40:33 +02:00
Pravdyvy
ec149d3227 feat: deterministic keys 2025-11-11 12:15:20 +02:00
Pravdyvy
20c276e63e fix: continuation of integration 2025-11-10 16:29:33 +02:00
Sergio Chouhy
ef7a5b6610 wip 2025-11-07 20:42:00 -03:00
Sergio Chouhy
ffe2ae4e0b Merge branch 'main' into schouhy/implement-privacy-preserving-tail-calls 2025-11-07 19:32:42 -03:00
Sergio Chouhy
d69e8a292e
Merge pull request #150 from vacp2p/schouhy/update-readme
Update README
2025-11-07 14:42:48 -03:00
Sergio Chouhy
a048fad7cd Update readme 2025-11-07 13:16:01 -03:00
Pravdyvy
d9a130cc55 feat: private tree 2025-11-07 16:21:14 +02:00
Sergio Chouhy
dfd45c8678 wip 2025-11-06 19:35:47 -03:00
Pravdyvy
4a430622f4 fix: testing and debugging 2025-11-06 16:50:32 +02:00
Pravdyvy
af1e129b6b feat: public keys tree 2025-11-05 15:15:29 +02:00
Pravdyvy
9788f189b1 feat: stat of deterministic passwords 2025-11-04 16:09:04 +02:00
Sergio Chouhy
5e22357f9a
Merge pull request #143 from vacp2p/schouhy/node-state-reconstruction
Node state reconstruction from block storage
2025-11-04 01:17:37 -03:00
Sergio Chouhy
51c1b7f31f
Merge pull request #142 from vacp2p/schouhy/add-sequencer-tps-test
Add tps integration test
2025-11-03 23:37:10 -03:00
Sergio Chouhy
883fdc583a Merge branch 'main' into schouhy/node-state-reconstruction 2025-11-03 23:36:42 -03:00
Sergio Chouhy
343f8c4864 Merge branch 'main' into schouhy/add-sequencer-tps-test 2025-11-03 13:47:57 -03:00
Pravdyvy
2920953184 Merge branch 'main' into Pravdyvy/default-wallet-config-path 2025-11-03 15:49:10 +02:00
Pravdyvy
f593e6be94 Merge branch 'main' into Pravdyvy/wallet-personalization 2025-11-03 15:47:51 +02:00
Oleksandr Pravdyvyi
9d31b143ed
feat: config command added 2025-11-03 15:45:50 +02:00
Sergio Chouhy
4be1977925
Merge pull request #146 from vacp2p/schouhy/add-tail-call-mechanism
Add tail call mechanism for public executions
2025-11-03 10:36:39 -03:00
Pravdyvy
aa36cc09fa
Merge pull request #141 from vacp2p/Pravdyvy/cli-refactor
CLI refactor
2025-11-03 15:35:30 +02:00
Oleksandr Pravdyvyi
f635f07ebd
feat: config subcommand 2025-10-31 16:23:01 +02:00
Oleksandr Pravdyvyi
18dca9407c
fix: config update 2025-10-31 10:16:15 +02:00
Oleksandr Pravdyvyi
e40d387475
fix: sequencer config update 2025-10-31 10:14:12 +02:00
Sergio Chouhy
12974f6f6b refactor 2025-10-30 14:10:33 -03:00
Oleksandr Pravdyvyi
228f7591d5
fix: lint and fmt 2025-10-30 17:23:50 +02:00
Sergio Chouhy
0fb72e452f fix claiming mechanism for chained calls 2025-10-30 10:52:53 -03:00
Oleksandr Pravdyvyi
2c21abc2d9
fix: default config paths agnostic 2025-10-30 15:33:58 +02:00
Oleksandr Pravdyvyi
c2b8459645
fix: suggestions fix 1 2025-10-30 15:00:21 +02:00
Sergio Chouhy
48fc643952 add chained call test 2025-10-30 09:36:20 -03:00
Sergio Chouhy
3a27719392 add tail-chain logic for public transactions 2025-10-29 13:40:56 -03:00
Oleksandr Pravdyvyi
813868f16f
feat: linux default config paths 2025-10-29 13:23:07 +02:00
Oleksandr Pravdyvyi
a903c221db
fix: tests fix 2025-10-29 12:02:41 +02:00
Sergio Chouhy
6d9d6b3d28 add chained_call field to program output 2025-10-29 00:40:56 -03:00
Sergio Chouhy
e96bbb84a4 remove unnecesary line 2025-10-28 23:35:16 -03:00
Sergio Chouhy
719a8dcafe refactor tps test 2025-10-28 16:45:16 -03:00
Sergio Chouhy
ad9ad8d1d3 Merge branch 'main' into schouhy/add-sequencer-tps-test 2025-10-28 16:39:38 -03:00
Sergio Chouhy
43cf732ad4 Merge branch 'main' into schouhy/node-state-reconstruction 2025-10-28 15:56:05 -03:00
Sergio Chouhy
97eb110f0e
Merge pull request #144 from vacp2p/schouhy/add-progam-methods-guest-cargo-lock-for-determinism
Add `nssa/program_methods/guest/Cargo.lock` for nssa program deterministic builds
2025-10-28 13:12:11 -03:00
Sergio Chouhy
4a23accbde refactor 2025-10-28 13:08:05 -03:00
Pravdyvy
e41ffeac68 Merge branch 'main' into Pravdyvy/cli-refactor 2025-10-28 16:54:39 +02:00
Pravdyvy
785ed5f169 doc: cli docs added 2025-10-28 16:53:39 +02:00
Pravdyvy
39f48cd74e
Merge pull request #140 from vacp2p/Pravdyvy/test-suite-proc-macro
Test suite proc macro
2025-10-28 16:50:24 +02:00
Oleksandr Pravdyvyi
5840f9b779
fix: cli full refactor 2025-10-28 16:02:30 +02:00
Oleksandr Pravdyvyi
b3e4b9a8ca
Merge branch 'Pravdyvy/test-suite-proc-macro' into Pravdyvy/cli-refactor 2025-10-28 14:41:34 +02:00
Oleksandr Pravdyvyi
5b3732d9f2
Merge branch 'main' into Pravdyvy/test-suite-proc-macro 2025-10-28 14:40:59 +02:00
Oleksandr Pravdyvyi
27bb5bbb0f
temp: temp changes 2025-10-28 14:40:16 +02:00
Pravdyvy
60b7c58af8
Merge pull request #137 from vacp2p/Pravdyvy/usability-updates
Boilerplate refactor
2025-10-28 14:39:30 +02:00
Oleksandr Pravdyvyi
bf25c92b30
fix: suggestions fix 2025-10-28 10:41:40 +02:00
Sergio Chouhy
6b75609012 fix block id 2025-10-27 20:07:15 -03:00
Sergio Chouhy
1ad93c2977 fmt 2025-10-27 16:04:12 -03:00
Oleksandr Pravdyvyi
62668161b2
feat: transfers changes 2025-10-27 14:32:28 +02:00
Sergio Chouhy
a14b15d123 add Cargo.lock 2025-10-25 00:34:02 -03:00
Sergio Chouhy
7f075fcdd3 wip 2025-10-25 00:30:04 -03:00
Sergio Chouhy
4648f46f51 minor changes 2025-10-24 23:09:10 -03:00
Sergio Chouhy
c47693b9b0 add tps integration test 2025-10-24 16:17:00 -03:00
Oleksandr Pravdyvyi
66ee0c5449
fix: account subcommand updated 2025-10-24 15:26:30 +03:00
Oleksandr Pravdyvyi
0384efc38f
fix: base58 adoption fixes 2025-10-24 11:12:32 +03:00
Oleksandr Pravdyvyi
a12d3cc354
Merge branch 'Pravdyvy/test-suite-proc-macro' into Pravdyvy/cli-refactor 2025-10-24 09:11:46 +03:00
Oleksandr Pravdyvyi
13232200c0
Merge branch 'Pravdyvy/usability-updates' into Pravdyvy/test-suite-proc-macro 2025-10-24 09:08:46 +03:00
Oleksandr Pravdyvyi
5c6c7d1c3e
Merge branch 'main' into Pravdyvy/usability-updates 2025-10-23 17:38:09 +03:00
Oleksandr Pravdyvyi
4e36ae4679
fix; first refactor 2025-10-23 17:33:25 +03:00
Sergio Chouhy
f96f4d9117
Merge pull request #136 from vacp2p/schouhy/code-cleanup
Code cleanup
2025-10-23 11:09:29 -03:00
Oleksandr Pravdyvyi
d7089eac96
fix: taplo fmt 2025-10-22 16:28:19 +03:00
Oleksandr Pravdyvyi
4ecd0430b8
Merge branch 'main' into Pravdyvy/test-suite-proc-macro 2025-10-22 14:11:49 +03:00
Oleksandr Pravdyvyi
31783d9b78
fix: test suite proc macro 2025-10-22 13:55:35 +03:00
Sergio Chouhy
8ced04ae97
Merge pull request #138 from vacp2p/schouhy/fix-merge-error
Fix merge compilation error
2025-10-21 10:45:13 -03:00
Sergio Chouhy
32b7780ff3 remove unused dep 2025-10-21 09:28:00 -03:00
Sergio Chouhy
d99fbde101 Merge branch 'main' into schouhy/code-cleanup 2025-10-21 09:27:19 -03:00
Oleksandr Pravdyvyi
37360e6d8c
fix: merge fix 2025-10-21 15:17:44 +03:00
Oleksandr Pravdyvyi
941738c26f
Merge branch 'main' into Pravdyvy/usability-updates 2025-10-21 15:16:44 +03:00
Oleksandr Pravdyvyi
a01bfe3688
fix: private account preparation unified 2025-10-21 15:15:41 +03:00
Sergio Chouhy
3b3493df94 add await 2025-10-21 09:14:29 -03:00
Sergio Chouhy
bdb0c576a3
Merge pull request #128 from vacp2p/schouhy/add-program-deployment-transactions
Add program deployment transaction types
2025-10-21 09:10:24 -03:00
Sergio Chouhy
04f7e67384
Merge pull request #127 from vacp2p/Pravdyvy/various-updates
Wallet updates
2025-10-21 09:10:06 -03:00
Oleksandr Pravdyvyi
5b7e162e4d
fix: wallet transaction creation refactor 2025-10-21 10:32:42 +03:00
Oleksandr Pravdyvyi
bbab0399cd
Merge branch 'main' into Pravdyvy/various-updates 2025-10-21 07:09:42 +03:00
Sergio Chouhy
1e3f7038ee Merge branch 'main' into schouhy/code-cleanup 2025-10-20 22:51:38 -03:00
Sergio Chouhy
2da861c2d2 Merge branch 'main' into schouhy/add-program-deployment-transactions 2025-10-20 22:47:18 -03:00
Sergio Chouhy
17e87a5f53
Merge pull request #126 from vacp2p/schouhy/add-authenticated-transfer-program-init-function
Add account initialization function to the authenticated transfer program
2025-10-20 20:42:58 -03:00
Sergio Chouhy
e3a498faf0 Merge branch 'main' into schouhy/add-program-deployment-transactions 2025-10-20 19:19:18 -03:00
Sergio Chouhy
86bbbcdda8
Merge pull request #125 from vacp2p/schouhy/reproducible-builds-of-guest-programs
Reproducible builds through `nssa/build.rs`
2025-10-20 19:05:16 -03:00
Sergio Chouhy
fd7907f893 Merge branch 'main' into schouhy/add-authenticated-transfer-program-init-function 2025-10-20 19:03:51 -03:00
Sergio Chouhy
204e5444c8 Merge branch 'main' into schouhy/reproducible-builds-of-guest-programs 2025-10-20 17:47:59 -03:00
Sergio Chouhy
2c138cb027
Merge pull request #124 from vacp2p/Pravdyvy/token-program-private
Private token program wallet interactions
2025-10-20 17:45:00 -03:00
Sergio Chouhy
348156043a
Merge pull request #123 from vacp2p/schouhy/wallet-fetch-programs
Add wallet command to check program ids match the ones used by the node
2025-10-20 17:44:40 -03:00
Sergio Chouhy
79606f81ed Merge branch 'main' into schouhy/wallet-fetch-programs 2025-10-20 15:21:06 -03:00
Sergio Chouhy
1ded99c7de
Merge pull request #122 from vacp2p/Pravdyvy/wallet-pinata-private
Wallet pinata program private execution
2025-10-20 15:18:23 -03:00
Oleksandr Pravdyvyi
28c1fd39a4
fix: suggestions added 1 2025-10-20 10:01:54 +03:00
Oleksandr Pravdyvyi
ff448cbb3c
fix: fmt 2025-10-20 09:20:22 +03:00
Oleksandr Pravdyvyi
833d6bf932
Merge branch 'Pravdyvy/token-program-private' into Pravdyvy/various-updates 2025-10-20 09:19:53 +03:00
Oleksandr Pravdyvyi
e5a6acf28d
fix; shielded and deshielded transfers 2025-10-20 09:10:54 +03:00
Sergio Chouhy
7724b7a2db remove dup test 2025-10-17 17:39:03 -03:00
Sergio Chouhy
e1085e1907 fmt 2025-10-17 16:20:31 -03:00
Sergio Chouhy
6447f8fbf7 remove unused dependencies 2025-10-17 16:17:15 -03:00
Sergio Chouhy
fd0e783176 remove unused error type 2025-10-17 16:16:54 -03:00
Sergio Chouhy
93fd485622 move common errors to own module. Remove unused ExecutionFailureKind variants 2025-10-17 16:16:11 -03:00
Sergio Chouhy
7d85424948 remove unnecessary rs_merkle dep 2025-10-17 16:07:59 -03:00
Sergio Chouhy
b93c0aa390 rename TreeHashType to HashType 2025-10-17 16:04:09 -03:00
Sergio Chouhy
217551f960 remove outdated env.sh file 2025-10-17 15:58:28 -03:00
Sergio Chouhy
9e03507dd4 remove unused error codes 2025-10-17 15:56:26 -03:00
Sergio Chouhy
b3822c4b75 remove outdated sc methods in rocksdb 2025-10-17 15:52:00 -03:00
Sergio Chouhy
c3ca1c4804 remove unused common/src/utxo_commitment.rs file 2025-10-17 15:39:17 -03:00
Sergio Chouhy
f669f10d9e remove outdated common/src/execution_input.rs file 2025-10-17 15:37:57 -03:00
Sergio Chouhy
983865d31f remove outdated common/src/commitment.rs file 2025-10-17 15:36:04 -03:00
Sergio Chouhy
e0fd94152a remove outdated common/sec/nullifier.rs file 2025-10-17 15:35:06 -03:00
Sergio Chouhy
0b44afa4f6 remove unused code 2025-10-17 15:29:09 -03:00
Sergio Chouhy
323f58d566 clippy 2025-10-17 11:05:58 -03:00
Sergio Chouhy
25ecfa733f remove double test in ci 2025-10-17 07:59:32 -03:00
Sergio Chouhy
6b18168c3c remove unused type alias 2025-10-16 17:03:01 -03:00
Sergio Chouhy
6157e3023b add execution of deployed program in integration test 2025-10-16 16:54:34 -03:00
Sergio Chouhy
19215ee009 rename V01State to V02State 2025-10-16 16:24:18 -03:00
Sergio Chouhy
f3fbae66b5 fmt 2025-10-16 16:20:29 -03:00
Sergio Chouhy
ba20728f40 update version tags in domain separator 2025-10-16 16:19:03 -03:00
Oleksandr Pravdyvyi
9614c3143b
feat: integration test and async fs 2025-10-16 15:58:35 +03:00
Sergio Chouhy
942e90ae2a add sequencer methods 2025-10-15 20:14:19 -03:00
Sergio Chouhy
bfde33d78d add add canonical serialization for program deployment txs 2025-10-15 18:00:35 -03:00
Sergio Chouhy
da28f3317b add transition function for program deployment 2025-10-15 17:28:50 -03:00
Oleksandr Pravdyvyi
28fe9e2113
fix: merge updates 2025-10-15 15:44:52 +03:00
Oleksandr Pravdyvyi
5f00c89c0a
Merge branch 'Pravdyvy/token-program-private' into Pravdyvy/various-updates 2025-10-15 15:32:15 +03:00
Oleksandr Pravdyvyi
5010c6c370
fix: merge update 2025-10-15 15:29:28 +03:00
Oleksandr Pravdyvyi
8e3fb2f67b
Merge branch 'Pravdyvy/wallet-pinata-private' into Pravdyvy/token-program-private 2025-10-15 15:26:36 +03:00
Oleksandr Pravdyvyi
1428dc4a90
fix: suggestion fix 2 2025-10-15 15:25:36 +03:00
Oleksandr Pravdyvyi
88446b17f9
feat: automatic mode added 2025-10-15 15:17:30 +03:00
Sergio Chouhy
54c54199d7 wip 2025-10-14 17:15:04 -03:00
Oleksandr Pravdyvyi
c39c9ad4ca
feat: cli refactor 2025-10-14 15:29:18 +03:00
Oleksandr Pravdyvyi
4b7319afe9
fix: merge updates 2025-10-14 10:18:54 +03:00
Oleksandr Pravdyvyi
d05093f84f
Merge branch 'Pravdyvy/wallet-pinata-private' into Pravdyvy/token-program-private 2025-10-14 09:40:16 +03:00
Oleksandr Pravdyvyi
d556c9b699
fix: lint build fix 1 2025-10-14 09:36:21 +03:00
Oleksandr Pravdyvyi
d4a8cbd8d8
fix: suggestions 1 2025-10-14 08:33:20 +03:00
Sergio Chouhy
9559fb4bf0 remove unused Nonce type alias 2025-10-13 19:05:08 -03:00
Sergio Chouhy
fb4bb02f1a add docstrings 2025-10-13 18:06:02 -03:00
Sergio Chouhy
a2b9aef152 minor refactor 2025-10-13 17:45:03 -03:00
Sergio Chouhy
c772f1b0fe add init function 2025-10-13 17:08:29 -03:00
Sergio Chouhy
6274addad9 Remove unused Nonce alias 2025-10-13 16:25:59 -03:00
Sergio Chouhy
cf9d296d08 remove redundant test in ci 2025-10-13 15:26:14 -03:00
Sergio Chouhy
ba35fafad4 fmt 2025-10-13 15:15:38 -03:00
Oleksandr Pravdyvyi
898c5e9bcf
fix: structured subcommand approach 2025-10-13 17:25:36 +03:00
Oleksandr Pravdyvyi
577171bc5c
fix: try generic array dep 2025-10-13 16:12:43 +03:00
Oleksandr Pravdyvyi
a205cc1505
feat: private token program transfers 2025-10-13 13:29:32 +03:00
Sergio Chouhy
35806f1036 fmt 2025-10-10 18:24:11 -03:00
Sergio Chouhy
d7240e073a fix integration tests 2025-10-10 18:20:47 -03:00
Sergio Chouhy
766d72bd75 remove get programs 2025-10-10 17:44:42 -03:00
Sergio Chouhy
f200f39779 minor fix 2025-10-10 16:48:12 -03:00
Sergio Chouhy
69b610269b use risc0 method for image_id computaiton 2025-10-10 16:46:12 -03:00
Oleksandr Pravdyvyi
7213da587c
fix: token creation test 2025-10-10 11:12:47 +03:00
Oleksandr Pravdyvyi
0635bd201d
feat: private token definitions 2025-10-09 14:40:06 +03:00
Oleksandr Pravdyvyi
359e545b69
fix: pinata test fix 2025-10-09 09:44:13 +03:00
Sergio Chouhy
e8f660c2c7 wip 2025-10-08 20:27:09 -03:00
Oleksandr Pravdyvyi
4c45fa7768
Merge branch 'main' into Pravdyvy/wallet-pinata-private 2025-10-08 16:02:22 +03:00
Oleksandr Pravdyvyi
566df336f5
feat: wallet method for private pinata claim 2025-10-08 16:01:35 +03:00
Sergio Chouhy
a071340564
Merge pull request #121 from vacp2p/schouhy/fix-non-uniqueness-of-private-account-ids
Proposal for enforcing uniqueness of private account ids
2025-10-07 14:58:14 -03:00
Sergio Chouhy
667ad5a532 Merge branch 'main' into schouhy/fix-non-uniqueness-of-private-account-ids 2025-10-07 12:56:57 -03:00
Sergio Chouhy
1645dacd1f
Merge pull request #120 from vacp2p/schouhy/add-check-for-repeated-account-ids-in-circuit
Fix repeated ids inflation bug
2025-10-07 11:43:29 -03:00
Sergio Chouhy
ed9682bf58 Merge branch 'main' into schouhy/add-check-for-repeated-account-ids-in-circuit 2025-10-07 09:49:53 -03:00
Sergio Chouhy
e101a9311c
Merge pull request #119 from vacp2p/schouhy/wallet-minor-improvements
Wallet improvements
2025-10-07 09:41:36 -03:00
Oleksandr Pravdyvyi
e041b57807
feat: private pinata claim method on wallet 2025-10-07 10:40:06 +03:00
Sergio Chouhy
4bb8bc94ff Merge branch 'main' into schouhy/wallet-minor-improvements 2025-10-06 16:08:06 -03:00
Sergio Chouhy
cbbc3cfb9e
Merge pull request #118 from vacp2p/Pravdyvy/serde-json-removal-from-db
serde-json removal from db storage
2025-10-06 13:39:42 -03:00
Oleksandr Pravdyvyi
33e3db9f19
fix: merge fix 2025-10-06 13:25:05 +03:00
Oleksandr Pravdyvyi
bc01fe0dc7
fix: merge dep fix 2025-10-06 13:20:56 +03:00
Pravdyvy
468b669c14
Merge branch 'main' into Pravdyvy/serde-json-removal-from-db 2025-10-06 11:43:03 +03:00
Sergio Chouhy
b2e51990c9 remove commented code 2025-10-03 23:05:11 -03:00
Sergio Chouhy
4e51a9c778 add code comment 2025-10-03 23:04:36 -03:00
Sergio Chouhy
63436955c6 add nullifier for private account initialization 2025-10-03 20:47:37 -03:00
Sergio Chouhy
8b70da517c add check and test 2025-10-03 18:43:09 -03:00
Sergio Chouhy
f8153c6fb9 fmt, clippy 2025-10-03 17:07:15 -03:00
Sergio Chouhy
313425f6f8 rename 2025-10-03 17:06:45 -03:00
Sergio Chouhy
8f874a6b4f refactor 2025-10-03 16:50:23 -03:00
Sergio Chouhy
b6e7019588 use account with metadata constructor 2025-10-03 08:44:15 -03:00
Sergio Chouhy
46f899ac95 fmt 2025-10-03 08:11:55 -03:00
Sergio Chouhy
9141fbf06c use random nonces for private accounts in wallet 2025-10-03 01:30:40 -03:00
Sergio Chouhy
d54ea96bba remove resetting program owner in wallet privacy commands 2025-10-03 00:44:46 -03:00
Sergio Chouhy
e69fb8b1b8 fix eph key computation 2025-10-02 22:30:33 -03:00
Sergio Chouhy
ddc127f591 machete 2025-10-02 09:17:19 -03:00
Sergio Chouhy
aa8b138945 fmt clippy 2025-10-02 08:58:57 -03:00
Sergio Chouhy
86f61e5ac9 fix impl 2025-10-02 08:40:52 -03:00
Sergio Chouhy
a00773d5aa wip 2025-09-30 17:14:09 -03:00
Sergio Chouhy
6070213232 wip 2025-09-30 16:45:25 -03:00
Sergio Chouhy
4bd5494370 wip 2025-09-30 15:30:28 -03:00
Sergio Chouhy
64048ccf1d rename 2025-09-30 14:44:43 -03:00
Sergio Chouhy
dfab1d6fa8 minor refactor 2025-09-30 14:31:04 -03:00
Sergio Chouhy
23afa1e05a nit 2025-09-30 14:17:46 -03:00
Sergio Chouhy
f707d3893d remove unused function 2025-09-30 14:15:50 -03:00
Sergio Chouhy
f49d79d0e4 Rename GetProofForCommitment 2025-09-30 14:13:12 -03:00
Sergio Chouhy
fea132ef24
Merge pull request #116 from vacp2p/schouhy/add-token-program
Add token program
2025-09-29 21:31:02 -03:00
Sergio Chouhy
36beca9c7c Merge branch 'main' into schouhy/add-token-program 2025-09-29 16:00:53 -03:00
Sergio Chouhy
01638ad7be
Merge pull request #115 from vacp2p/Pravdyvy/wallet-privacy-preserving-transactions
Privacy preserving transactions in wallet
2025-09-29 14:29:18 -03:00
Oleksandr Pravdyvyi
c3ae7ab0a2
fix: account id merge fix 2025-09-26 09:50:09 +03:00
Oleksandr Pravdyvyi
8d9e7764aa
Merge branch 'main' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-26 09:15:25 +03:00
Oleksandr Pravdyvyi
3b99bf60c7
fix: ci simplification 2025-09-26 08:51:24 +03:00
Sergio Chouhy
cc927d2e43
Merge pull request #114 from vacp2p/schouhy/change-authorization-mechanism
Make addresses available to programs
2025-09-25 13:30:00 -03:00
Sergio Chouhy
bedcccb633 Merge branch 'schouhy/change-authorization-mechanism' into schouhy/add-token-program 2025-09-25 12:52:17 -03:00
Sergio Chouhy
4a755a0c23 Merge branch 'main' into schouhy/change-authorization-mechanism 2025-09-25 12:39:13 -03:00
Oleksandr Pravdyvyi
c58ef27224
feat: first db update 2025-09-25 11:53:42 +03:00
Oleksandr Pravdyvyi
1cdec1e05f
fix: tests fix 2025-09-25 06:56:21 +03:00
Oleksandr Pravdyvyi
6f2a193a50
fix: claiming path 2025-09-25 05:54:32 +03:00
Oleksandr Pravdyvyi
49b2069f0f
fix: fmt 2025-09-24 16:53:45 +03:00
Oleksandr Pravdyvyi
2ce773705d
Merge branch 'main' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-24 16:53:22 +03:00
Oleksandr Pravdyvyi
0e5087ca8f
fix: tests run 1 2025-09-24 16:44:03 +03:00
Sergio Chouhy
ae0c589d1e
Merge pull request #111 from vacp2p/schouhy/add-pinata-program
Add piñata program
2025-09-24 09:44:53 -03:00
Oleksandr Pravdyvyi
21e68b6b4a
fix: proving in dev mode 2025-09-24 15:24:20 +03:00
Oleksandr Pravdyvyi
a7c60a56b7
fix: try unify program id 2025-09-24 14:29:56 +03:00
Oleksandr Pravdyvyi
d7c577061e
fix: removal of locks 2025-09-24 12:57:17 +03:00
Oleksandr Pravdyvyi
bc5b9478df
fix: gitignore update 2025-09-24 12:25:25 +03:00
Oleksandr Pravdyvyi
476d5a9b14
fix: swanitem revert try 2025-09-24 12:15:59 +03:00
Oleksandr Pravdyvyi
0d68bec358
Merge branch 'main' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-23 15:50:06 +03:00
Oleksandr Pravdyvyi
3d704bd321
fix: account storage 2025-09-23 14:47:18 +03:00
Oleksandr Pravdyvyi
e0f5ac9e7c
fix: all execution types tests added 2025-09-23 09:54:33 +03:00
Oleksandr Pravdyvyi
d3742867ed
fix: more integration tests 2025-09-22 16:38:25 +03:00
Pravdyvy
6fda3d84dd
Merge pull request #110 from vacp2p/Pravdyvy/key-protocol-update-private
Key protocol update (private)
2025-09-20 04:57:35 +03:00
Sergio Chouhy
f5f5ab4ef1 add token program tests to ci tests 2025-09-19 12:52:21 -03:00
Sergio Chouhy
2de7e49eeb fmt 2025-09-19 12:37:24 -03:00
Sergio Chouhy
fcebd5f726 add tests 2025-09-19 12:22:28 -03:00
Oleksandr Pravdyvyi
c204915e1d
fix: ci try 1 2025-09-19 17:05:37 +03:00
Oleksandr Pravdyvyi
6114ff0d3c
fix: adding test to all tests 2025-09-19 15:50:43 +03:00
Sergio Chouhy
aded05f493 fix token program logic and add explicit panic on balance overflow 2025-09-19 09:49:18 -03:00
Oleksandr Pravdyvyi
76d374a453
fix: first integration test for privacy-preserving tx 2025-09-19 15:03:01 +03:00
Sergio Chouhy
4f67ff0c35 Merge branch 'main' into schouhy/change-authorization-mechanism 2025-09-18 17:09:02 -03:00
Sergio Chouhy
cca835e016 Merge branch 'main' into schouhy/add-pinata-program 2025-09-18 16:50:52 -03:00
Sergio Chouhy
ec55e00049
Merge pull request #109 from vacp2p/schouhy/fix-sequencer-runner
Fix sequencer runner
2025-09-18 12:12:21 -03:00
Sergio Chouhy
b7c2e8a3ec
Merge pull request #108 from vacp2p/schouhy/add-privacy-preserving-circuit-tests
Add privacy preserving circuit tests
2025-09-18 12:11:53 -03:00
Oleksandr Pravdyvyi
0e720dd9d3
fix: configs and tests updates 2025-09-18 15:59:17 +03:00
Oleksandr Pravdyvyi
f1de182ec6
fix: tests fix 2025-09-17 13:57:31 +03:00
Oleksandr Pravdyvyi
2178a3a408
Merge branch 'main' into Pravdyvy/key-protocol-update-private 2025-09-17 11:32:44 +03:00
Pravdyvy
0e81035039
Merge pull request #105 from vacp2p/Pravdyvy/sequencer-update
Sequencer specs implementation
2025-09-17 11:28:10 +03:00
Oleksandr Pravdyvyi
f75fab89b0
fix: lint fix 2025-09-17 09:38:46 +03:00
Oleksandr Pravdyvyi
9336a6c130
Merge branch 'Pravdyvy/key-protocol-update-private' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-17 09:04:43 +03:00
Oleksandr Pravdyvyi
85a16a2f04
fix: revers of scalar dep 2025-09-17 08:59:14 +03:00
Oleksandr Pravdyvyi
931b8c7176
Merge branch 'Pravdyvy/sequencer-update' into Pravdyvy/key-protocol-update-private 2025-09-17 08:45:21 +03:00
Oleksandr Pravdyvyi
f83fca56d0
Merge branch 'main' into Pravdyvy/sequencer-update 2025-09-17 08:43:42 +03:00
Sergio Chouhy
9aab707ec7 finish test 2025-09-16 11:39:29 -03:00
Sergio Chouhy
473a5fd98b add integratin tests wip 2025-09-16 11:38:26 -03:00
Sergio Chouhy
5979d8d0cf fmt 2025-09-16 11:37:36 -03:00
Sergio Chouhy
24f3952c49 minor change 2025-09-16 11:37:36 -03:00
Sergio Chouhy
afc977e044 change validate_execution logic 2025-09-16 11:37:36 -03:00
Sergio Chouhy
856114019e fix 2025-09-16 11:37:36 -03:00
Sergio Chouhy
b9e0ff230f add token program 2025-09-16 11:37:36 -03:00
Sergio Chouhy
29914b3220 fmt 2025-09-16 11:37:36 -03:00
Sergio Chouhy
37b4d0d6e2 add tests 2025-09-16 11:37:36 -03:00
Sergio Chouhy
bfbb5e2870 rename fingerprint to account_id 2025-09-16 11:37:36 -03:00
Sergio Chouhy
32910e76e3 refactor 2025-09-16 11:37:36 -03:00
Sergio Chouhy
c3b2f4691b fmt, clippy 2025-09-16 11:37:36 -03:00
Sergio Chouhy
3d240c72f8 wip 2025-09-16 11:37:36 -03:00
Sergio Chouhy
80505f0440 rollback to is_authorized field 2025-09-16 11:37:36 -03:00
Sergio Chouhy
cee882502c wip 2025-09-16 11:37:36 -03:00
Sergio Chouhy
bf95a4112e
Merge pull request #117 from vacp2p/schouhy/add-get-account-command
Add `get-account` wallet command.
2025-09-16 11:15:43 -03:00
Oleksandr Pravdyvyi
08526d47bf
feat: shielded+deshielded token transfers 2025-09-16 14:53:00 +03:00
Sergio Chouhy
75b7fdd069 add domain separation for private and public account ids 2025-09-16 07:51:40 -03:00
Oleksandr Pravdyvyi
ae70baf5c4
Merge branch 'Pravdyvy/key-protocol-update-private' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-16 08:49:10 +03:00
Sergio Chouhy
37b5aec264 fmt 2025-09-15 18:39:36 -03:00
Sergio Chouhy
2d22b170d4 add test 2025-09-15 18:38:45 -03:00
Sergio Chouhy
d796d7baf1 add get-account wallet command. Small refactor 2025-09-15 18:13:08 -03:00
Oleksandr Pravdyvyi
d07b813739
fix: deviations adjustments 2025-09-15 14:04:49 +03:00
Oleksandr Pravdyvyi
93fcbb8f61
Merge branch 'Pravdyvy/sequencer-update' into Pravdyvy/key-protocol-update-private 2025-09-15 10:49:48 +03:00
Oleksandr Pravdyvyi
a11f372091
fix: comments fix 2025-09-15 10:39:57 +03:00
Oleksandr Pravdyvyi
eb9c45bbb7
feat: private token transfer 2025-09-12 16:00:57 +03:00
Sergio Chouhy
d91b07a785 fmt 2025-09-12 09:39:08 -03:00
Sergio Chouhy
2c2c4fed76 add tests 2025-09-12 09:36:26 -03:00
Sergio Chouhy
f31bbe4876 rename fingerprint to account_id 2025-09-12 09:18:40 -03:00
Oleksandr Pravdyvyi
d81fb2665f
fix: commnets fix cleanup 2025-09-12 15:06:49 +03:00
Sergio Chouhy
e12fe4492b refactor 2025-09-11 16:39:07 -03:00
Sergio Chouhy
e8ace6838f fmt, clippy 2025-09-11 15:54:25 -03:00
Oleksandr Pravdyvyi
854d96af72
fix; privacy preserving tx gen 1 2025-09-11 18:32:46 +03:00
Sergio Chouhy
3a9d9af815 wip 2025-09-10 18:56:34 -03:00
Oleksandr Pravdyvyi
65dfbd8bbb
fix merge fix 2025-09-10 13:52:28 +03:00
Oleksandr Pravdyvyi
4a3af34c6a
Merge branch 'Pravdyvy/key-protocol-update-private' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-10 08:30:55 +03:00
Oleksandr Pravdyvyi
6552e6d015
Merge branch 'Pravdyvy/sequencer-update' into Pravdyvy/wallet-privacy-preserving-transactions 2025-09-10 08:27:58 +03:00
Sergio Chouhy
d63cde85b9 rollback to is_authorized field 2025-09-09 17:03:58 -03:00
Oleksandr Pravdyvyi
ef32f7179e
fix: cache test 2025-09-09 15:41:14 +03:00
Oleksandr Pravdyvyi
54590f8157
fix: ci test run 3 2025-09-09 14:53:34 +03:00
Oleksandr Pravdyvyi
125fac770a
fix: ci test run 2 2025-09-09 14:49:56 +03:00
Oleksandr Pravdyvyi
95032e8e06
feat: ci cache test run 2025-09-09 14:43:48 +03:00
Sergio Chouhy
d24969387c wip 2025-09-08 19:29:56 -03:00
Oleksandr Pravdyvyi
23e79d3e17
fix: fmt 2025-09-08 15:23:32 +03:00
Oleksandr Pravdyvyi
4837413989
fix: merge fix 2025-09-08 15:03:02 +03:00
Oleksandr Pravdyvyi
a5123992c9
Merge branch 'main' into Pravdyvy/key-protocol-update-private 2025-09-08 14:53:22 +03:00
Oleksandr Pravdyvyi
33783e06d8
fix: keys structures updates 2025-09-08 14:48:58 +03:00
Oleksandr Pravdyvyi
0e1905ad22
fix: suggestions fix 2025-09-08 10:11:04 +03:00
Oleksandr Pravdyvyi
5747070e39
fix: merge fixes 2025-09-08 09:09:32 +03:00
Oleksandr Pravdyvyi
8ceb27421e
Merge branch 'main' into Pravdyvy/sequencer-update 2025-09-08 09:03:39 +03:00
Sergio Chouhy
e2d596be20 clippy 2025-09-05 23:49:25 -03:00
Sergio Chouhy
a432019b23 wip 2025-09-05 23:43:15 -03:00
Sergio Chouhy
df2026f107
Merge pull request #113 from vacp2p/comments_commitments
added comments related to commitments
2025-09-05 22:40:53 -03:00
jonesmarvin8
c055941738
Update nssa/src/state.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 20:48:56 -04:00
jonesmarvin8
4a0a99e264
Update nssa/src/state.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 20:48:47 -04:00
jonesmarvin8
4ae2af21a5
Update nssa/src/state.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 20:48:26 -04:00
jonesmarvin8
49019eaee2
Update nssa/core/src/commitment.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 20:48:11 -04:00
Sergio Chouhy
41f7ea654e
Merge pull request #112 from vacp2p/comments_merkle_trees
added comments for Merkle tree
2025-09-05 19:54:06 -03:00
jonesmarvin8
5dea03027a minor corrections 2025-09-05 16:38:34 -04:00
jonesmarvin8
26acdbed61
Update nssa/src/merkle_tree/mod.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 16:28:13 -04:00
jonesmarvin8
1e7c3e1555
Update nssa/src/merkle_tree/mod.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 16:27:55 -04:00
jonesmarvin8
73c11600ba
Update nssa/src/merkle_tree/mod.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 16:27:43 -04:00
jonesmarvin8
6e7520bfea
Update nssa/src/merkle_tree/mod.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 16:27:03 -04:00
jonesmarvin8
45b31d304c
Update nssa/src/merkle_tree/mod.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2025-09-05 16:26:56 -04:00
jonesmarvin8
5eeb925384 added comments related to commitments 2025-09-05 16:21:46 -04:00
jonesmarvin8
4e122abbce added comments for Merkle tree 2025-09-05 16:03:49 -04:00
Oleksandr Pravdyvyi
324f477b63
fix: keys corect generatin 2025-09-05 14:47:58 +03:00
Sergio Chouhy
e2494467ea Merge branch 'main' into schouhy/add-pinata-program 2025-09-04 12:44:37 -03:00
Sergio Chouhy
4a44b12384 wip 2025-09-04 12:44:22 -03:00
Oleksandr Pravdyvyi
ebe616247f
fix: seed generation from mnemonic 2025-09-04 17:49:55 +03:00
Pravdyvy
cab8153201
Merge pull request #101 from vacp2p/Pravdyvy/accounts-dump-fetch
Wallet CLI extension
2025-09-04 17:37:07 +03:00
Oleksandr Pravdyvyi
b1d3b71df7
fix: tests fix 2025-09-04 16:46:20 +03:00
Oleksandr Pravdyvyi
57045fa8e1
fix: merge upfix 2025-09-04 15:15:14 +03:00
Oleksandr Pravdyvyi
00c76df04b
Merge branch 'main' into Pravdyvy/accounts-dump-fetch 2025-09-04 15:14:28 +03:00
Oleksandr Pravdyvyi
d402cfca52
fix: direct log dependency 2025-09-04 15:12:01 +03:00
Oleksandr Pravdyvyi
762a0d760e
fix: resolver 3 2025-09-04 14:54:48 +03:00
Oleksandr Pravdyvyi
7052bccfbc
fix: try edition 2024 2025-09-04 14:38:41 +03:00
Oleksandr Pravdyvyi
ee91d7d79c
fix: ci fix 1 2025-09-04 14:18:44 +03:00
Oleksandr Pravdyvyi
1d627ce5b9
fix: suggestions 1 2025-09-04 13:33:17 +03:00
Sergio Chouhy
efb7108c58 add more tests 2025-09-03 16:44:55 -03:00
Sergio Chouhy
63517b6b1c add circuit tests 2025-09-03 16:25:02 -03:00
Sergio Chouhy
83542b310c fix double nonce increment in privacy preserving tx 2025-09-03 15:20:40 -03:00
Sergio Chouhy
9b4506de3b fix sequencer runner 2025-09-03 14:47:35 -03:00
Sergio Chouhy
e07733e5c3
Merge pull request #107 from vacp2p/schouhy/remove-unused-dependencies
Remove unused dependencies
2025-09-03 09:16:37 -03:00
Oleksandr Pravdyvyi
82f4df638e
Merge branch 'Pravdyvy/accounts-dump-fetch' into Pravdyvy/sequencer-update 2025-09-03 15:11:14 +03:00
Oleksandr Pravdyvyi
55d207ac9a
Merge branch 'main' into Pravdyvy/sequencer-update 2025-09-03 10:31:50 +03:00
Oleksandr Pravdyvyi
b4f21b2f09
fix: checks added 2025-09-03 10:29:51 +03:00
Sergio Chouhy
4f9ee9f19f remove unused dependencies 2025-09-02 16:29:56 -03:00
Sergio Chouhy
82070f9918
Merge pull request #106 from vacp2p/schouhy/add-tag-computation
Add view tag computation
2025-09-02 14:51:44 -03:00
Sergio Chouhy
f08ed17509 test incorrect number of masks in visibility mask list 2025-09-02 14:50:16 -03:00
Sergio Chouhy
a1e4c06bc7 add tests 2025-09-02 14:09:50 -03:00
Sergio Chouhy
f3d63806c3 fix tests 2025-09-02 12:56:01 -03:00
Sergio Chouhy
5190b486c4 fix circuit and add test 2025-09-02 12:45:30 -03:00
Oleksandr Pravdyvyi
ea426d6650
Merge branch 'main' into Pravdyvy/accounts-dump-fetch 2025-09-02 17:12:14 +03:00
Pravdyvy
c297186aee
Merge pull request #104 from vacp2p/Pravdyvy/key-protocol-update-public-part
Key protocol update public part
2025-09-02 17:10:02 +03:00
Oleksandr Pravdyvyi
570a516cbf
fix: merge fix 2025-09-02 16:22:40 +03:00
Oleksandr Pravdyvyi
4ac2196ddf
fix: lock update 2025-09-02 16:11:27 +03:00
Oleksandr Pravdyvyi
348ec65059
Merge branch 'main' into Pravdyvy/key-protocol-update-public-part 2025-09-02 16:11:08 +03:00
Sergio Chouhy
2bcee59d39
Merge pull request #103 from vacp2p/schouhy/implement-nssa-v0.1-private-state
Implement NSSA v0.1 Private State
2025-09-02 06:46:26 -03:00
Oleksandr Pravdyvyi
6efac43210
fix: block interfix 2025-09-02 11:06:41 +03:00
Oleksandr Pravdyvyi
211b6f9115
Merge branch 'Pravdyvy/accounts-dump-fetch' into Pravdyvy/sequencer-update 2025-09-02 10:17:48 +03:00
Oleksandr Pravdyvyi
fbcc9cf3e2
fix: encoding updates 2025-09-02 10:17:00 +03:00
Oleksandr Pravdyvyi
6967c0c22f
fix: update to pr 104 2025-09-02 09:01:33 +03:00
Oleksandr Pravdyvyi
4363a16a62
Merge branch 'Pravdyvy/key-protocol-update-public-part' into Pravdyvy/accounts-dump-fetch 2025-09-02 08:25:00 +03:00
Oleksandr Pravdyvyi
7c42b3de10
fix: lint fix 1 2025-09-02 07:51:49 +03:00
Oleksandr Pravdyvyi
5de28e999e
fix: fmt fix 2025-09-02 07:44:24 +03:00
Oleksandr Pravdyvyi
9993590d45
fix: comments fix 2 2025-09-02 07:32:39 +03:00
Sergio Chouhy
786d0b2899 add tag computation 2025-09-01 18:25:25 -03:00
Oleksandr Pravdyvyi
5c3418ca8e
fix: comments fix 2 2025-09-01 14:17:16 +03:00
Oleksandr Pravdyvyi
22cdce5102
fix: comments fix 2025-09-01 14:06:43 +03:00
Oleksandr Pravdyvyi
ca131b2c26
fix: block structs update 2025-08-28 12:00:04 +03:00
Oleksandr Pravdyvyi
512d96d384
Merge branch 'schouhy/implement-nssa-v0.1-private-state' into Pravdyvy/sequencer-update 2025-08-28 07:39:01 +03:00
Sergio Chouhy
a36592485c remove builtin programs check 2025-08-27 19:25:03 -03:00
Sergio Chouhy
87577726ec add program_id check 2025-08-27 18:31:13 -03:00
Sergio Chouhy
5bd45b685f bump r0 version 2025-08-27 18:02:10 -03:00
Sergio Chouhy
8dbb636a14 add dev mode to ci rust tests 2025-08-27 17:24:59 -03:00
Sergio Chouhy
0a3f093d60 fmt and clippy 2025-08-27 17:22:09 -03:00
Sergio Chouhy
66b5efaacb file refactor 2025-08-27 17:22:03 -03:00
Sergio Chouhy
fd74216249 add commit to kdf 2025-08-26 14:14:08 -03:00
Sergio Chouhy
e508547914 add npk to kdf 2025-08-26 13:50:52 -03:00
Oleksandr Pravdyvyi
f47692773c
fix: merge fix 2025-08-26 14:09:33 +03:00
Oleksandr Pravdyvyi
562480225c
Merge branch 'schouhy/implement-nssa-v0.1-private-state' into Pravdyvy/sequencer-update 2025-08-26 14:06:49 +03:00
Oleksandr Pravdyvyi
ab35d37766
fix: suggestions fix 2025-08-26 09:16:46 +03:00
Sergio Chouhy
d623812c24 remove shared secrete derivation from r0 2025-08-25 17:45:59 -03:00
Sergio Chouhy
20897596b0 add root history 2025-08-25 09:58:02 -03:00
Sergio Chouhy
9ff6a5bc85 fix 2025-08-25 07:57:35 -03:00
Sergio Chouhy
2e371300d3 refactor mt 2025-08-25 07:44:56 -03:00
Sergio Chouhy
f2a7c574e5 fix nonce in circuit 2025-08-22 18:49:46 -03:00
Sergio Chouhy
96ca181f2d implement encryption/decryption of private outputs 2025-08-22 18:11:45 -03:00
Sergio Chouhy
d00c551027 minor refactor 2025-08-22 13:42:37 -03:00
Sergio Chouhy
75211903d7 polish tests 2025-08-22 12:29:45 -03:00
Sergio Chouhy
f7e1b85091 add transition from privacy preserving transaction deshielded 2025-08-22 11:03:10 -03:00
Oleksandr Pravdyvyi
fedf63b759
fix: risk0 bump 2025-08-22 16:36:38 +03:00
Sergio Chouhy
1d2b0bbed7 add test for transition from private transaction 2025-08-22 10:35:01 -03:00
Oleksandr Pravdyvyi
41af90e2eb
fix: tests addded-fixed 2025-08-22 15:58:43 +03:00
Sergio Chouhy
1ca3d68d7e remove serde for nssa::address 2025-08-22 08:53:40 -03:00
Sergio Chouhy
02ad6129d6 refactor merkle tree into file 2025-08-22 08:34:47 -03:00
Sergio Chouhy
79727f0195 refactor circuit module into file 2025-08-22 08:32:05 -03:00
Sergio Chouhy
d53edf7b61 remove unused dep 2025-08-22 08:28:38 -03:00
Sergio Chouhy
48a70cb6e5 Merge branch 'main' into schouhy/implement-nssa-v0.1-private-state 2025-08-22 08:27:19 -03:00
Sergio Chouhy
9b7c2587fe minor changes 2025-08-21 15:52:35 -03:00
Sergio Chouhy
b6cabe8fb8 refactor. Add test for state transition from privacy preserving transaction 2025-08-21 14:32:57 -03:00
Sergio Chouhy
a5dc01d85e improve test to match exact new commitments and new nullifiers 2025-08-21 10:52:52 -03:00
Sergio Chouhy
8a0e2d780a fix test with valid merkle proofs 2025-08-21 10:19:50 -03:00
Oleksandr Pravdyvyi
914cbfb9dc
fix: complete cli intefaces 2025-08-21 15:58:31 +03:00
Sergio Chouhy
6d56ee51db add verification reference impl and tests 2025-08-21 08:11:33 -03:00
Sergio Chouhy
0554500f2f remove vec attribute 2025-08-20 20:25:56 -03:00
Sergio Chouhy
e9fbce2106 add test 2025-08-20 20:02:28 -03:00
Sergio Chouhy
096a404859 add auth paths 2025-08-20 19:57:44 -03:00
Sergio Chouhy
44a4f2f9f3 fix 2025-08-20 19:13:32 -03:00
Sergio Chouhy
b3f6b2756e add extend capacity 2025-08-20 18:26:54 -03:00
Sergio Chouhy
499b23c335 refactor 2025-08-20 16:21:05 -03:00
Sergio Chouhy
c41eb6b517 add with_capacity 2025-08-20 15:27:57 -03:00
Oleksandr Pravdyvyi
612a67f5ed
Merge branch 'main' into Pravdyvy/key-protocol-update-public-part 2025-08-20 17:53:09 +03:00
Pravdyvy
6547d0efb4
Merge pull request #102 from vacp2p/Pravdyvy/structural-improvements
Structural improvements
2025-08-20 17:51:57 +03:00
Oleksandr Pravdyvyi
0c7456d7a0
fix: first batch of wallet methods 2025-08-20 17:16:51 +03:00
Oleksandr Pravdyvyi
0abb23e26a
Merge branch 'Pravdyvy/key-protocol-update-public-part' into Pravdyvy/accounts-dump-fetch 2025-08-20 08:22:47 +03:00
Sergio Chouhy
15e2c131b2 add merkle tests 2025-08-19 16:39:32 -03:00
Sergio Chouhy
ceba630cff merkle tree wip 2025-08-19 15:22:35 -03:00
Sergio Chouhy
8239855e88 add test. refactor 2025-08-19 12:52:52 -03:00
Sergio Chouhy
538bb72556 encapsulate proof 2025-08-19 10:47:24 -03:00
Sergio Chouhy
769e372e8f add test of privacy preserving circuit proof generation 2025-08-19 10:39:47 -03:00
Oleksandr Pravdyvyi
80620b6aac
fix: wallet fix 2025-08-19 14:14:09 +03:00
Oleksandr Pravdyvyi
d2ab8dd4d4
fix: comments fix 2025-08-19 06:41:36 +03:00
Sergio Chouhy
f905e79f4c wip 2025-08-18 19:57:21 -03:00
Sergio Chouhy
562fe2e5e6 wip execute offchain 2025-08-18 18:54:47 -03:00
Sergio Chouhy
330d79379f add message serialization roundtrip test 2025-08-18 14:55:50 -03:00
Sergio Chouhy
a185e52203 add encodings 2025-08-18 14:28:26 -03:00
Sergio Chouhy
1e1ab787bc add nullifier pk from secret 2025-08-18 11:53:43 -03:00
Oleksandr Pravdyvyi
e617cac69c
fix: key proctocol crate updated 2025-08-18 16:15:25 +03:00
Sergio Chouhy
2813d536bb add nullifier constructor 2025-08-18 09:50:11 -03:00
Sergio Chouhy
acbde736f0 wip 2025-08-18 09:21:07 -03:00
Sergio Chouhy
b20a97e5a1 wip 2025-08-18 07:39:41 -03:00
Oleksandr Pravdyvyi
4268830d18
Merge branch 'main' into Pravdyvy/key-protocol-update-public-part 2025-08-15 14:29:05 +03:00
Oleksandr Pravdyvyi
1cdf058938
Merge branch 'main' into Pravdyvy/structural-improvements 2025-08-15 14:28:31 +03:00
Oleksandr Pravdyvyi
35b636a27d
fix: clearing and renaming 2025-08-15 14:27:36 +03:00
Sergio Chouhy
97f69f9498
Merge pull request #100 from vacp2p/schouhy/implement-nssa-v0.1-public-state
Implement NSSA v0.1 Public State
2025-08-15 08:19:59 -03:00
Sergio Chouhy
1a10dade25 add priv preserving tx validation criteria scaffolding 2025-08-14 16:20:09 -03:00
Sergio Chouhy
507988832f add transition_from_privacy_preserving_transaction method and relevant scaffolding 2025-08-14 15:34:21 -03:00
Sergio Chouhy
a694e705ea move claiming accounts logic to state transition 2025-08-14 14:48:20 -03:00
Sergio Chouhy
d1ebb831ef refactor program input 2025-08-14 14:30:04 -03:00
Sergio Chouhy
c5a4e83e3e add pre states to program output 2025-08-14 14:09:04 -03:00
Sergio Chouhy
035f950229 add execute_and_prove 2025-08-14 13:28:23 -03:00
Sergio Chouhy
35ffb65df0 add privacy preserving transaction scaffolding 2025-08-14 12:10:27 -03:00
Oleksandr Pravdyvyi
74f0c983d3
fix: comments fix 2025-08-14 14:03:48 +03:00
Sergio Chouhy
fe06a22589 remove serialize and deserialize from message 2025-08-13 19:24:26 -03:00
Oleksandr Pravdyvyi
6cada5bd09
fix: nonces fix 2025-08-13 16:23:00 +03:00
Oleksandr Pravdyvyi
e589ddae5a
fix: test fix 2 2025-08-13 16:17:52 +03:00
Sergio Chouhy
9d8c74ec1e taplo 2025-08-13 10:01:44 -03:00
Oleksandr Pravdyvyi
d7acffd8da
fix: test fix 1 2025-08-13 15:11:24 +03:00
Oleksandr Pravdyvyi
a9d81b19ed
fix: lints and merge fixes 2025-08-13 14:15:05 +03:00
Oleksandr Pravdyvyi
494cc7fb1e
Merge branch 'Pravdyvy/structural-upgrades' into Pravdyvy/structural-improvements 2025-08-13 13:48:01 +03:00
Oleksandr Pravdyvyi
fed2d50a9a
Revert "fix: AccountAddress wrapped into struct"
This reverts commit 6bced517644b1ab3879aa35d5c4695edb5f3bcb2.
2025-08-13 13:44:41 +03:00
Oleksandr Pravdyvyi
939553cc85
fix: structural upgrades finalized 2025-08-13 13:42:00 +03:00
Sergio Chouhy
490ac908b8 nit 2025-08-13 03:02:32 -03:00
Sergio Chouhy
df78d5f162 fix integration tests 2025-08-13 02:25:19 -03:00
Sergio Chouhy
b22de50107 fmt clippy 2025-08-13 01:59:29 -03:00
Sergio Chouhy
63cca0f30f add tests 2025-08-13 01:55:56 -03:00
Sergio Chouhy
4bdd2c6d9f add try_new test 2025-08-13 01:49:17 -03:00
Sergio Chouhy
2c0c417c22 improve attribute visibility 2025-08-13 01:36:19 -03:00
Sergio Chouhy
504eb00819 refactor tests 2025-08-13 01:33:11 -03:00
Sergio Chouhy
acaf62f31f fmt clippy 2025-08-13 00:51:54 -03:00
Sergio Chouhy
24a3165634 add tests 2025-08-13 00:43:17 -03:00
Sergio Chouhy
d0a1cd5fa0 add tests 2025-08-13 00:15:22 -03:00
Sergio Chouhy
d3827fc823 add tests. refactor 2025-08-12 23:31:41 -03:00
Sergio Chouhy
2d9896f6ed error handling for encoding 2025-08-12 22:50:21 -03:00
Sergio Chouhy
0dcdb2188a refactor. add tests 2025-08-12 21:27:27 -03:00
Sergio Chouhy
b2f79e2965 add all tests 2025-08-12 17:58:48 -03:00
Sergio Chouhy
0b2650127a clippy 2025-08-12 16:56:16 -03:00
Sergio Chouhy
2884fdd00a fmt 2025-08-12 16:48:53 -03:00
Sergio Chouhy
82818db873 fix test 2025-08-12 16:48:32 -03:00
Sergio Chouhy
066aa8f3f7 add test vectors 2025-08-12 16:45:07 -03:00
Sergio Chouhy
927254f6ce add bip340 test vectors for public keys 2025-08-12 15:20:35 -03:00
Sergio Chouhy
e8e565fe8c refactor encoding 2025-08-12 13:10:46 -03:00
Sergio Chouhy
82907f5d8f refactor all 2025-08-12 12:18:13 -03:00
Sergio Chouhy
bab1112251 refactor encoding/decoding for public transactions without serde 2025-08-12 10:16:04 -03:00
Oleksandr Pravdyvyi
6bced51764
fix: AccountAddress wrapped into struct 2025-08-12 14:35:10 +03:00
Sergio Chouhy
a5d0c27d6b fix 2025-08-11 20:38:29 -03:00
Sergio Chouhy
5bc1c9c688 add signatures 2025-08-11 20:22:41 -03:00
Sergio Chouhy
703a127f0e implement public and private keys 2025-08-11 19:14:12 -03:00
Sergio Chouhy
54dd9aa814 minor refactor 2025-08-11 12:07:30 -03:00
Oleksandr Pravdyvyi
f32d7a7daf
Merge branch 'main' into Pravdyvy/accounts-dump-fetch 2025-08-11 15:25:24 +03:00
Sergio Chouhy
96b256bd4c Merge branch 'main' into schouhy/implement-nssa-v0.1-public-state-tmp 2025-08-11 09:08:06 -03:00
Pravdyvy
4581dcc1d1
Merge pull request #99 from vacp2p/Pravdyvy/node-wallet-rewrite
Data storage removal and node refactor.
2025-08-11 14:52:51 +03:00
Oleksandr Pravdyvyi
a3444f0c5c
fix: tests updates 2025-08-11 14:01:13 +03:00
Oleksandr Pravdyvyi
b5011d6b1d
fix: ci fix 1 2025-08-11 10:03:20 +03:00
Oleksandr Pravdyvyi
8727dabe27
fix: merge fixes 2025-08-11 09:05:18 +03:00
Oleksandr Pravdyvyi
56ac4ab982
Merge branch 'Pravdyvy/node-wallet-rewrite' into Pravdyvy/accounts-dump-fetch 2025-08-11 08:59:04 +03:00
Oleksandr Pravdyvyi
c3b5d62ea6
fix: comments fix 2025-08-11 08:55:08 +03:00
Sergio Chouhy
43058193df minor change 2025-08-10 19:53:05 -03:00
Sergio Chouhy
9d19183786 minor refactor 2025-08-10 19:08:18 -03:00
Sergio Chouhy
102d2e13f9 add general instruction data 2025-08-10 18:51:55 -03:00
Sergio Chouhy
48fe6f2740 refactor logic 2025-08-10 14:44:27 -03:00
Sergio Chouhy
15ca5ad4ec refactor public_transaction module into folder 2025-08-10 14:10:11 -03:00
Sergio Chouhy
dacf880b88 add test for balance invariance after program execution 2025-08-10 12:36:11 -03:00
Sergio Chouhy
f86719f54c add test for invalid data modification 2025-08-10 11:17:15 -03:00
Sergio Chouhy
ad47f48a79 add test for invalid balance transfers 2025-08-10 11:02:59 -03:00
Sergio Chouhy
3594c846da add test program owner changer 2025-08-10 10:36:55 -03:00
Sergio Chouhy
a3b64e4021 add test for missing outputs 2025-08-10 10:09:23 -03:00
Sergio Chouhy
ecdb4ba130 add test for extra outputs 2025-08-10 09:57:10 -03:00
Sergio Chouhy
bfdf039ef3 add test folder 2025-08-10 01:27:37 -03:00
Sergio Chouhy
4f7bde100c minor change 2025-08-09 21:14:13 -03:00
Sergio Chouhy
6030e54cd7 refactor program 2025-08-09 20:28:34 -03:00
Sergio Chouhy
51d8ac47cf refactor program 2025-08-09 20:16:18 -03:00
Sergio Chouhy
55e241dc97 add error handling 2025-08-09 19:49:07 -03:00
Sergio Chouhy
04f6474799 clippy 2025-08-09 19:20:19 -03:00
Sergio Chouhy
7d23983309 fix test 2025-08-09 19:13:44 -03:00
Sergio Chouhy
00773d7457 clippy 2025-08-09 18:49:05 -03:00
Sergio Chouhy
fcb90f6f11 clippy 2025-08-09 18:37:04 -03:00
Sergio Chouhy
3188f98117 early returns instead of panicking in program methods 2025-08-09 18:30:34 -03:00
Sergio Chouhy
20a7dad9a0 Merge branch 'Pravdyvy/node-wallet-rewrite' into schouhy/implement-nssa-v0.1-public-state-tmp 2025-08-09 18:00:58 -03:00
Sergio Chouhy
13cc82e3ed remove unnecessary mempoolitem trait 2025-08-08 16:53:15 -03:00
Sergio Chouhy
22c16c1ec9 improve tests function to avoid manual entry of hex string in test 2025-08-08 16:37:20 -03:00
Sergio Chouhy
002ad048b0 refactor programs. Add builtin programs. Implement account claim logic 2025-08-08 16:19:50 -03:00
Sergio Chouhy
3dfcb47534 add tests for default account 2025-08-08 13:32:50 -03:00
Oleksandr Pravdyvyi
dbb276e470
fix: fmt 2025-08-08 17:01:21 +03:00
Sergio Chouhy
ef6af9a967 solve linking problem 2025-08-08 10:51:23 -03:00
Oleksandr Pravdyvyi
c0318de646
fix: restore and dump methods 2025-08-08 15:22:04 +03:00
Oleksandr Pravdyvyi
99640bd70c
feat: dump command 2025-08-08 10:07:10 +03:00
Sergio Chouhy
ec909a1625 adapt sequencer to use nssa 2025-08-07 15:19:06 -03:00
Sergio Chouhy
ae9963aec3 add test 2025-08-07 09:33:54 -03:00
Oleksandr Pravdyvyi
17b6851d00
fix: cleanup 2025-08-07 14:07:34 +03:00
Sergio Chouhy
aba8f3549f public transactions wip 2025-08-06 20:05:04 -03:00
Sergio Chouhy
a06af6da0a nssa basic project structure 2025-08-06 13:39:09 -03:00
Oleksandr Pravdyvyi
c5097ab879
fix: cli added 2025-08-06 14:56:58 +03:00
Oleksandr Pravdyvyi
7be870369c
fix: fmt 2025-08-05 15:44:52 +03:00
Oleksandr Pravdyvyi
4f95cef08f
fix: code cleanup and final removals 2025-08-05 14:59:20 +03:00
Oleksandr Pravdyvyi
6565e0af18
breaking: initial cuts 2025-08-04 15:09:28 +03:00
Pravdyvy
ebec84b3c0
Merge pull request #96 from vacp2p/Pravdyvy/integration-tests
Integration tests
2025-08-04 14:52:25 +03:00
Oleksandr Pravdyvyi
2657e64df8
fix: ci fix 2025-08-04 13:46:41 +03:00
Oleksandr Pravdyvyi
418ce51805
Merge branch 'main' into Pravdyvy/integration-tests 2025-08-04 13:20:54 +03:00
Oleksandr Pravdyvyi
c17160602c
fix: ci try retry 2025-08-04 10:40:08 +03:00
Oleksandr Pravdyvyi
5d42e53b18
fix: comments fix 2025-08-01 18:32:30 +03:00
Sergio Chouhy
7f97340667
Merge pull request #97 from vacp2p/schouhy/prevent-replay-attacks-with-nonces
Prevent replay attacks with nonce mechanism
2025-07-31 16:31:19 -03:00
Oleksandr Pravdyvyi
f5d9990cc8
fix: macro for test functions 2025-07-31 15:41:36 +03:00
Oleksandr Pravdyvyi
7a6a958179
fix: integration tests added 2025-07-31 14:40:23 +03:00
Oleksandr Pravdyvyi
aa142eed07
fix: fmt commit 2025-07-30 14:14:46 +03:00
Oleksandr Pravdyvyi
6df4a04f84
feat: first scenario implemented 2025-07-30 14:01:40 +03:00
Oleksandr Pravdyvyi
28317b6227
Merge branch 'main' into Pravdyvy/integration-tests 2025-07-30 10:10:36 +03:00
Sergio Chouhy
18489be4d1 nit 2025-07-29 16:48:50 -03:00
Sergio Chouhy
c6fb383adf fix increase nonce and add test 2025-07-29 16:42:22 -03:00
Sergio Chouhy
e9b11af986 move nonce to public execution input 2025-07-29 16:09:21 -03:00
Sergio Chouhy
6a38c2eaa2 ad test 2025-07-29 15:41:57 -03:00
Sergio Chouhy
a1d53ee6f0 use tempdir for tests 2025-07-29 15:29:00 -03:00
Sergio Chouhy
6ed4369647 clippy 2025-07-29 15:26:08 -03:00
Sergio Chouhy
4300e87485 refactor address to avoid code repetition in computing addresses from public keys 2025-07-29 15:23:54 -03:00
Sergio Chouhy
76a023c33a remove unused nonce method 2025-07-29 12:51:33 -03:00
Sergio Chouhy
966a5c9a04 Merge branch 'Pravdyvy/state-transition-token-transfer' into schouhy/prevent-replay-attacks-with-nonces
fix test
2025-07-29 12:50:30 -03:00
Pravdyvy
72b5035733
Merge pull request #92 from vacp2p/Pravdyvy/state-transition-token-transfer
State transition for token transfer
2025-07-29 18:32:38 +03:00
Oleksandr Pravdyvyi
e72df20b60
fix: test fix 2025-07-29 15:04:38 +03:00
Oleksandr Pravdyvyi
5d7d6278ee
fix: updates and tests 2025-07-29 14:20:03 +03:00
Sergio Chouhy
f21c0df652 wip: added nonces and test 2025-07-28 16:09:03 -03:00
Sergio Chouhy
484c22b649 Merge branch 'Pravdyvy/state-transition-token-transfer' into schouhy/prevent-replay-attacks-with-nonces 2025-07-28 15:22:19 -03:00
Sergio Chouhy
70b31856e9 wip 2025-07-28 15:21:35 -03:00
Oleksandr Pravdyvyi
d181ce73e6
fix: node and sequencer startup 2025-07-28 16:31:43 +03:00
Oleksandr Pravdyvyi
c546af7865
fix: correct sender check fix 2025-07-25 19:46:23 +03:00
Oleksandr Pravdyvyi
6d947710d1
feat:int test 2025-07-25 19:42:29 +03:00
Oleksandr Pravdyvyi
e0b1ec165c
fix: fmt commit 2025-07-25 10:46:32 +03:00
Oleksandr Pravdyvyi
7695e8e46e
fix: merge fix 2025-07-25 10:09:34 +03:00
Oleksandr Pravdyvyi
3de86d975e
Merge branch 'main' into Pravdyvy/state-transition-token-transfer 2025-07-25 10:04:31 +03:00
Oleksandr Pravdyvyi
d232cecbb0
fix: comments fix 2 2025-07-25 10:00:27 +03:00
Sergio Chouhy
00f1490eff
Merge pull request #95 from vacp2p/schouhy/add-get-transaction-rpc-method
Add get transaction by hash method to RPC server
2025-07-24 15:06:26 -03:00
Oleksandr Pravdyvyi
494ff2ac71
fix: ToDo doc 2025-07-24 17:31:53 +03:00
Oleksandr Pravdyvyi
41b65521f9
fix: comments fix 1 2025-07-24 16:05:27 +03:00
Sergio Chouhy
eaaf485325 Merge branch 'main' into schouhy/add-get-transaction-rpc-method 2025-07-24 10:02:01 -03:00
Sergio Chouhy
8a31522444 Merge branch 'main' into schouhy/add-get-transaction-rpc-method 2025-07-24 08:35:32 -03:00
Sergio Chouhy
6ede7eac16 add TODO 2025-07-24 08:21:20 -03:00
Oleksandr Pravdyvyi
95fec47897
fix: merge lint test fixes 2025-07-24 09:14:38 +03:00
Oleksandr Pravdyvyi
88872f31dd
Merge branch 'main' into Pravdyvy/state-transition-token-transfer 2025-07-24 08:41:34 +03:00
Sergio Chouhy
ef0b659ad1
Merge pull request #94 from vacp2p/schouhy/add-get-account-balance-rpc-method
Add get account balance method to sequencer RPC server
2025-07-23 15:14:49 -03:00
Sergio Chouhy
af6608585c Merge branch 'main' into schouhy/add-get-account-balance-rpc-method 2025-07-23 13:18:12 -03:00
Oleksandr Pravdyvyi
262531799b
Merge branch 'main' into Pravdyvy/state-transition-token-transfer 2025-07-23 19:03:54 +03:00
Pravdyvy
645429d8d8
Merge pull request #78 from vacp2p/schouhy/add-clippy-to-ci
Add clippy to CI
2025-07-23 18:53:18 +03:00
Oleksandr Pravdyvyi
872986926e
fix: merge clippy fix 2025-07-23 17:44:40 +03:00
Oleksandr Pravdyvyi
d9ced25e98
Merge branch 'main' into schouhy/add-clippy-to-ci 2025-07-23 17:41:40 +03:00
Pravdyvy
128b58127b
Merge pull request #91 from vacp2p/schouhy/add-signatures-to-transactions
Add signature validation for transactions in sequencer
2025-07-23 17:36:59 +03:00
Oleksandr Pravdyvyi
dfb28abbe7
fix: ci rerun 2025-07-23 16:12:37 +03:00
Oleksandr Pravdyvyi
8604a672bd
fix: merge fix 2025-07-23 15:53:00 +03:00
Oleksandr Pravdyvyi
0f82c0ec05
Merge branch 'main' into schouhy/add-clippy-to-ci 2025-07-23 15:41:53 +03:00
Oleksandr Pravdyvyi
5b2af29efd
fix: fixes and retrieval methods 2025-07-23 15:16:53 +03:00
Sergio Chouhy
bf139aa634 improve error messages 2025-07-22 13:56:56 -03:00
Sergio Chouhy
db5815ec09 add docstrings 2025-07-22 13:44:52 -03:00
Sergio Chouhy
693aa0c9f7 improve error messages 2025-07-22 13:36:12 -03:00
Sergio Chouhy
3e54156abf improve test so that it covers the map update logic 2025-07-22 13:25:15 -03:00
Sergio Chouhy
5dd7d25762 nit 2025-07-22 12:58:54 -03:00
Sergio Chouhy
98631721fa add test 2025-07-22 12:27:42 -03:00
Sergio Chouhy
c9574b0d09 add test 2025-07-22 11:13:19 -03:00
Sergio Chouhy
1afb77e63e use correct rpc error 2025-07-22 10:37:04 -03:00
Sergio Chouhy
13536e69af add test 2025-07-22 10:34:57 -03:00
Sergio Chouhy
9d85ea234e add get transaction by hash rpc method 2025-07-22 10:23:52 -03:00
Oleksandr Pravdyvyi
9f8724ee4c
feat: native token transactions 2 2025-07-22 15:22:20 +03:00
Sergio Chouhy
cab71a0e00 return parse error for invalid addresses 2025-07-22 09:13:41 -03:00
Sergio Chouhy
d1cd653ed5 fmt 2025-07-22 08:45:47 -03:00
Sergio Chouhy
f3aaacb6ca add get_balance rpc method 2025-07-22 08:40:04 -03:00
Oleksandr Pravdyvyi
3eee533a17
Merge branch 'schouhy/add-signatures-to-transactions' into Pravdyvy/state-transition-token-transfer 2025-07-22 12:27:35 +03:00
Sergio Chouhy
5de28c062e remove usage of prehash sinc it is hazard material. Prefer use of secure api 2025-07-21 21:07:16 -03:00
Sergio Chouhy
71fdce8050 remove unused dependencies 2025-07-21 19:13:43 -03:00
Sergio Chouhy
361e3b6f76 fmt 2025-07-21 19:08:47 -03:00
Sergio Chouhy
b3323c78cf clippy 2025-07-21 18:46:50 -03:00
Sergio Chouhy
a6cb55221b Merge branch 'main' into schouhy/add-signatures-to-transactions 2025-07-21 17:58:02 -03:00
Sergio Chouhy
39b4c866a1 fix double-hashing bug 2025-07-21 17:50:08 -03:00
Sergio Chouhy
4580812b64
Merge pull request #89 from vacp2p/schouhy/remove-precomputed-hash-from-transaction
Remove precomputed hash from Transaction
2025-07-21 14:41:44 -03:00
Oleksandr Pravdyvyi
5e3476673e
fix: build substraction 2025-07-21 12:48:22 +03:00
Oleksandr Pravdyvyi
ca3a63a885
fix: ci update test 2025-07-21 11:46:01 +03:00
Oleksandr Pravdyvyi
59501f2ca5
fix: run retry 2025-07-18 15:36:01 +03:00
Oleksandr Pravdyvyi
9646152550
fix: more lints fix 2025-07-18 14:07:06 +03:00
Pravdyvy
7d11c95be8
Update lint-ubuntu.sh 2025-07-18 12:36:53 +03:00
Oleksandr Pravdyvyi
140a051fc9 Merge branch 'main' into Pravdyvy/state-transition-token-transfer 2025-07-18 12:35:34 +03:00
Oleksandr Pravdyvyi
3bc2f6aba7 fix: refetch 2025-07-18 12:29:32 +03:00
Oleksandr Pravdyvyi
eb16534ad9 fix: fmt 2025-07-18 11:25:50 +03:00
Oleksandr Pravdyvyi
b9d3f921e9 fix: latest lint fixes 2025-07-18 11:13:45 +03:00
Oleksandr Pravdyvyi
1c4ec47f1a Merge branch 'main' into schouhy/add-clippy-to-ci 2025-07-18 10:11:50 +03:00
Sergio Chouhy
6d5e2a1a9f change variable name 2025-07-17 08:36:46 -03:00
Sergio Chouhy
5b49156a5f Merge branch 'main' into schouhy/remove-precomputed-hash-from-transaction 2025-07-17 08:17:32 -03:00
Sergio Chouhy
a4deb42d3d Merge branch 'main' into schouhy/add-signatures-to-transactions 2025-07-17 08:09:46 -03:00
Pravdyvy
103804683d
Merge pull request #86 from vacp2p/Pravdyvy/utxo-nullifier-fix
UTXO nullifier calculation fix and circuits updates
2025-07-17 13:48:49 +03:00
Pravdyvy
50fed7ae42
Merge pull request #88 from vacp2p/Pravdyvy/sequencer-account-store-modifications
SequencerAccountsStore updates
2025-07-17 13:46:57 +03:00
Pravdyvy
da7285856c
Merge pull request #87 from vacp2p/zkvm_tests
Zkvm tests
2025-07-17 13:46:25 +03:00
Oleksandr Pravdyvyi
de8462803d fix: api rate limit refetch 2025-07-17 11:51:46 +03:00
Oleksandr Pravdyvyi
9097762a53 feat: node side of public native token transfer 1 2025-07-17 11:47:38 +03:00
Pravdyvy
9954f8e0da
Update Cargo.toml 2025-07-17 09:04:24 +03:00
Pravdyvy
085d7b4c95
Update Cargo.toml 2025-07-17 09:04:00 +03:00
Pravdyvy
d1a7b03b55
Update Cargo.toml 2025-07-17 09:02:27 +03:00
Pravdyvy
14da838637
Update Cargo.toml 2025-07-17 09:01:26 +03:00
Pravdyvy
0211ff78e1
Update Cargo.toml 2025-07-17 08:56:11 +03:00
Oleksandr Pravdyvyi
8b6769d7e8 fix: comments fix 2 2025-07-17 08:22:04 +03:00
Oleksandr Pravdyvyi
00532b564b fix: comments fix 1 2025-07-17 08:09:27 +03:00
Oleksandr Pravdyvyi
19de364958 fix: zkvm version bump 2025-07-17 07:53:03 +03:00
Sergio Chouhy
91ca3af477
Merge pull request #93 from vacp2p/schouhy-add-mit-license
Add MIT LICENSE
2025-07-16 17:50:47 -03:00
Sergio Chouhy
079b343981 remove unused hash parameter in dummy function 2025-07-16 13:51:13 -03:00
Sergio Chouhy
c60c7235c1 add getter for transaction body and test it 2025-07-16 13:30:30 -03:00
Sergio Chouhy
e79c30f765 add test for signing key getter 2025-07-16 13:30:30 -03:00
Sergio Chouhy
b6ea00daa4 add transactions tests 2025-07-16 13:30:30 -03:00
Sergio Chouhy
ab06501e04 rename scenarios 2025-07-16 13:30:30 -03:00
Sergio Chouhy
8b1d3b478c minor refactor 2025-07-16 13:30:30 -03:00
Sergio Chouhy
b1724ec235 move mempool checks outside transaction check function 2025-07-16 13:30:30 -03:00
Sergio Chouhy
1ef7be0af6 add pem feature to k256 and remove manual impls of Serialize and Deserialize 2025-07-16 13:30:28 -03:00
Sergio Chouhy
e7b727c0ba make sequencer validate transaction signatures before adding transactions to blocks 2025-07-16 13:30:28 -03:00
Sergio Chouhy
6e48bcfd9e sign transactions from node's end 2025-07-16 13:30:24 -03:00
Sergio Chouhy
f02c97e622 rename structs. Implement serde for AuthenticatedTransaction 2025-07-16 13:30:24 -03:00
Sergio Chouhy
a174eb4b85 add un/verified signed transaction structs 2025-07-16 13:30:18 -03:00
Sergio Chouhy
f0c8e19e64
Create MIT LICENSE 2025-07-16 10:38:59 -03:00
Oleksandr Pravdyvyi
14b35a93c0 feat: new public transaction kind 2025-07-16 12:31:47 +03:00
Oleksandr Pravdyvyi
38b57df883 fix: rate limit refetch 2025-07-16 08:18:44 +03:00
Oleksandr Pravdyvyi
eee7cc1397 fix: comments fix 2025-07-16 08:10:49 +03:00
Oleksandr Pravdyvyi
90205c6330 fix: account masks updates to safe state 2025-07-15 12:49:19 +03:00
Oleksandr Pravdyvyi
2078867d7b Merge branch 'schouhy/update-risc0-version' into Pravdyvy/utxo-nullifier-fix 2025-07-15 12:33:43 +03:00
Oleksandr Pravdyvyi
a24a40f4bc fix: docs added 2025-07-14 13:25:40 +03:00
Oleksandr Pravdyvyi
5f4d6c0f8d fix: additional test with other accounts 2025-07-14 13:17:46 +03:00
Oleksandr Pravdyvyi
a43a32fc55 feat: initial accounts configuration 2025-07-14 10:43:35 +03:00
Moudy
d76358c37f
Update README.md 2025-07-13 23:12:31 +02:00
Oleksandr Pravdyvyi
5e9c6a0677 feat: preset accounts in sequencer account store 2025-07-11 10:34:13 +03:00
Oleksandr Pravdyvyi
b115313955 Merge branch 'schouhy/update-risc0-version' into Pravdyvy/sequencer-account-store-modifications 2025-07-11 07:52:53 +03:00
Sergio Chouhy
b49f38ca4b avoid computing hash multiple times in transaction_pre_check 2025-07-10 14:35:41 -03:00
Sergio Chouhy
e79261a566 Merge branch 'schouhy/update-risc0-version' into schouhy/remove-precomputed-hash-from-transaction 2025-07-10 14:16:55 -03:00
Sergio Chouhy
1d4548fb3b bump risc0 version to 2.2 2025-07-10 14:15:07 -03:00
Sergio Chouhy
e286108bb5 add TODO to remove unwrap 2025-07-10 13:00:27 -03:00
Sergio Chouhy
81b6d34693 add Transaction::hash inline docs 2025-07-10 12:52:48 -03:00
Sergio Chouhy
b16575b407 fmt 2025-07-10 12:16:05 -03:00
Sergio Chouhy
f01be72d8f move impl of hash to existing impl Transaction block 2025-07-10 12:15:37 -03:00
Sergio Chouhy
e1e018fcfc remove redundant TransactionPayload struct 2025-07-10 12:13:36 -03:00
Sergio Chouhy
16e3a682fe add test for hash function 2025-07-10 12:09:01 -03:00
Sergio Chouhy
789dec673e remove hash attribute from Transaction and use a method instead 2025-07-10 11:35:46 -03:00
Oleksandr Pravdyvyi
54284be74b fix: account data public only for sequencer 2025-07-09 16:03:30 +03:00
Oleksandr Pravdyvyi
8e987847ee feat: AccountPublicData struct changed 2025-07-09 08:16:12 +03:00
Rostyslav Tyshko
28005ae633 fmt 2025-06-26 23:18:30 -04:00
Rostyslav Tyshko
b31f753c11 add test_prove_send_utxo_multiple_assets_one_receiver 2025-06-26 23:18:18 -04:00
Rostyslav Tyshko
a5c8e5125c add test_prove_send_utxo_shielded 2025-06-26 23:17:58 -04:00
Rostyslav Tyshko
553e37b701 add test_prove_send_utxo_deshielded 2025-06-26 23:17:34 -04:00
Rostyslav Tyshko
90231f76cc add test_prove_send_utxo 2025-06-26 23:17:14 -04:00
Rostyslav Tyshko
d9696e77eb add test_prove_mint_utxo 2025-06-26 23:16:56 -04:00
Rostyslav Tyshko
d0c5040fe9 add test_execute_mint_utxo 2025-06-26 23:16:37 -04:00
Rostyslav Tyshko
eb14d632d9 add test_gas_limits_check_insufficient_funds 2025-06-26 23:15:45 -04:00
Rostyslav Tyshko
2fadf0c82f add test_gas_limits_check_sufficient_funds 2025-06-26 23:15:14 -04:00
Rostyslav Tyshko
c1aa0d0004 fix unused results 2025-06-26 22:19:10 -04:00
Oleksandr Pravdyvyi
5d5dde33b7 fix: utxo nullifier calculation fix and circuits updates 2025-06-26 07:21:31 +03:00
tyshko-rostyslav
5172a95f53
Merge pull request #85 from vacp2p/schouhy/add-pr-template
Add PR template
2025-06-20 07:09:53 +02:00
Sergio Chouhy
352c97f25c update with suggestions 2025-06-19 09:20:44 -03:00
Oleksandr Pravdyvyi
3f9d671fb1 fix: lint fix probably latest 2025-06-18 17:26:57 +03:00
Oleksandr Pravdyvyi
ac697c0bd8 fix: lint fix 5 2025-06-18 16:59:29 +03:00
Oleksandr Pravdyvyi
48a43eb268 fix: lint fix 4 2025-06-18 15:58:15 +03:00
Sergio Chouhy
a870650faf add how to test 2025-06-18 09:26:58 -03:00
Sergio Chouhy
7fd44d0247 add PR template 2025-06-18 09:20:41 -03:00
Oleksandr Pravdyvyi
f9eee73ef4 fix: lint fix 3 2025-06-18 14:52:02 +03:00
Oleksandr Pravdyvyi
f491266105 fix: lint fix 2 2025-06-18 14:32:30 +03:00
Oleksandr Pravdyvyi
cdd1bdbfbd fix: lints fix 2025-06-18 13:56:09 +03:00
Oleksandr Pravdyvyi
411d8e9034 Merge branch 'main' into Pravdyvy/lints-fix 2025-06-18 12:44:09 +03:00
tyshko-rostyslav
e826fc4a31
Merge pull request #82 from vacp2p/start_from_block
Start from snapshot block
2025-06-18 11:35:24 +02:00
Rostyslav Tyshko
5e3fd4bbf8 update risc0 version 2025-06-11 02:08:36 -04:00
Rostyslav Tyshko
adb802f28e redundunt 2025-06-11 01:46:35 -04:00
Rostyslav Tyshko
31722b2f72 fmt 2025-06-11 01:25:47 -04:00
Rostyslav Tyshko
a65dcd518d add test_new_recovers_from_snapshot 2025-06-11 01:23:28 -04:00
Rostyslav Tyshko
b62821cb74 add test_new_initializes_correctly 2025-06-11 01:23:12 -04:00
Rostyslav Tyshko
62f06582ef AccMap struct for HashMap<[u8;32], Account>, serialization 2025-06-11 01:22:48 -04:00
Rostyslav Tyshko
222b0136bf AccountForSerialization struct for Account serialization 2025-06-11 01:20:46 -04:00
Rostyslav Tyshko
720263ae2d fix after merge 2025-06-10 01:39:11 -04:00
Rostyslav Tyshko
b77289937f Merge branch 'main' into start_from_block 2025-06-10 01:33:19 -04:00
tyshko-rostyslav
bf4097aa60
Merge pull request #81 from vacp2p/Pravdyvyi/periodic-snapshots-storing
Periodic snapshooting
2025-06-10 07:17:23 +02:00
Rostyslav Tyshko
d755a529ef fmt 2025-05-30 16:19:54 -04:00
Rostyslav Tyshko
79d8bfb864 fix test_open_db_restart 2025-05-30 16:19:40 -04:00
Rostyslav Tyshko
b57d6f5d21 rm test for useless case 2025-05-30 15:58:57 -04:00
Rostyslav Tyshko
baf43f9780 fix build CI 2025-05-30 15:38:48 -04:00
Rostyslav Tyshko
4d7cda0001 Merge branch 'main' into start_from_block 2025-05-30 15:28:31 -04:00
Rostyslav Tyshko
0c9bbb5dde fmt 2025-05-30 15:25:21 -04:00
Rostyslav Tyshko
9cd81c62eb fix start_from_config_update_chain fn 2025-05-30 15:25:02 -04:00
Rostyslav Tyshko
9609595525 fix NodeChainStore's new fn according to snapshoting logic 2025-05-30 15:24:40 -04:00
Rostyslav Tyshko
6a351419d6 imports 2025-05-30 15:24:06 -04:00
Rostyslav Tyshko
a9f8dff7e9 same 2025-05-30 15:23:55 -04:00
Rostyslav Tyshko
9b8ddb0580 add deserialization of nullifier and transaction from snapshot 2025-05-30 15:23:41 -04:00
Rostyslav Tyshko
87e6363686 addblock id getter, deserialization of account and commintmant from snapshot 2025-05-30 15:23:09 -04:00
Rostyslav Tyshko
88da732d5c clear out situation when one tries to start a DB without a block 2025-05-30 15:22:15 -04:00
Rostyslav Tyshko
13d8c72a82 serialize/deserialize TopSecretKeyHolder and UTXOSecretKeyHolder 2025-05-30 15:20:52 -04:00
Rostyslav Tyshko
fe79365c63 serialize/deserialize AddressKeyHolder 2025-05-30 15:20:29 -04:00
Rostyslav Tyshko
5e9499873d serialize/deserialize Account 2025-05-30 15:20:14 -04:00
Oleksandr Pravdyvyi
8cbb8089fb fix: suggestion added 2 2025-05-30 19:26:59 +03:00
Oleksandr Pravdyvyi
5df8763166 fix: suggestion added 1 2025-05-30 14:08:06 +03:00
tyshko-rostyslav
6a5ec2d953
Merge pull request #77 from vacp2p/schouhy/update-utxo-crate-3-add-randomness
3/3 Update utxo crate: Add randomness to UTXO
2025-05-30 08:45:39 +02:00
Oleksandr Pravdyvyi
7e47ecd91e fix: warn fix 2025-05-30 09:29:56 +03:00
Oleksandr Pravdyvyi
894ba19345 fix: fmt 2025-05-30 09:06:39 +03:00
Oleksandr Pravdyvyi
9d3bda9bce fix: fmt 2025-05-30 08:50:35 +03:00
Sergio Chouhy
014cbc3c4d Merge branch 'main' into schouhy/update-utxo-crate-3-add-randomness 2025-05-29 11:06:24 -03:00
Oleksandr Pravdyvyi
66def746e6 feat: periodic snapshooting 2025-05-29 12:00:50 +03:00
Pravdyvy
0d577da288
Merge pull request #73 from vacp2p/Pravdyvy/sparse-merkle-tree-storage-preparation
Sparse Merkle Tree -> HashSet Migration
2025-05-28 21:17:40 +03:00
Oleksandr Pravdyvyi
9ad013253a fix: suggestions added 2 2025-05-28 20:32:43 +03:00
tyshko-rostyslav
81ae388ac4
Merge pull request #74 from vacp2p/storage-merkle-tree-preparation
Hash Storage merkle tree serialization
2025-05-28 07:29:34 +02:00
tyshko-rostyslav
880c0e6802
Merge pull request #80 from vacp2p/snapshhot_preparation
DB Snapshot preparation
2025-05-28 07:26:18 +02:00
Oleksandr Pravdyvyi
8d3ee36392 fix: suggersion added 1 2025-05-28 08:23:54 +03:00
Rostyslav Tyshko
a642946665 add asserts to test 2025-05-28 01:05:44 -04:00
tyshko-rostyslav
895c6490bb
Merge pull request #76 from vacp2p/schouhy/update-utxo-crate-2-remove-nullifier-attribute
2/3 Update utxo crate: Remove nullifier attribute from UTXO
2025-05-27 07:04:50 +02:00
Rostyslav Tyshko
0b1a1c03dc fmt 2025-05-23 15:51:31 -04:00
Rostyslav Tyshko
b69969942a add out fn for transaction, nullifier and account 2025-05-23 15:51:21 -04:00
Rostyslav Tyshko
c71e1b9f8b add out fn for block_id and commitment 2025-05-23 15:50:51 -04:00
Rostyslav Tyshko
611436a943 add getters for account 2025-05-23 15:50:16 -04:00
Rostyslav Tyshko
ee26147dde add getters for transaction and nullifier 2025-05-23 15:49:59 -04:00
Rostyslav Tyshko
4350b69a18 add getters for block_id and commitment 2025-05-23 15:49:27 -04:00
Rostyslav Tyshko
caaa6108d8 add handle for snapshot 2025-05-23 15:48:09 -04:00
Rostyslav Tyshko
a53e8f708c fix destroy fn 2025-05-23 15:47:51 -04:00
Rostyslav Tyshko
d9e82f4ffc fix new fn 2025-05-23 15:47:39 -04:00
Rostyslav Tyshko
b89dcb7fca add new db keys 2025-05-23 15:47:20 -04:00
Rostyslav Tyshko
e94173aa12 add new column family 2025-05-23 15:46:52 -04:00
Oleksandr Pravdyvyi
958e1dcb9c fix: tests fix 2025-05-23 09:10:34 +03:00
Oleksandr Pravdyvyi
9bf0ec9de7 fix: fmt 2025-05-23 09:07:53 +03:00
Oleksandr Pravdyvyi
cb22a95df2 fix: smt/imt replaced with sets 2025-05-23 09:04:04 +03:00
Oleksandr Pravdyvyi
00297db3ab feat: indexed tree migration 1 2025-05-22 00:13:17 +03:00
Oleksandr Pravdyvyi
00fe02c1d1 fix: merge updates 2025-05-21 08:34:03 +03:00
Oleksandr Pravdyvyi
77062e2e4e Merge branch 'main' into Pravdyvy/sparse-merkle-tree-storage-preparation 2025-05-21 08:31:15 +03:00
tyshko-rostyslav
f33c2f14e5
Merge pull request #75 from vacp2p/schouhy/update-utxo-crate-1-remove-utxo-tree
1/3 Update utxo crate: Remove UTXO Tree
2025-05-20 13:36:44 +02:00
tyshko-rostyslav
e6184e4bd8
Merge pull request #67 from vacp2p/schouhy/fix-shared-key-derivation
Fix AES key derivation for encryption / decryption
2025-05-20 13:36:27 +02:00
Sergio Chouhy
f8c925c265 add clippy to CI 2025-05-17 18:10:57 -03:00
Sergio Chouhy
da5a0c8749 clippy 2025-05-17 17:01:50 -03:00
Sergio Chouhy
ecaa6874ce fix imports 2025-05-17 17:00:41 -03:00
Sergio Chouhy
67422a5cd8 fmt 2025-05-16 22:33:38 -03:00
Sergio Chouhy
81f0cf72ae fix unused imports 2025-05-16 22:25:28 -03:00
Sergio Chouhy
ef5d026074 fix tests 2025-05-16 22:23:35 -03:00
Sergio Chouhy
b6700f8adb fmt 2025-05-16 22:21:43 -03:00
Sergio Chouhy
efcd797648 fmt 2025-05-16 22:07:34 -03:00
Sergio Chouhy
f4b9aaffef Remove nullifier attribute 2025-05-16 22:07:34 -03:00
Sergio Chouhy
6aa6c9d34f fmt 2025-05-16 22:06:06 -03:00
Sergio Chouhy
1490b51f71 add randomness to UTXO 2025-05-16 21:55:25 -03:00
Sergio Chouhy
4524177931 fmt 2025-05-16 20:54:11 -03:00
Sergio Chouhy
f1643492bc Remove nullifier attribute 2025-05-16 20:46:55 -03:00
Sergio Chouhy
b565c65628 fmt 2025-05-16 20:46:40 -03:00
Sergio Chouhy
c6a4a00fda remove utxo tree 2025-05-16 20:25:23 -03:00
Rostyslav Tyshko
4ba4c12a87 rm unused 2025-05-16 19:16:45 -04:00
Sergio Chouhy
f50ef5be9a wip 2025-05-16 19:59:51 -03:00
Rostyslav Tyshko
b4c0fb9351 fmt 2025-05-16 18:40:45 -04:00
Rostyslav Tyshko
2346f06d23 add a test 2025-05-16 18:39:39 -04:00
Rostyslav Tyshko
cdb8e3a08a impleDeserialize for HashStorageMerkleTree 2025-05-16 18:39:24 -04:00
Rostyslav Tyshko
9df2b51813 imple Visitor for HashStorageMerkleTreeDeserializer 2025-05-16 18:38:36 -04:00
Rostyslav Tyshko
0daffaf4ad HashStorageMerkleTreeDeserializer 2025-05-16 18:37:58 -04:00
Rostyslav Tyshko
96dc9bd840 serialize for HashStorageMerkleTree 2025-05-16 18:37:38 -04:00
Oleksandr Pravdyvyi
cde9f0a5c8 feat: sparse trees preparation for serialization 2025-05-15 11:38:37 +03:00
tyshko-rostyslav
25ef949a97
Merge pull request #63 from vacp2p/Pravdyvyi/issue-fix
Various qol and fixes
2025-05-08 17:04:16 +02:00
tyshko-rostyslav
7b2c22f0ba
Merge pull request #62 from vacp2p/schouhy/fix-register-account
Fix register account method
2025-05-08 16:52:11 +02:00
Sergio Chouhy
74d8fd54d9 fix tests 2025-05-07 16:52:08 -03:00
Sergio Chouhy
7572188ab0 fmt 2025-05-07 16:37:03 -03:00
Sergio Chouhy
7a117150ef remove usage of deprecated function 2025-05-07 16:36:30 -03:00
Sergio Chouhy
837cc31a93 use x coordinate as key for aes 2025-05-07 16:34:52 -03:00
Oleksandr Pravdyvyi
aa88d1c8f4 fix: fmt fix 2025-04-25 09:08:43 +03:00
Oleksandr Pravdyvyi
456016959a fix: warning fix 2025-04-25 08:48:30 +03:00
Oleksandr Pravdyvyi
825e80a5a0 fix: issue fix 2025-04-24 15:51:34 +03:00
Sergio Chouhy
7760b95a41 Fix register account method 2025-04-23 11:26:47 -03:00
Oleksandr Pravdyvyi
73d0f75844 Merge branch 'main' into Pravdyvyi/issue-fix 2025-04-23 10:09:14 +03:00
tyshko-rostyslav
a9b7f061fe
Merge pull request #60 from vacp2p/refactor-cont
Refactor continued
2025-04-23 08:56:46 +02:00
tyshko-rostyslav
72bf31a828
Merge pull request #59 from vacp2p/Pravdyvy/refactor-1
Storage primitives split
2025-04-23 08:56:24 +02:00
Oleksandr Pravdyvyi
a959ff78c9 fix: eph key deser fix 2025-04-23 09:27:06 +03:00
Rostyslav Tyshko
257044b210 fmt 2025-04-18 11:45:01 -04:00
Rostyslav Tyshko
92b9fe252a fix ci scripts 2025-04-18 08:17:56 -04:00
Rostyslav Tyshko
9f5ac1af94 add env file 2025-04-18 08:17:46 -04:00
Rostyslav Tyshko
b85633fa6e fix const use 2025-04-18 08:17:40 -04:00
Rostyslav Tyshko
35cc38a947 nullifier and viewing consts 2025-04-18 08:17:28 -04:00
Rostyslav Tyshko
bcef0650dc add lazy_static to toml file 2025-04-18 08:16:56 -04:00
Rostyslav Tyshko
1a33d464f0 rm unused 2025-04-18 08:16:26 -04:00
Rostyslav Tyshko
56bb3dba6a fix public context rs 2025-04-18 08:16:13 -04:00
Rostyslav Tyshko
4f86b3cd31 fix process rs node rs 2025-04-18 08:15:46 -04:00
Rostyslav Tyshko
c27be69d92 rm unused 2025-04-18 08:15:29 -04:00
Rostyslav Tyshko
d48924ed01 rm unused 2025-04-18 08:15:21 -04:00
Rostyslav Tyshko
3921841630 fix net_utils rs 2025-04-18 08:15:11 -04:00
Rostyslav Tyshko
c617fcc6e4 fix process rs 2025-04-18 08:14:57 -04:00
Rostyslav Tyshko
93ef263c5e leftover 2025-04-18 08:14:43 -04:00
Rostyslav Tyshko
e09735a3c2 fix rust_log 2025-04-18 08:14:31 -04:00
Rostyslav Tyshko
c6b784266b rm parse rs 2025-04-18 08:14:18 -04:00
Rostyslav Tyshko
7336ccb660 rm core primitives 2025-04-18 08:14:09 -04:00
tyshko-rostyslav
373e3b953d
Merge pull request #57 from vacp2p/provability
Implementation of Public State Provability
2025-04-16 12:27:31 -04:00
tyshko-rostyslav
e430c02c7f
Merge pull request #58 from vacp2p/Pravdyvy/deterministic-serilization-of-context-fix
Deterministic serialization of public sc context
2025-04-16 12:27:19 -04:00
Oleksandr Pravdyvyi
8e4956891c fix: refactor 1 2025-04-16 16:17:53 +03:00
Oleksandr Pravdyvyi
46361868ed fix: additional tests for context serialization 2025-04-14 01:50:44 +03:00
Oleksandr Pravdyvyi
80192ea42a fix: PublicSCContext stable serialization 2025-04-10 15:57:33 +03:00
Rostyslav Tyshko
7b82c5b00c fmt 2025-04-09 02:20:27 -04:00
Rostyslav Tyshko
e75db3b73d fix tests 2025-04-09 02:03:01 -04:00
Rostyslav Tyshko
b3d96d8b53 taplo 2025-04-09 02:01:18 -04:00
Rostyslav Tyshko
0db4a60399 lint 2025-04-09 01:38:57 -04:00
Rostyslav Tyshko
bc99026521 fmt 2025-04-09 01:38:22 -04:00
Rostyslav Tyshko
2779e2e18c style 2025-04-09 01:38:02 -04:00
Rostyslav Tyshko
0b37cb6634 split_utxo add commitments 2025-04-09 01:36:44 -04:00
Rostyslav Tyshko
cce349ff15 transfer_utxo_deshielded add commitments 2025-04-09 01:36:23 -04:00
Rostyslav Tyshko
9f5276a497 transfer_balance_shielded add commitments 2025-04-09 01:36:07 -04:00
Rostyslav Tyshko
e9a2cf361d transfer_utxo_multiple_assets_private add commitments 2025-04-09 01:35:44 -04:00
Rostyslav Tyshko
8a4606f5d3 transfer_utxo_private add commitments 2025-04-09 01:35:19 -04:00
Rostyslav Tyshko
e7249002e5 mint_utxo_multiple_assets_private add commitments 2025-04-09 01:34:57 -04:00
Rostyslav Tyshko
7a57b4f51c vec_u8_to_vec_u64 helper 2025-04-09 01:34:21 -04:00
Rostyslav Tyshko
10e779c1e9 mint_utxo_private commitments 2025-04-09 01:34:03 -04:00
Rostyslav Tyshko
3d56c52291 lock file 2025-04-09 01:33:27 -04:00
Rostyslav Tyshko
def10dea18 serialiaze AccountPublicMask 2025-04-09 01:33:20 -04:00
Rostyslav Tyshko
8b811ae65f add dependency to core_primitives 2025-04-09 01:33:09 -04:00
Rostyslav Tyshko
94493d1051 fix core primitives 2025-04-09 01:32:57 -04:00
Rostyslav Tyshko
593235a09f add dependency to sequencer_core 2025-04-09 01:32:34 -04:00
Rostyslav Tyshko
6447545ec4 serialiaze PublicSCContext 2025-04-09 01:32:16 -04:00
Rostyslav Tyshko
d6b6d92122 add dependency to storage 2025-04-09 01:31:52 -04:00
Rostyslav Tyshko
ded84933b2 get_sc_sc_state for NodeBlockStore 2025-04-09 01:31:39 -04:00
Rostyslav Tyshko
aa93d26b80 function to create pedersen commitments for multiple values 2025-04-09 01:31:20 -04:00
Rostyslav Tyshko
31655f2c35 function to create pedersen commitments 2025-04-09 01:31:05 -04:00
Rostyslav Tyshko
97aeb48109 rpc error pushthrough 2025-04-09 01:30:26 -04:00
Rostyslav Tyshko
bbb84cd849 add new type of error, since we have a new interaction 2025-04-09 01:30:10 -04:00
Rostyslav Tyshko
0113925b92 fix rtansaction for tests 2025-04-09 01:29:35 -04:00
Rostyslav Tyshko
250dec1ae6 fix transaction payload 2025-04-09 01:29:19 -04:00
Rostyslav Tyshko
8fc244b271 add pedersen commitments to Transaction and TransactionPayload struct 2025-04-09 01:28:56 -04:00
tyshko-rostyslav
bfe39185fa
Merge pull request #56 from vacp2p/serde_json_vs_group_encoding
`serde_json` instead of `GroupEncoding` serialization
2025-04-08 14:25:09 -04:00
tyshko-rostyslav
45555782c6
Merge pull request #55 from vacp2p/Pravdyvyi/sc-public-context
Smart contract public context
2025-04-08 14:24:56 -04:00
tyshko-rostyslav
a893cce2f7
Merge pull request #54 from vacp2p/bug-fix-sc-storage
SC public stage storage testing
2025-04-08 14:23:41 -04:00
tyshko-rostyslav
df57293ebb
Merge pull request #53 from vacp2p/Pravdyvy/db-sc-public-data-storage
Smart contract public state storage in DB
2025-04-08 14:23:24 -04:00
Rostyslav Tyshko
33934f1e05 fmt 2025-04-04 15:23:19 -04:00
Rostyslav Tyshko
a9bd1a1a5c replace serilization in sequencer 2025-04-04 15:02:12 -04:00
Rostyslav Tyshko
6066554a7a replace serilization in key_management secret holder 2025-04-04 15:02:03 -04:00
Rostyslav Tyshko
59e6ee8240 replace serilization in key_management ephm key holder 2025-04-04 14:56:30 -04:00
Rostyslav Tyshko
2f3a6ab921 replace serilization in key_management 2025-04-04 14:55:50 -04:00
Rostyslav Tyshko
bd35f5e025 fix log 2025-04-04 14:39:37 -04:00
Rostyslav Tyshko
a1ba0894d9 build fix 2025-04-04 14:39:27 -04:00
Rostyslav Tyshko
4b0666c617 fmt 2025-04-04 14:14:04 -04:00
Rostyslav Tyshko
ef3125b48e fix eph_key_compressed AffinePoint serialization 2025-04-04 14:13:51 -04:00
Rostyslav Tyshko
691bc1d4e6 change serialization in node core lib rs 2025-04-04 14:12:46 -04:00
Oleksandr Pravdyvyi
88c30645e7 fix: warning fix 2025-04-04 13:01:41 +03:00
Oleksandr Pravdyvyi
0b1df5b3d5 fix: public context structure added 2025-04-04 12:11:54 +03:00
Rostyslav Tyshko
4ff5fe895b fix bug 2025-04-03 18:37:36 -04:00
Rostyslav Tyshko
ae5645251d add test_compare_blob_lists_modified 2025-04-03 18:37:23 -04:00
Rostyslav Tyshko
6b302a051f add test_compare_blob_lists_deleted 2025-04-03 18:37:05 -04:00
Rostyslav Tyshko
2aec310c1e add test_compare_blob_lists_created 2025-04-03 18:36:44 -04:00
Rostyslav Tyshko
dc1f975f13 add test_produce_blob_list_from_sc_public_state 2025-04-03 18:36:24 -04:00
Rostyslav Tyshko
5b2098c9f7 add test_produce_blob_from_fit_vec_panic 2025-04-03 18:36:06 -04:00
Rostyslav Tyshko
4193094232 add test_produce_blob_from_fit_vec 2025-04-03 18:35:41 -04:00
Oleksandr Pravdyvyi
d84a134904 fix: merge fix 2025-04-03 10:36:38 +03:00
Oleksandr Pravdyvyi
a05cde7256 Merge branch 'main' into Pravdyvy/db-sc-public-data-storage 2025-04-03 10:34:32 +03:00
tyshko-rostyslav
ea20f0be48
Merge pull request #52 from vacp2p/Pravdyvy/UTXO-encoded-with-a-tag
UTXO with tags
2025-04-03 00:22:34 -04:00
tyshko-rostyslav
dd3bcc8f73
Merge pull request #51 from vacp2p/Pravdyvy/core-primitives
Core primitives
2025-04-02 22:51:08 -04:00
Oleksandr Pravdyvyi
dadf6ffb1d fix: rosc0 version fix 2025-04-02 13:19:45 +03:00
Oleksandr Pravdyvyi
7083e77d9c fix: risc0 version bump 2025-04-02 12:43:14 +03:00
Oleksandr Pravdyvyi
dd976dee00 fix: db public sc data added 2025-04-02 12:16:02 +03:00
Oleksandr Pravdyvyi
305e8d7296 fix: risc0 version bump 2025-03-28 17:45:02 +02:00
Oleksandr Pravdyvyi
437a3a5700 feat: making tags for utxo to privately filter decoding attempts 2025-03-28 17:12:28 +02:00
Oleksandr Pravdyvyi
2c7326d3fc fix: warning fix 2025-03-17 13:41:53 +02:00
Oleksandr Pravdyvyi
7f512474dc fix: adding core primitives crate 2025-03-17 13:18:44 +02:00
tyshko-rostyslav
90c8b50689
Merge pull request #50 from vacp2p/sc_core_crypto
Sc core cryptography and usage
2025-03-17 07:16:21 -04:00
Rostyslav Tyshko
e808422320 warnings 2025-03-16 11:37:23 -04:00
Rostyslav Tyshko
45cb6b21a2 fmt 2025-03-16 11:05:55 -04:00
Rostyslav Tyshko
5708735ca8 sc_core reuse in node_core 2025-03-16 11:05:44 -04:00
Rostyslav Tyshko
bcbe8a73b8 other deps for cryptography 2025-03-16 11:05:27 -04:00
Rostyslav Tyshko
c5a9c81642 crypto dn added 2025-03-16 11:05:08 -04:00
Rostyslav Tyshko
75e5652bf6 deps for cryptography 2025-03-16 11:04:48 -04:00
tyshko-rostyslav
af458635e2
Merge pull request #49 from vacp2p/Pravdyvy/sc-core-helpers
Sc Core helperfunctions
2025-03-14 03:54:54 +01:00
Oleksandr Pravdyvyi
847e77ff72 fix: r0vm version fix 2025-03-07 08:51:36 +02:00
Oleksandr Pravdyvyi
f4aa3e7c18 feat: sc core helpers and manipulators 2025-03-07 05:37:15 +02:00
Pravdyvy
37ce873db8
Merge pull request #48 from vacp2p/Pravdyvy/gas-modeling
Gas Calculation Model
2025-03-05 10:22:44 +02:00
Oleksandr Pravdyvyi
ace1021959 fix: updated rosc0 version 2025-02-28 13:07:22 +02:00
Oleksandr Pravdyvyi
470d1ae3ec fix: gas calculation model 2025-02-28 12:32:54 +02:00
tyshko-rostyslav
c3b5921d14
Merge pull request #47 from vacp2p/Pravdyvy/fixed-error-propagation
Fixed error propagation
2025-02-21 14:52:38 +01:00
Oleksandr Pravdyvyi
9300b786f8 fix: taplo fmt 2025-02-14 11:08:28 +02:00
Oleksandr Pravdyvyi
443ee9bb4e fix: merge fix 2025-02-14 10:58:54 +02:00
Oleksandr Pravdyvyi
620aefec23 Merge branch 'main' into Pravdyvy/fixed-error-propagation 2025-02-14 10:49:34 +02:00
tyshko-rostyslav
b925b3e639
Merge pull request #46 from vacp2p/redundunt
Remove redundunt code
2025-02-14 05:52:17 +01:00
tyshko-rostyslav
09835b0462
Merge pull request #45 from vacp2p/error-handling
Error handling
2025-02-14 05:51:57 +01:00
Rostyslav Tyshko
b88358949c fmt 2025-02-09 11:46:08 -05:00
Rostyslav Tyshko
9c5b4fb3d4 fix imports 2025-02-09 11:45:53 -05:00
Rostyslav Tyshko
e8c14f9185 rm node_rps redundunt code 2025-02-09 11:45:45 -05:00
Rostyslav Tyshko
a0580238a6 add needed deps 2025-02-09 11:45:31 -05:00
Rostyslav Tyshko
01b370d9b6 create common requests module 2025-02-09 11:45:16 -05:00
Rostyslav Tyshko
8815eb836c unused 2025-02-09 11:45:01 -05:00
Rostyslav Tyshko
f472c25349 rm node_core reduncunt code 2025-02-09 11:44:55 -05:00
Rostyslav Tyshko
809cc090e5 rm parse 2025-02-09 11:44:41 -05:00
Rostyslav Tyshko
d34d87c274 rm redundunt structures in json 2025-02-09 11:44:24 -05:00
Rostyslav Tyshko
c4bff550bb lock file changes 2025-02-09 11:44:10 -05:00
Rostyslav Tyshko
818f58e2f9 fmt 2025-02-07 15:17:55 -05:00
Rostyslav Tyshko
bfb79e38d6 propagation in node_core 2025-02-07 15:17:42 -05:00
Rostyslav Tyshko
a52bf50a0f errors in account_core 2025-02-07 15:17:20 -05:00
Rostyslav Tyshko
49750b600f propagation in utxo_core 2025-02-07 15:17:03 -05:00
Rostyslav Tyshko
ffad7c48d2 errors in utxo_tree 2025-02-07 15:16:47 -05:00
Rostyslav Tyshko
43bd2a8314 fix error handing in zkvm module 2025-02-07 15:16:31 -05:00
Oleksandr Pravdyvyi
e96d640082 Merge branch 'main' into Pravdyvy/fixed-error-propagation 2025-02-06 11:52:37 +02:00
tyshko-rostyslav
df9d90d017
Merge pull request #43 from vacp2p/Pravdyvy/node-rpc-docs
JSON RPC DOCS for node RPC
2025-02-06 04:51:09 -05:00
tyshko-rostyslav
bbad30b86d
Merge pull request #42 from vacp2p/chain_state_tests
Chain state validation tests
2025-02-06 04:37:01 -05:00
tyshko-rostyslav
86c12d13a7
Merge pull request #44 from vacp2p/fix_warnings
Fix warnings
2025-02-05 17:45:01 -05:00
Oleksandr Pravdyvyi
bd8b4b8fa8 fix: error propagation 2025-02-05 12:24:09 +02:00
Pravdyvy
4ecb87658b
fix: PATH clarification 2025-02-04 18:20:12 +02:00
Oleksandr Pravdyvyi
c1e8153871 fix: more links 2025-02-04 14:10:36 +02:00
Pravdyvy
d54b0ca556
fix: fix link 2025-02-04 14:06:53 +02:00
Oleksandr Pravdyvyi
c67969efa2 fix: link added, risc0 toockain install instructions added 2025-02-04 14:05:42 +02:00
Rostyslav Tyshko
2f9ce0c5cf fmt 2025-01-31 17:02:44 -05:00
Rostyslav Tyshko
ec702ddc05 build scripts now check for warnings 2025-01-31 17:02:32 -05:00
Rostyslav Tyshko
98ba83e0a4 storage fix warnings 2025-01-31 17:02:17 -05:00
Rostyslav Tyshko
37938a022c sequencer_rpc fix warnings 2025-01-31 17:02:08 -05:00
Rostyslav Tyshko
7ee5f0d448 account_core fix 2025-01-31 17:01:50 -05:00
Rostyslav Tyshko
b98de3d992 var naming 2025-01-31 17:01:39 -05:00
Rostyslav Tyshko
2670fb1b4f lib.rs fix warnings 2025-01-31 16:50:00 -05:00
Rostyslav Tyshko
360981b77d se fix warnings 2025-01-31 16:49:53 -05:00
Rostyslav Tyshko
c693ad434a de fix warnings 2025-01-31 16:49:47 -05:00
Rostyslav Tyshko
67bb04c6c2 private_exec fix warnings 2025-01-31 16:49:41 -05:00
Rostyslav Tyshko
764669398c node_rpc fix warnings 2025-01-31 16:45:55 -05:00
Oleksandr Pravdyvyi
cc3db7d323 fix: format fix 2025-01-31 10:02:09 +02:00
Oleksandr Pravdyvyi
bd7809bc17 fix: rpc docs added 2025-01-31 09:54:19 +02:00
Rostyslav Tyshko
0e30e64534 fmt 2025-01-27 13:51:27 +01:00
Rostyslav Tyshko
01d51c6e45 add test_produce_new_block_with_mempool_transactions 2025-01-27 13:45:01 +01:00
Rostyslav Tyshko
8d63de52f9 add test_push_tx_into_mempool_pre_check 2025-01-27 13:44:45 +01:00
Rostyslav Tyshko
f2a781545b add test_transaction_pre_check_fail_mempool_full 2025-01-27 13:44:30 +01:00
Rostyslav Tyshko
671a1f2923 add test_transaction_pre_check_pass 2025-01-27 13:44:07 +01:00
Rostyslav Tyshko
ef1d95ea2d add test_get_tree_roots 2025-01-27 13:43:45 +01:00
Rostyslav Tyshko
182adad9d2 add test_start_from_config 2025-01-27 13:43:17 +01:00
Rostyslav Tyshko
91de70b7dc add common_setup for tests 2025-01-27 13:42:43 +01:00
Rostyslav Tyshko
aa74dae70f add create_dummy_transaction for tests 2025-01-27 13:42:27 +01:00
Rostyslav Tyshko
4f61d792bc add setup_sequencer_config for tests 2025-01-27 13:42:11 +01:00
tyshko-rostyslav
603461f19a
Merge pull request #41 from vacp2p/Pravdyvy/chain-state-validation
Chain state validation
2025-01-27 12:12:19 +01:00
Oleksandr Pravdyvyi
4a535085c5 fix:chain state validation 2025-01-24 09:10:42 +02:00
404 changed files with 56707 additions and 12687 deletions

61
.deny.toml Normal file
View File

@ -0,0 +1,61 @@
# Config file reference can be found at https://embarkstudios.github.io/cargo-deny/checks/cfg.html.
[graph]
all-features = true
exclude-dev = true
no-default-features = true
[advisories]
ignore = [
{ id = "RUSTSEC-2023-0071", reason = "Marvin Attack: potential key recovery through timing sidechannels" },
{ id = "RUSTSEC-2024-0388", reason = "`derivative` is unmaintained; consider using an alternative. Use `cargo tree -p derivative -i > tmp.txt` to check the dependency tree." },
{ id = "RUSTSEC-2024-0436", reason = "`paste` has a security vulnerability; consider using an alternative. Use `cargo tree -p paste -i > tmp.txt` to check the dependency tree." },
{ id = "RUSTSEC-2025-0055", reason = "`tracing-subscriber` v0.2.25 pulled in by ark-relations v0.4.0 - will be addressed before mainnet" },
{ id = "RUSTSEC-2025-0141", reason = "`bincode` is unmaintained but continuing to use it." },
{ id = "RUSTSEC-2023-0089", reason = "atomic-polyfill is pulled transitively via risc0-zkvm; waiting on upstream fix (see https://github.com/risc0/risc0/issues/3453)" },
]
yanked = "deny"
unused-ignored-advisory = "deny"
[bans]
allow-wildcard-paths = false
multiple-versions = "allow"
[licenses]
allow = [
"Apache-2.0 WITH LLVM-exception",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BSL-1.0",
"CC0-1.0",
"CDLA-Permissive-2.0",
"ISC",
"MIT",
"MPL-2.0",
"Unicode-3.0",
"Zlib",
]
exceptions = [
# TEMP: Pending legal review. Pulled transitively via `risc0-zkvm`
{ name = "downloader", version = "0.2.8", allow = ["LGPL-3.0-or-later"] },
{ name = "malachite", version = "0.4.22", allow = ["LGPL-3.0-only"] },
{ name = "malachite-base", version = "0.4.22", allow = ["LGPL-3.0-only"] },
{ name = "malachite-float", version = "0.4.22", allow = ["LGPL-3.0-only"] },
{ name = "malachite-nz", version = "0.4.22", allow = ["LGPL-3.0-only"] },
{ name = "malachite-q", version = "0.4.22", allow = ["LGPL-3.0-only"] },
{ name = "managed", version = "0.8.0", allow = ["0BSD"] },
]
private = { ignore = false }
unused-allowed-license = "deny"
[sources]
allow-git = [
"https://github.com/EspressoSystems/jellyfish.git",
"https://github.com/logos-blockchain/logos-blockchain.git",
]
unknown-git = "deny"
unknown-registry = "deny"
[sources.allow-org]
github = ["logos-co"]

45
.dockerignore Normal file
View File

@ -0,0 +1,45 @@
# Build artifacts
target/
**/target/
# RocksDB data
rocksdb/
**/rocksdb/
# Git
.git/
.gitignore
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# CI/CD
.github/
ci_scripts/
# Documentation
docs/
*.md
!README.md
# Non-build project files
completions/
configs/
Justfile
clippy.toml
rustfmt.toml
flake.nix
flake.lock
LICENSE
# Docker compose files (not needed inside build)
docker-compose*.yml
**/docker-compose*.yml

View File

@ -0,0 +1,19 @@
name: Setup Logos Blockchain Circuits
description: Set up Logos Blockchain Circom Circuits, Rapidsnark prover and Rapidsnark verifier using the setup-logos-blockchain-circuits.sh script.
inputs:
github-token:
description: GitHub token for downloading releases
required: true
runs:
using: "composite"
steps:
- name: Setup logos-blockchain-circuits
shell: bash
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/main/scripts/setup-logos-blockchain-circuits.sh | bash

View File

@ -0,0 +1,10 @@
name: Install risc0
description: Installs risc0 in the environment
runs:
using: "composite"
steps:
- name: Install risc0
run: |
curl -L https://risczero.com/install | bash
/home/runner/.risc0/bin/rzup install
shell: bash

View File

@ -0,0 +1,10 @@
name: Install system dependencies
description: Installs system dependencies in the environment
runs:
using: "composite"
steps:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential clang libclang-dev libssl-dev pkg-config
shell: bash

43
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,43 @@
## 🎯 Purpose
*What problem does this PR solve or what feature does it add? Mention issues related to it*
TO COMPLETE
## ⚙️ Approach
*Describe the core changes introduced by this PR.*
TO COMPLETE
- [ ] Change ...
- [ ] Add ...
- [ ] Fix ...
- [ ] ...
## 🧪 How to Test
*How to verify that this PR works as intended.*
TO COMPLETE
## 🔗 Dependencies
*Link PRs that must be merged before this one.*
TO COMPLETE IF APPLICABLE
## 🔜 Future Work
*List any work intentionally left out of this PR, whether due to scope, prioritization, or pending decisions.*
TO COMPLETE IF APPLICABLE
## 📋 PR Completion Checklist
*Mark only completed items. A complete PR should have all boxes ticked.*
- [ ] Complete PR description
- [ ] Implement the core functionality
- [ ] Add/update tests
- [ ] Add/update documentation and inline comments

View File

@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
paths-ignore:
- "**.md"
- "!.github/workflows/*.yml"
@ -14,64 +14,223 @@ on:
name: General
jobs:
build-ubuntu-latest:
fmt-rs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- name: Install nightly toolchain for rustfmt
run: rustup install nightly --profile minimal --component rustfmt
- name: Check Rust files are formatted
run: cargo +nightly fmt --check
fmt-toml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- name: Install taplo-cli
run: cargo install --locked taplo-cli
- name: Check TOML files are formatted
run: taplo fmt --check .
machete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- name: Install active toolchain
run: rustup install
- name: Install cargo-machete
run: cargo install cargo-machete
- name: Check for unused dependencies
run: cargo machete
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- name: Install cargo-deny
run: cargo install --locked cargo-deny
- name: Check licenses and advisories
run: cargo deny check
lint:
runs-on: ubuntu-latest
timeout-minutes: 60
name: build - ubuntu-latest
name: lint
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v5
with:
profile: minimal
toolchain: nightly
override: true
- name: build - ubuntu-latest
if: success() || failure()
run: chmod 777 ./ci_scripts/build-ubuntu.sh && ./ci_scripts/build-ubuntu.sh
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-system-deps
lint:
strategy:
matrix:
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
- uses: ./.github/actions/install-risc0
- uses: ./.github/actions/install-logos-blockchain-circuits
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install active toolchain
run: rustup install
- name: Lint workspace
env:
RISC0_SKIP_BUILD: "1"
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Lint programs
env:
RISC0_SKIP_BUILD: "1"
run: cargo clippy -p "*programs" -- -D warnings
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-system-deps
- uses: ./.github/actions/install-risc0
- uses: ./.github/actions/install-logos-blockchain-circuits
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install active toolchain
run: rustup install
- name: Install nextest
run: cargo install --locked cargo-nextest
- name: Run tests
env:
RISC0_DEV_MODE: "1"
RUST_LOG: "info"
run: cargo nextest run --workspace --exclude integration_tests
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-system-deps
- uses: ./.github/actions/install-risc0
- uses: ./.github/actions/install-logos-blockchain-circuits
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install active toolchain
run: rustup install
- name: Install nextest
run: cargo install --locked cargo-nextest
- name: Run tests
env:
RISC0_DEV_MODE: "1"
RUST_LOG: "info"
run: cargo nextest run -p integration_tests -- --skip tps_test --skip indexer
integration-tests-indexer:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-system-deps
- uses: ./.github/actions/install-risc0
- uses: ./.github/actions/install-logos-blockchain-circuits
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install active toolchain
run: rustup install
- name: Install nextest
run: cargo install --locked cargo-nextest
- name: Run tests
env:
RISC0_DEV_MODE: "1"
RUST_LOG: "info"
run: cargo nextest run -p integration_tests indexer -- --skip tps_test
valid-proof-test:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-system-deps
- uses: ./.github/actions/install-risc0
- uses: ./.github/actions/install-logos-blockchain-circuits
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install active toolchain
run: rustup install
- name: Test valid proof
env:
RUST_LOG: "info"
run: cargo test -p integration_tests -- --exact private::private_transfer_to_owned_account
artifacts:
runs-on: ubuntu-latest
timeout-minutes: 60
name: lint - ${{ matrix.crate }} - ${{ matrix.platform }}
name: artifacts
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v5
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: lint - ubuntu-latest
if: success() || failure()
run: chmod 777 ./ci_scripts/lint-ubuntu.sh && ./ci_scripts/lint-ubuntu.sh
ref: ${{ github.head_ref }}
- uses: ./.github/actions/install-risc0
test:
strategy:
matrix:
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
- name: Install just
run: cargo install just
name: test - ${{ matrix.crate }} - ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: test ubuntu-latest
if: success() || failure()
run: chmod 777 ./ci_scripts/test-ubuntu.sh && ./ci_scripts/test-ubuntu.sh
- name: Build artifacts
run: just build-artifacts
- name: Check if artifacts match repository
run: |
if ! git diff --exit-code artifacts/; then
echo "❌ Artifacts in the repository are out of date!"
echo "Please run 'just build-artifacts' and commit the changes."
exit 1
fi
echo "✅ Artifacts are up to date"

66
.github/workflows/publish_images.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Publish Docker Images
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: sequencer_service
dockerfile: ./sequencer/service/Dockerfile
build_args: |
STANDALONE=false
- name: sequencer_service-standalone
dockerfile: ./sequencer/service/Dockerfile
build_args: |
STANDALONE=true
- name: indexer_service
dockerfile: ./indexer/service/Dockerfile
build_args: ""
- name: explorer_service
dockerfile: ./explorer_service/Dockerfile
build_args: ""
steps:
- uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.name }}
tags: |
type=ref,event=tag
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.build_args }}
cache-from: type=gha
cache-to: type=gha,mode=max

6
.gitignore vendored
View File

@ -6,3 +6,9 @@ data/
.idea/
.vscode/
rocksdb
sequencer/service/data/
storage.json
result
wallet-ffi/wallet_ffi.h
bedrock_signing_key
integration_tests/configs/debug/

8097
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +1,284 @@
[workspace.package]
license = "MIT or Apache-2.0"
[workspace]
resolver = "2"
resolver = "3"
members = [
"node_runner",
"sequencer_runner",
"integration_tests",
"storage",
"accounts",
"utxo",
"vm",
"networking",
"consensus",
"node_rpc",
"sequencer_rpc",
"key_protocol",
"mempool",
"zkvm",
"node_core",
"sequencer_core",
"rpc_primitives",
"wallet",
"wallet-ffi",
"common",
"nssa",
"nssa/core",
"programs/amm/core",
"programs/amm",
"programs/token/core",
"programs/token",
"sequencer/core",
"sequencer/service",
"sequencer/service/protocol",
"sequencer/service/rpc",
"indexer/core",
"indexer/service",
"indexer/service/protocol",
"indexer/service/rpc",
"explorer_service",
"program_methods",
"program_methods/guest",
"test_program_methods",
"test_program_methods/guest",
"examples/program_deployment",
"examples/program_deployment/methods",
"examples/program_deployment/methods/guest",
"bedrock_client",
]
[workspace.dependencies]
anyhow = "1.0"
nssa = { path = "nssa" }
nssa_core = { path = "nssa/core" }
common = { path = "common" }
mempool = { path = "mempool" }
storage = { path = "storage" }
key_protocol = { path = "key_protocol" }
sequencer_core = { path = "sequencer/core" }
sequencer_service_protocol = { path = "sequencer/service/protocol" }
sequencer_service_rpc = { path = "sequencer/service/rpc" }
sequencer_service = { path = "sequencer/service" }
indexer_core = { path = "indexer/core" }
indexer_service = { path = "indexer/service" }
indexer_service_protocol = { path = "indexer/service/protocol" }
indexer_service_rpc = { path = "indexer/service/rpc" }
wallet = { path = "wallet" }
wallet-ffi = { path = "wallet-ffi", default-features = false }
token_core = { path = "programs/token/core" }
token_program = { path = "programs/token" }
amm_core = { path = "programs/amm/core" }
amm_program = { path = "programs/amm" }
test_program_methods = { path = "test_program_methods" }
bedrock_client = { path = "bedrock_client" }
tokio = { version = "1.50", features = [
"net",
"rt-multi-thread",
"sync",
"fs",
] }
tokio-util = "0.7.18"
risc0-zkvm = { version = "3.0.5", features = ['std'] }
risc0-build = "3.0.5"
anyhow = "1.0.98"
num_cpus = "1.13.1"
openssl = { version = "0.10", features = ["vendored"] }
openssl-probe = { version = "0.1.2" }
serde = { version = "1.0.60", default-features = false, features = ["derive"] }
serde_json = "1.0.81"
serde_with = "3.16.1"
actix = "0.13.0"
actix-cors = "0.6.1"
actix-cors = "0.7.1"
jsonrpsee = "0.26.0"
futures = "0.3"
actix-rt = "*"
env_logger = "0.10"
log = "0.4"
lru = "0.7.8"
thiserror = "1.0"
rs_merkle = "1.4"
lazy_static = "1.5.0"
env_logger = "0.11"
log = "0.4.28"
lru = "0.16.3"
thiserror = "2.0"
sha2 = "0.10.8"
monotree = "0.1.5"
hex = "0.4.3"
bytemuck = "1.24.0"
bytesize = { version = "2.3.1", features = ["serde"] }
humantime-serde = "1.1"
humantime = "2.1"
aes-gcm = "0.10.3"
toml = "0.7.4"
secp256k1-zkp = "0.11.0"
toml = "0.9.8"
bincode = "1.3.3"
tempfile = "3.14.0"
light-poseidon = "0.3.0"
ark-bn254 = "0.5.0"
ark-ff = "0.5.0"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
base64 = "0.22.1"
bip39 = "2.2.0"
hmac-sha512 = "1.1.7"
chrono = "0.4.41"
borsh = "1.5.7"
base58 = "0.2.0"
itertools = "0.14.0"
url = { version = "2.5.4", features = ["serde"] }
tokio-retry = "0.3.0"
schemars = "1.2"
async-stream = "0.3.6"
rocksdb = { version = "0.21.0", default-features = false, features = [
logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git" }
rocksdb = { version = "0.24.0", default-features = false, features = [
"snappy",
"bindgen-runtime",
] }
rand = { version = "0.8.5", features = ["std", "std_rng", "getrandom"] }
k256 = { version = "0.13.3", features = [
"ecdsa-core",
"arithmetic",
"expose-field",
"serde",
"pem",
] }
elliptic-curve = { version = "0.13.8", features = ["arithmetic"] }
actix-web = { version = "4.13.0", default-features = false, features = [
"macros",
] }
clap = { version = "4.5.42", features = ["derive", "env"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls", "stream"] }
[workspace.dependencies.rand]
features = ["std", "std_rng", "getrandom"]
version = "0.8.5"
# Profile for leptos WASM release builds
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1
[workspace.dependencies.k256]
features = ["ecdsa-core", "arithmetic", "expose-field"]
version = "0.13.4"
[workspace.lints.rust]
warnings = "deny"
[workspace.dependencies.elliptic-curve]
features = ["arithmetic"]
version = "0.13.8"
[workspace.lints]
clippy.all = { level = "deny", priority = -1 }
[workspace.dependencies.serde]
features = ["derive"]
version = "1.0.60"
# Pedantic
clippy.pedantic = { level = "deny", priority = -1 }
[workspace.dependencies.actix-web]
default-features = false
version = "=4.1.0"
# Reason: documenting every function returning Result is too verbose and doesn't add much value when you have good error types.
clippy.missing-errors-doc = "allow"
# Reason: most of the panics are internal and not part of the public API, so documenting them is not necessary.
clippy.missing-panics-doc = "allow"
# Reason: this isn't always bad and actually works well for our financial and cryptography code.
clippy.similar-names = "allow"
# Reason: this lint is too strict and hard to fix.
clippy.too-many-lines = "allow"
# Reason: std hasher is fine for us in public functions.
clippy.implicit-hasher = "allow"
[workspace.dependencies.clap]
features = ["derive", "env"]
version = "3.1.6"
# Restriction
clippy.restriction = { level = "deny", priority = -1 }
[workspace.dependencies.tokio-retry]
version = "0.3.0"
# Reason: we deny the whole `restriction` group but we allow things that don't make sense for us.
# That way we can still benefit from new lints added to the `restriction` group without having to
# explicitly allow them.
# As a downside our contributors don't know if some lint was enabled intentionally or just no one
# else faced it before to allow it but we can handle this during code reviews.
clippy.blanket-clippy-restriction-lints = "allow"
# Reason: we can't avoid using unwrap for now.
clippy.unwrap-used = "allow"
# Reason: we can't avoid using expect for now.
clippy.expect-used = "allow"
# Reason: unreachable is good in many cases.
clippy.unreachable = "allow"
# Reason: this is ridiculous strict in our codebase and doesn't add any value.
clippy.single-call-fn = "allow"
# Reason: we use panic in some places and it's okay.
clippy.panic = "allow"
# Reason: shadowing is good most of the times.
clippy.shadow-reuse = "allow"
# Reason: implicit return is good.
clippy.implicit-return = "allow"
# Reason: std is fine for us, we don't need to use core.
clippy.std-instead-of-core = "allow"
# Reason: std is fine for us, we don't need to use alloc.
clippy.std-instead-of-alloc = "allow"
# Reason: default methods are good most of the time.
clippy.missing-trait-methods = "allow"
# Reason: this is too verbose and doesn't help much if you have rust analyzer.
clippy.pattern-type-mismatch = "allow"
# Reason: decreases readability.
clippy.assertions-on-result-states = "allow"
# Reason: documenting every assert is too verbose.
clippy.missing-assert-message = "allow"
# Reason: documenting private items is too verbose and doesn't add much value.
clippy.missing-docs-in-private-items = "allow"
# Reason: we use separated suffix style.
clippy.separated_literal_suffix = "allow"
# Reason: sometimes absolute paths are more readable.
clippy.absolute-paths = "allow"
# Reason: sometimes it's as readable as full variable naming.
clippy.min-ident-chars = "allow"
# Reason: it's very common and handy.
clippy.indexing-slicing = "allow"
# Reason: we use little endian style.
clippy.little-endian-bytes = "allow"
# Reason: we use this style of pub visibility.
clippy.pub-with-shorthand = "allow"
# Reason: question mark operator is very cool.
clippy.question-mark-used = "allow"
# Reason: it's fine to panic in tests and some functions where it makes sense.
clippy.panic-in-result-fn = "allow"
# Reason: we don't care that much about inlining and LTO should take care of it.
clippy.missing_inline_in_public_items = "allow"
# Reason: it's okay for us.
clippy.default-numeric-fallback = "allow"
# Reason: this is fine for us.
clippy.exhaustive-enums = "allow"
# Reason: this is fine for us.
clippy.exhaustive-structs = "allow"
# Reason: this helps readability when item is imported in other modules.
clippy.module-name-repetitions = "allow"
# Reason: mostly historical reasons, maybe we'll address this in future.
clippy.mod-module-files = "allow"
# Reason: named module files is our preferred way.
clippy.self-named-module-files = "allow"
# Reason: this is actually quite handy.
clippy.impl-trait-in-params = "allow"
# Reason: this is often useful.
clippy.use-debug = "allow"
# Reason: this is sometimes useful.
clippy.field-scoped-visibility-modifiers = "allow"
# Reason: `pub use` is good for re-exports and hiding unnecessary details.
clippy.pub-use = "allow"
# Reason: we prefer semicolons inside blocks.
clippy.semicolon-outside-block = "allow"
# Reason: we don't do it blindly, this is mostly internal constraints checks.
clippy.unwrap-in-result = "allow"
# Reason: we don't see any problems with that.
clippy.shadow-same = "allow"
# Reason: this lint is too verbose.
clippy.let-underscore-untyped = "allow"
# Reason: this lint is actually bad as it forces to use wildcard `..` instead of
# field-by-field `_` which may lead to subtle bugs when new fields are added to the struct.
clippy.unneeded-field-pattern = "allow"
[workspace.dependencies.reqwest]
features = ["json"]
version = "0.11.16"
# Nursery
clippy.nursery = { level = "deny", priority = -1 }
[workspace.dependencies.tokio]
features = ["net", "rt-multi-thread", "sync", "fs"]
version = "1.28.2"
# Reason: this is okay if it compiles.
clippy.future-not-send = "allow"
# Reason: this is actually a good lint, but currently it gives a lot of false-positives.
clippy.significant-drop-tightening = "allow"
[workspace.dependencies.tracing]
features = ["std"]
version = "0.1.13"
# Correctness
clippy.correctness = { level = "deny", priority = -1 }
# Complexity
clippy.complexity = { level = "deny", priority = -1 }
# Perf
clippy.perf = { level = "deny", priority = -1 }
# Suspicious
clippy.suspicious = { level = "deny", priority = -1 }
# Style
clippy.style = { level = "deny", priority = -1 }
# Cargo
clippy.cargo = { level = "deny", priority = -1 }
# Reason: we're not at this stage yet and it will be a pain to create a new crate.
clippy.cargo-common-metadata = "allow"
# Reason: hard to address right now and mostly comes from dependencies
# so the fix would be just a long list of exceptions.
clippy.multiple-crate-versions = "allow"

70
Justfile Normal file
View File

@ -0,0 +1,70 @@
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
default:
@just --list
# ---- Configuration ----
METHODS_PATH := "program_methods"
TEST_METHODS_PATH := "test_program_methods"
ARTIFACTS := "artifacts"
# Build risc0 program artifacts
build-artifacts:
@echo "🔨 Building artifacts"
@for methods_path in {{METHODS_PATH}} {{TEST_METHODS_PATH}}; do \
echo "Building artifacts for $methods_path"; \
CARGO_TARGET_DIR=target/$methods_path cargo risczero build --manifest-path $methods_path/guest/Cargo.toml; \
mkdir -p {{ARTIFACTS}}/$methods_path; \
cp target/$methods_path/riscv32im-risc0-zkvm-elf/docker/*.bin {{ARTIFACTS}}/$methods_path; \
done
# Run tests
test:
@echo "🧪 Running tests"
RISC0_DEV_MODE=1 cargo nextest run --no-fail-fast
# Run Bedrock node in docker
[working-directory: 'bedrock']
run-bedrock:
@echo "⛓️ Running bedrock"
docker compose up
# Run Sequencer
[working-directory: 'sequencer/service']
run-sequencer:
@echo "🧠 Running sequencer"
RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release -p sequencer_service configs/debug/sequencer_config.json
# Run Indexer
[working-directory: 'indexer/service']
run-indexer mock="":
@echo "🔍 Running indexer"
@if [ "{{mock}}" = "mock" ]; then \
echo "🧪 Using mock data"; \
RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release --features mock-responses -p indexer_service configs/indexer_config.json; \
else \
echo "🚀 Using real data"; \
RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release -p indexer_service configs/indexer_config.json; \
fi
# Run Explorer
[working-directory: 'explorer_service']
run-explorer:
@echo "🌐 Running explorer"
RUST_LOG=info cargo leptos serve
# Run Wallet
[working-directory: 'wallet']
run-wallet +args:
@echo "🔑 Running wallet"
NSSA_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}}
# Clean runtime data
clean:
@echo "🧹 Cleaning run artifacts"
rm -rf sequencer/service/bedrock_signing_key
rm -rf sequencer/service/rocksdb
rm -rf indexer/service/rocksdb
rm -rf wallet/configs/debug/storage.json
rm -rf rocksdb
cd bedrock && docker compose down -v

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Vac
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

241
README.md
View File

@ -1,2 +1,239 @@
# nescience-testnet
This repo serves for Nescience Node testnet
# Logos Execution Zone (LEZ)
Logos Execution Zone (LEZ) is a programmable blockchain that cleanly separates public and private state while keeping them fully interoperable. Developers can build apps that operate across transparent and privacy-preserving accounts without changing their logic. Privacy is enforced by the protocol itself through zero-knowledge proofs (ZKPs), so it is always available and automatic.
## Background
These features are provided by the Logos Execution Environment (LEE). Traditional public blockchains expose a fully transparent state: the mapping from account IDs to account values is entirely visible. LEE introduces a parallel *private state* that coexists with the public one. Together, public and private accounts form a partition of the account ID space: public IDs are visible on-chain, while private accounts are accessible only to holders of the corresponding viewing keys. Consistency across both states is enforced by ZKPs.
Public accounts are stored on-chain as a visible map from IDs to account states, and their values are updated in place. Private accounts are never stored on-chain in raw form. Each update produces a new commitment that binds the current value while keeping it hidden. Previous commitments remain on-chain, but a nullifier set marks old versions as spent, ensuring that only the most recent private state can be used in execution.
### Programmability and selective privacy
LEZ aims to deliver full programmability in a hybrid public/private model, with the same flexibility and composability as public blockchains. Developers write and deploy programs in LEZ without addressing privacy concerns. The protocol automatically supports executions that involve any combination of public and private accounts. From the programs perspective, all accounts look the same, and privacy is enforced transparently. This lets developers focus on business logic while the system guarantees privacy and correctness.
To our knowledge, this design is unique to LEZ. Other privacy-focused programmable blockchains often require developers to explicitly handle private inputs inside their app logic. In LEZ, privacy is protocol-level: programs do not change, accounts are treated uniformly, and private execution works out of the box.
---
## Example: Creating and transferring tokens across states
1. Token creation (public execution)
- Alice submits a transaction that executes the token program `New` function on-chain.
- A new public token definition account is created.
- The minted tokens are recorded on-chain in Alices public account.
2. Transfer from public to private (local / privacy-preserving execution)
- Alice runs the token program `Transfer` function locally, sending to Bobs private account.
- A ZKP of correct execution is generated.
- The proof is submitted to the blockchain and verified by validators.
- Alices public balance is updated on-chain.
- Bobs private balance remains hidden, while the transfer is provably correct.
3. Transferring private to public (local / privacy-preserving execution)
- Bob executes the token program `Transfer` function locally, sending to Charlies public account.
- A ZKP of correct execution is generated.
- Bobs private account and balance still remain hidden.
- Charlie's public account is modified with the new tokens added.
4. Transferring public to public (public execution):
- Alice submits a transaction to execute the token program `Transfer` function on-chain, specifying Charlie's public account as recipient.
- The execution is handled on-chain without ZKPs involved.
- Alice's and Charlie's accounts are modified according to the transaction.
4. Transfer from public to public (public execution)
- Alice submits an on-chain transaction to run `Transfer`, sending to Charlies public account.
- Execution is handled fully on-chain without ZKPs.
- Alices and Charlies public balances are updated.
### Key points:
- The same token program is used in every execution.
- The only difference is execution mode: public execution updates visible state on-chain, while private execution relies on ZKPs.
- Validators verify proofs only for privacy-preserving transactions, keeping processing efficient.
---
## The accounts model
To achieve both state separation and full programmability, LEZ uses a stateless program model. Programs hold no internal state. All persistent data is stored in accounts passed explicitly into each execution. This enables precise access control and visibility while preserving composability across public and private states.
### Execution types
LEZ supports two execution types:
- Public execution runs transparently on-chain.
- Private execution runs off-chain and is verified on-chain with ZKPs.
Both public and private executions use the same Risc0 VM bytecode. Public transactions are executed directly on-chain like any standard RISC-V VM call, without proof generation. Private transactions are executed locally by users, who generate Risc0 proofs that validators verify instead of re-executing the program.
This design keeps public transactions as fast as any RISC-Vbased VM and makes private transactions efficient for validators. It also supports parallel execution similar to Solana, improving throughput. The main computational cost for privacy-preserving transactions is on the user side, where ZK proofs are generated.
---
---
---
# Versioning
We release versions as git tags (e.g. `v0.1.0`). If no critical issues with version is found you can expect it to be immutable. All further features and fixes will be a part of the next tag. As the project is in active development we don't provide backward compatibility yet.
For each tag we publish docker images of our services.
If you depend on this project you can pin your rust dependency to a git tag like this:
```toml
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.1.0" }
```
# Install dependencies
### Install build dependencies
- On Linux
Ubuntu / Debian
```sh
apt install build-essential clang libclang-dev libssl-dev pkg-config
```
- On Fedora
```sh
sudo dnf install clang clang-devel openssl-devel pkgconf
```
- On Mac
```sh
xcode-select --install
brew install pkg-config openssl
```
### Install Rust
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
### Install Risc0
```sh
curl -L https://risczero.com/install | bash
```
### Then restart your shell and run
```sh
rzup install
```
# Run tests
The LEZ repository includes both unit and integration test suites.
### Unit tests
```bash
# RISC0_DEV_MODE=1 is used to skip proof generation and reduce test runtime overhead
RISC0_DEV_MODE=1 cargo test --release
```
### Integration tests
```bash
export NSSA_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/
cd integration_tests
# RISC0_DEV_MODE=1 skips proof generation; RUST_LOG=info enables runtime logs
RUST_LOG=info RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all
```
# Run the sequencer and node
## Running Manually
### Normal mode
The sequencer and logos blockchain node can be run locally:
1. On one terminal go to the `logos-blockchain/logos-blockchain` repo and run a local logos blockchain node:
- `git checkout master; git pull`
- `cargo clean`
- `rm -r ~/.logos-blockchain-circuits`
- `./scripts/setup-logos-blockchain-circuits.sh`
- `cargo build --all-features`
- `./target/debug/logos-blockchain-node --deployment nodes/node/standalone-deployment-config.yaml nodes/node/standalone-node-config.yaml`
- Alternatively (WARNING: This node is outdated) go to `logos-blockchain/lssa/` repo and run the node from docker:
- `cd bedrock`
- Change line 14 of `docker-compose.yml` from `"0:18080/tcp"` into `"8080:18080/tcp"`
- `docker compose up`
2. On another terminal go to the `logos-blockchain/lssa` repo and run indexer service:
- `RUST_LOG=info cargo run -p indexer_service indexer/service/configs/indexer_config.json`
3. On another terminal go to the `logos-blockchain/lssa` repo and run the sequencer:
- `RUST_LOG=info cargo run -p sequencer_service sequencer/service/configs/debug/sequencer_config.json`
4. (To run the explorer): on another terminal go to `logos-blockchain/lssa/explorer_service` and run the following:
- `cargo install cargo-leptos`
- `cargo leptos build --release`
- `cargo leptos serve --release`
### Notes on cleanup
After stopping services above you need to remove 3 folders to start cleanly:
1. In the `logos-blockchain/logos-blockchain` folder `state` (not needed in case of docker setup)
2. In the `lssa` folder `sequencer/service/rocksdb`
3. In the `lssa` file `sequencer/service/bedrock_signing_key`
4. In the `lssa` folder `indexer/service/rocksdb`
### Normal mode (`just` commands)
We provide a `Justfile` for developer and user needs, you can run the whole setup with it. The only difference will be that logos-blockchain (bedrock) will be started from docker.
#### 1'st Terminal
```bash
just run-bedrock
```
#### 2'nd Terminal
```bash
just run-indexer
```
#### 3'rd Terminal
```bash
just run-sequencer
```
#### 4'th Terminal
```bash
just run-explorer
```
#### 5'th Terminal
You can run any command our wallet support by passing it as an argument for `just run-wallet`, for example:
```bash
just run-wallet check-health
```
This will use a wallet binary built from this repo and not the one installed in your system if you have some. Also another wallet home directory will be used. This is done to not to mess up with your local wallet and to easily clean generated files (see next section).
#### Shutdown
1. Press `ctrl-c` in every terminal
2. Run `just clean` to clean runtime data
### Standalone mode
The sequencer can be run in standalone mode with:
```bash
RUST_LOG=info cargo run --features standalone -p sequencer_service sequencer/service/configs/debug
```
## Running with Docker
You can run the whole setup with Docker:
```bash
docker compose up
```
With that you can send transactions from local wallet to the Sequencer running inside Docker using `wallet/configs/debug` as well as exploring blocks by opening `http://localhost:8080`.
## Caution for local image builds
If you're going to build sequencer image locally you should better adjust default docker settings and set `defaultKeepStorage` at least `25GB` so that it can keep layers properly cached.

View File

@ -1,23 +0,0 @@
[package]
name = "accounts"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow.workspace = true
serde_json.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
k256.workspace = true
sha2.workspace = true
rand.workspace = true
elliptic-curve.workspace = true
hex.workspace = true
aes-gcm.workspace = true
[dependencies.storage]
path = "../storage"
[dependencies.utxo]
path = "../utxo"

View File

@ -1,205 +0,0 @@
use std::collections::HashMap;
use anyhow::Result;
use k256::AffinePoint;
use log::info;
use serde::{Deserialize, Serialize};
use storage::{merkle_tree_public::TreeHashType, nullifier::UTXONullifier};
use utxo::{
utxo_core::{UTXOPayload, UTXO},
utxo_tree::UTXOSparseMerkleTree,
};
use crate::key_management::{
constants_types::{CipherText, Nonce},
ephemeral_key_holder::EphemeralKeyHolder,
AddressKeyHolder,
};
pub type PublicKey = AffinePoint;
pub type AccountAddress = TreeHashType;
pub struct Account {
pub key_holder: AddressKeyHolder,
pub address: AccountAddress,
pub balance: u64,
pub utxo_tree: UTXOSparseMerkleTree,
}
impl Account {
pub fn new() -> Self {
let key_holder = AddressKeyHolder::new_os_random();
let address = key_holder.address;
let balance = 0;
let utxo_tree = UTXOSparseMerkleTree::new();
Self {
key_holder,
address,
balance,
utxo_tree,
}
}
pub fn new_with_balance(balance: u64) -> Self {
let key_holder = AddressKeyHolder::new_os_random();
let address = key_holder.address;
let utxo_tree = UTXOSparseMerkleTree::new();
Self {
key_holder,
address,
balance,
utxo_tree,
}
}
pub fn produce_ephemeral_key_holder(&self) -> EphemeralKeyHolder {
self.key_holder.produce_ephemeral_key_holder()
}
pub fn encrypt_data(
ephemeral_key_holder: &EphemeralKeyHolder,
viewing_public_key_receiver: AffinePoint,
data: &[u8],
) -> (CipherText, Nonce) {
ephemeral_key_holder.encrypt_data(viewing_public_key_receiver, data)
}
pub fn decrypt_data(
&self,
ephemeral_public_key_sender: AffinePoint,
ciphertext: CipherText,
nonce: Nonce,
) -> Result<Vec<u8>, aes_gcm::Error> {
self.key_holder
.decrypt_data(ephemeral_public_key_sender, ciphertext, nonce)
}
pub fn mark_spent_utxo(
&mut self,
utxo_nullifier_map: HashMap<TreeHashType, UTXONullifier>,
) -> Result<()> {
for (hash, nullifier) in utxo_nullifier_map {
if let Some(utxo_entry) = self.utxo_tree.store.get_mut(&hash) {
utxo_entry.consume_utxo(nullifier)?;
}
}
Ok(())
}
pub fn add_new_utxo_outputs(&mut self, utxos: Vec<UTXO>) -> Result<()> {
Ok(self.utxo_tree.insert_items(utxos)?)
}
pub fn update_public_balance(&mut self, new_balance: u64) {
self.balance = new_balance;
}
pub fn add_asset<Asset: Serialize>(
&mut self,
asset: Asset,
amount: u128,
privacy_flag: bool,
) -> Result<()> {
let payload_with_asset = UTXOPayload {
owner: self.address,
asset: serde_json::to_vec(&asset)?,
amount,
privacy_flag,
};
let asset_utxo = UTXO::create_utxo_from_payload(payload_with_asset);
self.utxo_tree.insert_item(asset_utxo)?;
Ok(())
}
pub fn log(&self) {
info!("Keys generated");
info!("Account address is {:?}", hex::encode(self.address));
info!("Account balance is {:?}", self.balance);
}
}
impl Default for Account {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {
use super::*;
fn generate_dummy_utxo_nullifier() -> UTXONullifier {
UTXONullifier::default()
}
fn generate_dummy_utxo(address: TreeHashType, amount: u128) -> UTXO {
let payload = UTXOPayload {
owner: address,
asset: vec![],
amount,
privacy_flag: false,
};
UTXO::create_utxo_from_payload(payload)
}
#[test]
fn test_new_account() {
let account = Account::new();
assert_eq!(account.balance, 0);
assert!(account.key_holder.address != [0u8; 32]); // Check if the address is not empty
}
#[test]
fn test_mark_spent_utxo() {
let mut account = Account::new();
let utxo = generate_dummy_utxo(account.address, 100);
account.add_new_utxo_outputs(vec![utxo]).unwrap();
let mut utxo_nullifier_map = HashMap::new();
utxo_nullifier_map.insert(account.address, generate_dummy_utxo_nullifier());
let result = account.mark_spent_utxo(utxo_nullifier_map);
assert!(result.is_ok());
assert!(account.utxo_tree.store.get(&account.address).is_none());
}
#[test]
fn test_add_new_utxo_outputs() {
let mut account = Account::new();
let utxo1 = generate_dummy_utxo(account.address, 100);
let utxo2 = generate_dummy_utxo(account.address, 200);
let result = account.add_new_utxo_outputs(vec![utxo1.clone(), utxo2.clone()]);
assert!(result.is_ok());
assert_eq!(account.utxo_tree.store.len(), 2);
}
#[test]
fn test_update_public_balance() {
let mut account = Account::new();
account.update_public_balance(500);
assert_eq!(account.balance, 500);
}
#[test]
fn test_add_asset() {
let mut account = Account::new();
let asset = "dummy_asset";
let amount = 1000u128;
let result = account.add_asset(asset, amount, false);
assert!(result.is_ok());
assert_eq!(account.utxo_tree.store.len(), 1);
}
}

View File

@ -1,17 +0,0 @@
use elliptic_curve::{
consts::{B0, B1},
generic_array::GenericArray,
};
use sha2::digest::typenum::{UInt, UTerm};
pub const NULLIFIER_SECRET_CONST: [u8; 32] = [
38, 29, 97, 210, 148, 172, 75, 220, 36, 249, 27, 111, 73, 14, 250, 38, 55, 87, 164, 169, 95,
101, 135, 28, 212, 241, 107, 46, 162, 60, 59, 93,
];
pub const VIEVING_SECRET_CONST: [u8; 32] = [
97, 23, 175, 117, 11, 48, 215, 162, 150, 103, 46, 195, 179, 178, 93, 52, 137, 190, 202, 60,
254, 87, 112, 250, 57, 242, 117, 206, 195, 149, 213, 206,
];
pub type CipherText = Vec<u8>;
pub type Nonce = GenericArray<u8, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>;

View File

@ -1,62 +0,0 @@
use aes_gcm::{aead::Aead, AeadCore, Aes256Gcm, Key, KeyInit};
use elliptic_curve::group::GroupEncoding;
use elliptic_curve::PrimeField;
use k256::{AffinePoint, FieldBytes, Scalar};
use log::info;
use rand::{rngs::OsRng, RngCore};
use super::constants_types::{CipherText, Nonce};
#[derive(Debug)]
///Ephemeral secret key holder. Non-clonable as intended for one-time use. Produces ephemeral public keys. Can produce shared secret for sender.
pub struct EphemeralKeyHolder {
ephemeral_secret_key: Scalar,
}
impl EphemeralKeyHolder {
pub fn new_os_random() -> Self {
let mut bytes = FieldBytes::default();
OsRng.fill_bytes(&mut bytes);
Self {
ephemeral_secret_key: Scalar::from_repr(bytes).unwrap(),
}
}
pub fn generate_ephemeral_public_key(&self) -> AffinePoint {
(AffinePoint::GENERATOR * self.ephemeral_secret_key).into()
}
pub fn calculate_shared_secret_sender(
&self,
viewing_public_key_receiver: AffinePoint,
) -> AffinePoint {
(viewing_public_key_receiver * self.ephemeral_secret_key).into()
}
pub fn encrypt_data(
&self,
viewing_public_key_receiver: AffinePoint,
data: &[u8],
) -> (CipherText, Nonce) {
let key_point = self.calculate_shared_secret_sender(viewing_public_key_receiver);
let binding = key_point.to_bytes();
let key_raw = &binding.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
let nonce = Aes256Gcm::generate_nonce(&mut OsRng);
(cipher.encrypt(&nonce, data).unwrap(), nonce)
}
pub fn log(&self) {
info!(
"Ephemeral private key is {:?}",
hex::encode(self.ephemeral_secret_key.to_bytes())
);
}
}

View File

@ -1,383 +0,0 @@
use aes_gcm::{aead::Aead, Aes256Gcm, Key, KeyInit};
use constants_types::{CipherText, Nonce};
use elliptic_curve::group::GroupEncoding;
use ephemeral_key_holder::EphemeralKeyHolder;
use k256::AffinePoint;
use log::info;
use secret_holders::{SeedHolder, TopSecretKeyHolder, UTXOSecretKeyHolder};
use storage::merkle_tree_public::TreeHashType;
use crate::account_core::PublicKey;
pub mod constants_types;
pub mod ephemeral_key_holder;
pub mod secret_holders;
#[derive(Clone)]
///Entrypoint to key management
pub struct AddressKeyHolder {
//Will be useful in future
#[allow(dead_code)]
top_secret_key_holder: TopSecretKeyHolder,
pub utxo_secret_key_holder: UTXOSecretKeyHolder,
pub address: TreeHashType,
pub nullifer_public_key: PublicKey,
pub viewing_public_key: PublicKey,
}
impl AddressKeyHolder {
pub fn new_os_random() -> Self {
//Currently dropping SeedHolder at the end of initialization.
//Now entirely sure if we need it in the future.
let seed_holder = SeedHolder::new_os_random();
let top_secret_key_holder = seed_holder.produce_top_secret_key_holder();
let utxo_secret_key_holder = top_secret_key_holder.produce_utxo_secret_holder();
let address = utxo_secret_key_holder.generate_address();
let nullifer_public_key = utxo_secret_key_holder.generate_nullifier_public_key();
let viewing_public_key = utxo_secret_key_holder.generate_viewing_public_key();
Self {
top_secret_key_holder,
utxo_secret_key_holder,
address,
nullifer_public_key,
viewing_public_key,
}
}
pub fn calculate_shared_secret_receiver(
&self,
ephemeral_public_key_sender: AffinePoint,
) -> AffinePoint {
(ephemeral_public_key_sender * self.utxo_secret_key_holder.viewing_secret_key).into()
}
pub fn produce_ephemeral_key_holder(&self) -> EphemeralKeyHolder {
EphemeralKeyHolder::new_os_random()
}
pub fn decrypt_data(
&self,
ephemeral_public_key_sender: AffinePoint,
ciphertext: CipherText,
nonce: Nonce,
) -> Result<Vec<u8>, aes_gcm::Error> {
let key_point = self.calculate_shared_secret_receiver(ephemeral_public_key_sender);
let binding = key_point.to_bytes();
let key_raw = &binding.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
cipher.decrypt(&nonce, ciphertext.as_slice())
}
pub fn log(&self) {
info!(
"Secret spending key is {:?}",
hex::encode(self.top_secret_key_holder.secret_spending_key.to_bytes()),
);
info!(
"Nulifier secret key is {:?}",
hex::encode(self.utxo_secret_key_holder.nullifier_secret_key.to_bytes()),
);
info!(
"Viewing secret key is {:?}",
hex::encode(self.utxo_secret_key_holder.viewing_secret_key.to_bytes()),
);
info!(
"Nullifier public key is {:?}",
hex::encode(self.nullifer_public_key.to_bytes()),
);
info!(
"Viewing public key is {:?}",
hex::encode(self.viewing_public_key.to_bytes()),
);
}
}
#[cfg(test)]
mod tests {
use aes_gcm::{
aead::{Aead, KeyInit, OsRng},
Aes256Gcm,
};
use constants_types::{CipherText, Nonce};
use constants_types::{NULLIFIER_SECRET_CONST, VIEVING_SECRET_CONST};
use elliptic_curve::ff::Field;
use elliptic_curve::group::prime::PrimeCurveAffine;
use elliptic_curve::group::GroupEncoding;
use k256::{AffinePoint, ProjectivePoint, Scalar};
use super::*;
#[test]
fn test_new_os_random() {
// Ensure that a new AddressKeyHolder instance can be created without errors.
let address_key_holder = AddressKeyHolder::new_os_random();
// Check that key holder fields are initialized with expected types
assert!(!Into::<bool>::into(
address_key_holder.nullifer_public_key.is_identity()
));
assert!(!Into::<bool>::into(
address_key_holder.viewing_public_key.is_identity()
));
}
#[test]
fn test_calculate_shared_secret_receiver() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Generate a random ephemeral public key sender
let scalar = Scalar::random(&mut OsRng);
let ephemeral_public_key_sender = (ProjectivePoint::generator() * scalar).to_affine();
// Calculate shared secret
let shared_secret =
address_key_holder.calculate_shared_secret_receiver(ephemeral_public_key_sender);
// Ensure the shared secret is not an identity point (suggesting non-zero output)
assert!(!Into::<bool>::into(shared_secret.is_identity()));
}
#[test]
fn test_decrypt_data() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Generate an ephemeral key and shared secret
let scalar = Scalar::random(OsRng);
let ephemeral_public_key_sender = address_key_holder
.produce_ephemeral_key_holder()
.generate_ephemeral_public_key();
let shared_secret =
address_key_holder.calculate_shared_secret_receiver(ephemeral_public_key_sender);
// Prepare the encryption key from shared secret
let key_raw = shared_secret.to_bytes();
let key_raw_adjust_pre = &key_raw.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw_adjust_pre.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
// Encrypt sample data
let nonce = Nonce::from_slice(b"unique nonce");
let plaintext = b"Sensitive data";
let ciphertext = cipher
.encrypt(nonce, plaintext.as_ref())
.expect("encryption failure");
// Attempt decryption
let decrypted_data: Vec<u8> = address_key_holder
.decrypt_data(
ephemeral_public_key_sender,
CipherText::from(ciphertext),
nonce.clone(),
)
.unwrap();
// Verify decryption is successful and matches original plaintext
assert_eq!(decrypted_data, plaintext);
}
#[test]
fn test_new_os_random_initialization() {
// Ensure that AddressKeyHolder is initialized correctly
let address_key_holder = AddressKeyHolder::new_os_random();
// Check that key holder fields are initialized with expected types and values
assert!(!Into::<bool>::into(
address_key_holder.nullifer_public_key.is_identity()
));
assert!(!Into::<bool>::into(
address_key_holder.viewing_public_key.is_identity()
));
assert!(address_key_holder.address.as_slice().len() > 0); // Assume TreeHashType has non-zero length for a valid address
}
#[test]
fn test_calculate_shared_secret_with_identity_point() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Use identity point as ephemeral public key
let identity_point = AffinePoint::identity();
// Calculate shared secret
let shared_secret = address_key_holder.calculate_shared_secret_receiver(identity_point);
// The shared secret with the identity point should also result in the identity point
assert!(Into::<bool>::into(shared_secret.is_identity()));
}
#[test]
#[should_panic]
fn test_decrypt_data_with_incorrect_nonce() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Generate ephemeral public key and shared secret
let scalar = Scalar::random(OsRng);
let ephemeral_public_key_sender = (ProjectivePoint::generator() * scalar).to_affine();
let shared_secret =
address_key_holder.calculate_shared_secret_receiver(ephemeral_public_key_sender);
// Prepare the encryption key from shared secret
let key_raw = shared_secret.to_bytes();
let key_raw_adjust_pre = &key_raw.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw_adjust_pre.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
// Encrypt sample data with a specific nonce
let nonce = Nonce::from_slice(b"unique nonce");
let plaintext = b"Sensitive data";
let ciphertext = cipher
.encrypt(nonce, plaintext.as_ref())
.expect("encryption failure");
// Attempt decryption with an incorrect nonce
let incorrect_nonce = Nonce::from_slice(b"wrong nonce");
let decrypted_data = address_key_holder
.decrypt_data(
ephemeral_public_key_sender,
CipherText::from(ciphertext.clone()),
incorrect_nonce.clone(),
)
.unwrap();
// The decryption should fail or produce incorrect output due to nonce mismatch
assert_ne!(decrypted_data, plaintext);
}
#[test]
#[should_panic]
fn test_decrypt_data_with_incorrect_ciphertext() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Generate ephemeral public key and shared secret
let scalar = Scalar::random(OsRng);
let ephemeral_public_key_sender = (ProjectivePoint::generator() * scalar).to_affine();
let shared_secret =
address_key_holder.calculate_shared_secret_receiver(ephemeral_public_key_sender);
// Prepare the encryption key from shared secret
let key_raw = shared_secret.to_bytes();
let key_raw_adjust_pre = &key_raw.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw_adjust_pre.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
// Encrypt sample data
let nonce = Nonce::from_slice(b"unique nonce");
let plaintext = b"Sensitive data";
let ciphertext = cipher
.encrypt(nonce, plaintext.as_ref())
.expect("encryption failure");
// Tamper with the ciphertext to simulate corruption
let mut corrupted_ciphertext = ciphertext.clone();
corrupted_ciphertext[0] ^= 1; // Flip a bit in the ciphertext
// Attempt decryption
let result = address_key_holder
.decrypt_data(
ephemeral_public_key_sender,
CipherText::from(corrupted_ciphertext),
nonce.clone(),
)
.unwrap();
// The decryption should fail or produce incorrect output due to tampered ciphertext
assert_ne!(result, plaintext);
}
#[test]
fn test_encryption_decryption_round_trip() {
let address_key_holder = AddressKeyHolder::new_os_random();
// Generate ephemeral key and shared secret
let scalar = Scalar::random(OsRng);
let ephemeral_public_key_sender = (ProjectivePoint::generator() * scalar).to_affine();
// Encrypt sample data
let plaintext = b"Round-trip test data";
let nonce = Nonce::from_slice(b"unique nonce");
let shared_secret =
address_key_holder.calculate_shared_secret_receiver(ephemeral_public_key_sender);
// Prepare the encryption key from shared secret
let key_raw = shared_secret.to_bytes();
let key_raw_adjust_pre = &key_raw.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw_adjust_pre.try_into().unwrap();
let key: Key<Aes256Gcm> = key_raw_adjust.into();
let cipher = Aes256Gcm::new(&key);
let ciphertext = cipher
.encrypt(nonce, plaintext.as_ref())
.expect("encryption failure");
// Decrypt the data using the `AddressKeyHolder` instance
let decrypted_data = address_key_holder
.decrypt_data(
ephemeral_public_key_sender,
CipherText::from(ciphertext),
nonce.clone(),
)
.unwrap();
// Verify the decrypted data matches the original plaintext
assert_eq!(decrypted_data, plaintext);
}
#[test]
fn key_generation_test() {
let seed_holder = SeedHolder::new_os_random();
let top_secret_key_holder = seed_holder.produce_top_secret_key_holder();
let utxo_secret_key_holder = top_secret_key_holder.produce_utxo_secret_holder();
let address = utxo_secret_key_holder.generate_address();
let nullifer_public_key = utxo_secret_key_holder.generate_nullifier_public_key();
let viewing_public_key = utxo_secret_key_holder.generate_viewing_public_key();
println!("======Prerequisites======");
println!();
println!(
"Group generator {:?}",
hex::encode(AffinePoint::GENERATOR.to_bytes())
);
println!(
"Nullifier constant {:?}",
hex::encode(NULLIFIER_SECRET_CONST)
);
println!("Viewing constatnt {:?}", hex::encode(VIEVING_SECRET_CONST));
println!();
println!("======Holders======");
println!();
println!("{seed_holder:?}");
println!("{top_secret_key_holder:?}");
println!("{utxo_secret_key_holder:?}");
println!();
println!("======Public data======");
println!();
println!("Address{:?}", hex::encode(address));
println!(
"Nulifier public key {:?}",
hex::encode(nullifer_public_key.to_bytes())
);
println!(
"Viewing public key {:?}",
hex::encode(viewing_public_key.to_bytes())
);
}
}

View File

@ -1,113 +0,0 @@
use elliptic_curve::group::GroupEncoding;
use elliptic_curve::PrimeField;
use k256::{AffinePoint, FieldBytes, Scalar};
use rand::{rngs::OsRng, RngCore};
use sha2::{digest::FixedOutput, Digest};
use storage::merkle_tree_public::TreeHashType;
use super::constants_types::{NULLIFIER_SECRET_CONST, VIEVING_SECRET_CONST};
#[derive(Debug)]
///Seed holder. Non-clonable to ensure that different holders use different seeds.
/// Produces `TopSecretKeyHolder` objects.
pub struct SeedHolder {
seed: Scalar,
}
#[derive(Debug, Clone)]
///Secret spending key holder. Produces `UTXOSecretKeyHolder` objects.
pub struct TopSecretKeyHolder {
pub secret_spending_key: Scalar,
}
#[derive(Debug, Clone)]
///Nullifier secret key and viewing secret key holder. Produces public keys. Can produce address. Can produce shared secret for recepient.
pub struct UTXOSecretKeyHolder {
pub nullifier_secret_key: Scalar,
pub viewing_secret_key: Scalar,
}
impl SeedHolder {
pub fn new_os_random() -> Self {
let mut bytes = FieldBytes::default();
OsRng.fill_bytes(&mut bytes);
Self {
seed: Scalar::from_repr(bytes).unwrap(),
}
}
pub fn generate_secret_spending_key_hash(&self) -> TreeHashType {
let mut hasher = sha2::Sha256::new();
hasher.update(self.seed.to_bytes());
<TreeHashType>::from(hasher.finalize_fixed())
}
pub fn generate_secret_spending_key_scalar(&self) -> Scalar {
let hash = self.generate_secret_spending_key_hash();
Scalar::from_repr(hash.into()).unwrap()
}
pub fn produce_top_secret_key_holder(&self) -> TopSecretKeyHolder {
TopSecretKeyHolder {
secret_spending_key: self.generate_secret_spending_key_scalar(),
}
}
}
impl TopSecretKeyHolder {
pub fn generate_nullifier_secret_key(&self) -> Scalar {
let mut hasher = sha2::Sha256::new();
hasher.update(self.secret_spending_key.to_bytes());
hasher.update(NULLIFIER_SECRET_CONST);
let hash = <TreeHashType>::from(hasher.finalize_fixed());
Scalar::from_repr(hash.into()).unwrap()
}
pub fn generate_viewing_secret_key(&self) -> Scalar {
let mut hasher = sha2::Sha256::new();
hasher.update(self.secret_spending_key.to_bytes());
hasher.update(VIEVING_SECRET_CONST);
let hash = <TreeHashType>::from(hasher.finalize_fixed());
Scalar::from_repr(hash.into()).unwrap()
}
pub fn produce_utxo_secret_holder(&self) -> UTXOSecretKeyHolder {
UTXOSecretKeyHolder {
nullifier_secret_key: self.generate_nullifier_secret_key(),
viewing_secret_key: self.generate_viewing_secret_key(),
}
}
}
impl UTXOSecretKeyHolder {
pub fn generate_nullifier_public_key(&self) -> AffinePoint {
(AffinePoint::GENERATOR * self.nullifier_secret_key).into()
}
pub fn generate_viewing_public_key(&self) -> AffinePoint {
(AffinePoint::GENERATOR * self.viewing_secret_key).into()
}
pub fn generate_address(&self) -> TreeHashType {
let npk = self.generate_nullifier_public_key();
let vpk = self.generate_viewing_public_key();
let mut hasher = sha2::Sha256::new();
hasher.update(npk.to_bytes());
hasher.update(vpk.to_bytes());
<TreeHashType>::from(hasher.finalize_fixed())
}
}

View File

@ -1,2 +0,0 @@
pub mod account_core;
pub mod key_management;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

32
bedrock/README.md Normal file
View File

@ -0,0 +1,32 @@
# Bedrock Configuration Files for All-in-One run and Integration Tests
## How to update
- `docker-compose.yml` file.
Compare with `https://github.com/logos-blockchain/logos-blockchain/blob/master/compose.static.yml` and update the file accordingly, don't bring unneeded things like grafana and etc.
Replace `sha` hash with the latest `testnet` tag hash.
- `scripts` folder.
```bash
curl https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/master/testnet/scripts/run_cfgsync.sh >> scripts/run_cfgsync.sh
curl https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/master/testnet/scripts/run_logos_blockchain_node.sh >> scripts/run_logos_blockchain_node.sh
chmod +x scripts/*
```
Then in `scripts/run_logos_blockchain_node.sh` update `cfgsync-client` to `logos-blockchain-cfgsync-client` and in `scripts/run_cfgsync.sh` update `cfgsync-server` to `logos-blockchain-cfgsync-server` if it hasn't been fixed already, see <https://github.com/logos-blockchain/logos-blockchain/pull/2092>.
- `cfgsync.yaml` file.
```bash
curl -O https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/master/testnet/cfgsync.yaml
```
Set `logger`, `tracing` and `metrics` to `None`
- `kzgrs_test_params` file.
```bash
curl -O https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/master/tests/kzgrs/kzgrs_test_params
```

12
bedrock/cfgsync.yaml Normal file
View File

@ -0,0 +1,12 @@
port: 4400
n_hosts: 4
timeout: 10
# Tracing
tracing_settings:
logger: Stdout
tracing: None
filter: None
metrics: None
console: None
level: DEBUG

View File

@ -0,0 +1,46 @@
services:
cfgsync:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:000982e751dfd346ca5346b8025c685fc3abc585079c59cde3bde7fd63100657
volumes:
- ./scripts:/etc/logos-blockchain/scripts
- ./cfgsync.yaml:/etc/logos-blockchain/cfgsync.yaml:z
entrypoint: /etc/logos-blockchain/scripts/run_cfgsync.sh
logos-blockchain-node-0:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:000982e751dfd346ca5346b8025c685fc3abc585079c59cde3bde7fd63100657
ports:
- "${PORT:-8080}:18080/tcp"
volumes:
- ./scripts:/etc/logos-blockchain/scripts
- ./kzgrs_test_params:/kzgrs_test_params:z
depends_on:
- cfgsync
entrypoint: /etc/logos-blockchain/scripts/run_logos_blockchain_node.sh
logos-blockchain-node-1:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:000982e751dfd346ca5346b8025c685fc3abc585079c59cde3bde7fd63100657
volumes:
- ./scripts:/etc/logos-blockchain/scripts
- ./kzgrs_test_params:/kzgrs_test_params:z
depends_on:
- cfgsync
entrypoint: /etc/logos-blockchain/scripts/run_logos_blockchain_node.sh
logos-blockchain-node-2:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:000982e751dfd346ca5346b8025c685fc3abc585079c59cde3bde7fd63100657
volumes:
- ./scripts:/etc/logos-blockchain/scripts
- ./kzgrs_test_params:/kzgrs_test_params:z
depends_on:
- cfgsync
entrypoint: /etc/logos-blockchain/scripts/run_logos_blockchain_node.sh
logos-blockchain-node-3:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:000982e751dfd346ca5346b8025c685fc3abc585079c59cde3bde7fd63100657
volumes:
- ./scripts:/etc/logos-blockchain/scripts
- ./kzgrs_test_params:/kzgrs_test_params:z
depends_on:
- cfgsync
entrypoint: /etc/logos-blockchain/scripts/run_logos_blockchain_node.sh

BIN
bedrock/kzgrs_test_params Normal file

Binary file not shown.

5
bedrock/scripts/run_cfgsync.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -e
exec /usr/bin/logos-blockchain-cfgsync-server /etc/logos-blockchain/cfgsync.yaml

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
export CFG_FILE_PATH="/config.yaml" \
CFG_SERVER_ADDR="http://cfgsync:4400" \
CFG_HOST_IP=$(hostname -i) \
CFG_HOST_IDENTIFIER="validator-$(hostname -i)" \
LOG_LEVEL="INFO" \
POL_PROOF_DEV_MODE=true
/usr/bin/logos-blockchain-cfgsync-client && \
exec /usr/bin/logos-blockchain-node /config.yaml

23
bedrock_client/Cargo.toml Normal file
View File

@ -0,0 +1,23 @@
[package]
name = "bedrock_client"
version = "0.1.0"
edition = "2024"
license = { workspace = true }
[lints]
workspace = true
[dependencies]
common.workspace = true
reqwest.workspace = true
anyhow.workspace = true
tokio-retry.workspace = true
futures.workspace = true
log.workspace = true
serde.workspace = true
humantime-serde.workspace = true
logos-blockchain-common-http-client.workspace = true
logos-blockchain-core.workspace = true
logos-blockchain-chain-broadcast-service.workspace = true
logos-blockchain-chain-service.workspace = true

121
bedrock_client/src/lib.rs Normal file
View File

@ -0,0 +1,121 @@
use std::time::Duration;
use anyhow::{Context as _, Result};
use common::config::BasicAuth;
use futures::{Stream, TryFutureExt as _};
#[expect(clippy::single_component_path_imports, reason = "Satisfy machete")]
use humantime_serde;
use log::{info, warn};
pub use logos_blockchain_chain_broadcast_service::BlockInfo;
use logos_blockchain_chain_service::CryptarchiaInfo;
pub use logos_blockchain_common_http_client::{CommonHttpClient, Error};
pub use logos_blockchain_core::{block::Block, header::HeaderId, mantle::SignedMantleTx};
use reqwest::{Client, Url};
use serde::{Deserialize, Serialize};
use tokio_retry::Retry;
/// Fibonacci backoff retry strategy configuration.
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
pub struct BackoffConfig {
#[serde(with = "humantime_serde")]
pub start_delay: Duration,
pub max_retries: usize,
}
impl Default for BackoffConfig {
fn default() -> Self {
Self {
start_delay: Duration::from_millis(100),
max_retries: 5,
}
}
}
/// Simple wrapper
/// maybe extend in the future for our purposes
/// `Clone` is cheap because `CommonHttpClient` is internally reference counted (`Arc`).
#[derive(Clone)]
pub struct BedrockClient {
http_client: CommonHttpClient,
node_url: Url,
backoff: BackoffConfig,
}
impl BedrockClient {
pub fn new(backoff: BackoffConfig, node_url: Url, auth: Option<BasicAuth>) -> Result<Self> {
info!("Creating Bedrock client with node URL {node_url}");
let client = Client::builder()
//Add more fields if needed
.timeout(std::time::Duration::from_secs(60))
.build()
.context("Failed to build HTTP client")?;
let auth = auth.map(|a| {
logos_blockchain_common_http_client::BasicAuthCredentials::new(a.username, a.password)
});
let http_client = CommonHttpClient::new_with_client(client, auth);
Ok(Self {
http_client,
node_url,
backoff,
})
}
pub async fn post_transaction(&self, tx: SignedMantleTx) -> Result<Result<(), Error>, Error> {
Retry::spawn(self.backoff_strategy(), || async {
match self
.http_client
.post_transaction(self.node_url.clone(), tx.clone())
.await
{
Ok(()) => Ok(Ok(())),
Err(err) => match err {
// Retry arm.
// Retrying only reqwest errors: mainly connected to http.
Error::Request(_) => Err(err),
// Returning non-retryable error
Error::Server(_) | Error::Client(_) | Error::Url(_) => Ok(Err(err)),
},
}
})
.await
}
pub async fn get_lib_stream(&self) -> Result<impl Stream<Item = BlockInfo>, Error> {
self.http_client.get_lib_stream(self.node_url.clone()).await
}
pub async fn get_block_by_id(
&self,
header_id: HeaderId,
) -> Result<Option<Block<SignedMantleTx>>, Error> {
Retry::spawn(self.backoff_strategy(), || {
self.http_client
.get_block_by_id(self.node_url.clone(), header_id)
.inspect_err(|err| warn!("Block fetching failed with error: {err:#}"))
})
.await
}
pub async fn get_consensus_info(&self) -> Result<CryptarchiaInfo, Error> {
Retry::spawn(self.backoff_strategy(), || {
self.http_client
.consensus_info(self.node_url.clone())
.inspect_err(|err| warn!("Block fetching failed with error: {err:#}"))
})
.await
}
fn backoff_strategy(&self) -> impl Iterator<Item = Duration> {
let start_delay_millis = self
.backoff
.start_delay
.as_millis()
.try_into()
.expect("Start delay must be less than u64::MAX milliseconds");
tokio_retry::strategy::FibonacciBackoff::from_millis(start_delay_millis)
.take(self.backoff.max_retries)
}
}

View File

@ -1,4 +0,0 @@
set -e
curl -L https://risczero.com/install | bash
/Users/runner/.risc0/bin/rzup install
cargo build

View File

@ -1,4 +0,0 @@
set -e
curl -L https://risczero.com/install | bash
/home/runner/.risc0/bin/rzup install
cargo build

View File

@ -1,8 +0,0 @@
set -e
curl -L https://risczero.com/install | bash
/home/runner/.risc0/bin/rzup install
cargo install taplo-cli --locked
cargo fmt -- --check
taplo fmt --check

View File

@ -1,6 +0,0 @@
set -e
curl -L https://risczero.com/install | bash
/home/runner/.risc0/bin/rzup install
cargo test --release

54
clippy.toml Normal file
View File

@ -0,0 +1,54 @@
module-item-order-groupings = [
[
"use",
[
"use",
],
],
[
"modules",
[
"extern_crate",
"mod",
"foreign_mod",
],
],
[
"macros",
[
"macro",
],
],
[
"global_asm",
[
"global_asm",
],
],
[
"UPPER_SNAKE_CASE",
[
"static",
"const",
],
],
[
"PascalCase",
[
"ty_alias",
"enum",
"struct",
"union",
"trait",
"trait_alias",
"impl",
],
],
[
"lower_snake_case",
[
"fn",
],
],
]
source-item-ordering = ["module"]

23
common/Cargo.toml Normal file
View File

@ -0,0 +1,23 @@
[package]
name = "common"
version = "0.1.0"
edition = "2024"
license = { workspace = true }
[lints]
workspace = true
[dependencies]
nssa.workspace = true
nssa_core.workspace = true
anyhow.workspace = true
thiserror.workspace = true
serde.workspace = true
serde_with.workspace = true
base64.workspace = true
sha2.workspace = true
log.workspace = true
hex.workspace = true
borsh.workspace = true
logos-blockchain-common-http-client.workspace = true

153
common/src/block.rs Normal file
View File

@ -0,0 +1,153 @@
use borsh::{BorshDeserialize, BorshSerialize};
use nssa::AccountId;
use serde::{Deserialize, Serialize};
use sha2::{Digest as _, Sha256, digest::FixedOutput as _};
use crate::{HashType, transaction::NSSATransaction};
pub type MantleMsgId = [u8; 32];
pub type BlockHash = HashType;
pub type BlockId = u64;
pub type TimeStamp = u64;
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub struct BlockMeta {
pub id: BlockId,
pub hash: BlockHash,
pub msg_id: MantleMsgId,
}
#[derive(Debug, Clone)]
/// Our own hasher.
/// Currently it is SHA256 hasher wrapper. May change in a future.
pub struct OwnHasher;
impl OwnHasher {
fn hash(data: &[u8]) -> HashType {
let mut hasher = Sha256::new();
hasher.update(data);
HashType(<[u8; 32]>::from(hasher.finalize_fixed()))
}
}
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub struct BlockHeader {
pub block_id: BlockId,
pub prev_block_hash: BlockHash,
pub hash: BlockHash,
pub timestamp: TimeStamp,
pub signature: nssa::Signature,
}
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub struct BlockBody {
pub transactions: Vec<NSSATransaction>,
}
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub enum BedrockStatus {
Pending,
Safe,
Finalized,
}
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub struct Block {
pub header: BlockHeader,
pub body: BlockBody,
pub bedrock_status: BedrockStatus,
pub bedrock_parent_id: MantleMsgId,
}
impl Serialize for Block {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
crate::borsh_base64::serialize(self, serializer)
}
}
impl<'de> Deserialize<'de> for Block {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
crate::borsh_base64::deserialize(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)]
pub struct HashableBlockData {
pub block_id: BlockId,
pub prev_block_hash: BlockHash,
pub timestamp: TimeStamp,
pub transactions: Vec<NSSATransaction>,
}
impl HashableBlockData {
#[must_use]
pub fn into_pending_block(
self,
signing_key: &nssa::PrivateKey,
bedrock_parent_id: MantleMsgId,
) -> Block {
let data_bytes = borsh::to_vec(&self).unwrap();
let signature = nssa::Signature::new(signing_key, &data_bytes);
let hash = OwnHasher::hash(&data_bytes);
Block {
header: BlockHeader {
block_id: self.block_id,
prev_block_hash: self.prev_block_hash,
hash,
timestamp: self.timestamp,
signature,
},
body: BlockBody {
transactions: self.transactions,
},
bedrock_status: BedrockStatus::Pending,
bedrock_parent_id,
}
}
#[must_use]
pub fn block_hash(&self) -> BlockHash {
OwnHasher::hash(&borsh::to_vec(&self).unwrap())
}
}
impl From<Block> for HashableBlockData {
fn from(value: Block) -> Self {
Self {
block_id: value.header.block_id,
prev_block_hash: value.header.prev_block_hash,
timestamp: value.header.timestamp,
transactions: value.body.transactions,
}
}
}
/// Helper struct for account (de-)serialization.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccountInitialData {
pub account_id: AccountId,
pub balance: u128,
}
/// Helper struct to (de-)serialize initial commitments.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommitmentsInitialData {
pub npk: nssa_core::NullifierPublicKey,
pub account: nssa_core::account::Account,
}
#[cfg(test)]
mod tests {
use crate::{HashType, block::HashableBlockData, test_utils};
#[test]
fn encoding_roundtrip() {
let transactions = vec![test_utils::produce_dummy_empty_transaction()];
let block = test_utils::produce_dummy_block(1, Some(HashType([1; 32])), transactions);
let hashable = HashableBlockData::from(block);
let bytes = borsh::to_vec(&hashable).unwrap();
let block_from_bytes = borsh::from_slice::<HashableBlockData>(&bytes).unwrap();
assert_eq!(hashable, block_from_bytes);
}
}

View File

@ -0,0 +1,25 @@
//! This module provides utilities for serializing and deserializing data by combining Borsh and
//! Base64 encodings.
use base64::{Engine as _, engine::general_purpose::STANDARD};
use borsh::{BorshDeserialize, BorshSerialize};
use serde::{Deserialize, Serialize};
pub fn serialize<T: BorshSerialize, S: serde::Serializer>(
value: &T,
serializer: S,
) -> Result<S::Ok, S::Error> {
let borsh_encoded = borsh::to_vec(value).map_err(serde::ser::Error::custom)?;
let base64_encoded = STANDARD.encode(&borsh_encoded);
Serialize::serialize(&base64_encoded, serializer)
}
pub fn deserialize<'de, T: BorshDeserialize, D: serde::Deserializer<'de>>(
deserializer: D,
) -> Result<T, D::Error> {
let base64_encoded = <String as Deserialize>::deserialize(deserializer)?;
let borsh_encoded = STANDARD
.decode(base64_encoded.as_bytes())
.map_err(serde::de::Error::custom)?;
borsh::from_slice(&borsh_encoded).map_err(serde::de::Error::custom)
}

55
common/src/config.rs Normal file
View File

@ -0,0 +1,55 @@
//! Common configuration structures and utilities.
use std::str::FromStr;
use logos_blockchain_common_http_client::BasicAuthCredentials;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BasicAuth {
pub username: String,
pub password: Option<String>,
}
impl std::fmt::Display for BasicAuth {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.username)?;
if let Some(password) = &self.password {
write!(f, ":{password}")?;
}
Ok(())
}
}
impl FromStr for BasicAuth {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let parse = || {
let mut parts = s.splitn(2, ':');
let username = parts.next()?;
let password = parts.next().filter(|p| !p.is_empty());
if parts.next().is_some() {
return None;
}
Some((username, password))
};
let (username, password) = parse().ok_or_else(|| {
anyhow::anyhow!("Invalid auth format. Expected 'user' or 'user:password'")
})?;
Ok(Self {
username: username.to_owned(),
password: password.map(std::string::ToString::to_string),
})
}
}
impl From<BasicAuth> for BasicAuthCredentials {
fn from(value: BasicAuth) -> Self {
Self::new(value.username, value.password)
}
}

96
common/src/lib.rs Normal file
View File

@ -0,0 +1,96 @@
use std::{fmt::Display, str::FromStr};
use borsh::{BorshDeserialize, BorshSerialize};
use serde_with::{DeserializeFromStr, SerializeDisplay};
pub mod block;
mod borsh_base64;
pub mod config;
pub mod transaction;
// Module for tests utility functions
// TODO: Compile only for tests
pub mod test_utils;
pub const PINATA_BASE58: &str = "EfQhKQAkX2FJiwNii2WFQsGndjvF1Mzd7RuVe7QdPLw7";
#[derive(
Default,
Copy,
Clone,
PartialEq,
Eq,
Hash,
SerializeDisplay,
DeserializeFromStr,
BorshSerialize,
BorshDeserialize,
)]
pub struct HashType(pub [u8; 32]);
impl Display for HashType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", hex::encode(self.0))
}
}
impl std::fmt::Debug for HashType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", hex::encode(self.0))
}
}
impl FromStr for HashType {
type Err = hex::FromHexError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut bytes = [0_u8; 32];
hex::decode_to_slice(s, &mut bytes)?;
Ok(Self(bytes))
}
}
impl AsRef<[u8]> for HashType {
fn as_ref(&self) -> &[u8] {
&self.0
}
}
impl From<HashType> for [u8; 32] {
fn from(hash: HashType) -> Self {
hash.0
}
}
impl From<[u8; 32]> for HashType {
fn from(bytes: [u8; 32]) -> Self {
Self(bytes)
}
}
impl TryFrom<Vec<u8>> for HashType {
type Error = <[u8; 32] as TryFrom<Vec<u8>>>::Error;
fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
Ok(Self(value.try_into()?))
}
}
impl From<HashType> for Vec<u8> {
fn from(hash: HashType) -> Self {
hash.0.to_vec()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn serialization_roundtrip() {
let original = HashType([1_u8; 32]);
let serialized = original.to_string();
let deserialized = HashType::from_str(&serialized).unwrap();
assert_eq!(original, deserialized);
}
}

85
common/src/test_utils.rs Normal file
View File

@ -0,0 +1,85 @@
use nssa::AccountId;
use crate::{
HashType,
block::{Block, HashableBlockData},
transaction::NSSATransaction,
};
// Helpers
#[must_use]
pub fn sequencer_sign_key_for_testing() -> nssa::PrivateKey {
nssa::PrivateKey::try_new([37; 32]).unwrap()
}
// Dummy producers
/// Produce dummy block with.
///
/// `id` - block id, provide zero for genesis.
///
/// `prev_hash` - hash of previous block, provide None for genesis.
///
/// `transactions` - vector of `EncodedTransaction` objects.
#[must_use]
pub fn produce_dummy_block(
id: u64,
prev_hash: Option<HashType>,
transactions: Vec<NSSATransaction>,
) -> Block {
let block_data = HashableBlockData {
block_id: id,
prev_block_hash: prev_hash.unwrap_or_default(),
timestamp: id.saturating_mul(100),
transactions,
};
block_data.into_pending_block(&sequencer_sign_key_for_testing(), [0; 32])
}
#[must_use]
pub fn produce_dummy_empty_transaction() -> NSSATransaction {
let program_id = nssa::program::Program::authenticated_transfer_program().id();
let account_ids = vec![];
let nonces = vec![];
let instruction_data: u128 = 0;
let message = nssa::public_transaction::Message::try_new(
program_id,
account_ids,
nonces,
instruction_data,
)
.unwrap();
let private_key = nssa::PrivateKey::try_new([1; 32]).unwrap();
let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[&private_key]);
let nssa_tx = nssa::PublicTransaction::new(message, witness_set);
NSSATransaction::Public(nssa_tx)
}
#[must_use]
pub fn create_transaction_native_token_transfer(
from: AccountId,
nonce: u128,
to: AccountId,
balance_to_move: u128,
signing_key: &nssa::PrivateKey,
) -> NSSATransaction {
let account_ids = vec![from, to];
let nonces = vec![nonce.into()];
let program_id = nssa::program::Program::authenticated_transfer_program().id();
let message = nssa::public_transaction::Message::try_new(
program_id,
account_ids,
nonces,
balance_to_move,
)
.unwrap();
let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[signing_key]);
let nssa_tx = nssa::PublicTransaction::new(message, witness_set);
NSSATransaction::Public(nssa_tx)
}

118
common/src/transaction.rs Normal file
View File

@ -0,0 +1,118 @@
use borsh::{BorshDeserialize, BorshSerialize};
use log::warn;
use nssa::{AccountId, V03State};
use serde::{Deserialize, Serialize};
use crate::HashType;
#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)]
pub enum NSSATransaction {
Public(nssa::PublicTransaction),
PrivacyPreserving(nssa::PrivacyPreservingTransaction),
ProgramDeployment(nssa::ProgramDeploymentTransaction),
}
impl Serialize for NSSATransaction {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
crate::borsh_base64::serialize(self, serializer)
}
}
impl<'de> Deserialize<'de> for NSSATransaction {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
crate::borsh_base64::deserialize(deserializer)
}
}
impl NSSATransaction {
#[must_use]
pub fn hash(&self) -> HashType {
HashType(match self {
Self::Public(tx) => tx.hash(),
Self::PrivacyPreserving(tx) => tx.hash(),
Self::ProgramDeployment(tx) => tx.hash(),
})
}
#[must_use]
pub fn affected_public_account_ids(&self) -> Vec<AccountId> {
match self {
Self::ProgramDeployment(tx) => tx.affected_public_account_ids(),
Self::Public(tx) => tx.affected_public_account_ids(),
Self::PrivacyPreserving(tx) => tx.affected_public_account_ids(),
}
}
// TODO: Introduce type-safe wrapper around checked transaction, e.g. AuthenticatedTransaction
pub fn transaction_stateless_check(self) -> Result<Self, TransactionMalformationError> {
// Stateless checks here
match self {
Self::Public(tx) => {
if tx.witness_set().is_valid_for(tx.message()) {
Ok(Self::Public(tx))
} else {
Err(TransactionMalformationError::InvalidSignature)
}
}
Self::PrivacyPreserving(tx) => {
if tx.witness_set().signatures_are_valid_for(tx.message()) {
Ok(Self::PrivacyPreserving(tx))
} else {
Err(TransactionMalformationError::InvalidSignature)
}
}
Self::ProgramDeployment(tx) => Ok(Self::ProgramDeployment(tx)),
}
}
pub fn execute_check_on_state(
self,
state: &mut V03State,
) -> Result<Self, nssa::error::NssaError> {
match &self {
Self::Public(tx) => state.transition_from_public_transaction(tx),
Self::PrivacyPreserving(tx) => state.transition_from_privacy_preserving_transaction(tx),
Self::ProgramDeployment(tx) => state.transition_from_program_deployment_transaction(tx),
}
.inspect_err(|err| warn!("Error at transition {err:#?}"))?;
Ok(self)
}
}
impl From<nssa::PublicTransaction> for NSSATransaction {
fn from(value: nssa::PublicTransaction) -> Self {
Self::Public(value)
}
}
impl From<nssa::PrivacyPreservingTransaction> for NSSATransaction {
fn from(value: nssa::PrivacyPreservingTransaction) -> Self {
Self::PrivacyPreserving(value)
}
}
impl From<nssa::ProgramDeploymentTransaction> for NSSATransaction {
fn from(value: nssa::ProgramDeploymentTransaction) -> Self {
Self::ProgramDeployment(value)
}
}
#[derive(
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize,
)]
pub enum TxKind {
Public,
PrivacyPreserving,
ProgramDeployment,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, thiserror::Error)]
pub enum TransactionMalformationError {
#[error("Invalid signature(-s)")]
InvalidSignature,
#[error("Failed to decode transaction with hash: {tx:?}")]
FailedToDecode { tx: HashType },
#[error("Transaction size {size} exceeds maximum allowed size of {max} bytes")]
TransactionTooLarge { size: usize, max: usize },
}

206
completions/README.md Normal file
View File

@ -0,0 +1,206 @@
# Wallet CLI Completion
Completion scripts for the LSSA `wallet` command.
## ZSH
Works with both vanilla zsh and oh-my-zsh.
### Features
- Full completion for all wallet subcommands
- Contextual option completion for each command
- Dynamic account ID completion via `wallet account list`
- Descriptions for all commands and options
Note that only accounts created by the user auto-complete.
Preconfigured accounts and accounts only with `/` (no number) are not completed.
e.g.:
```
▶ wallet account list
Preconfigured Public/7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo,
Preconfigured Public/6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV,
Preconfigured Private/3oCG8gqdKLMegw4rRfyaMQvuPHpcASt7xwttsmnZLSkw,
Preconfigured Private/AKTcXgJ1xoynta1Ec7y6Jso1z1JQtHqd7aPQ1h9er6xX,
/ Public/8DstRgMQrB2N9a7ymv98RDDbt8nctrP9ZzaNRSpKDZSu,
/0 Public/2gJJjtG9UivBGEhA1Jz6waZQx1cwfYupC5yvKEweHaeH,
/ Private/Bcv15B36bs1VqvQAdY6ZGFM1KioByNQQsB92KTNAx6u2
```
Only `Public/2gJJjtG9UivBGEhA1Jz6waZQx1cwfYupC5yvKEweHaeH` is used for completion.
### Supported Commands
| Command | Description |
|------------------------|-------------------------------------------------------------|
| `wallet auth-transfer` | Authenticated transfer (init, send) |
| `wallet chain-info` | Chain info queries (current-block-id, block, transaction) |
| `wallet account` | Account management (get, list, new, sync-private) |
| `wallet pinata` | Piñata faucet (claim) |
| `wallet token` | Token operations (new, send) |
| `wallet amm` | AMM operations (new, swap, add-liquidity, remove-liquidity) |
| `wallet check-health` | Health check |
### Installation
#### Vanilla Zsh
1. Create a completions directory:
```sh
mkdir -p ~/.zsh/completions
```
2. Copy the completion file:
```sh
cp ./zsh/_wallet ~/.zsh/completions/
```
3. Add to your `~/.zshrc` (before any `compinit` call, or add these lines if you don't have one):
```sh
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
```
4. Reload your shell:
```sh
exec zsh
```
#### Oh-My-Zsh
1. Create the plugin directory and copy the file:
```sh
mkdir -p ~/.oh-my-zsh/custom/plugins/wallet
cp _wallet ~/.oh-my-zsh/custom/plugins/wallet/
```
2. Add `wallet` to your plugins array in `~/.zshrc`:
```sh
plugins=(... wallet)
```
3. Reload your shell:
```sh
exec zsh
```
### Requirements
The completion script calls `wallet account list` to dynamically fetch account IDs. Ensure the `wallet` command is in your `$PATH`.
### Usage
```sh
# Main commands
wallet <TAB>
# Account subcommands
wallet account <TAB>
# Options for auth-transfer send
wallet auth-transfer send --<TAB>
# Account types when creating
wallet account new <TAB>
# Shows: public private
# Account IDs (fetched dynamically)
wallet account get --account-id <TAB>
# Shows: Public/... Private/...
```
## Bash
Works with bash 4+. The `bash-completion` package is required for auto-sourcing from
`/etc/bash_completion.d/`; without it, source the file directly from `~/.bashrc` instead.
### Features
- Full completion for all wallet subcommands
- Contextual option completion for each command
- Dynamic account ID completion via `wallet account list`
- Falls back to `Public/` / `Private/` prefixes when no accounts are available
Note that only accounts created by the user auto-complete (same filtering as zsh — see above).
### Installation
#### Option A — source directly from `~/.bashrc` (works everywhere)
```sh
echo "source $(pwd)/completions/bash/wallet" >> ~/.bashrc
exec bash
```
#### Option B — system-wide via `bash-completion`
1. Copy the file:
```sh
cp ./bash/wallet /etc/bash_completion.d/wallet
```
2. Ensure `bash-completion` is initialised in every interactive shell. On many Linux
distributions (e.g. Fedora) it is only sourced for **login** shells via
`/etc/profile.d/bash_completion.sh`. For non-login shells (e.g. a bash session started
inside zsh), add this to `~/.bashrc`:
```sh
[[ -f /usr/share/bash-completion/bash_completion ]] && source /usr/share/bash-completion/bash_completion
```
3. Reload your shell:
```sh
exec bash
```
### Requirements
The completion script calls `wallet account list` to dynamically fetch account IDs. Ensure the `wallet` command is in your `$PATH`.
### Usage
```sh
# Main commands
wallet <TAB>
# Account subcommands
wallet account <TAB>
# Options for auth-transfer send
wallet auth-transfer send --<TAB>
# Account types when creating
wallet account new <TAB>
# Shows: public private
# Account IDs (fetched dynamically)
wallet account get --account-id <TAB>
# Shows: Public/... Private/...
```
## Troubleshooting
### Zsh completions not appearing
1. Check that `compinit` is called in your `.zshrc`
2. Rebuild the completion cache:
```sh
rm -f ~/.zcompdump*
exec zsh
```
### Account IDs not completing
Ensure `wallet account list` works from your command line.

382
completions/bash/wallet Normal file
View File

@ -0,0 +1,382 @@
#!/usr/bin/env bash
# Bash completion script for the wallet CLI
# See instructions in ../README.md
# Helper function to complete account IDs
# Uses `wallet account list` to get available accounts
# Only includes accounts with /N prefix (where N is a number)
_wallet_complete_account_id() {
local cur="$1"
local accounts
if command -v wallet &>/dev/null; then
accounts=$(wallet account list 2>/dev/null | grep '^/[0-9]' | awk '{print $2}' | tr -d ',')
fi
if [[ -n "$accounts" ]]; then
COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
else
COMPREPLY=($(compgen -W "Public/ Private/" -- "$cur"))
compopt -o nospace 2>/dev/null
fi
}
_wallet() {
local cur prev words cword
_init_completion 2>/dev/null || {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
words=("${COMP_WORDS[@]}")
cword=$COMP_CWORD
}
local commands="auth-transfer chain-info account pinata token amm check-health config restore-keys deploy-program help"
# Find the main command and subcommand by scanning words before the cursor.
# Global options that take a value are skipped along with their argument.
local cmd="" subcmd=""
local cmd_idx=0 subcmd_idx=0
local i
for ((i = 1; i < cword; i++)); do
local w="${words[$i]}"
case "$w" in
--auth)
((i++)) # skip the auth value
;;
-c | --continuous-run)
# boolean flag, no value
;;
-*)
# unrecognised option, skip
;;
*)
if [[ -z "$cmd" ]]; then
cmd="$w"
cmd_idx=$i
elif [[ -z "$subcmd" ]]; then
subcmd="$w"
subcmd_idx=$i
fi
;;
esac
done
local config_keys="override_rust_log sequencer_addr seq_poll_timeout seq_tx_poll_max_blocks seq_poll_max_retries seq_block_poll_max_amount initial_accounts basic_auth"
case "$cmd" in
"")
# Completing the main command or a global option
if [[ "$prev" == "--auth" ]]; then
return # completing the --auth value; no suggestions
fi
case "$cur" in
-*)
COMPREPLY=($(compgen -W "-c --continuous-run --auth" -- "$cur"))
;;
*)
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
;;
esac
;;
auth-transfer)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "init send help" -- "$cur"))
;;
init)
case "$prev" in
--account-id)
_wallet_complete_account_id "$cur"
;;
*)
COMPREPLY=($(compgen -W "--account-id" -- "$cur"))
;;
esac
;;
send)
case "$prev" in
--from | --to)
_wallet_complete_account_id "$cur"
;;
--to-npk | --to-vpk | --amount)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--from --to --to-npk --to-vpk --amount" -- "$cur"))
;;
esac
;;
esac
;;
chain-info)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "current-block-id block transaction help" -- "$cur"))
;;
block)
case "$prev" in
-i | --id)
;; # no specific completion for block ID
*)
COMPREPLY=($(compgen -W "-i --id" -- "$cur"))
;;
esac
;;
transaction)
case "$prev" in
-t | --hash)
;; # no specific completion for tx hash
*)
COMPREPLY=($(compgen -W "-t --hash" -- "$cur"))
;;
esac
;;
esac
;;
account)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "get new sync-private list ls label help" -- "$cur"))
;;
get)
case "$prev" in
-a | --account-id)
_wallet_complete_account_id "$cur"
;;
*)
COMPREPLY=($(compgen -W "-r --raw -k --keys -a --account-id" -- "$cur"))
;;
esac
;;
list | ls)
COMPREPLY=($(compgen -W "-l --long" -- "$cur"))
;;
sync-private)
;; # no options
new)
# `account new` is itself a subcommand: public | private
local new_subcmd=""
for ((i = subcmd_idx + 1; i < cword; i++)); do
case "${words[$i]}" in
public | private)
new_subcmd="${words[$i]}"
break
;;
esac
done
if [[ -z "$new_subcmd" ]]; then
COMPREPLY=($(compgen -W "public private" -- "$cur"))
else
case "$prev" in
--cci | -l | --label)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--cci -l --label" -- "$cur"))
;;
esac
fi
;;
label)
case "$prev" in
-a | --account-id)
_wallet_complete_account_id "$cur"
;;
-l | --label)
;; # no specific completion for label value
*)
COMPREPLY=($(compgen -W "-a --account-id -l --label" -- "$cur"))
;;
esac
;;
esac
;;
pinata)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "claim help" -- "$cur"))
;;
claim)
case "$prev" in
--to)
_wallet_complete_account_id "$cur"
;;
*)
COMPREPLY=($(compgen -W "--to" -- "$cur"))
;;
esac
;;
esac
;;
token)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "new send burn mint help" -- "$cur"))
;;
new)
case "$prev" in
--definition-account-id | --supply-account-id)
_wallet_complete_account_id "$cur"
;;
-n | --name | -t | --total-supply)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--definition-account-id --supply-account-id -n --name -t --total-supply" -- "$cur"))
;;
esac
;;
send)
case "$prev" in
--from | --to)
_wallet_complete_account_id "$cur"
;;
--to-npk | --to-vpk | --amount)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--from --to --to-npk --to-vpk --amount" -- "$cur"))
;;
esac
;;
burn)
case "$prev" in
--definition | --holder)
_wallet_complete_account_id "$cur"
;;
--amount)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--definition --holder --amount" -- "$cur"))
;;
esac
;;
mint)
case "$prev" in
--definition | --holder)
_wallet_complete_account_id "$cur"
;;
--holder-npk | --holder-vpk | --amount)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--definition --holder --holder-npk --holder-vpk --amount" -- "$cur"))
;;
esac
;;
esac
;;
amm)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "new swap add-liquidity remove-liquidity help" -- "$cur"))
;;
new)
case "$prev" in
--user-holding-a | --user-holding-b | --user-holding-lp)
_wallet_complete_account_id "$cur"
;;
--balance-a | --balance-b)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--user-holding-a --user-holding-b --user-holding-lp --balance-a --balance-b" -- "$cur"))
;;
esac
;;
swap)
case "$prev" in
--user-holding-a | --user-holding-b)
_wallet_complete_account_id "$cur"
;;
--amount-in | --min-amount-out | --token-definition)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--user-holding-a --user-holding-b --amount-in --min-amount-out --token-definition" -- "$cur"))
;;
esac
;;
add-liquidity)
case "$prev" in
--user-holding-a | --user-holding-b | --user-holding-lp)
_wallet_complete_account_id "$cur"
;;
--max-amount-a | --max-amount-b | --min-amount-lp)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--user-holding-a --user-holding-b --user-holding-lp --max-amount-a --max-amount-b --min-amount-lp" -- "$cur"))
;;
esac
;;
remove-liquidity)
case "$prev" in
--user-holding-a | --user-holding-b | --user-holding-lp)
_wallet_complete_account_id "$cur"
;;
--balance-lp | --min-amount-a | --min-amount-b)
;; # no specific completion
*)
COMPREPLY=($(compgen -W "--user-holding-a --user-holding-b --user-holding-lp --balance-lp --min-amount-a --min-amount-b" -- "$cur"))
;;
esac
;;
esac
;;
config)
case "$subcmd" in
"")
COMPREPLY=($(compgen -W "get set description help" -- "$cur"))
;;
get)
# Accepts optional -a/--all flag and an optional positional key
COMPREPLY=($(compgen -W "--all -a $config_keys" -- "$cur"))
;;
set)
# set <key> <value> — only complete the key; no completion for the value
local set_args=0
for ((i = subcmd_idx + 1; i < cword; i++)); do
[[ "${words[$i]}" != -* ]] && ((set_args++))
done
if [[ $set_args -eq 0 ]]; then
COMPREPLY=($(compgen -W "$config_keys" -- "$cur"))
fi
;;
description)
# description <key> — only complete if no key provided yet
local has_key=false
for ((i = subcmd_idx + 1; i < cword; i++)); do
[[ "${words[$i]}" != -* ]] && has_key=true && break
done
if ! $has_key; then
COMPREPLY=($(compgen -W "$config_keys" -- "$cur"))
fi
;;
esac
;;
restore-keys)
case "$prev" in
-d | --depth)
;; # no specific completion for depth value
*)
COMPREPLY=($(compgen -W "-d --depth" -- "$cur"))
;;
esac
;;
deploy-program)
COMPREPLY=($(compgen -f -- "$cur"))
compopt -o filenames 2>/dev/null
;;
help)
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
;;
esac
}
complete -F _wallet wallet

446
completions/zsh/_wallet Normal file
View File

@ -0,0 +1,446 @@
#compdef wallet
# Zsh completion script for the wallet CLI
# See instructions in ../README.md
_wallet() {
local -a commands
local -a subcommands
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'(-c --continuous-run)'{-c,--continuous-run}'[Continuous run flag]' \
'--auth[Basic authentication in the format user or user\:password]:auth:' \
'1: :->command' \
'*:: :->args'
case $state in
command)
commands=(
'auth-transfer:Authenticated transfer subcommand'
'chain-info:Generic chain info subcommand'
'account:Account view and sync subcommand'
'pinata:Pinata program interaction subcommand'
'token:Token program interaction subcommand'
'amm:AMM program interaction subcommand'
'check-health:Check the wallet can connect to the node and builtin local programs match the remote versions'
'config:Command to setup config, get and set config fields'
'restore-keys:Restoring keys from given password at given depth'
'deploy-program:Deploy a program'
'help:Print help message or the help of the given subcommand(s)'
)
_describe -t commands 'wallet commands' commands
;;
args)
case $line[1] in
auth-transfer)
_wallet_auth_transfer
;;
chain-info)
_wallet_chain_info
;;
account)
_wallet_account
;;
pinata)
_wallet_pinata
;;
token)
_wallet_token
;;
amm)
_wallet_amm
;;
config)
_wallet_config
;;
restore-keys)
_wallet_restore_keys
;;
deploy-program)
_wallet_deploy_program
;;
help)
_wallet_help
;;
esac
;;
esac
}
# auth-transfer subcommand
_wallet_auth_transfer() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'init:Initialize account under authenticated transfer program'
'send:Send native tokens from one account to another with variable privacy'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'auth-transfer subcommands' subcommands
;;
args)
case $line[1] in
init)
_arguments \
'--account-id[Account ID to initialize]:account_id:_wallet_account_ids'
;;
send)
_arguments \
'--from[Source account ID]:from_account:_wallet_account_ids' \
'--to[Destination account ID (for owned accounts)]:to_account:_wallet_account_ids' \
'--to-npk[Destination nullifier public key (for foreign private accounts)]:npk:' \
'--to-vpk[Destination viewing public key (for foreign private accounts)]:vpk:' \
'--amount[Amount of native tokens to send]:amount:'
;;
esac
;;
esac
}
# chain-info subcommand
_wallet_chain_info() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'current-block-id:Get current block id from sequencer'
'block:Get block at id from sequencer'
'transaction:Get transaction at hash from sequencer'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'chain-info subcommands' subcommands
;;
args)
case $line[1] in
block)
_arguments \
'--id[Block ID to retrieve]:block_id:'
;;
transaction)
_arguments \
'--hash[Transaction hash to retrieve]:tx_hash:'
;;
esac
;;
esac
}
# account subcommand
_wallet_account() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'get:Get account data'
'list:List all accounts owned by the wallet'
'ls:List all accounts (alias for list)'
'new:Produce new public or private account'
'sync-private:Sync private accounts'
'label:Set a label for an account'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'account subcommands' subcommands
;;
args)
case $line[1] in
get)
_arguments \
'(-r --raw)'{-r,--raw}'[Get raw account data]' \
'(-k --keys)'{-k,--keys}'[Display keys (pk for public accounts, npk/vpk for private accounts)]' \
'(-a --account-id)'{-a,--account-id}'[Account ID to query]:account_id:_wallet_account_ids'
;;
list|ls)
_arguments \
'(-l --long)'{-l,--long}'[Display detailed account information]'
;;
new)
_arguments -C \
'1: :->account_type' \
'*:: :->new_args'
case $state in
account_type)
compadd public private
;;
new_args)
_arguments \
'--cci[Chain index of a parent node]:chain_index:' \
'(-l --label)'{-l,--label}'[Label to assign to the new account]:label:'
;;
esac
;;
label)
_arguments \
'(-a --account-id)'{-a,--account-id}'[Account ID to label]:account_id:_wallet_account_ids' \
'(-l --label)'{-l,--label}'[The label to assign to the account]:label:'
;;
esac
;;
esac
}
# pinata subcommand
_wallet_pinata() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'claim:Claim tokens from the Piñata faucet'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'pinata subcommands' subcommands
;;
args)
case $line[1] in
claim)
_arguments \
'--to[Destination account ID to receive claimed tokens]:to_account:_wallet_account_ids'
;;
esac
;;
esac
}
# token subcommand
_wallet_token() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'new:Produce a new token'
'send:Send tokens from one account to another with variable privacy'
'burn:Burn tokens on holder, modify definition'
'mint:Mint tokens on holder, modify definition'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'token subcommands' subcommands
;;
args)
case $line[1] in
new)
_arguments \
'--name[Token name]:name:' \
'--total-supply[Total supply of tokens to mint]:total_supply:' \
'--definition-account-id[Account ID for token definition]:definition_account:_wallet_account_ids' \
'--supply-account-id[Account ID to receive initial supply]:supply_account:_wallet_account_ids'
;;
send)
_arguments \
'--from[Source holding account ID]:from_account:_wallet_account_ids' \
'--to[Destination holding account ID (for owned accounts)]:to_account:_wallet_account_ids' \
'--to-npk[Destination nullifier public key (for foreign private accounts)]:npk:' \
'--to-vpk[Destination viewing public key (for foreign private accounts)]:vpk:' \
'--amount[Amount of tokens to send]:amount:'
;;
burn)
_arguments \
'--definition[Definition account ID]:definition_account:_wallet_account_ids' \
'--holder[Holder account ID]:holder_account:_wallet_account_ids' \
'--amount[Amount of tokens to burn]:amount:'
;;
mint)
_arguments \
'--definition[Definition account ID]:definition_account:_wallet_account_ids' \
'--holder[Holder account ID (for owned accounts)]:holder_account:_wallet_account_ids' \
'--holder-npk[Holder nullifier public key (for foreign private accounts)]:npk:' \
'--holder-vpk[Holder viewing public key (for foreign private accounts)]:vpk:' \
'--amount[Amount of tokens to mint]:amount:'
;;
esac
;;
esac
}
# amm subcommand
_wallet_amm() {
local -a subcommands
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'new:Create a new liquidity pool'
'swap:Swap tokens using the AMM'
'add-liquidity:Add liquidity to an existing pool'
'remove-liquidity:Remove liquidity from a pool'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'amm subcommands' subcommands
;;
args)
case $line[1] in
new)
_arguments \
'--user-holding-a[User token A holding account ID]:holding_a:_wallet_account_ids' \
'--user-holding-b[User token B holding account ID]:holding_b:_wallet_account_ids' \
'--user-holding-lp[User LP token holding account ID]:holding_lp:_wallet_account_ids' \
'--balance-a[Amount of token A to deposit]:balance_a:' \
'--balance-b[Amount of token B to deposit]:balance_b:'
;;
swap)
_arguments \
'--user-holding-a[User token A holding account ID]:holding_a:_wallet_account_ids' \
'--user-holding-b[User token B holding account ID]:holding_b:_wallet_account_ids' \
'--amount-in[Amount of tokens to swap]:amount_in:' \
'--min-amount-out[Minimum tokens expected in return]:min_amount_out:' \
'--token-definition[Definition ID of the token being provided]:token_def:'
;;
add-liquidity)
_arguments \
'--user-holding-a[User token A holding account ID]:holding_a:_wallet_account_ids' \
'--user-holding-b[User token B holding account ID]:holding_b:_wallet_account_ids' \
'--user-holding-lp[User LP token holding account ID]:holding_lp:_wallet_account_ids' \
'--max-amount-a[Maximum amount of token A to deposit]:max_amount_a:' \
'--max-amount-b[Maximum amount of token B to deposit]:max_amount_b:' \
'--min-amount-lp[Minimum LP tokens to receive]:min_amount_lp:'
;;
remove-liquidity)
_arguments \
'--user-holding-a[User token A holding account ID]:holding_a:_wallet_account_ids' \
'--user-holding-b[User token B holding account ID]:holding_b:_wallet_account_ids' \
'--user-holding-lp[User LP token holding account ID]:holding_lp:_wallet_account_ids' \
'--balance-lp[Amount of LP tokens to burn]:balance_lp:' \
'--min-amount-a[Minimum token A to receive]:min_amount_a:' \
'--min-amount-b[Minimum token B to receive]:min_amount_b:'
;;
esac
;;
esac
}
# config subcommand
_wallet_config() {
local -a subcommands
local -a config_keys
config_keys=(
'override_rust_log'
'sequencer_addr'
'seq_poll_timeout'
'seq_tx_poll_max_blocks'
'seq_poll_max_retries'
'seq_block_poll_max_amount'
'initial_accounts'
'basic_auth'
)
_arguments -C \
'1: :->subcommand' \
'*:: :->args'
case $state in
subcommand)
subcommands=(
'get:Getter of config fields'
'set:Setter of config fields'
'description:Prints description of corresponding field'
'help:Print this message or the help of the given subcommand(s)'
)
_describe -t subcommands 'config subcommands' subcommands
;;
args)
case $line[1] in
get)
_arguments \
'(-a --all)'{-a,--all}'[Print all config fields]' \
'::key:compadd -a config_keys'
;;
description)
compadd -a config_keys
;;
set)
_arguments \
'1:key:compadd -a config_keys' \
'2:value:'
;;
esac
;;
esac
}
# restore-keys subcommand
_wallet_restore_keys() {
_arguments \
'(-d --depth)'{-d,--depth}'[How deep in tree accounts may be]:depth:'
}
# deploy-program subcommand
_wallet_deploy_program() {
_arguments \
'1:binary filepath:_files'
}
# help subcommand
_wallet_help() {
local -a commands
commands=(
'auth-transfer:Authenticated transfer subcommand'
'chain-info:Generic chain info subcommand'
'account:Account view and sync subcommand'
'pinata:Pinata program interaction subcommand'
'token:Token program interaction subcommand'
'amm:AMM program interaction subcommand'
'check-health:Check the wallet can connect to the node'
'config:Command to setup config, get and set config fields'
'restore-keys:Restoring keys from given password at given depth'
'deploy-program:Deploy a program'
)
_describe -t commands 'wallet commands' commands
}
# Helper function to complete account IDs
# Uses `wallet account list` to get available accounts
# Only includes accounts with /N prefix (where N is a number)
_wallet_account_ids() {
local -a accounts
local line
# Try to get accounts from wallet account list command
# Filter to lines starting with /N (numbered accounts) and extract the account ID
if command -v wallet &>/dev/null; then
while IFS= read -r line; do
# Remove trailing comma if present and add to array
[[ -n "$line" ]] && accounts+=("${line%,}")
done < <(wallet account list 2>/dev/null | grep '^/[0-9]' | awk '{print $2}')
fi
# Provide type prefixes as fallback if command fails or returns nothing
if (( ${#accounts} == 0 )); then
compadd -S '' -- 'Public/' 'Private/'
return
fi
_multi_parts / accounts
}
_wallet "$@"

View File

@ -0,0 +1,160 @@
{
"home": "./indexer/service",
"consensus_info_polling_interval": "1s",
"bedrock_client_config": {
"addr": "http://logos-blockchain-node-0:18080",
"backoff": {
"start_delay": "100ms",
"max_retries": 5
}
},
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"initial_accounts": [
{
"account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV",
"balance": 10000
},
{
"account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo",
"balance": 20000
}
],
"initial_commitments": [
{
"npk":[
177,
64,
1,
11,
87,
38,
254,
159,
231,
165,
1,
94,
64,
137,
243,
76,
249,
101,
251,
129,
33,
101,
189,
30,
42,
11,
191,
34,
103,
186,
227,
230
] ,
"account": {
"program_owner": [
0,
0,
0,
0,
0,
0,
0,
0
],
"balance": 10000,
"data": [],
"nonce": 0
}
},
{
"npk": [
32,
67,
72,
164,
106,
53,
66,
239,
141,
15,
52,
230,
136,
177,
2,
236,
207,
243,
134,
135,
210,
143,
87,
232,
215,
128,
194,
120,
113,
224,
4,
165
],
"account": {
"program_owner": [
0,
0,
0,
0,
0,
0,
0,
0
],
"balance": 20000,
"data": [],
"nonce": 0
}
}
],
"signing_key": [
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37
]
}

View File

@ -0,0 +1,167 @@
{
"home": "/var/lib/sequencer_service",
"genesis_id": 1,
"is_genesis_random": true,
"max_num_tx_in_block": 20,
"max_block_size": "1 MiB",
"mempool_max_size": 10000,
"block_create_timeout": "10s",
"retry_pending_blocks_timeout": "7s",
"bedrock_config": {
"backoff": {
"start_delay": "100ms",
"max_retries": 5
},
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"node_url": "http://logos-blockchain-node-0:18080"
},
"indexer_rpc_url": "ws://indexer_service:8779",
"initial_accounts": [
{
"account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV",
"balance": 10000
},
{
"account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo",
"balance": 20000
}
],
"initial_commitments": [
{
"npk":[
177,
64,
1,
11,
87,
38,
254,
159,
231,
165,
1,
94,
64,
137,
243,
76,
249,
101,
251,
129,
33,
101,
189,
30,
42,
11,
191,
34,
103,
186,
227,
230
] ,
"account": {
"program_owner": [
0,
0,
0,
0,
0,
0,
0,
0
],
"balance": 10000,
"data": [],
"nonce": 0
}
},
{
"npk": [
32,
67,
72,
164,
106,
53,
66,
239,
141,
15,
52,
230,
136,
177,
2,
236,
207,
243,
134,
135,
210,
143,
87,
232,
215,
128,
194,
120,
113,
224,
4,
165
],
"account": {
"program_owner": [
0,
0,
0,
0,
0,
0,
0,
0
],
"balance": 20000,
"data": [],
"nonce": 0
}
}
],
"signing_key": [
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37,
37
]
}

View File

@ -1,15 +0,0 @@
[package]
name = "consensus"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow.workspace = true
serde_json.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
tokio.workspace = true
[dependencies.networking]
path = "../networking"

View File

@ -1,22 +0,0 @@
use std::sync::Arc;
use networking::peer_manager::PeerManager;
use tokio::sync::Mutex;
#[derive(Debug)]
///Entrypoint to consensus.
/// Manages consensus protocol.
pub struct ConsensusManager {
pub peer_manager: Arc<Mutex<PeerManager>>,
}
impl ConsensusManager {
pub fn new(peer_manager: Arc<Mutex<PeerManager>>) -> Self {
Self { peer_manager }
}
//ToDo: change block from generic value into struct, when data block will be defined
pub fn vote(&self, _block: serde_json::Value) -> bool {
todo!()
}
}

View File

@ -0,0 +1,27 @@
# This file is automatically applied on top of docker-compose.yml when running `docker compose` commands.
services:
logos-blockchain-node-0:
ports: !override
- "18080:18080/tcp"
environment:
- RUST_LOG=error
sequencer_service:
depends_on:
- logos-blockchain-node-0
- indexer_service
volumes:
- ./configs/docker-all-in-one/sequencer_config.json:/etc/sequencer_service/sequencer_config.json
indexer_service:
depends_on:
- logos-blockchain-node-0
volumes:
- ./configs/docker-all-in-one/indexer_config.json:/etc/indexer_service/indexer_config.json
explorer_service:
depends_on:
- indexer_service
environment:
- INDEXER_RPC_URL=http://indexer_service:8779

13
docker-compose.yml Normal file
View File

@ -0,0 +1,13 @@
# All-in-one docker compose configuration.
# It runs all services from this repo and the bedrock nodes in a single docker network.
# This is useful for development and testing purposes.
include:
- path:
bedrock/docker-compose.yml
- path:
sequencer/service/docker-compose.yml
- path:
indexer/service/docker-compose.yml
- path:
explorer_service/docker-compose.yml

View File

@ -0,0 +1,109 @@
# Automated Market Maker (AMM)
This tutorial covers the AMM program in LEZ. The AMM manages liquidity pools and enables swaps between custom tokens. By the end, you will have practiced:
1. Creating a liquidity pool for a token pair.
2. Swapping tokens.
3. Withdrawing liquidity from the pool.
4. Adding liquidity to the pool.
## 1. Creating a liquidity pool for a token pair
We start by creating a pool for the tokens created earlier. In return for providing liquidity, you receive liquidity provider (LP) tokens. LP tokens represent your share of the pool and are required to withdraw liquidity later.
> [!NOTE]
> The AMM does not currently charge swap fees or distribute rewards to liquidity providers. LP tokens therefore represent only a proportional share of the pool reserves. Fee support will be added in future versions.
### a. Create an LP holding account
```bash
wallet account new public
# Output:
Generated new account with account_id Public/FHgLW9jW4HXMV6egLWbwpTqVAGiCHw2vkg71KYSuimVf
```
### b. Initialize the pool
Deposit tokens A and B and specify the account that will receive LP tokens:
```bash
wallet amm new \
--user-holding-a Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw \
--user-holding-b Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6 \
--user-holding-lp Public/FHgLW9jW4HXMV6egLWbwpTqVAGiCHw2vkg71KYSuimVf \
--balance-a 100 \
--balance-b 200
```
> [!Important]
> The LP holding account is owned by the token program, so LP tokens are managed using the same token infrastructure as regular tokens.
```bash
wallet account get --account-id Public/FHgLW9jW4HXMV6egLWbwpTqVAGiCHw2vkg71KYSuimVf
# Output:
Holding account owned by token program
{"account_type":"Token holding","definition_id":"7BeDS3e28MA5Err7gBswmR1fUKdHXqmUpTefNPu3pJ9i","balance":100}
```
> [!Tip]
> If you inspect the `user-holding-a` and `user-holding-b` accounts, you will see that 100 and 200 tokens were deducted. Those tokens now reside in the pool and are available for swaps by any user.
## 2. Swapping
Use `wallet amm swap` to perform a token swap:
```bash
wallet amm swap \
--user-holding-a Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw \
--user-holding-b Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6 \
# The amount of tokens to swap
--amount-in 5 \
# The minimum number of tokens expected in return
--min-amount-out 8 \
# The definition ID of the token being provided to the swap
# In this case, we are swapping from TOKENA to TOKENB, and so this is the definition ID of TOKENA
--token-definition 4X9kAcnCZ1Ukkbm3nywW9xfCNPK8XaMWCk3zfs1sP4J7
```
Once executed, 5 tokens are deducted from the Token A holding account and the corresponding amount (computed by the pools pricing function) is credited to the Token B holding account.
## 3. Withdrawing liquidity from the pool
Liquidity providers can withdraw assets by redeeming (burning) LP tokens. The amount received is proportional to the share of LP tokens redeemed relative to the total LP supply.
Use `wallet amm remove-liquidity`:
```bash
wallet amm remove-liquidity \
--user-holding-a Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw \
--user-holding-b Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6 \
--user-holding-lp Public/FHgLW9jW4HXMV6egLWbwpTqVAGiCHw2vkg71KYSuimVf \
--balance-lp 20 \
--min-amount-a 1 \
--min-amount-b 1
```
> [!Important]
> This burns `balance-lp` LP tokens from the users LP holding account. In return, the AMM transfers tokens A and B from the pool vaults to the users holding accounts, based on current reserves.
> The `min-amount-a` and `min-amount-b` parameters set the minimum acceptable outputs. If the computed amounts fall below either threshold, the instruction fails to protect against unfavorable pool changes.
## 4. Adding liquidity to the pool
To add liquidity, deposit tokens A and B in the ratio implied by current pool reserves. In return, the AMM mints new LP tokens that represent your proportional share.
Use `wallet amm add-liquidity`:
```bash
wallet amm add-liquidity \
--user-holding-a Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw \
--user-holding-b Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6 \
--user-holding-lp Public/FHgLW9jW4HXMV6egLWbwpTqVAGiCHw2vkg71KYSuimVf \
--min-amount-lp 1 \
--max-amount-a 10 \
--max-amount-b 10
```
> [!Important]
> `max-amount-a` and `max-amount-b` cap how many tokens A and B can be taken from the users accounts. The AMM computes the required amounts based on the pools reserve ratio.
> `min-amount-lp` sets the minimum LP tokens to mint. If the computed LP amount falls below this threshold, the instruction fails.

View File

@ -0,0 +1,159 @@
This tutorial focuses on custom tokens using the Token program. As of now, you have used the authenticated-transfers program for native tokens. The Token program is for creating and managing custom tokens. By the end, you will have practiced:
1. Creating new tokens.
2. Transferring custom tokens.
> [!Important]
> The Token program is a single program that creates and manages all tokens, so you do not deploy a new program for each token.
> Token program accounts fall into two types:
> - Token definition accounts: store token metadata such as name and total supply. This account is the tokens identifier.
> - Token holding accounts: store balances and the definition ID they belong to.
The CLI provides commands to execute the Token program. Run `wallet token` to see the options:
```bash
Commands:
new Produce a new token
send Send tokens from one account to another with variable privacy
help Print this message or the help of the given subcommand(s)
```
## 1. Creating new tokens
Use `wallet token new` to execute the `New` function of the Token program. The command expects:
- A token name.
- A total supply.
- Two uninitialized accounts:
- One for the token definition account.
- One for the token holding account that receives the initial supply.
### a. Public definition account and public supply account
1. Create two new public accounts:
```bash
wallet account new public
# Output:
Generated new account with account_id Public/4X9kAcnCZ1Ukkbm3nywW9xfCNPK8XaMWCk3zfs1sP4J7
```
```bash
wallet account new public
# Output:
Generated new account with account_id Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw
```
2. Create the token (Token A):
```bash
wallet token new \
--name TOKENA \
--total-supply 1337 \
--definition-account-id Public/4X9kAcnCZ1Ukkbm3nywW9xfCNPK8XaMWCk3zfs1sP4J7 \
--supply-account-id Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw
```
3. Inspect the initialized accounts:
```bash
wallet account get --account-id Public/4X9kAcnCZ1Ukkbm3nywW9xfCNPK8XaMWCk3zfs1sP4J7
# Output:
Definition account owned by token program
{"account_type":"Token definition","name":"TOKENA","total_supply":1337}
```
```bash
wallet account get --account-id Public/9RRSMm3w99uCD2Jp2Mqqf6dfc8me2tkFRE9HeU2DFftw
# Output:
Holding account owned by token program
{"account_type":"Token holding","definition_id":"4X9kAcnCZ1Ukkbm3nywW9xfCNPK8XaMWCk3zfs1sP4J7","balance":1337}
```
### b. Public definition account and private supply account
1. Create fresh accounts for this example:
> [!Important]
> You cannot reuse the accounts from the previous example. Create new ones here.
```bash
wallet account new public
# Output:
Generated new account with account_id Public/GQ3C8rbprTtQUCvkuVBRu3v9wvUvjafCMFqoSPvTEVii
```
```bash
wallet account new private
# Output:
Generated new account with account_id Private/HMRHZdPw4pbyPVZHNGrV6K5AA95wACFsHTRST84fr3CF
With npk 6a2dfe433cf28e525aa0196d719be3c16146f7ee358ca39595323f94fde38f93
With vpk 03d59abf4bee974cc12ddb44641c19f0b5441fef39191f047c988c29a77252a577
```
2. Create the token (Token B):
```bash
wallet token new \
--name TOKENB \
--total-supply 7331 \
--definition-account-id Public/GQ3C8rbprTtQUCvkuVBRu3v9wvUvjafCMFqoSPvTEVii \
--supply-account-id Private/HMRHZdPw4pbyPVZHNGrV6K5AA95wACFsHTRST84fr3CF
```
3. Inspect the accounts:
```bash
wallet account get --account-id Public/GQ3C8rbprTtQUCvkuVBRu3v9wvUvjafCMFqoSPvTEVii
# Output:
Definition account owned by token program
{"account_type":"Token definition","name":"TOKENB","total_supply":7331}
```
```bash
wallet account get --account-id Private/HMRHZdPw4pbyPVZHNGrV6K5AA95wACFsHTRST84fr3CF
# Output:
Holding account owned by token program
{"account_type":"Token holding","definition_id":"GQ3C8rbprTtQUCvkuVBRu3v9wvUvjafCMFqoSPvTEVii","balance":7331}
```
> [!Important]
> As a private account, the supply account is visible only in your local wallet storage.
## 2. Custom token transfers
The Token program can move balances between token holding accounts. If the recipient account is uninitialized, the token program will automatically claim it. Use `wallet token send` to execute a transfer.
### a. Create a recipient account
```bash
wallet account new public
# Output:
Generated new account with account_id Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6
```
### b. Send 1000 TOKENB to the recipient
```bash
wallet token send \
--from Private/HMRHZdPw4pbyPVZHNGrV6K5AA95wACFsHTRST84fr3CF \
--to Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6 \
--amount 1000
```
### c. Inspect the recipient account
```bash
wallet account get --account-id Public/88f2zeTgiv9LUthQwPJbrmufb9SiDfmpCs47B7vw6Gd6
# Output:
Holding account owned by token program
{"account_type":"Token holding","definition_id":"GQ3C8rbprTtQUCvkuVBRu3v9wvUvjafCMFqoSPvTEVii","balance":1000}
```

View File

@ -0,0 +1,250 @@
This tutorial walks through native token transfers between public and private accounts using the Authenticated-Transfers program. You will create and initialize accounts, fund them with the Pinata program, and run transfers across different privacy combinations. By the end, you will have practiced:
1. Public account creation and initialization.
2. Account funding through the Pinata program.
3. Native token transfers between public accounts.
4. Private account creation.
5. Native token transfer from a public account to a private account.
6. Native token transfer from a public account to a private account owned by someone else.
---
The CLI provides commands to manage accounts. Run `wallet account` to see the options available:
```bash
Commands:
get Get account data
new Produce new public or private account
sync-private Sync private accounts
help Print this message or the help of the given subcommand(s)
```
## 1. Public account creation and initialization
> [!Important]
> Public accounts live on-chain and are identified by a 32-byte Account ID. Running `wallet account new public` generates a fresh keypair for the signature scheme used in LEZ.
> The account ID is derived from the public key, and the private key signs transactions and authorizes program executions.
> The CLI can create both public and private accounts.
### a. New public account creation
```bash
wallet account new public
# Output:
Generated new account with account_id Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
```
> [!Tip]
> Save this account ID. You will use it in later commands.
### b. Account initialization
To query the accounts current status, run:
```bash
# Replace the id with yours
wallet account get --account-id Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
# Output:
Account is Uninitialized
```
In this example, we initialize the account for the authenticated-transfer program, which manages native token transfers and enforces authenticated debits.
1. Initialize the account:
```bash
# This command submits a public transaction executing the `init` function of the
# authenticated-transfer program. The wallet polls the sequencer until the
# transaction is included in a block, which may take several seconds.
wallet auth-transfer init --account-id Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
```
2. Check the updated account status:
```bash
wallet account get --account-id Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
# Output:
Account owned by authenticated-transfer program
{"balance":0}
```
> [!NOTE]
> New accounts start uninitialized, meaning no program owns them yet. Any program may claim an uninitialized account; once claimed, that program owns it.
> Owned accounts can only be modified through executions of the owning program. The only exception is native-token credits: any program may credit native tokens to any account.
> Debiting native tokens must always be performed by the owning program.
## 2. Account funding through the Piñata program
Now that the account is initialized under the authenticated-tansfer program, fund it using the testnet Piñata program.
```bash
# Replace with your id
wallet pinata claim --to Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
```
After the claim succeeds, the account is funded:
```bash
wallet account get --account-id Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ
# Output:
Account owned by authenticated-transfer program
{"balance":150}
```
## 3. Native token transfers between public accounts
LEZ includes a program for managing native tokens. Run `wallet auth-transfer` to see the available commands:
```bash
Commands:
init Initialize account under the authenticated-transfer program
send Send native tokens from one account to another with variable privacy
help Print this message or the help of the given subcommand(s)
```
We already used `init`. Now use `send` to execute a transfer.
### a. Create a recipient account
```bash
wallet account new public
# Output:
Generated new account with account_id Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS
```
> [!NOTE]
> The new account is uninitialized. The authenticated-transfer program will claim any uninitialized account used in a transfer, so manual initialization isnt required.
### b. Send 37 tokens to the new account
```bash
wallet auth-transfer send \
--from Public/9ypzv6GGr3fwsgxY7EZezg5rz6zj52DPCkmf1vVujEiJ \
--to Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS \
--amount 37
```
### c. Check both accounts
```bash
# Sender account (use your sender ID)
wallet account get --account-id Public/HrA8TVjBS8UVf9akV7LRhyh6k4c7F6PS7PvqgtPmKAT8
# Output:
Account owned by authenticated-transfer program
{"balance":113}
```
```bash
# Recipient account
wallet account get --account-id Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS
# Output:
Account owned by authenticated-transfer program
{"balance":37}
```
## 4. Private account creation
> [!Important]
> Private accounts are structurally identical to public accounts, but their values are stored off-chain. On-chain, only a 32-byte commitment is recorded.
> Transactions include encrypted private values so the owner can recover them, and the decryption keys are never shared.
> Private accounts use two keypairs: nullifier keys for privacy-preserving executions and viewing keys for encrypting and decrypting values.
> The private account ID is derived from the nullifier public key.
> Private accounts can be initialized by anyone, but once initialized they can only be modified by the owners keys.
> Updates include a new commitment and a nullifier for the old state, which prevents linkage between versions.
### a. Create a private account
```bash
wallet account new private
# Output:
Generated new account with account_id Private/HacPU3hakLYzWtSqUPw6TUr8fqoMieVWovsUR6sJf7cL
With npk e6366f79d026c8bd64ae6b3d601f0506832ec682ab54897f205fffe64ec0d951
With vpk 02ddc96d0eb56e00ce14994cfdaec5ae1f76244180a919545983156e3519940a17
```
> [!Tip]
> Focus on the account ID for now. The `npk` and `vpk` values are stored locally and used to build privacy-preserving transactions. The private account ID is derived from `npk`.
Just like public accounts, new private accounts start out uninitialized:
```bash
wallet account get --account-id Private/HacPU3hakLYzWtSqUPw6TUr8fqoMieVWovsUR6sJf7cL
# Output:
Account is Uninitialized
```
> [!Important]
> Private accounts are never visible to the network. They exist only in your local wallet storage.
## 5. Native token transfer from a public account to a private account
> [!Important]
> Sending tokens to an uninitialized private account causes the authenticated-transfer program to claim it, just like with public accounts. Program logic is the same regardless of account type.
### a. Send 17 tokens to the private account
> [!Note]
> The syntax matches public-to-public transfers, but the recipient is a private ID. This runs locally, generates a proof, and submits it to the sequencer. It may take 30 seconds to 4 minutes.
```bash
wallet auth-transfer send \
--from Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS \
--to Private/HacPU3hakLYzWtSqUPw6TUr8fqoMieVWovsUR6sJf7cL \
--amount 17
```
### b. Check both accounts
```bash
# Public sender account
wallet account get --account-id Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS
# Output:
Account owned by authenticated-transfer program
{"balance":20}
```
```bash
# Private recipient account
wallet account get --account-id Private/HacPU3hakLYzWtSqUPw6TUr8fqoMieVWovsUR6sJf7cL
# Output:
Account owned by authenticated-transfer program
{"balance":17}
```
> [!Note]
> The last command does not query the network. It works offline because private account data is stored locally. Other users cannot read your private balances.
> [!Caution]
> Private accounts can only be modified by their owners keys. The exception is initialization: any user can initialize an uninitialized private account. This enables transfers to a private account owned by someone else, as long as that account is uninitialized.
## 6. Native token transfer from a public account to a private account owned by someone else
> [!Important]
> Well simulate transferring to someone else by creating a new private account we own and treating it as if it belonged to another user.
### a. Create a new uninitialized private account
```bash
wallet account new private
# Output:
Generated new account with account_id Private/AukXPRBmrYVqoqEW2HTs7N3hvTn3qdNFDcxDHVr5hMm5
With npk 0c95ebc4b3830f53da77bb0b80a276a776cdcf6410932acc718dcdb3f788a00e
With vpk 039fd12a3674a880d3e917804129141e4170d419d1f9e28a3dcf979c1f2369cb72
```
> [!Tip]
> Ignore the private account ID here and use the `npk` and `vpk` values to send to a foreign private account.
```bash
wallet auth-transfer send \
--from Public/Ev1JprP9BmhbFVQyBcbznU8bAXcwrzwRoPTetXdQPAWS \
--to-npk 0c95ebc4b3830f53da77bb0b80a276a776cdcf6410932acc718dcdb3f788a00e \
--to-vpk 039fd12a3674a880d3e917804129141e4170d419d1f9e28a3dcf979c1f2369cb72 \
--amount 3
```
> [!Warning]
> This command creates a privacy-preserving transaction, which may take a few minutes. The updated values are encrypted and included in the transaction.
> Once accepted, the recipient must run `wallet account sync-private` to scan the chain for their encrypted updates and refresh local state.
> [!Note]
> You have seen transfers between two public accounts and from a public sender to a private recipient. Transfers from a private sender, whether to a public account or to another private account, follow the same pattern.

View File

@ -0,0 +1,26 @@
This repository includes a CLI for interacting with the Logos Blockchain. To install it, run the following command from the root of the repository:
```bash
cargo install --path wallet --force
```
To check that everythin is working, run `wallet help`.
## Available Wallet Commands
| Command | Description |
|------------------------|-------------------------------------------------------------|
| `wallet auth-transfer` | Authenticated transfer (init, send) |
| `wallet chain-info` | Chain info queries (current-block-id, block, transaction) |
| `wallet account` | Account management (get, list, new, sync-private) |
| `wallet pinata` | Piñata faucet (claim) |
| `wallet token` | Token operations (new, send) |
| `wallet amm` | AMM operations (new, swap, add-liquidity, remove-liquidity) |
| `wallet check-health` | Health checks that the wallet is connected to the node |
| `wallet config` | Config Setup (get, set) |
| `wallet restore-keys ` | Keys restore from a given password at given `depth` |
| `wallet deploy-program`| Program deployment |
| `wallet help` | Help |
Some completion scripts exists, see the [completions](./completions/README.md) folder.

View File

@ -0,0 +1,18 @@
[package]
name = "program_deployment"
version = "0.1.0"
edition = "2024"
license = { workspace = true }
[lints]
workspace = true
[dependencies]
common.workspace = true
nssa.workspace = true
nssa_core.workspace = true
sequencer_service_rpc = { workspace = true, features = ["client"] }
wallet.workspace = true
tokio = { workspace = true, features = ["macros"] }
clap.workspace = true

View File

@ -0,0 +1,660 @@
# Program deployment tutorial
This guide walks you through running the sequencer, compiling example programs, deploying a Hello World program, and interacting with accounts.
You'll find:
- Programs: example LEZ programs under `methods/guest/src/bin`.
- Runners: scripts to create and submit transactions to invoke these programs publicly and privately under `src/bin`.
# 0. Install the wallet
From the projects root directory:
```bash
cargo install --path wallet --force
```
# 1. Run the sequencer
From the projects root directory, start the sequencer by following [these instructions](https://github.com/logos-blockchain/lssa#run-the-sequencer-and-node).
## Checking and setting up the wallet
For sanity let's check that the wallet can connect to it.
```bash
wallet check-health
```
If this is your first time, the wallet will ask for a password. This is used as seed to deterministically generate all account keys (public and private).
For this tutorial, use: `program-tutorial`
You should see `✅All looks good!` if everything went well.
# 2. Compile the example programs
In a second terminal, from the `lssa` root directory, compile the example Risc0 programs:
```bash
cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
```
Because this repository is organized as a Cargo workspace, build artifacts are written to the
shared `target/` directory at the workspace root by default. The compiled `.bin` files will
appear under:
```
target/riscv32im-risc0-zkvm-elf/docker/
```
For convenience, export this path:
```bash
export EXAMPLE_PROGRAMS_BUILD_DIR=$(pwd)/target/riscv32im-risc0-zkvm-elf/docker
```
> [!IMPORTANT]
> **All remaining commands must be run from the `examples/program_deployment` directory.**
# 3. Hello world example
The Hello world program reads an arbitrary sequence of bytes from its instruction and appends them to the data field of the input account.
Execution succeeds only if the account is:
- Uninitialized, or
- Already owned by this program
If uninitialized, the program will claim the account and emit the updated state.
## Navigate to the example directory
All remaining commands must be run from:
```bash
cd examples/program_deployment
```
## Deploy the Program
Use the wallets built-in program deployment command:
```bash
wallet deploy-program $EXAMPLE_PROGRAMS_BUILD_DIR/hello_world.bin
```
# 4. Public execution of the Hello world example
## Create a Public Account
Generate a new public account:
```bash
wallet account new public
```
You'll see an output similar to:
```bash
Generated new account with account_id Public/BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9 at path /0
```
The relevant part is the account id `BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9`
> [!NOTE]
> You can optionally assign a label to the account for easier identification using the `--label` option: `wallet account new public --label "my-account"`. Labels must be unique across all accounts.
## Check the account state
New accounts are always Uninitialized. Verify:
```bash
wallet account get --account-id Public/BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9
```
Expected output:
```
Account is Uninitialized
```
The `Public/` prefix tells the wallet to query the public state.
## Execute the Hello world program
Run the example:
```bash
cargo run --bin run_hello_world \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world.bin \
BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9
```
> [!NOTE]
> - Passing the `.bin` lets the script compute the program ID and build the transaction.
> - Because this program executes publicly, the node performs the execution.
> - The program will claim the account and write data into it.
Monitor the sequencer terminal to confirm execution.
## Inspect the updated account
After the transaction is processed, check the new state:
```bash
wallet account get --account-id Public/BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9
```
Example output:
```json
{
"balance": 0,
"program_owner_b64": "o6C6/bbjDmN9VUC51McBpPrta8lxrx2X0iHExhX0yNU=",
"data_b64": "SG9sYSBtdW5kbyE=",
"nonce": 0
}
```
The `data_b64` field contains de data in Base64.
Decode it:
```bash
echo -n SG9sYSBtdW5kbyE= | base64 -d
```
You should see `Hola mundo!`.
# 5. Understanding the code in `hello_world.rs`.
The Hello world example demonstrates the minimal structure of an NSSA program.
Its purpose is very simple: append the instruction bytes to the data field of a single account.
### What this program does in a nutshell
1. Reads the program inputs
- The list of pre-state accounts (`pre_states`)
- The instruction bytes (`instruction`)
- The raw instruction data (used again when writing outputs)
2. Checks that there is exactly one input account: this example operates on a single account, so it expects `pre_states` to contain exactly one entry.
3. Builds the post-state: It clones the input account and appends the instruction bytes to its data field.
4. Handles account claiming logic: If the account is uninitialized (i.e. not yet claimed by any program), its program_owner will equal `DEFAULT_PROGRAM_ID`. In that case, the program issues a claim request, meaning: "This program now owns this account."
5. Outputs the proposed state transition: `write_nssa_outputs` emits:
- The original instruction data
- The original pre-states
- The new post-states
## Code walkthrough
1. Reading inputs:
```rust
let (ProgramInput { pre_states, instruction: greeting }, instruction_data)
= read_nssa_inputs::<Instruction>();
```
2. Extracting the single account:
```rust
let [pre_state] = pre_states
.try_into()
.unwrap_or_else(|_| panic!("Input pre states should consist of a single account"));
```
3. Constructing the updated account post state
```rust
let mut this = pre_state.account.clone();
let mut bytes = this.data.into_inner();
bytes.extend_from_slice(&greeting);
this.data = bytes.try_into().expect("Data should fit within the allowed limits");
```
4. Instantiating the `AccountPostState` with a claiming request only if the account pre state is uninitialized:
```rust
let post_state = if post_account.program_owner == DEFAULT_PROGRAM_ID {
AccountPostState::new_claimed(post_account)
} else {
AccountPostState::new(post_account)
};
```
5. Emmiting the output
```rust
write_nssa_outputs(instruction_data, vec![pre_state], vec![post_state]);
```
# 6. Understanding the runner script `run_hello_world.rs`
The `run_hello_world.rs` example demonstrates how to construct and submit a public transaction that executes the `hello_world` program. Below is a breakdown of what the file does and how the pieces fit together.
### 1. Wallet initialization
```rust
let wallet_config = fetch_config().await.unwrap();
let wallet_core = WalletCore::start_from_config_update_chain(wallet_config)
.await
.unwrap();
```
The example loads the wallet configuration and initializes `WalletCore`.
This gives access to:
- the sequencer client,
- the wallets account storage.
### 2. Parsing inputs
```rust
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
let account_id: AccountId = std::env::args_os().nth(2).unwrap().into_string().unwrap().parse().unwrap();
```
The program expects two arguments:
- Path to the guest binary
- AccountId of the public account to operate on
This is the account that the program will claim and write data into.
### 3. Loading the program bytecode
```rust
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
```
The Risc0 ELF is read from disk and wrapped in a Program object, which can be used to compute the program ID. The ID is used by the node to identify which program is invoked by the transaction.
### 4. Preparing the instruction data
```rust
let greeting: Vec<u8> = vec![72,111,108,97,32,109,117,110,100,111,33];
```
The example hardcodes the ASCII bytes for `Hola mundo!`. These bytes are passed to the program as its “instruction,” which the Hello World program simply appends to the accounts data field.
### 5. Creating the public transaction
```rust
let nonces = vec![];
let signing_keys = [];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
```
A public transaction consists of:
- a `Message`
- a corresponding `WitnessSet`
For this simple example, no signing or nonces are required. The transaction includes only the program ID, the target account, and the instruction bytes. The Hello World program allows this because it does not explicitly require authorization. In the next example, well see how authorization requirements are enforced and how to construct a transaction that includes signatures and nonces.
### 6. Submitting the transaction
```rust
let response = wallet_core.sequencer_client.send_tx_public(tx).await.unwrap();
```
The transaction is sent to the sequencer, which processes it and updates the public state accordingly.
Once executed, youll be able to query the updated account to see the newly written "Hola mundo!" data.
# 7. Private execution of the Hello world example
This section is very similar to the previous case:
## Create a private account
Generate a new private account:
```bash
wallet account new private
```
You'll see an output similar to:
```bash
Generated new account with account_id Private/7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr at path /0
```
The relevant part for this tutorial is the account id `7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr`
> [!NOTE]
> As with public accounts, you can use the `--label` option to assign a label: `wallet account new private --label "my-private-account"`.
You can check it's uninitialized with
```bash
wallet account get --account-id Private/7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr
```
## Privately executing the Hello world program
### Execute the Hello world program
Run the example:
```bash
cargo run --bin run_hello_world_private \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world.bin \
7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr
```
> [!NOTE]
> - This command may take a few minutes to complete. A ZK proof of the Hello world program execution and the privacy preserving circuit are being generated. Depending on the machine this can take from 30 seconds to 4 minutes.
> - We are passing the same `hello_world.bin` binary as in the previous case with public executions. This is because the program is the same, it is the privacy context of the input account that's different.
> - Because this program executes privately, the local machine runs the program and generate the proof of execution.
> - The program will claim the private account and write data into it.
### Syncing the new private account values
The `run_hello_world` script submitted a transaction and it was (hopefully) accepted by the node. On chain there is now a commitment to the new private account values, and the account data is stored encrypted. However, the local client hasnt updated its private state yet. Thats why, if you try to get the private account values now, it still reads the old values from local storage instead.
```bash
wallet account get --account-id Private/7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr
```
This will still show `Account is Uninitialized`. To see the new values locally, you need to run the wallet sync command. Once the client syncs, the local store will reflect the updated account data.
To sync private accounts run:
```bash
wallet account sync-private
```
> [!NOTE]
> - This queries the node for transactions and goes throught the encrypted accounts. Whenever a new value is found for one of the owned private accounts, the local storage is updated.
After this completes, running
```bash
wallet account get --account-id Private/7EDHyxejuynBpmbLuiEym9HMUyCYxZDuF8X3B89ADeMr
```
should show something similar to
```json
{
"balance":0,
"program_owner_b64":"dWgtNRixwjC0C8aA0NL0Iuss3Q26Dw6ECk7bzExW4bI=",
"data_b64":"SG9sYSBtdW5kbyE=",
"nonce":236788677072686551559312843688143377080
}
```
## The `run_hello_world_private.rs` runner
This example extends the public `run_hello_world.rs` flow by constructing a privacy-preserving transaction instead of a public one.
Both runners load a guest program, prepare a transaction, and submit it. But the private version handles encrypted account data, nullifiers, ephemeral keys, and zk proofs.
Unlike the public version, `run_hello_world_private.rs` must:
- prepare the private account pre-state (nullifier keys, membership proof, encrypted values)
- derive a shared secret to encrypt the post-state
- compute the correct visibility mask (initialized vs. uninitialized private account)
- execute the guest program inside the zkVM and produce a proof
- build a PrivacyPreservingTransaction composed of:
- a Message encoding commitments + encrypted post-state
- a WitnessSet embedding the zk proof
Luckily all that complexity is hidden behind the `wallet_core.send_privacy_preserving_tx` function:
```rust
let accounts = vec![PrivacyPreservingAccount::PrivateOwned(account_id)];
// Construct and submit the privacy-preserving transaction
wallet_core
.send_privacy_preserving_tx(
accounts,
&Program::serialize_instruction(greeting).unwrap(),
&program.into(),
)
.await
.unwrap();
```
Check the `run_hello_world_private.rs` file to see how it is used.
# 8. Account authorization mechanism
The Hello world example does not enforce any authorization on the input account. This means any user can execute it on any account, regardless of ownership.
NSSA provides a mechanism for programs to enforce proper authorization before an execution can succeed. The meaning of authorization differs between public and private accounts:
- Public accounts: authorization requires that the transaction is signed with the accounts signing key.
- Private accounts: authorization requires that the circuit verifies knowledge of the accounts nullifier secret key.
From the program development perspective it is very simple: input accounts come with a flag indicating whether they has been properly authorized. And so, the only difference between the program `hello_world.rs` and `hello_world_with_authorization.rs` is in the lines
```rust
// #### Difference with `hello_world` example here:
// Fail if the input account is not authorized
// The `is_authorized` field will be correctly populated or verified by the system if
// authorization is provided.
if !pre_state.is_authorized {
panic!("Missing required authorization");
}
// ####
```
Which just checks the `is_authorized` flag and fails if it is set to false.
# 9. Public execution of the Hello world with authorization example
The workflow to execute it publicly is very similar:
### Deploy the program
```bash
wallet deploy-program $EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_authorization.bin
```
### Create a new public account
Our previous public account is already claimed by the simple Hello world program. So we need a new one to work with this other version of the hello program
```bash
wallet account new public
```
Outupt:
```
Generated new account with account_id Public/9Ppqqf8NeCX58pnr8ZqKoHvSoYGqH79dSikZAtLxKgXE at path /1
```
### Run the program
```bash
cargo run --bin run_hello_world_with_authorization \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_authorization.bin \
9Ppqqf8NeCX58pnr8ZqKoHvSoYGqH79dSikZAtLxKgXE
```
# 10. Understanding `run_hello_world_with_authorization.rs`
From the runner script perspective, the only difference is that the signing keys are passed to the `WitnessSet` constructor for it to sign it. You can see this in the following parts of the code:
1. Loading the sigining keys from the wallet storage
```rust
// Load signing keys to provide authorization
let signing_key = wallet_core
.storage
.user_data
.get_pub_account_signing_key(&account_id)
.expect("Input account should be a self owned public account");
```
2. Fetching the current public nonce.
```rust
// Construct the public transaction
// Query the current nonce from the node
let nonces = wallet_core
.get_accounts_nonces(vec![account_id])
.await
.expect("Node should be reachable to query account data");
```
2. Instantiate the witness set using the signing keys
```rust
let signing_keys = [signing_key];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
// Pass the signing key to sign the message. This will be used by the node
// to flag the pre_state as `is_authorized` when executing the program
let witness_set = WitnessSet::for_message(&message, &signing_keys);
```
## Seeing the mechanism in action
If everything went well you won't notice any difference with the first Hello world, because the runner takes care of signing the transaction to provide authorization and the program just succeeds.
Try using the `run_hello_world.rs` runner with the `hello_world_with_authorization.bin` program. This will fail because the runner will submit the transaction without the corresponding signature.
```bash
cargo run --bin run_hello_world \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_authorization.bin \
9Ppqqf8NeCX58pnr8ZqKoHvSoYGqH79dSikZAtLxKgXE
```
You should see something like the following **on the node logs**.
```bash
[2025-12-11T13:43:22Z WARN sequencer_core] Error at transition ProgramExecutionFailed(
"Guest panicked: Missing required authorization",
)
```
# 11. Public and private account interaction example
Previous examples only operated on public or private accounts independently. Those minimal programs were useful to introduce basic concepts, but they couldn't demonstrate how different types of accounts interact within a single program invocation.
The "Hello world with move function" introduces two operations that require one or two input accounts:
- `write`: appends arbitrary bytes to a single account. This is what we already had.
- `move_data`: reads all bytes from one account, clears it, and appends those bytes to another account.
Because these operations may involve multiple accounts, we'll see how public and private accounts can participate together in one execution. It highlights how ownership checks work, when an account needs to be claimed, and how multiple post-states are emitted when several accounts are modified.
> [!NOTE]
> The program logic is completely agnostic to whether input accounts are public or private. It always executes the same way.
> See `methods/guest/src/bin/hello_world_with_move_function.rs`. The program just reads the instruction bytes and updates the accounts state.
> All privacy handling happens on the runner side. When constructing the transaction, the runner decides which accounts are public or private and prepares the appropriate proofs. The program itself can't differentiate between privacy modes.
Let's start by deploying the program
```bash
wallet deploy-program $EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_move_function.bin
```
Let's also create a new public account
```bash
wallet account new public
```
Output:
```
Generated new account with account_id Public/95iNQMbmxMRY6jULiHYkCzCkYKPEuysvBh5kEHayDxLs at path /0/0
```
Let's execute the write function
```bash
cargo run --bin run_hello_world_with_move_function \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_move_function.bin \
write-public 95iNQMbmxMRY6jULiHYkCzCkYKPEuysvBh5kEHayDxLs mundo!
```
Let's crate a new private account.
```bash
wallet account new private
```
Output:
```
Generated new account with account_id Private/8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU at path /1
```
Let's execute the write function
```bash
cargo run --bin run_hello_world_with_move_function \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_move_function.bin \
write-private 8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU Hola
```
To check the values of the accounts are as expected run:
```bash
wallet account get --account-id Public/95iNQMbmxMRY6jULiHYkCzCkYKPEuysvBh5kEHayDxLs
```
and
```bash
wallet account sync-private
wallet account get --account-id Private/8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU
```
and check the (base64 encoded) data values are `mundo!` and `Hola` respectively.
Now we can execute the move function to clear the data on the public account and move it to the private account.
```bash
cargo run --bin run_hello_world_with_move_function \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world_with_move_function.bin \
move-data-public-to-private 95iNQMbmxMRY6jULiHYkCzCkYKPEuysvBh5kEHayDxLs 8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU
```
After succeeding, re run the get and sync commands and check that the public account has empty data and the private account data is `Holamundo!`.
# 12. Program composition: tail calls
Programs can chain calls to other programs when they return. This is the tail call or chained call mechanism. It is used by programs that depend on other programs.
The examples include a `guest/src/bin/simple_tail_call.rs` program that shows how to trigger this mechanism. It internally calls the first Hello World program with a fixed greeting: `Hello from tail call`.
> [!NOTE]
> This program hardcodes the ID of the Hello World program. If something fails, check that this ID matches the one produced when building the Hello World program. You can see it in the output of `cargo risczero build` from the earlier sections of this tutorial. If it differs, update the ID in `simple_tail_call.rs` and build again.
As before, let's start by deploying the program
```bash
wallet deploy-program $EXAMPLE_PROGRAMS_BUILD_DIR/simple_tail_call.bin
```
We'll use the first public account of this tutorial. The one with account id `BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9`. This account is already owned by the Hello world program and its data reads `Hola mundo!`.
Let's run the tail call program
```bash
cargo run --bin run_hello_world_through_tail_call \
$EXAMPLE_PROGRAMS_BUILD_DIR/simple_tail_call.bin \
BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9
```
Once the transaction is processed, query the account values with:
```bash
wallet account get --account-id Public/BzdBoL4JRa5M873cuWb9rbYgASr1pXyaAZ1YW9ertWH9
```
You should se an output similar to
```json
{
"balance":0,
"program_owner_b64":"fpnW4tFY9N6llZcBHaXRwu7xe+7WZnZX9RWzhwNbk1o=",
"data_b64":"SG9sYSBtdW5kbyFIZWxsbyBmcm9tIHRhaWwgY2FsbA==",
"nonce":0
}
```
Decoding the (base64 encoded) data
```bash
echo -n SG9sYSBtdW5kbyFIZWxsbyBmcm9tIHRhaWwgY2FsbA== | base64 -d
```
Output:
```
Hola mundo!Hello from tail call
```
## Private tail-calls
There's support for tail calls in privacy preserving executions too. The `run_hello_world_through_tail_call_private.rs` runner walks you through the process of invoking such an execution.
The only difference is that, since the execution is local, the runner will need both programs: the `simple_tail_call` and it's dependency `hello_world`.
Let's use our existing private account with id `8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU`. This one is already owned by the `hello_world` program.
You can test the privacy tail calls with
```bash
cargo run --bin run_hello_world_through_tail_call_private \
$EXAMPLE_PROGRAMS_BUILD_DIR/simple_tail_call.bin \
$EXAMPLE_PROGRAMS_BUILD_DIR/hello_world.bin \
8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU
```
>[!NOTE]
> The above command may take longer than the previous privacy executions because needs to generate proofs of execution of both the `simple_tail_call` and the `hello_world` programs.
Once finished run the following to see the changes
```bash
wallet account sync-private
wallet account get --account-id Private/8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEVkReU
```
# 13. Program derived accounts: authorizing accounts through tail calls
## Digression: account authority vs account program ownership
In NSSA there are two distinct concepts that control who can modify an account:
**Program Ownership:** Each account has a field: `program_owner: ProgramId`.
This indicates which program is allowed to update the accounts state during execution.
- If a program is the program_owner of an account, it can freely mutate its fields.
- If the account is uninitialized (`program_owner = DEFAULT_PROGRAM_ID`), a program may claim it and become its owner.
- If a program is not the owner and the account is not claimable, any attempt to modify it will cause the transition to fail.
Program ownership is about mutation rights during program execution.
**Account authority**: Independent from program ownership, each account also has an authority. The entity that is allowed to set: `is_authorized = true`. This flag indicates that the account has been authorized for use in a transaction.
Who can act as authority?
- User-defined accounts: The user is the authority. They can mark an account as authorized by:
- Signing the transaction (public accounts)
- Providing a valid nullifiers secret key ownership proof (private accounts)
- Program derived accounts: Programs are automatically the authority of a dedicated namespace of public accounts.
Each program owns a non-overlapping space of 2^256 **public** account IDs. They do not overlap with:
- User accounts (public or private)
- Other programs PDAs
> [!NOTE]
> Currently PDAs are restricted to the public state.
A program can be the authority of an account owned by another program, which is the most common case.
During a chained call, a program can mark its PDA accounts as `is_authorized=true` without requiring any user signatures or nullifier secret keys. This enables programs to safely authorize accounts during program composition. Importantly, these flags can only be set to true for PDA accounts through an execution of the program that is their authority. No user and no other program can execute any transition that requires authorization of PDA accounts belonging to a different program.
## Running the example
This tutorial includes an example of PDA usage in `methods/guest/src/bin/tail_call_with_pda.rs.`. That programs sole purpose is to forward one of its own PDA accounts, an account for which it is the authority, to the "Hello World with authorization" program via a chained call. The Hello World program will then claim the account and become its program owner, but the `tail_call_with_pda` program remains the authority. This means it is still the only entity capable of marking that account as `is_authorized=true`.
Deploy the program:
```bash
wallet deploy-program $EXAMPLE_PROGRAMS_BUILD_DIR/tail_call_with_pda.bin
```
There is no need to create a new account for this example, because we simply use one of the PDA accounts belonging to the `tail_call_with_pda` program.
Execute the program
```bash
cargo run --bin run_hello_world_with_authorization_through_tail_call_with_pda $EXAMPLE_PROGRAMS_BUILD_DIR/tail_call_with_pda.bin
```
You'll see an output like the following:
```bash
The program derived account ID is: 3tfTPPuxj3eSE1cLVuNBEk8eSHzpnYS1oqEdeH3Nfsks
```
Then check the status of that account
```bash
wallet account get --account-id Public/3tfTPPuxj3eSE1cLVuNBEk8eSHzpnYS1oqEdeH3Nfsks
```
Output:
```bash
{
"balance":0,
"program_owner_b64":"HZXHYRaKf6YusVo8x00/B15uyY5sGsJb1bzH4KlCY5g=",
"data_b64": "SGVsbG8gZnJvbSB0YWlsIGNhbGwgd2l0aCBQcm9ncmFtIERlcml2ZWQgQWNjb3VudCBJRA==",
"nonce":0"
}
```

View File

@ -0,0 +1,14 @@
[package]
name = "example_program_deployment_methods"
version = "0.1.0"
edition = "2024"
license = { workspace = true }
[lints]
workspace = true
[build-dependencies]
risc0-build.workspace = true
[package.metadata.risc0]
methods = ["guest"]

View File

@ -0,0 +1,15 @@
[package]
name = "example_program_deployment_programs"
version = "0.1.0"
edition = "2024"
license = { workspace = true }
[lints]
workspace = true
[dependencies]
nssa_core.workspace = true
hex.workspace = true
bytemuck.workspace = true
risc0-zkvm.workspace = true

View File

@ -0,0 +1,60 @@
use nssa_core::program::{
AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, read_nssa_inputs, write_nssa_outputs,
};
// Hello-world example program.
//
// This program reads an arbitrary sequence of bytes as its instruction
// and appends those bytes to the `data` field of the single input account.
//
// Execution succeeds only if the input account is either:
// - uninitialized, or
// - already owned by this program.
//
// In case the input account is uninitialized, the program claims it.
//
// The updated account is emitted as the sole post-state.
type Instruction = Vec<u8>;
fn main() {
// Read inputs
let (
ProgramInput {
pre_states,
instruction: greeting,
},
instruction_data,
) = read_nssa_inputs::<Instruction>();
// Unpack the input account pre state
let [pre_state] = pre_states
.try_into()
.unwrap_or_else(|_| panic!("Input pre states should consist of a single account"));
// Construct the post state account values
let post_account = {
let mut this = pre_state.account.clone();
let mut bytes = this.data.into_inner();
bytes.extend_from_slice(&greeting);
this.data = bytes
.try_into()
.expect("Data should fit within the allowed limits");
this
};
// Wrap the post state account values inside a `AccountPostState` instance.
// This is used to forward the account claiming request if any
let post_state = if post_account.program_owner == DEFAULT_PROGRAM_ID {
// This produces a claim request
AccountPostState::new_claimed(post_account)
} else {
// This doesn't produce a claim request
AccountPostState::new(post_account)
};
// The output is a proposed state difference. It will only succeed if the pre states coincide
// with the previous values of the accounts, and the transition to the post states conforms
// with the NSSA program rules.
write_nssa_outputs(instruction_data, vec![pre_state], vec![post_state]);
}

View File

@ -0,0 +1,67 @@
use nssa_core::program::{
AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, read_nssa_inputs, write_nssa_outputs,
};
// Hello-world with authorization example program.
//
// This program reads an arbitrary sequence of bytes as its instruction
// and appends those bytes to the `data` field of the single input account.
//
// Execution succeeds only if the input account **is authorized** and is either:
// - uninitialized, or
// - already owned by this program.
//
// In case the input account is uninitialized, the program claims it.
//
// The updated account is emitted as the sole post-state.
type Instruction = Vec<u8>;
fn main() {
// Read inputs
let (
ProgramInput {
pre_states,
instruction: greeting,
},
instruction_data,
) = read_nssa_inputs::<Instruction>();
// Unpack the input account pre state
let [pre_state] = pre_states
.try_into()
.unwrap_or_else(|_| panic!("Input pre states should consist of a single account"));
// #### Difference with `hello_world` example here:
// Fail if the input account is not authorized
// The `is_authorized` field will be correctly populated or verified by the system if
// authorization is provided.
assert!(pre_state.is_authorized, "Missing required authorization");
// ####
// Construct the post state account values
let post_account = {
let mut this = pre_state.account.clone();
let mut bytes = this.data.into_inner();
bytes.extend_from_slice(&greeting);
this.data = bytes
.try_into()
.expect("Data should fit within the allowed limits");
this
};
// Wrap the post state account values inside a `AccountPostState` instance.
// This is used to forward the account claiming request if any
let post_state = if post_account.program_owner == DEFAULT_PROGRAM_ID {
// This produces a claim request
AccountPostState::new_claimed(post_account)
} else {
// This doesn't produce a claim request
AccountPostState::new(post_account)
};
// The output is a proposed state difference. It will only succeed if the pre states coincide
// with the previous values of the accounts, and the transition to the post states conforms
// with the NSSA program rules.
write_nssa_outputs(instruction_data, vec![pre_state], vec![post_state]);
}

View File

@ -0,0 +1,99 @@
use nssa_core::{
account::{Account, AccountWithMetadata, Data},
program::{
AccountPostState, DEFAULT_PROGRAM_ID, ProgramInput, read_nssa_inputs, write_nssa_outputs,
},
};
// Hello-world with write + move_data example program.
//
// This program reads an instruction of the form `(function_id, data)` and
// dispatches to either:
//
// - `write`: appends `data` to the `data` field of a single input account.
// - `move_data`: moves all bytes from one account to another. The source account is cleared and the
// destination account receives the appended bytes.
//
// Execution succeeds only if:
// - the accounts involved are either uninitialized, or
// - already owned by this program.
//
// In case an input account is uninitialized, the program will claim it when
// producing the post-state.
const WRITE_FUNCTION_ID: u8 = 0;
const MOVE_DATA_FUNCTION_ID: u8 = 1;
type Instruction = (u8, Vec<u8>);
fn build_post_state(post_account: Account) -> AccountPostState {
if post_account.program_owner == DEFAULT_PROGRAM_ID {
// This produces a claim request
AccountPostState::new_claimed(post_account)
} else {
// This doesn't produce a claim request
AccountPostState::new(post_account)
}
}
fn write(pre_state: AccountWithMetadata, greeting: &[u8]) -> AccountPostState {
// Construct the post state account values
let post_account = {
let mut this = pre_state.account;
let mut bytes = this.data.into_inner();
bytes.extend_from_slice(greeting);
this.data = bytes
.try_into()
.expect("Data should fit within the allowed limits");
this
};
build_post_state(post_account)
}
fn move_data(from_pre: AccountWithMetadata, to_pre: AccountWithMetadata) -> Vec<AccountPostState> {
// Construct the post state account values
let from_data: Vec<u8> = from_pre.account.data.clone().into();
let from_post = {
let mut this = from_pre.account;
this.data = Data::default();
build_post_state(this)
};
let to_post = {
let mut this = to_pre.account;
let mut bytes = this.data.into_inner();
bytes.extend_from_slice(&from_data);
this.data = bytes
.try_into()
.expect("Data should fit within the allowed limits");
build_post_state(this)
};
vec![from_post, to_post]
}
fn main() {
// Read input accounts.
let (
ProgramInput {
pre_states,
instruction: (function_id, data),
},
instruction_words,
) = read_nssa_inputs::<Instruction>();
let post_states = match (pre_states.as_slice(), function_id, data.len()) {
([account_pre], WRITE_FUNCTION_ID, _) => {
let post = write(account_pre.clone(), &data);
vec![post]
}
([account_from_pre, account_to_pre], MOVE_DATA_FUNCTION_ID, 0) => {
move_data(account_from_pre.clone(), account_to_pre.clone())
}
_ => panic!("invalid params"),
};
write_nssa_outputs(instruction_words, pre_states, post_states);
}

View File

@ -0,0 +1,63 @@
use nssa_core::program::{
AccountPostState, ChainedCall, ProgramId, ProgramInput, read_nssa_inputs,
write_nssa_outputs_with_chained_call,
};
// Tail Call example program.
//
// This program shows how to chain execution to another program using `ChainedCall`.
// It reads a single account, emits it unchanged, and then triggers a tail call
// to the Hello World program with a fixed greeting.
/// This needs to be set to the ID of the Hello world program.
/// To get the ID run **from the root directoy of the repository**:
/// `cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml`
/// This compiles the programs and outputs the IDs in hex that can be used to copy here.
const HELLO_WORLD_PROGRAM_ID_HEX: &str =
"e9dfc5a5d03c9afa732adae6e0edfce4bbb44c7a2afb9f148f4309917eb2de6f";
fn hello_world_program_id() -> ProgramId {
let hello_world_program_id_bytes: [u8; 32] = hex::decode(HELLO_WORLD_PROGRAM_ID_HEX)
.unwrap()
.try_into()
.unwrap();
bytemuck::cast(hello_world_program_id_bytes)
}
fn main() {
// Read inputs
let (
ProgramInput {
pre_states,
instruction: (),
},
instruction_data,
) = read_nssa_inputs::<()>();
// Unpack the input account pre state
let [pre_state] = pre_states
.clone()
.try_into()
.unwrap_or_else(|_| panic!("Input pre states should consist of a single account"));
// Create the (unchanged) post state
let post_state = AccountPostState::new(pre_state.account.clone());
// Create the chained call
let chained_call_greeting: Vec<u8> = b"Hello from tail call".to_vec();
let chained_call_instruction_data = risc0_zkvm::serde::to_vec(&chained_call_greeting).unwrap();
let chained_call = ChainedCall {
program_id: hello_world_program_id(),
instruction_data: chained_call_instruction_data,
pre_states,
pda_seeds: vec![],
};
// Write the outputs
write_nssa_outputs_with_chained_call(
instruction_data,
vec![pre_state],
vec![post_state],
vec![chained_call],
);
}

View File

@ -0,0 +1,75 @@
use nssa_core::program::{
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, read_nssa_inputs,
write_nssa_outputs_with_chained_call,
};
// Tail Call with PDA example program.
//
// Demonstrates how to chain execution to another program using `ChainedCall`
// while authorizing program-derived accounts.
//
// Expects a single input account whose Account ID is derived from this
// programs ID and the fixed PDA seed below (as defined by the
// `<AccountId as From<(&ProgramId, &PdaSeed)>>` implementation).
//
// Emits this account unchanged, then performs a tail call to the
// Hello-World-with-Authorization program with a fixed greeting. The same
// account is passed along but marked with `is_authorized = true`.
const HELLO_WORLD_WITH_AUTHORIZATION_PROGRAM_ID_HEX: &str =
"1d95c761168a7fa62eb15a3cc74d3f075e6ec98e6c1ac25bd5bcc7e0a9426398";
const PDA_SEED: PdaSeed = PdaSeed::new([37; 32]);
fn hello_world_program_id() -> ProgramId {
let hello_world_program_id_bytes: [u8; 32] =
hex::decode(HELLO_WORLD_WITH_AUTHORIZATION_PROGRAM_ID_HEX)
.unwrap()
.try_into()
.unwrap();
bytemuck::cast(hello_world_program_id_bytes)
}
fn main() {
// Read inputs
let (
ProgramInput {
pre_states,
instruction: (),
},
instruction_data,
) = read_nssa_inputs::<()>();
// Unpack the input account pre state
let [pre_state] = pre_states
.try_into()
.unwrap_or_else(|_| panic!("Input pre states should consist of a single account"));
// Create the (unchanged) post state
let post_state = AccountPostState::new(pre_state.account.clone());
// Create the chained call
let chained_call_greeting: Vec<u8> =
b"Hello from tail call with Program Derived Account ID".to_vec();
let chained_call_instruction_data = risc0_zkvm::serde::to_vec(&chained_call_greeting).unwrap();
// Flip the `is_authorized` flag to true
let pre_state_for_chained_call = {
let mut this = pre_state.clone();
this.is_authorized = true;
this
};
let chained_call = ChainedCall {
program_id: hello_world_program_id(),
instruction_data: chained_call_instruction_data,
pre_states: vec![pre_state_for_chained_call],
pda_seeds: vec![PDA_SEED],
};
// Write the outputs
write_nssa_outputs_with_chained_call(
instruction_data,
vec![pre_state],
vec![post_state],
vec![chained_call],
);
}

View File

@ -0,0 +1,66 @@
use common::transaction::NSSATransaction;
use nssa::{
AccountId, PublicTransaction,
program::Program,
public_transaction::{Message, WitnessSet},
};
use sequencer_service_rpc::RpcClient as _;
use wallet::WalletCore;
// Before running this example, compile the `hello_world.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world.bin
//
//
// Usage:
// cargo run --bin run_hello_world /path/to/guest/binary <account_id>
//
// Example:
// cargo run --bin run_hello_world \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world.bin \
// Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the program binary
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Second argument is the account_id
let account_id: AccountId = std::env::args_os()
.nth(2)
.unwrap()
.into_string()
.unwrap()
.parse()
.unwrap();
// Load the program
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
// Define the desired greeting in ASCII
let greeting: Vec<u8> = vec![72, 111, 108, 97, 32, 109, 117, 110, 100, 111, 33];
// Construct the public transaction
// No nonces nor signing keys are needed for this example. Check out the
// `run_hello_world_with_authorization` on how to use them.
let nonces = vec![];
let signing_keys = [];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
}

View File

@ -0,0 +1,58 @@
use nssa::{AccountId, program::Program};
use wallet::{PrivacyPreservingAccount, WalletCore};
// Before running this example, compile the `hello_world.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world.bin
//
//
// Usage:
// cargo run --bin run_hello_world_private /path/to/guest/binary <account_id>
//
// Note: the provided account_id needs to be of a private self owned account
//
// Example:
// cargo run --bin run_hello_world_private \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world.bin \
// Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the program binary
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Second argument is the account_id
let account_id: AccountId = std::env::args_os()
.nth(2)
.unwrap()
.into_string()
.unwrap()
.parse()
.unwrap();
// Load the program
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
// Define the desired greeting in ASCII
let greeting: Vec<u8> = vec![72, 111, 108, 97, 32, 109, 117, 110, 100, 111, 33];
let accounts = vec![PrivacyPreservingAccount::PrivateOwned(account_id)];
// Construct and submit the privacy-preserving transaction
wallet_core
.send_privacy_preserving_tx(
accounts,
Program::serialize_instruction(greeting).unwrap(),
&program.into(),
)
.await
.unwrap();
}

View File

@ -0,0 +1,62 @@
use common::transaction::NSSATransaction;
use nssa::{
AccountId, PublicTransaction,
program::Program,
public_transaction::{Message, WitnessSet},
};
use sequencer_service_rpc::RpcClient as _;
use wallet::WalletCore;
// Before running this example, compile the `simple_tail_call.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/simple_tail_call.bin
//
//
// Usage:
// cargo run --bin run_hello_world_through_tail_call /path/to/guest/binary <account_id>
//
// Example:
// cargo run --bin run_hello_world_through_tail_call \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/simple_tail_call.bin \
// Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the program binary
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Second argument is the account_id
let account_id: AccountId = std::env::args_os()
.nth(2)
.unwrap()
.into_string()
.unwrap()
.parse()
.unwrap();
// Load the program
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
let instruction_data = ();
let nonces = vec![];
let signing_keys = [];
let message =
Message::try_new(program.id(), vec![account_id], nonces, instruction_data).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
}

View File

@ -0,0 +1,66 @@
use std::collections::HashMap;
use nssa::{
AccountId, ProgramId, privacy_preserving_transaction::circuit::ProgramWithDependencies,
program::Program,
};
use wallet::{PrivacyPreservingAccount, WalletCore};
// Before running this example, compile the `simple_tail_call.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/simple_tail_call.bin
//
//
// Usage:
// cargo run --bin run_hello_world_through_tail_call_private /path/to/guest/binary <account_id>
//
// Example:
// cargo run --bin run_hello_world_through_tail_call \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/simple_tail_call.bin \
// Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the simple_tail_call program binary
let simple_tail_call_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Second argument is the path to the hello_world program binary
let hello_world_path = std::env::args_os().nth(2).unwrap().into_string().unwrap();
// Third argument is the account_id
let account_id: AccountId = std::env::args_os()
.nth(3)
.unwrap()
.into_string()
.unwrap()
.parse()
.unwrap();
// Load the program and its dependencies (the hellow world program)
let simple_tail_call_bytecode: Vec<u8> = std::fs::read(simple_tail_call_path).unwrap();
let simple_tail_call = Program::new(simple_tail_call_bytecode).unwrap();
let hello_world_bytecode: Vec<u8> = std::fs::read(hello_world_path).unwrap();
let hello_world = Program::new(hello_world_bytecode).unwrap();
let dependencies: HashMap<ProgramId, Program> =
std::iter::once((hello_world.id(), hello_world)).collect();
let program_with_dependencies = ProgramWithDependencies::new(simple_tail_call, dependencies);
let accounts = vec![PrivacyPreservingAccount::PrivateOwned(account_id)];
// Construct and submit the privacy-preserving transaction
let instruction = ();
wallet_core
.send_privacy_preserving_tx(
accounts,
Program::serialize_instruction(instruction).unwrap(),
&program_with_dependencies,
)
.await
.unwrap();
}

View File

@ -0,0 +1,79 @@
use common::transaction::NSSATransaction;
use nssa::{
AccountId, PublicTransaction,
program::Program,
public_transaction::{Message, WitnessSet},
};
use sequencer_service_rpc::RpcClient as _;
use wallet::WalletCore;
// Before running this example, compile the `hello_world_with_authorization.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world_with_authorization.bin
//
//
// Usage:
// ./run_hello_world_with_authorization /path/to/guest/binary <account_id>
//
// Note: the provided account_id needs to be of a public self owned account
//
// Example:
// cargo run --bin run_hello_world_with_authorization \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world_with_authorization.bin \
// Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the program binary
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Second argument is the account_id
let account_id: AccountId = std::env::args_os()
.nth(2)
.unwrap()
.into_string()
.unwrap()
.parse()
.unwrap();
// Load the program
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
// Load signing keys to provide authorization
let signing_key = wallet_core
.storage()
.user_data
.get_pub_account_signing_key(account_id)
.expect("Input account should be a self owned public account");
// Define the desired greeting in ASCII
let greeting: Vec<u8> = vec![72, 111, 108, 97, 32, 109, 117, 110, 100, 111, 33];
// Construct the public transaction
// Query the current nonce from the node
let nonces = wallet_core
.get_accounts_nonces(vec![account_id])
.await
.expect("Node should be reachable to query account data");
let signing_keys = [signing_key];
let message = Message::try_new(program.id(), vec![account_id], nonces, greeting).unwrap();
// Pass the signing key to sign the message. This will be used by the node
// to flag the pre_state as `is_authorized` when executing the program
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
}

View File

@ -0,0 +1,66 @@
#![expect(
clippy::print_stdout,
reason = "This is an example program, it's fine to print to stdout"
)]
use common::transaction::NSSATransaction;
use nssa::{
AccountId, PublicTransaction,
program::Program,
public_transaction::{Message, WitnessSet},
};
use nssa_core::program::PdaSeed;
use sequencer_service_rpc::RpcClient as _;
use wallet::WalletCore;
// Before running this example, compile the `simple_tail_call.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/simple_tail_call.bin
//
//
// Usage:
// cargo run --bin run_hello_world_with_authorization_through_tail_call_with_pda
// /path/to/guest/binary <account_id>
//
// Example:
// cargo run --bin run_hello_world_with_authorization_through_tail_call_with_pda \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/tail_call_with_pda.bin
const PDA_SEED: PdaSeed = PdaSeed::new([37; 32]);
#[tokio::main]
async fn main() {
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
// Parse arguments
// First argument is the path to the program binary
let program_path = std::env::args_os().nth(1).unwrap().into_string().unwrap();
// Load the program
let bytecode: Vec<u8> = std::fs::read(program_path).unwrap();
let program = Program::new(bytecode).unwrap();
// Compute the PDA to pass it as input account to the public execution
let pda = AccountId::from((&program.id(), &PDA_SEED));
let account_ids = vec![pda];
let instruction_data = ();
let nonces = vec![];
let signing_keys = [];
let message = Message::try_new(program.id(), account_ids, nonces, instruction_data).unwrap();
let witness_set = WitnessSet::for_message(&message, &signing_keys);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
println!("The program derived account id is: {pda}");
}

View File

@ -0,0 +1,155 @@
use clap::{Parser, Subcommand};
use common::transaction::NSSATransaction;
use nssa::{PublicTransaction, program::Program, public_transaction};
use sequencer_service_rpc::RpcClient as _;
use wallet::{PrivacyPreservingAccount, WalletCore};
// Before running this example, compile the `hello_world_with_move_function.rs` guest program with:
//
// cargo risczero build --manifest-path examples/program_deployment/methods/guest/Cargo.toml
//
// Note: you must run the above command from the root of the `lssa` repository.
// Note: The compiled binary file is stored in
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world_with_move_function.bin
//
//
// Usage:
// cargo run --bin run_hello_world_with_move_function /path/to/guest/binary <function> <params>
//
// Example:
// cargo run --bin run_hello_world_with_move_function \
// methods/guest/target/riscv32im-risc0-zkvm-elf/docker/hello_world_with_move_function.bin \
// write-public Ds8q5PjLcKwwV97Zi7duhRVF9uwA2PuYMoLL7FwCzsXE Hola
const WRITE_FUNCTION_ID: u8 = 0;
const MOVE_DATA_FUNCTION_ID: u8 = 1;
type Instruction = (u8, Vec<u8>);
#[derive(Parser, Debug)]
struct Cli {
/// Path to program binary.
program_path: String,
#[command(subcommand)]
command: Command,
}
#[derive(Subcommand, Debug)]
enum Command {
/// Write instruction into one account.
WritePublic {
account_id: String,
greeting: String,
},
WritePrivate {
account_id: String,
greeting: String,
},
/// Move data between two accounts.
MoveDataPublicToPublic {
from: String,
to: String,
},
MoveDataPublicToPrivate {
from: String,
to: String,
},
}
#[tokio::main]
async fn main() {
let cli = Cli::parse();
// Load the program
let bytecode: Vec<u8> = std::fs::read(cli.program_path).unwrap();
let program = Program::new(bytecode).unwrap();
// Initialize wallet
let wallet_core = WalletCore::from_env().unwrap();
match cli.command {
Command::WritePublic {
account_id,
greeting,
} => {
let instruction: Instruction = (WRITE_FUNCTION_ID, greeting.into_bytes());
let account_id = account_id.parse().unwrap();
let nonces = vec![];
let message = public_transaction::Message::try_new(
program.id(),
vec![account_id],
nonces,
instruction,
)
.unwrap();
let witness_set = public_transaction::WitnessSet::for_message(&message, &[]);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
}
Command::WritePrivate {
account_id,
greeting,
} => {
let instruction: Instruction = (WRITE_FUNCTION_ID, greeting.into_bytes());
let account_id = account_id.parse().unwrap();
let accounts = vec![PrivacyPreservingAccount::PrivateOwned(account_id)];
wallet_core
.send_privacy_preserving_tx(
accounts,
Program::serialize_instruction(instruction).unwrap(),
&program.into(),
)
.await
.unwrap();
}
Command::MoveDataPublicToPublic { from, to } => {
let instruction: Instruction = (MOVE_DATA_FUNCTION_ID, vec![]);
let from = from.parse().unwrap();
let to = to.parse().unwrap();
let nonces = vec![];
let message = public_transaction::Message::try_new(
program.id(),
vec![from, to],
nonces,
instruction,
)
.unwrap();
let witness_set = public_transaction::WitnessSet::for_message(&message, &[]);
let tx = PublicTransaction::new(message, witness_set);
// Submit the transaction
let _response = wallet_core
.sequencer_client
.send_transaction(NSSATransaction::Public(tx))
.await
.unwrap();
}
Command::MoveDataPublicToPrivate { from, to } => {
let instruction: Instruction = (MOVE_DATA_FUNCTION_ID, vec![]);
let from = from.parse().unwrap();
let to = to.parse().unwrap();
let accounts = vec![
PrivacyPreservingAccount::Public(from),
PrivacyPreservingAccount::PrivateOwned(to),
];
wallet_core
.send_privacy_preserving_tx(
accounts,
Program::serialize_instruction(instruction).unwrap(),
&program.into(),
)
.await
.unwrap();
}
}
}

11
explorer_service/.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
# Leptos build outputs
/target
/pkg
/site
# WASM artifacts
*.wasm
# Environment
.env
.env.local

View File

@ -0,0 +1,76 @@
[package]
name = "explorer_service"
version = "0.1.0"
edition = "2024"
license.workspace = true
[lints]
workspace = true
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
indexer_service_protocol.workspace = true
# Leptos framework
leptos = "0.8.15"
leptos_meta = "0.8.5"
leptos_router = "0.8.11"
# Serialization
serde.workspace = true
# Logging
log.workspace = true
console_error_panic_hook = "0.1"
console_log = "1.0"
# Date/Time
chrono.workspace = true
# URL encoding
urlencoding = "2.1"
# WASM-specific
wasm-bindgen = "0.2"
web-sys = { version = "0.3", features = [
"Window",
"Document",
"Location",
"HtmlInputElement",
] }
# Server-side dependencies (optional, enabled by features)
indexer_service_rpc = { workspace = true, features = [
"client",
], optional = true }
jsonrpsee = { workspace = true, features = ["http-client"], optional = true }
tokio = { workspace = true, optional = true }
axum = { version = "0.8.8", optional = true }
leptos_axum = { version = "0.8.7", optional = true }
clap = { workspace = true, features = ["derive"], optional = true }
url = { workspace = true, optional = true }
env_logger = { workspace = true, optional = true }
# Mandatory server side dependencies
itertools.workspace = true
[features]
hydrate = ["leptos/hydrate"]
ssr = [
"leptos/ssr",
"dep:indexer_service_rpc",
"dep:jsonrpsee",
"dep:tokio",
"dep:axum",
"dep:leptos_axum",
"dep:clap",
"dep:url",
"dep:env_logger",
]
[package.metadata.leptos]
bin-features = ["ssr"]
lib-features = ["hydrate"]
assets-dir = "public"

View File

@ -0,0 +1,58 @@
FROM rust:1.94.0-trixie AS builder
# Install cargo-binstall, which makes it easier to install other
# cargo extensions like cargo-leptos
RUN wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
RUN tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
RUN cp cargo-binstall /usr/local/cargo/bin
# Install required tools
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends clang
# Install cargo-leptos
RUN cargo binstall cargo-leptos -y
# Add the WASM target
RUN rustup target add wasm32-unknown-unknown
# Make an /explorer_service dir, which everything will eventually live in
RUN mkdir -p /explorer_service
WORKDIR /explorer_service
COPY . .
# Build the app
RUN --mount=type=cache,target=/usr/local/cargo/registry/index \
--mount=type=cache,target=/usr/local/cargo/registry/cache \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/explorer_service/target \
cargo leptos build --release -vv \
&& cp /explorer_service/target/release/explorer_service /usr/local/bin/explorer_service \
&& cp -r /explorer_service/target/site /explorer_service/site_output
FROM debian:trixie-slim AS runtime
WORKDIR /explorer_service
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Copy the server binary to the /explorer_service directory
COPY --from=builder /usr/local/bin/explorer_service /explorer_service/
# /target/site contains our JS/WASM/CSS, etc.
COPY --from=builder /explorer_service/site_output /explorer_service/site
# Copy Cargo.toml as its needed at runtime
COPY --from=builder /explorer_service/Cargo.toml /explorer_service/
# Set any required env variables
ENV RUST_LOG="info"
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
ENV LEPTOS_SITE_ROOT="site"
ENV INDEXER_RPC_URL="http://localhost:8779"
EXPOSE 8080
# Run the server
CMD ["/explorer_service/explorer_service"]

View File

@ -0,0 +1,71 @@
# LEE Blockchain Explorer
A web-based UI for exploring the blockchain state, built with Rust and Leptos framework.
## Features
- **Main Page**: Search for blocks, transactions, or accounts by hash/ID. View recent blocks.
- **Block Page**: View detailed block information and all transactions within a block.
- **Transaction Page**: View transaction details including type, accounts involved, and proofs.
- **Account Page**: View account state and transaction history.
## Architecture
- **Framework**: Leptos 0.8 with SSR (Server-Side Rendering) and hydration
- **Data Source**: Indexer Service JSON-RPC API
- **Components**: Reusable BlockPreview, TransactionPreview, and AccountPreview components
- **Styling**: Custom CSS with responsive design
## Development
### Prerequisites
- Rust (stable or nightly)
- `cargo-leptos` tool: `cargo install cargo-leptos`
- Running indexer service at `http://localhost:8080/rpc` (or configure via `INDEXER_RPC_URL`)
### Build and Run
```bash
# Development mode (with hot-reload)
cargo leptos watch
# Production build
cargo leptos build --release
# Run production build
cargo leptos serve --release
```
The explorer will be available at `http://localhost:3000` by default.
### Configuration
Set the `INDEXER_RPC_URL` environment variable to point to your indexer service:
```bash
export INDEXER_RPC_URL=http://localhost:8080/rpc
cargo leptos watch
```
## Features
### Search
The search bar supports:
- Block IDs (numeric)
- Block hashes (64-character hex)
- Transaction hashes (64-character hex)
- Account IDs (64-character hex)
### Real-time Updates
The main page loads recent blocks and can be extended to subscribe to new blocks via WebSocket.
### Responsive Design
The UI is mobile-friendly and adapts to different screen sizes.
## License
See LICENSE file in the repository root.

View File

@ -0,0 +1,11 @@
services:
explorer_service:
image: lssa/explorer_service
build:
context: ..
dockerfile: explorer_service/Dockerfile
container_name: explorer_service
environment:
INDEXER_RPC_URL: ${INDEXER_RPC_URL:-http://localhost:8779}
ports:
- "8080:8080"

View File

@ -0,0 +1,516 @@
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #f5f7fa;
color: #2c3e50;
line-height: 1.6;
}
/* App layout */
.app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.app-header {
background-color: #2c3e50;
color: white;
padding: 1rem 2rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.app-nav {
max-width: 1200px;
margin: 0 auto;
}
.nav-logo {
color: white;
text-decoration: none;
font-size: 1.5rem;
font-weight: bold;
}
.nav-logo:hover {
color: #3498db;
}
.app-main {
flex: 1;
max-width: 1200px;
width: 100%;
margin: 0 auto;
padding: 2rem;
}
.app-footer {
background-color: #34495e;
color: white;
text-align: center;
padding: 1.5rem;
margin-top: 2rem;
}
/* Page headers */
.page-header h1 {
font-size: 2rem;
margin-bottom: 1.5rem;
color: #2c3e50;
}
/* Search section */
.search-section {
margin-bottom: 3rem;
}
.search-form {
display: flex;
gap: 0.5rem;
margin-bottom: 1.5rem;
}
.search-input {
flex: 1;
padding: 0.75rem 1rem;
border: 2px solid #dde4ed;
border-radius: 8px;
font-size: 1rem;
transition: border-color 0.3s;
}
.search-input:focus {
outline: none;
border-color: #3498db;
}
.search-button {
padding: 0.75rem 2rem;
background-color: #3498db;
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s;
}
.search-button:hover {
background-color: #2980b9;
}
/* Block preview */
.block-preview {
background-color: white;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.block-preview:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.block-preview-link {
text-decoration: none;
color: inherit;
}
.block-preview-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid #eee;
}
.block-id .label {
color: #7f8c8d;
font-size: 0.9rem;
}
.block-id .value {
font-size: 1.5rem;
font-weight: bold;
color: #2c3e50;
}
.block-status {
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 600;
}
.status-pending {
background-color: #fff3cd;
color: #856404;
}
.status-safe {
background-color: #d1ecf1;
color: #0c5460;
}
.status-finalized {
background-color: #d4edda;
color: #155724;
}
.block-preview-body {
display: grid;
gap: 0.5rem;
}
.block-field {
display: flex;
gap: 0.5rem;
}
.field-label {
color: #7f8c8d;
font-weight: 500;
}
.field-value {
color: #2c3e50;
}
.hash {
font-family: "Courier New", monospace;
font-size: 0.9rem;
word-break: break-all;
}
/* Transaction preview */
.transaction-preview {
background-color: white;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.transaction-preview:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.transaction-preview-link {
text-decoration: none;
color: inherit;
}
.transaction-preview-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.75rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #eee;
}
.tx-type {
padding: 0.4rem 0.8rem;
border-radius: 16px;
font-size: 0.85rem;
font-weight: 600;
border: 2px solid;
}
.tx-type-public {
background-color: #e3f2fd;
color: #0d47a1;
border-color: #1976d2;
border-style: solid;
}
.tx-type-private {
background-color: #ffe0f0;
color: #880e4f;
border-color: #c2185b;
border-style: dashed;
font-style: italic;
}
.tx-type-deployment {
background-color: #fff3e0;
color: #e65100;
border-color: #ff9800;
border-style: dotted;
}
.tx-hash {
display: flex;
gap: 0.5rem;
align-items: center;
}
.transaction-preview-body {
color: #7f8c8d;
font-size: 0.9rem;
}
/* Account preview */
.account-preview {
background-color: white;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.account-preview:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.account-preview-link {
text-decoration: none;
color: inherit;
}
.account-preview-header {
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid #eee;
}
.account-id .label {
color: #7f8c8d;
font-size: 0.9rem;
}
.account-id .value {
font-size: 1.2rem;
font-weight: 600;
color: #2c3e50;
}
.account-preview-body {
display: grid;
gap: 0.5rem;
}
.account-field {
display: flex;
gap: 0.5rem;
}
.account-not-found {
color: #e74c3c;
font-style: italic;
}
/* Detail pages */
.block-detail,
.transaction-detail,
.account-detail {
background-color: white;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.block-info,
.transaction-info,
.account-info,
.transaction-details {
margin-bottom: 2rem;
}
.block-info h2,
.transaction-info h2,
.account-info h2,
.transaction-details h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #2c3e50;
}
.info-grid {
display: grid;
gap: 1rem;
}
.info-row {
display: flex;
gap: 1rem;
padding: 0.75rem;
background-color: #f8f9fa;
border-radius: 4px;
}
.info-label {
color: #7f8c8d;
font-weight: 600;
min-width: 150px;
}
.info-value {
color: #2c3e50;
word-break: break-all;
}
.signature {
font-size: 0.75rem;
}
/* Transactions list */
.block-transactions,
.account-transactions {
margin-top: 2rem;
}
.block-transactions h2,
.account-transactions h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #2c3e50;
}
.transactions-list {
display: grid;
gap: 1rem;
}
.no-transactions {
padding: 2rem;
text-align: center;
color: #7f8c8d;
background-color: #f8f9fa;
border-radius: 8px;
}
/* Accounts list */
.accounts-list {
display: grid;
gap: 0.5rem;
margin-top: 1rem;
}
.account-item {
padding: 0.75rem;
background-color: #f8f9fa;
border-radius: 4px;
}
.account-item a {
color: #3498db;
text-decoration: none;
}
.account-item a:hover {
text-decoration: underline;
}
.nonce {
color: #7f8c8d;
font-size: 0.9rem;
margin-left: 0.5rem;
}
/* Loading and error states */
.loading,
.loading-more {
text-align: center;
padding: 2rem;
color: #7f8c8d;
font-style: italic;
}
.error,
.error-page {
background-color: #f8d7da;
color: #721c24;
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
}
.not-found,
.not-found-page {
text-align: center;
padding: 3rem;
color: #7f8c8d;
}
.not-found-page h1 {
font-size: 4rem;
color: #e74c3c;
margin-bottom: 1rem;
}
.not-found-page a {
color: #3498db;
text-decoration: none;
font-weight: 600;
}
.not-found-page a:hover {
text-decoration: underline;
}
/* Load more button */
.load-more-button {
display: block;
width: 100%;
padding: 1rem;
margin-top: 1rem;
background-color: #3498db;
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s;
}
.load-more-button:hover {
background-color: #2980b9;
}
/* Responsive design */
@media (max-width: 768px) {
.app-main {
padding: 1rem;
}
.search-form {
flex-direction: column;
}
.search-button {
width: 100%;
}
.block-preview-header,
.transaction-preview-header {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.info-row {
flex-direction: column;
gap: 0.25rem;
}
.info-label {
min-width: auto;
}
}

161
explorer_service/src/api.rs Normal file
View File

@ -0,0 +1,161 @@
use indexer_service_protocol::{Account, AccountId, Block, BlockId, HashType, Transaction};
use leptos::prelude::*;
use serde::{Deserialize, Serialize};
/// Search results structure.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct SearchResults {
pub blocks: Vec<Block>,
pub transactions: Vec<Transaction>,
pub accounts: Vec<(AccountId, Account)>,
}
/// RPC client type.
#[cfg(feature = "ssr")]
pub type IndexerRpcClient = jsonrpsee::http_client::HttpClient;
/// Get account information by ID
#[server]
pub async fn get_account(account_id: AccountId) -> Result<Account, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_account(account_id)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
}
/// Search for a block, transaction, or account by query string
#[server]
pub async fn search(query: String) -> Result<SearchResults, ServerFnError> {
use std::str::FromStr as _;
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
let mut blocks = Vec::new();
let mut transactions = Vec::new();
let mut accounts = Vec::new();
// Try as hash
if let Ok(hash) = HashType::from_str(&query) {
// Try as block hash
if let Ok(Some(block)) = client.get_block_by_hash(hash).await {
blocks.push(block);
}
// Try as transaction hash
if let Ok(Some(tx)) = client.get_transaction(hash).await {
transactions.push(tx);
}
}
// Try as account ID
if let Ok(account_id) = AccountId::from_str(&query)
&& let Ok(account) = client.get_account(account_id).await
{
accounts.push((account_id, account));
}
// Try as block ID
if let Ok(block_id) = query.parse::<u64>()
&& let Ok(Some(block)) = client.get_block_by_id(block_id).await
{
blocks.push(block);
}
Ok(SearchResults {
blocks,
transactions,
accounts,
})
}
/// Get block by ID
#[server]
pub async fn get_block_by_id(block_id: BlockId) -> Result<Block, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_block_by_id(block_id)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
.and_then(|opt| opt.ok_or_else(|| ServerFnError::ServerError("Block not found".to_owned())))
}
/// Get latest block ID
#[server]
pub async fn get_latest_block_id() -> Result<BlockId, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_last_finalized_block_id()
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
}
/// Get block by hash
#[server]
pub async fn get_block_by_hash(block_hash: HashType) -> Result<Block, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_block_by_hash(block_hash)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
.and_then(|opt| opt.ok_or_else(|| ServerFnError::ServerError("Block not found".to_owned())))
}
/// Get transaction by hash
#[server]
pub async fn get_transaction(tx_hash: HashType) -> Result<Transaction, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_transaction(tx_hash)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
.and_then(|opt| {
opt.ok_or_else(|| ServerFnError::ServerError("Transaction not found".to_owned()))
})
}
/// Get blocks with pagination
#[server]
pub async fn get_blocks(before: Option<BlockId>, limit: u64) -> Result<Vec<Block>, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_blocks(before, limit)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
}
/// Get transactions by account
#[server]
pub async fn get_transactions_by_account(
account_id: AccountId,
offset: u64,
limit: u64,
) -> Result<Vec<Transaction>, ServerFnError> {
use indexer_service_rpc::RpcClient as _;
let client = expect_context::<IndexerRpcClient>();
client
.get_transactions_by_account(account_id, offset, limit)
.await
.map_err(|e| ServerFnError::ServerError(format!("RPC error: {e}")))
}
/// Create the RPC client for the indexer service (server-side only).
#[cfg(feature = "ssr")]
pub fn create_indexer_rpc_client(url: &url::Url) -> Result<IndexerRpcClient, String> {
use jsonrpsee::http_client::HttpClientBuilder;
use log::info;
info!("Connecting to Indexer RPC on URL: {url}");
HttpClientBuilder::default()
.build(url.as_str())
.map_err(|e| format!("Failed to create RPC client: {e}"))
}

View File

@ -0,0 +1,50 @@
use indexer_service_protocol::{Account, AccountId};
use leptos::prelude::*;
use leptos_router::components::A;
/// Account preview component
#[component]
pub fn AccountPreview(account_id: AccountId, account: Account) -> impl IntoView {
let account_id_str = account_id.to_string();
view! {
<div class="account-preview">
<A href=format!("/account/{}", account_id_str) attr:class="account-preview-link">
<div class="account-preview-header">
<div class="account-id">
<span class="label">"Account "</span>
<span class="value hash">{account_id_str.clone()}</span>
</div>
</div>
{move || {
let Account { program_owner, balance, data, nonce } = &account;
let program_id = program_owner.to_string();
view! {
<div class="account-preview-body">
<div class="account-field">
<span class="field-label">"Balance: "</span>
<span class="field-value">{balance.to_string()}</span>
</div>
<div class="account-field">
<span class="field-label">"Program: "</span>
<span class="field-value hash">{program_id}</span>
</div>
<div class="account-field">
<span class="field-label">"Nonce: "</span>
<span class="field-value">{nonce.to_string()}</span>
</div>
<div class="account-field">
<span class="field-label">"Data: "</span>
<span class="field-value">
{format!("{} bytes", data.0.len())}
</span>
</div>
</div>
}
.into_any()
}}
</A>
</div>
}
}

Some files were not shown because too many files have changed in this diff Show More