diff --git a/README.md b/README.md index 8bcc5f7..6310f48 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ cargo r --release --bin moat-cli-sp -- --wallet-pass ## Moat API -An API meant for developers willing to integrate Citadel in their code is available [here](https://github.com/dusk-network/moat/blob/main/moat-core/src/api.rs). You can find an example on how to use the API into `moat-example`. +An API meant for developers willing to integrate Citadel in their code is available [here](https://github.com/dusk-network/moat/blob/main/moat/src/api.rs). You can find an example on how to use the API into `moat-example`. diff --git a/moat-cli/moat-cli-lp/README.md b/moat-cli/moat-cli-lp/README.md index d7b5386..0acbed3 100644 --- a/moat-cli/moat-cli-lp/README.md +++ b/moat-cli/moat-cli-lp/README.md @@ -8,24 +8,12 @@ Available commands: - issue license for a given request - list licenses -## Retrieve relevant license requests (LP) +## Retrieve relevant license requests -arguments: -- scope: either an entire blockchain, or block range, or N last blocks -- data for Rusk cluster connection -- LP's view key (created from LP's SSK) +## Issue license for a given request -## Issue license for a given request (LP) - -arguments: -- data for wallet connection -- data for Rusk cluster connection -- gas limit -- gas price -- license (created from the relevant request and LP's SSK) +Arguments: +- request hash +- attribute data ## List licenses - -arguments: -- scope: block height range -- data for Rusk cluster connection diff --git a/moat-cli/moat-cli-sp/README.md b/moat-cli/moat-cli-sp/README.md index cc36e7a..6ee05cc 100644 --- a/moat-cli/moat-cli-sp/README.md +++ b/moat-cli/moat-cli-sp/README.md @@ -4,6 +4,15 @@ Command line interface to Dusk Citadel Service Provider Available commands: -- request and obtain service from SP based one a session cookie -- get session from license contract based on a session id -- show license contract state +- verify requested service +- get session + +## Verify Requested Service + +Arguments: +- session cookie + +## Get Session + +Arguments: +- session id diff --git a/moat-cli/moat-cli-user/README.md b/moat-cli/moat-cli-user/README.md index d3a8ea8..0d7de7f 100644 --- a/moat-cli/moat-cli-user/README.md +++ b/moat-cli/moat-cli-user/README.md @@ -4,46 +4,23 @@ Command line interface to Dusk Citadel User Available commands: -- submit a license request to blockchain (USER) -- list requests present on blockchain (USER) -- list user's licenses (USER) -- compute proof and use license (USER) -- obtain service from SP (USER & SP) +- submit a license request to blockchain +- list user's licenses +- use license +- request service from SP (Off-Chain) -## Submit a license request to blockchain (User) +## Submit a license request to blockchain -arguments: -- data for wallet connection -- data for Rusk cluster connection -- user SSK (Secret Spend Key) -- provider PSK (Public Spend Key) -- gas limit -- gas price +Arguments: +- address of the license provider -## Retrieve from blockchain the requests which were sent by the user (User) +## List user's licenses -arguments: -- scope: either an entire blockchain, or block range, or N last blocks -- data for Rusk cluster connection -- user's view key (created from user's SSK) +## Use license -## List user's licenses (User) - -arguments: -- scope: block height range -- data for Rusk cluster connection -- user's view key (created from user's SSK) - -## Use license (User) - -arguments: -- data for wallet connection -- data for Rusk cluster connection -- license -- more - TBD - -## Obtains service from SP (User and SP) - -arguments: -TBD as we need to mock SP +Arguments: +- license hash +- address of the license provider +- address of the service provider +- value of the challenge diff --git a/moat/CHANGELOG.md b/moat/CHANGELOG.md index fafd8ef..214ef10 100644 --- a/moat/CHANGELOG.md +++ b/moat/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.1.0] - 2023-11-28 +## [0.1.1] - 2023-12-01 ### Added diff --git a/moat/Cargo.toml b/moat/Cargo.toml index f08ba69..c0ab846 100644 --- a/moat/Cargo.toml +++ b/moat/Cargo.toml @@ -1,7 +1,13 @@ [package] name = "zk-citadel-moat" -version = "0.1.0" +description = "SDK for Citadel, a ZK-based SSI system integrated in Dusk Network." +version = "0.1.1" +authors = [ + "Milosz Muszynski ", + "Xavier Salleras " +] edition = "2021" +license = "MPL-2.0" [dependencies] tokio = { version = "1.15", features = ["rt-multi-thread", "time", "fs", "macros"] } diff --git a/moat/README.md b/moat/README.md new file mode 100644 index 0000000..6310f48 --- /dev/null +++ b/moat/README.md @@ -0,0 +1,56 @@ +# Moat: The Citadel SDK + +[![CI](https://github.com/dusk-network/moat/actions/workflows/dusk_ci.yml/badge.svg)](https://github.com/dusk-network/moat/actions/workflows/dusk_ci.yml) +[![Repository](https://img.shields.io/badge/github-moat-blueviolet?logo=github)](https://github.com/dusk-network/moat) + +**Moat** (a.k.a. the Citadel SDK) contains all the required tools for using and implementing self-sovereign identity systems using the Citadel protocol integrated into the Dusk Blockchain. + +## Prerequisites + +**Moat** requires a reachable Rusk node installed and running, or selecting a trusted one. You can set up a node as explained [here](https://wiki.dusk.network/en/setting-up-node). It also requires an installed wallet connected to the given Rusk node, as explained [here](https://github.com/dusk-network/wallet-cli/blob/main/src/bin/README.md). + +## Testing the environment + +You can test if the environment you set up and the library are working properly by specifying the testing Rusk node address in `integration-tests/config.toml`, and executing the following (note that the wallet needs to use `password` as password for the tests to succeed): + +``` +cargo t --release --features="exp_tests" -- --test-threads=1 +cargo t --release --features="int_tests" -- --test-threads=1 +``` + +## Moat CLI + +The `moat-cli` utility can be used from the POV of any of the parties involved in the Citadel protocol, let them be: +- **User:** A party requesting licenses onchain to LPs, and being able to use the licenses onchain as well. +- **License Provider (LP):** A party receiving onchain requests from users to issue licenses onchain addressed to them. +- **Service Provider (SP):** A party receiving offchain requests from users to grant services. + +To use the CLI, you should specify the Rusk node address in `moat-cli/config.toml`. Then, you can execute the CLI for any of the involved parties as follows. + +### User + +Users can request licenses and use them. To run the user CLI, simply run: + +```sh +cargo r --release --bin moat-cli-user -- --wallet-pass +``` + +### License Provider + +LPs can scan the Blockchain for requests and issue licenses if the requests are valid. To run the LP CLI, simply run: + +```sh +cargo r --release --bin moat-cli-lp -- --wallet-pass +``` + +### Service Provider + +SPs can get requests from users to grant their services, and accept or deny them by checking if the session cookies provided by the users are valid. To run the SP CLI, simply run: + +```sh +cargo r --release --bin moat-cli-sp -- --wallet-pass +``` + +## Moat API + +An API meant for developers willing to integrate Citadel in their code is available [here](https://github.com/dusk-network/moat/blob/main/moat/src/api.rs). You can find an example on how to use the API into `moat-example`.