https://github.com/lit-protocol/flutter-sdk
https://github.com/lit-protocol/flutter-sdk
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lit-protocol/flutter-sdk
- Owner: LIT-Protocol
- License: apache-2.0
- Created: 2023-10-24T03:54:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-02T18:40:08.000Z (over 2 years ago)
- Last Synced: 2025-02-04T12:04:28.684Z (over 1 year ago)
- Language: Dart
- Size: 358 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# 🦋 Lit Flutter SDK

# Prerequisite
## Simulator
Open iPhone simulator
```
open -a simulator
```
## Real devices
### IOS Setup
iOS requires some additional Rust targets for cross-compilation ([read more]((https://web.archive.org/web/20230408050003/https://cjycode.com/flutter_rust_bridge/template/setup_ios.html)))
```
# 64 bit targets (real device & simulator):
rustup target add aarch64-apple-ios x86_64-apple-ios
# New simulator target for Xcode 12 and later
rustup target add aarch64-apple-ios-sim
# 32 bit targets (you probably don't need these):
rustup target add armv7-apple-ios i386-apple-ios
```
# Getting Started
```
./gen-bindings.sh && flutter run
```
# BLS-SDK Flutter API
> Note: Do not append `0x` to hex values.
| Method | Parameters | Returns |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `encrypt` | - `publicKey`: String (Hex) Example: "1234abcd..."
- `message`: String (Hex) Example: "5678efgh..."
- `identity`: String (Hex) Example: "9abcde12..." | Future: Encrypted data in Base64 format |
| `combineSignatureShares` | - `shares`: List (JSON-like Strings) Example: [ "{\"ProofOfPossession\":\"01b2b4...\"}", "{\"ProofOfPossession\":\"02a834...\"}", "{\"ProofOfPossession\":\"03b159...\"}" ] | Future: Combined signature in Base64 format |
| `verifyAndDecryptWithSignatureShares` | - `publicKey`: String (Hex) Example: "1234abcd..."
- `identity`: String (Hex) Example: "9abcde12..."
- `ciphertext`: String (Base64) Example: "encrypted_base64=="
- `shares`: List (JSON-like Strings) Example: [ "{\"ProofOfPossession\":\"01b2b4...\"}", "{\"ProofOfPossession\":\"02a834...\"}", "{\"ProofOfPossession\":\"03b159...\"}" ] | Future: Decrypted data as Base64 string |
| `decryptWithSignatureShares` | - `ciphertext`: String (Base64) Example: "encrypted_base64=="
- `shares`: List (JSON-like Strings) Example: [ "{\"ProofOfPossession\":\"01b2b4...\"}", "{\"ProofOfPossession\":\"02a834...\"}", "{\"ProofOfPossession\":\"03b159...\"}" ] | Future: Decrypted data as Base64 string |
| `verifySignature` | - `publicKey`: String (Hex) Example: "1234abcd..."
- `message`: String (Base64) Example: "bWVzc2FnZQ=="
- `signature`: String (Base64) Example: "signature_base64==" | Future: Verification result (true or false) |
# ECDSA Flutter API
> Note: Do not append `0x` to hex values.
| Method | Parameters | Returns |
| ------------------ | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `combineSignature` | - `inShares`: List (JSON-encoded share objects)
- `keyType`: int (Supported values: 2, 3) | Future: Combined signature or error message |
| `computePublicKey` | - `id`: String (Hex)
- `publicKeys`: List (Hex-encoded public keys) | Future: Computed public key or error message |