This is a common error I have faced and the current way to solve it was through this:
Download the fetch-zk-params.sh script
curl -O https://raw.githubusercontent.com/bricktowers/midnight-proof-server/main/fetch-zk-params.sh
or
wget https://raw.githubusercontent.com/bricktowers/midnight-proof-server/main/fetch-zk-params.sh
Give execution permissions
chmod +x fetch-zk-params.sh
Run the script to download ZK parameters
./fetch-zk-params.sh
- This script will generate a folder at
/.cache/midnight/zk-params with all the required parameters for zero-knowledge proofs.
PS: It’s something the community did as a workaround. Is the Midnight team following up on this?
2 Likes
Hi @luislucena,
Thanks for sharing!
Just to add some context—as I’ve also run into this issue and am curious whether the Midnight team plans a more integrated solution.
Starting with version 4.0.0 of the proof-server, ZK parameters are fetched on-demand when proving circuits. Unfortunately, this mechanism fails in Docker environments.
The script you linked is actually part of the workaround we at Brick Towers published earlier, bundled with a custom Docker image that includes pre-baked ZK parameters. The script can also be used standalone to prefetch parameters locally. You can find the full setup here:
GitHub - bricktowers/midnight-proof-server: Midnight Proof Server for Zero-Knowledge Proofs
This has helped us avoid runtime failures in containerized setups. Definitely interested to hear if an official fix or alternative is being considered.
3 Likes
Hey @sergeykisel,
Thanks for adding more context and digging deeper!
Yes, I’ve seen the Brick Towers repository, and that’s where I got the script. But since they have it for building the local image, in my case I preferred to work with the Midnight official image.
Recapitulating what’s currently possible:
- i) Build your own image with the parameters
- ii) Download the parameters manually and continue using the official Midnight image
A solution that might work with the script in the Midnight image would be:
- i) Create a temporary container from the official Midnight image
- ii) Copy the script from the container to your current folder (project)
- iii) Delete the temporary container
With that:
- The script lives inside the image.
- You can easily extract it to your project.
- You don’t need to rebuild the image.
- It’s reproducible and automatable.
It’s an alternative; perhaps there are others, but this one occurs to me! I’d love to hear what you think!
1 Like
These are all just workarounds for a bug in midnight/proof-server 4.0.0. It might have been fixed already, but hard to tell since the repo isn’t open source yet. Probably best to report or track it via GitHub issues once it’s public.
1 Like
Yes, I hope someone from the Midnight team arrives! I’m interested in knowing how and in which version they fixed it! Thanks for the hands up!
1 Like
@sergeykisel !! Thank you for being the FIRST community dev to respond to a question in the forum! You are an absolute LEGEND!!
And thank you, @luislucena, for being the first to post a technical question!! (DMing you both to send some swag
)
4 Likes