Skip to content

Commit

Permalink
Merge pull request #209 from NillionNetwork/signer-dx
Browse files Browse the repository at this point in the history
add built-in programs
  • Loading branch information
oceans404 authored Feb 19, 2025
2 parents b794788 + e110c59 commit 4e863c4
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 128 deletions.
22 changes: 19 additions & 3 deletions docs/build/secretSigner/signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ When signing a message, only the message hash is sent to the network - the origi
## Usage

<Tabs>
<TabItem value="python" label="Python" default>
<TabItem value="python" label="Python Client" default>
## Python Client

### Install Nillion Python Client

```
pip install nillion-client
```

### Python Client: Sign a Message
<Tabs>
<TabItem value="store" label="signWithStoredPrivateKey.py" default>
Expand Down Expand Up @@ -47,7 +55,15 @@ When signing a message, only the message hash is sent to the network - the origi

</TabItem>

<TabItem value="js" label="Node.js">
<TabItem value="js" label="TypeScript Client">
## TypeScript Client

### Install Nillion TypeScript Client

```
npm i @nillion/client-wasm @nillion/client-vms
```

### TypeScript Client: Sign a Message
<Tabs>
<TabItem value="store=-js" label="signWithStoredPrivateKey.js" default>
Expand Down Expand Up @@ -81,7 +97,7 @@ When signing a message, only the message hash is sent to the network - the origi

Anyone can verify the signature using the same message hash and the public key that corresponds to the private key stored in Nillion. During verification:

- Use the signature (r, s values) returned from SecretSigner
- Use the signature (r, s) values returned from SecretSigner `tecdsa_signature` output
- Hash the message using SHA-256
- Verify using any standard ECDSA verification library

Expand Down
21 changes: 19 additions & 2 deletions docs/build/secretSigner/store-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ When storing the key, compute access is granted to specific Nillion users, allow
## Usage

<Tabs>
<TabItem value="python" label="Python" default>
<TabItem value="python" label="Python Client" default>
## Python Client

### Install Nillion Python Client

```
pip install nillion-client
```

### Python Client: Store a Private Key

<Tabs>
<TabItem value="store" label="storePrivateKey.py" default>
```python reference showGithubLink
Expand Down Expand Up @@ -46,7 +55,15 @@ When storing the key, compute access is granted to specific Nillion users, allow

</TabItem>

<TabItem value="js" label="Node.js">
<TabItem value="js" label="TypeScript Client">
## TypeScript Client

### Install Nillion TypeScript Client

```
npm i @nillion/client-wasm @nillion/client-vms
```

### TypeScript Client: Store a Private Key
<Tabs>
<TabItem value="store=-js" label="storePrivateKey.js" default>
Expand Down
19 changes: 2 additions & 17 deletions docs/start-building.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ import { nilVMCards } from '@site/src/utils/nilVMCards';

# Building with nilVM

<FeatureSection data={nilVMCards} />

<!-- ## Write a Nada Program
The [Nada Quickstart](/quickstart-nada) will teach you how to create a Nada project and write your first privacy-preserving Nada program. The [Nada by Example Portal](/nada-by-example) is an introduction to Nada with lots of example programs for your reference.
## Build a Blind App
This [Blind App Quickstart](/quickstart) is ideal for developers interested in **building frontends or fullstack web apps** on Nillion. This quickstart will guide you through writing a Nada program, storing the program on the Nillion Network, and creating a blind web app lets you store secrets and run your Nada program in the browser.
The core functionality provided by nilVM is the ability to sign data in a decentralized way using MPC, which can be leveraged using a built-in Nada program with [SecretSigner](/build/secretSigner/overview).

## Connect a backend to Nillion
If you want to **connect a backend** to Nillion, check out the Nillion [Python Quickstart](/python-quickstart).
## Write a privacy-preserving Blind AI Nada program
To write privacy-preserving AI programs, check out our [Nada AI](/nada-by-example/nada-ai) examples, tutorials, and Google Colab links. -->
<FeatureSection data={nilVMCards} />
104 changes: 0 additions & 104 deletions docs/threshold-signatures.md

This file was deleted.

5 changes: 5 additions & 0 deletions sidebar-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ const buildSidebar = [
'build/secretSigner/setup',
'build/secretSigner/store-key',
'build/secretSigner/signing',
{
type: 'link',
label: 'Nillion Signature Tools',
href: 'https://nillion-signature-tools.streamlit.app',
},
{
type: 'link',
label: 'Examples',
Expand Down
9 changes: 7 additions & 2 deletions sidebar-nilvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = [
type: 'doc',
id: 'nillion-client',
},
collapsed: false,
collapsible: false,
items: [
{
type: 'category',
Expand All @@ -26,7 +26,6 @@ module.exports = [
items: [
'python-quickstart',
'python-client-reference',
'threshold-signatures',
{
type: 'link',
label: 'Client Examples',
Expand Down Expand Up @@ -120,9 +119,15 @@ module.exports = [
type: 'doc',
id: 'nada-lang',
},
collapsible: false,
items: [
'nada-lang-types',
'nada-lang-operators',
{
type: 'category',
label: 'Built-in Programs',
items: ['build/secretSigner/signers'],
},
{
type: 'category',
label: 'Programming with Nada',
Expand Down
7 changes: 7 additions & 0 deletions src/utils/nilVMCards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
export const nilVMCards = [
{
title: 'SecretSigner',
description:
'Sign messages and ETH transactions without revealing the private key, which is stored as a secret in nilVM.',
icon: '🔏',
href: './build/secretSigner/signing',
},
{
title: 'Build a Next.js app',
description:
Expand Down

0 comments on commit 4e863c4

Please sign in to comment.