Skip to content

Commit

Permalink
bumped new version, add details for zkp-gen-iden3 README
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Aug 9, 2023
1 parent 097a740 commit c1fd0e4
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 20 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [2.0.0-rc.16] - 2023-08-09
### Added
- `@rarimo/client` - Identity related query methods
- `@rarimo/zkp-gen-iden3` - States manipulations
- `@rarimo/shared-zkp-iden3` - State details helpers

## [2.0.0-rc.15] - 2023-08-09
### Fixed
Expand Down Expand Up @@ -415,7 +417,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Under the hood changes
- Initiated repo with `@rarimo/provider` and `@rarimo/nft-checkout` packages

[Unreleased]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.15...HEAD
[Unreleased]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.16...HEAD
[2.0.0-rc.16]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.15...2.0.0-rc.16
[2.0.0-rc.15]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.14...2.0.0-rc.15
[2.0.0-rc.14]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.13...2.0.0-rc.14
[2.0.0-rc.13]: https://github.com/rarimo/js-sdk/compare/2.0.0-rc.12...2.0.0-rc.13
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"build:bridge": "yarn workspace @rarimo/bridge build",
"build:swap": "yarn workspace @rarimo/swap build",
"build:nft-checkout": "yarn workspace @rarimo/nft-checkout build",
"build:react-nft-checkout": "yarn workspace @rarimo/react-nft-checkout build",
"build:react-provider": "yarn workspace @rarimo/react-provider build",
"build:provider": "yarn workspace @rarimo/provider build",
"build:providers-evm": "yarn workspace @rarimo/providers-evm build",
"build:providers-solana": "yarn workspace @rarimo/providers-solana build",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-zkp-iden3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/auth-zkp-iden3",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Tools that authenticate a zero-knowledge proof and provide verifiable credentials from it.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/bridge",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Internal tools that other Rarimo packages use to bridge tokens.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/client",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "The Rarimo chain client",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/identity-gen-iden3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/identity-gen-iden3",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Tools that generate distributed identities for the Iden3 protocol.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/nft-checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/nft-checkout",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Features of the Rarimo SDK that create cross-chain transactions based on the Rarimo protocol.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/provider",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "A common interface for access to wallets (EVM and non-EVM) in the Rarimo SDK, used by packages that provide access to wallets on specific chains such as @rarimo/providers-evm, @rarimo/providers-solana, and @rarimo/providers-near.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/providers-evm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/providers-evm",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on EVM-compatible blockchains.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/providers-near/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/providers-near",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on the NEAR blockchain.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/providers-solana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/providers-solana",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on the Solana blockchain.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-nft-checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/react-nft-checkout",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "React components that you can use in your UI to create cross-chain transactions with the Rarimo protocol.",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/react-provider",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Tools to connect to wallets in React applications through the Rarimo SDK.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-zkp-iden3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/shared-zkp-iden3",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Internal tools that other Rarimo packages use for identity functionality.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/shared",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Utility functions, types and constants shared across Rarimo packages.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/swap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/swap",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Internal tools that other Rarimo packages use to swap tokens.",
"repository": {
"type": "git",
Expand Down
32 changes: 32 additions & 0 deletions packages/zkp-gen-iden3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const getZkProof = async (
value: ['1'],

circuitId: CircuitId.AtomicQueryMTPV2OnChain,

issuerId: config.ISSUER_ID,
},
})

Expand All @@ -89,6 +91,36 @@ const getZkProof = async (
}
```

### For more specific use cases, e.g. when we need to ensure of states actuality:
```ts
import { makeRarimoQuerier } from '@rarimo/client'
import { getTransitStateTxBody } from '@rarimo/shared-zkp-iden3'
import { config } from '@/config'

const querier = makeRarimoQuerier({
apiUrl: config.RARIMO_CORE_RPC_API_URL,
})

await zkProof.loadStatesDetails(querier)
await zkProof.loadMerkleProof(querier, config.ISSUER_ID)

if (zkProof.isStatesActual()) {
const transitParams = await isNaturalZkp?.loadParamsForTransitState(
querier,
)

// use
const txBody = getTransitStateTxBody(
config.LIGHTWEIGHT_STATE_V2_CONTRACT_ADDRESS,
transitParams.newIdentitiesStatesRoot,
transitParams.gistData,
transitParams.proof,
)

// send tx with txBody ...
}
```

## Known Issues

[Read here](https://github.com/rarimo/js-sdk/blob/main/README.md#working-with-zkp-iden3-packages)
Expand Down
2 changes: 1 addition & 1 deletion packages/zkp-gen-iden3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/zkp-gen-iden3",
"version": "2.0.0-rc.15",
"version": "2.0.0-rc.16",
"description": "Tools that generate zero-knowledge proofs for the Iden3 protocol.",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3246,13 +3246,13 @@ __metadata:
linkType: hard

"@types/react@npm:*, @types/react@npm:^18, @types/react@npm:^18.0.27":
version: 18.2.19
resolution: "@types/react@npm:18.2.19"
version: 18.2.20
resolution: "@types/react@npm:18.2.20"
dependencies:
"@types/prop-types": "*"
"@types/scheduler": "*"
csstype: ^3.0.2
checksum: 1ef657b90c7413451bbac2fd2fbce4f8a093941bc5041d344ab9833bc113c8eebf6318dae8aeeb1a0f922f15bc772507e6aaa0c7b51847b5f7302921c8dd6740
checksum: 30f699c60e5e4bfef273ce64d320651cdd60f5c6a08361c6c7eca8cebcccda1ac953d2ee57c9f321b5ae87f8a62c72b6d35ca42df0e261d337849952daab2141
languageName: node
linkType: hard

Expand Down

0 comments on commit c1fd0e4

Please sign in to comment.