Skip to content

ChainSafe/lumenos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LUMENOS: Private Proof Delegation with FHE-SNARKs

This project aims to develop and validate Private Proof Delegation via server-side FHE-evaluated SNARKs over encrypted single-client or private shared witness and untrusted public verifiability.

Documentation

Requirements

  • Linux amd64 / x86-64 system
  • avx512 and aes instruction set extensions
  • Go 1.23
  • gcc g++ make cmake libgmp-dev libmpfr-dev unzip

Run

Build

make init-submodules build
export LD_LIBRARY_PATH=./vdec/c

Test

go test -v -run TestLigeroPPD github.com/nulltea/lumenos/fhe

Demo

Run server:

make server

Run client

make client REMOTE_SERVER_URL=http://<IP>:8080

Benchmarks

  • BGV params based on GenerateBGVParamsForNTT heuristic
    • Plaintext prime: 144115188075593729 ($2^{57} – 2^{18} + 1$, $57$ bits)
    • LogN max(12, log2(ROWS)) (see table)
    • LogQ len([58, 56, 56, ... ])=log2(nttSize)
    • LogP [55,55]
  • Number of queries 306 (according to ref. implementation)

Server

Dimension 2048x1024 4096x2048 8192x4096 16384x4096
LogN 12 12 13 14
Encode eval 5.17s 12.63s 1m 6.78s 2m 22.73s
Commit eval 1.03s 2.04s 9.17s 18.79s
Inner product eval 8.51s 22.74s 1m 49.60s 4m 7.48s
Query cols eval 1.10s 1.42s 3.55s 7.63s
Prove eval total 9.61s 24.17s 1m 53.16s 4m 15.12s
$ct[\langle r_i,M_{i,j}\rangle]$ 135 MB 269 MB 1.1 GB 2.1 GB
$ct[\hat{M}_{i,j}] i \in \lambda$ 41 MB 41 MB 81 MB 162 MB
Proof size 310 MB 579 MB 2.2 GB 4.5 GB
Peak RAM (GB) 5.74 GB 10.79 GB 41.23 GB 79.43 GB

Hardware: m7i.8xlarge, 32 vCPUs 128GB RAM

Client

Dimension 2048x1024 4096x2048 8192x4096 16384x4096
LogN 12 12 13 14
Keys 69 MB 103 MB 237 MB 504 MB
Encrypted proof size 310 MB 579 MB 2.2 GB 4.5 GB
Decrypt $ct[\hat{M}_{i,j}] i \in \lambda$ 95.85ms 107.73ms 220.10ms 513.26ms
Decrypt $ct[\langle r_i,M_{i,j}\rangle]$ 531.57ms 1.05s 4.32s 47.53s
Decrypt total 627.49ms 1.16s 4.54s 48.05s
Batch ciphertexts 239.94ms 261.73ms 593.67ms 1.32s
PoD prover 22.96s 22.82s 22.82s 22.70s
Public verifier 151.94ms 197.06ms 389.39ms 804.64ms
Ligero local 3.89s 16.81s 1m 20.69s 14m 21.94s
Peak RAM (GB) 1.05 GB 1.83 GB 6.34 GB 7.18 GB

Hardware: m7i.8xlarge, 2 vCPUs 8GB RAM

Experimental

  • Same hardware as above.
  • Server performs ring switch to LogN: 10 for inner product ciphertexts $ct[\langle r_i,M_{i,j}\rangle]$.
    • Note: correct deployment requires SlotsToCoeff ("unbatching") before ring switch which is not yet implemented for BFV. Verification is skipped because of this.
  • PoD prover runs optimized GBFV version vdec_gbfv.c
    • Note: Lattigo currently does not support GBFV. So final PoD is partially invalid (h_our coeff check fails).

Server

Dimension 2048x1024 4096x2048 8192x4096 16384x4096
LogN 12 12 13 14
Encode eval 5.16s 12.72s 1m 6.39s 2m 23.12s
Commit eval 1.03s 2.04s 9.18s 18.80s
Inner product eval 8.51s 22.65s 1m 50.17s 4m 8.44s
Query cols eval 1.10s 1.41s 3.55s 7.63s
Prove eval total 9.67s 24.32s 1m 53.73s 4m 16.12s
$ct[\langle r_i,M_{i,j}\rangle]$ 17 MB / -7.94x 34 MB / -7.91x 68 MB / -16.57x 68 MB / -31.62x
$ct[\hat{M}_{i,j}] i \in \lambda$ 41 MB 41 MB 81 MB 162 MB
Proof size 75 MB / -4.13x 109 MB / -5.31x 218 MB / -10.33x 299 MB / -15.41x
Peak RAM (GB) 5.40 GB 10.78 GB 41.90 GB 79.25 GB

Client

Dimension 2048x1024 4096x2048 8192x4096 16384x4096
LogN 12 12 13 14
Keys 74 MB / +1.07x 110 MB / +1.07x 252 MB / +1.06x 533 MB / +1.06x
Encrypted proof size 75 MB 109 MB 218 MB 299 MB
Decrypt $ct[\hat{M}_{i,j}] i \in \lambda$ 98.15ms 107.52ms 223.39ms 483.88ms
Decrypt $ct[\langle r_i,M_{i,j}\rangle]$ 72.35ms / -7.35x 146.75ms / -7.15x 284.23ms / -15.19x 287.14ms / -165.52x
Decrypt total 170.58ms ~ -3.68x 254.38ms ~ -4.56x 507.71ms ~ -8.94x 771.12ms ~ -62.31x
Batch ciphertexts 243.19ms 269.33ms 595.06ms 1.26s
PoD prover 3.21s / -7.15x 3.05s / -7.48x 3.20s / -7.13x 3.20s / -7.09x
Public verifier N/A N/A N/A N/A
Ligero local 3.99s 16.66s 1m 20.11s 10m 15.22s
Peak RAM (GB) 0.56 GB / -1.88x 1.40 GB / -1.31x 5.39 GB / -1.18x 7.05 GB (≈)

Run yourself

Run the server:

./scripts/benchmark_server.sh

Run the client:

REMOTE_SERVER_URL=http://<IP>:8080 ./scripts/benchmark_client.sh

Run the client with ring switch and GBFV (experimental):

RING_SWITCH_LOGN=10 IS_GBFV=true REMOTE_SERVER_URL=http://<IP>:8080 \ 
./scripts/benchmark_client.sh -ringSwitchLogN 10

About

Private Proof Delegation with FHE-SNARKs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published