An open API service indexing awesome lists of open source software.

https://github.com/psyprotocol/sp1-dogecoin-scrypt-hash

Computes scrypt_1024_1_1_256 in a ZKP because we don't have enough compute resources to even do one scrypt_ro_mix on chain 😄
https://github.com/psyprotocol/sp1-dogecoin-scrypt-hash

Last synced: 9 months ago
JSON representation

Computes scrypt_1024_1_1_256 in a ZKP because we don't have enough compute resources to even do one scrypt_ro_mix on chain 😄

Awesome Lists containing this project

README

          

# Scrypt Block Header Hash Prover for Solana Bridge by Psy

## Motivation
Unfortunately Solana does not have enough memory/compute resources to compute a single scrypt hash -- but don't fret!

We can still verify Dogecoin Proof of Work consensus on Solana via a ZKP.

## IMPORTANT
** THIS CODE HAS NOT BEEN AUDITED, DO NOT USE IN PRODUCTION **

### Build the Program

To build the program, run the following command:

```sh
cd program
cargo prove build

```

### Execute the Program to Compute the Scrypt Hash of Some example Dogecoin blocks

To run the program without generating a proof:

```sh
cd script
RUST_LOG=info cargo run --release --bin mg16 -- --input ./data/block_headers_5610384-5610884.json --output ./data/block_headers_5610384-5610884_output.json --execute
```

This will execute the program and display the output.

### Generate Proofs (The format == DogeBlockScryptProofOutput for proof work proving worker)

To generate a scrypt proof for the dogecoin blocks + get vkey for the contract:

```sh
cd script
RUST_LOG=info cargo run --release --bin mg16 -- --input ./data/block_headers_5610384-5610884.json --output ./data/block_headers_5610384-5610884_output.json --prove
```

The MIT License (MIT)

Copyright (c) 2025 Zero Knowledge Labs Limited - Psy.xyz

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.