Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Swoir/swoir
Swoir is a Swift package for creating and verifying zero-knowledge Noir proofs.
https://github.com/Swoir/swoir
Last synced: 2 months ago
JSON representation
Swoir is a Swift package for creating and verifying zero-knowledge Noir proofs.
- Host: GitHub
- URL: https://github.com/Swoir/swoir
- Owner: Swoir
- License: apache-2.0
- Created: 2024-01-09T10:19:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T13:37:50.000Z (3 months ago)
- Last Synced: 2024-11-25T14:35:36.221Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 200 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-noir - Swoir - Proving and verifying Noir programs in Swift on iOS and MacOS (Dev Tools / Cross-language)
README
# Swoir
![Version](https://img.shields.io/badge/version-0.36.0--5-darkviolet)
[![Noir](https://img.shields.io/badge/Noir-0.36.0--5-darkviolet)](https://github.com/AztecProtocol/aztec-packages/tree/master/noir)
[![Swift 5](https://img.shields.io/badge/Swift-5-blue.svg)](https://developer.apple.com/swift/)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-green)](https://opensource.org/license/apache-2-0)Swoir is a Swift package for creating and verifying [Noir](https://noir-lang.org) zero-knowledge proofs.
## Getting Started
### Swift Package Manager
To use `Swoir` in your project, add the following to your `Package.swift` dependencies:
```swift
let package = Package(
name: "YourSwiftProject",
platforms: [ .macOS(.v10_15), .iOS(.v15) ],
// ...
dependencies: [
.package(url: "https://github.com/Swoir/Swoir.git", exact: "0.36.0-5")
],
// ...
targets: [
.target(name: "YourSwiftProject", dependencies: ["Swoir"])
]
)
```## Usage
```swift
import Foundation
import Swoir
import Swoirenberglet 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()// UltraPlonk
let proof = try circuit.prove([ "x": 1, "y": 2 ], proof_type: "plonk")
let verified = try circuit.verify(proof, proof_type: "plonk")// Honk
let proof = try circuit.prove([ "x": 1, "y": 2 ], proof_type: "honk")
let verified = try circuit.verify(proof, proof_type: "honk")print(verified ? "Verified!" : "Failed to verify")
```Ensure [x_not_eq_y.json](./Tests/SwoirTests/Fixtures/contracts/x_not_eq_y/target/x_not_eq_y.json) exists in the project root.
## Architectures
- iOS with architectures: `arm64`
- macOS with architectures: `arm64`## Authors
- [Michael Elliot](https://x.com/michaelelliot)
- [Théo Madzou](https://x.com/madztheo)## 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](./LICENSE) for more information.