Skip to content
/ Swoir Public

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

License

Notifications You must be signed in to change notification settings

Swoir/Swoir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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(.v10_15), .iOS(.v15) ],
    // ...
    dependencies: [
        .package(url: "https://github.com/Swoir/Swoir.git", exact: "1.0.0-beta.0-1")
    ],
    // ...
    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
// Must be called before proving or verifying
try circuit.setupSrs()

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

License

Stars

Watchers

Forks

Packages

No packages published