8000 GitHub - Swoir/Swoir: Swoir is a Swift package for creating and verifying zero-knowledge Noir proofs. · GitHub
[go: up one dir, main page]

Skip to content
SwoirPublic

About

Swoir is a Swift package for creating and verifying zero-knowledge Noir proofs.

Resources

Stars

17 stars

Watchers

2 watching

Forks

Latest commit

 

History

53 Commits

Folders and files

Repository files navigation

Swoir

Version Noir Swift 5 License: Apache-2.0

Swoir is a Swift package for creating and verifying Noir zero-knowledge proofs.

Getting Started

Swift Package Manager

To use Swoir in your project, add the following to your Package.swift dependencies:

let package = Package(
    name: "YourSwiftProject",
    platforms: [ .macOS(.v13), .iOS(.v15) ],
    // ...
    dependencies: [
        .package(url: "https://github.com/Swoir/Swoir.git", exact: "1.0.0-3")
    ],
    // ...
    targets: [
        .target(name: "YourSwiftProject", dependencies: ["Swoir"])
    ]
)

Usage

import Foundation
import Swoir
import Swoirenberg

let swoir = Swoir(backend: Swoirenberg.self)
let manifest = URL(fileURLWithPath: "x_not_eq_y.json")
let circuit = try swoir.createCircuit(manifest: manifest)

// Setup the SRS for the circuit from a local file: Swoir does not download it.
// The file holds the start of https://crs.aztec.network/g1.dat, 64 bytes per point.
// Must be called before proving or verifying
try circuit.setupSrs(srs_path: "g1.dat")

let proof = try circuit.prove([ "x": 1, "y": 2 ])
let verified = try circuit.verify(proof)

print(verified ? "Verified!" : "Failed to verify")

Ensure x_not_eq_y.json exists in the project root.

Architectures

  • iOS with architectures: arm64
  • macOS with architectures: arm64

Authors

Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

Licensed under the Apache-2.0 License. See LICENSE for more information.

About

Swoir is a Swift package for creating and verifying zero-knowledge Noir proofs.

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0