You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-27Lines changed: 28 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,27 +30,35 @@
30
30
</a>
31
31
</h4>
32
32
33
+
The [Blyss SDK](https://blyss.dev) lets you use homomorphic encryption to [retrieve information privately](https://blintzbase.com/posts/pir-and-fhe-from-scratch/). With it, you can build new kinds of privacy-preserving services, like [private password breach checking](https://playground.blyss.dev/passwords/), [private nameserver resolution](https://sprl.it/), and even [private Wikipedia](https://spiralwiki.com/).
33
34
34
-
The [Blyss SDK](https://blyss.dev) lets you use homomorphic encryption to make private retrievals from Blyss buckets. This can enable new privacy-preserving apps, like [private nameserver resolution](https://sprl.it/), [private wallets](https://btc.blyss.dev/), and even [private Wikipedia](https://spiralwiki.com/).
35
-
36
-
Get an API key by [signing up](https://blyss.dev). Detailed documentation is at [docs.blyss.dev](https://docs.blyss.dev).
35
+
You can get an API key by [signing up](https://blyss.dev), or run a server locally. Detailed documentation is at [docs.blyss.dev](https://docs.blyss.dev).
37
36
38
37
> **Warning**
39
-
> The SDK has not yet been audited or reviewed, and the public Blyss service is still in beta. Data stored in Blyss should not be considered durable. [Contact us](mailto:[email protected]) for access to a production-ready service.
40
-
41
-
> _Looking for Spiral?_
42
-
> Our new name is Blyss. The core Rust cryptographic library that this repo started as is now in `lib/spiral-rs`.
38
+
> The SDK has not yet been security reviewed, and the public Blyss service is still in beta. [Contact us](mailto:[email protected]) for access to a production-ready service.
43
39
44
-
## Quick start
40
+
## Quick start (cloud)
45
41
46
-
You can quickly try using the SDK without downloading anything. The example code shows how to use Blyss buckets to perform private contact intersection.
42
+
You can quickly try using the SDK with our managed service without downloading anything.
47
43
48
-
1. Get an API key by [signing up](https://blyss.dev).
49
-
2. Open [this CodeSandbox](https://codesandbox.io/s/blyss-contact-intersection-example-7qr6r5) and enter your API key where it says `<YOUR API KEY HERE>`. This lets you try using the SDK in your browser.
44
+
1. Get an API key by [signing up here](https://blyss.dev).
45
+
2. Open [this StackBlitz](https://stackblitz.com/edit/blyss-private-contact-intersection) and enter your API key where it says `<YOUR API KEY HERE>`.
50
46
3. Try adding users to the service using the "Add a user" button. As you add more users, the service will _privately_ intersect each new users's contacts and the already existing users.
51
47
Every user's list of contacts stays completely private using homomorphic encryption: it never leaves their device unencrypted.
52
48
53
-
If you prefer a simpler example using vanilla JS, check out [this CodePen](https://codepen.io/blyssprivacy/pen/qByMJwr?editors=0010&layout=left).
49
+
We also have [a simpler example using vanilla JS](https://codepen.io/blyssprivacy/pen/qByMJwr?editors=0010&layout=left).
50
+
51
+
## Quick start (local)
52
+
53
+
You can also use the Blyss SDK completely locally.
54
+
55
+
1. Clone this repo with `git clone [email protected]:blyssprivacy/sdk.git`.
56
+
2. Run the server by entering `lib/server` and running `cargo run --release`. The server will run on `localhost:8008` by default.
57
+
3. Run the client by entering `examples/node-local` and running `npx ts-node main.ts`. This will perform some writes and then a private read to your bucket.
58
+
59
+
## Installing as a package
60
+
61
+
To use the Blyss SDK in an existing TypeScript project, install it with `npm install @blyss/sdk`. Then, import the client with `import { Client } from '@blyss/sdk';`. If you're using SDK in Node, and prefer not to use ESM, you can instead import it as `const blyss = require('@blyss/sdk/node')`.
54
62
55
63
## Examples
56
64
@@ -74,25 +82,15 @@ The React example shows how to use the Blyss SDK in modern client-side JS. It al
74
82
75
83
### Node
76
84
77
-
The Node.js example shows how to use the Blyss SDK in server-side JS. Node 19+ and ESM support is required.
85
+
The Node.js example shows how to use the Blyss SDK in server-side JS. Node 18+ is required.
78
86
79
87
1. Enter `examples/node`, and run `npm install`.
80
88
2. Edit `main.ts` to use your API key.
81
89
3. Run `ts-node main.ts`.
82
90
83
91
### Python
84
92
85
-
The Blyss SDK for Python is still in development. To build the Python library:
86
-
87
-
1. Enter `python/` and run `python -m venv .env` (on macOS, use `python3 -m venv .env`)
88
-
2. Run `source .env/bin/activate`
89
-
3. Run `pip install maturin`
90
-
4. Run `maturin develop`
91
-
92
-
This will install the SDK locally as `blyss`. You can now import `blyss` in scripts you run from this virtual environment. To run the Python example:
93
-
94
-
1. Enter `examples/python`
95
-
2. Run `python main.py`
93
+
The Blyss SDK for Python is still in development.
96
94
97
95
## Documentation
98
96
@@ -110,13 +108,16 @@ Steps to building the SDK:
110
108
2. Run `npm install`.
111
109
3. Run `npm run build`.
112
110
113
-
This will completely build the SDK, including the core Rust library in `lib/spiral-rs`.
111
+
This will build the complete SDK, including the core Rust libraries in `lib/spiral-rs` and `lib/doublepir`
114
112
115
113
The SDK is structured as:
116
114
117
-
1.`lib/spiral-rs/`, a Rust crate containing the core cryptographic implementation of the [Spiral PIR scheme](https://eprint.iacr.org/2022/368.pdf).
115
+
1.`lib/`,
116
+
-`lib/server/`, a Rust project containing the open-source Blyss server.
117
+
-`lib/spiral-rs/`, a Rust crate containing the core cryptographic implementation of the [Spiral PIR scheme](https://eprint.iacr.org/2022/368).
118
+
-`lib/doublepir/`, a Rust crate containing the core cryptographic implementation of the [DoublePIR scheme](https://eprint.iacr.org/2022/949).
118
119
2.`js/`, the TypeScript code that implements the user-facing Blyss SDK.
119
-
-`js/bridge/`, a Rust "bridge" crate that exposes key functionality from `spiral-rs` to the TypeScript code.
120
+
-`js/bridge/`, a Rust "bridge" crate that exposes key functionality from `spiral-rs`and `doublepir`to the TypeScript code.
120
121
3.`python/`, the Python version of the SDK (still in development)
121
122
-`python/src/lib.rs`, another Rust "bridge" crate that exposes key functionality from `spiral-rs` to the Python code.
0 commit comments