Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imporved "generate proof" prompt wording #36

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +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).

## [2.0.3] - 2024-02-05
### Changed
- `@rarimo/rarime`:
- Creating proof "approve message"

## [2.0.2] - 2024-02-01
### Added
- `@rarimo/rarime`:
Expand Down Expand Up @@ -156,7 +161,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Implemented `@rarimo/rarime-connector` and `@rarimo/rarime` packages

[Unreleased]: https://github.com/rarimo/rarime/compare/2.0.2...HEAD
[Unreleased]: https://github.com/rarimo/rarime/compare/2.0.3...HEAD
[2.0.3]: https://github.com/rarimo/rarime/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/rarimo/rarime/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/rarimo/rarime/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/rarimo/rarime/compare/1.0.2...2.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/connector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/rarime-connector",
"version": "2.0.2",
"version": "2.0.3",
"description": "Facilitates interaction between a DApp and RariMe MetaMask snap",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/connector/src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.0.2"
"version": "2.0.3"
}
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "site",
"version": "2.0.2",
"version": "2.0.3",
"private": true,
"license": "(MIT-0 OR Apache-2.0)",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/rarime",
"version": "2.0.2",
"version": "2.0.3",
"description": "RariMe is a MetaMask Snap that safely holds any of your credentials and allows you to prove your identity without revealing any personal data. Powered by Rarimo Protocol and Zero-Knowledge Proof technology.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,7 +56,7 @@
"@metamask/snaps-jest": "^4.0.0",
"@metamask/snaps-sdk": "^1.1.0",
"@metamask/snaps-utils": "^4.0.0",
"@rarimo/rarime-connector": "2.0.2",
"@rarimo/rarime-connector": "2.0.3",
"buffer": "6.0.3",
"dids": "4.0.4",
"ethers": "5.7.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "2.0.2",
"version": "2.0.3",
"description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.",
"proposedName": "RariMe",
"repository": {
"type": "git",
"url": "https://github.com/rarimo/rarime.git"
},
"source": {
"shasum": "i0ljRZ0cephpKn1+G77icrHnm0Gh4soRcJ9b6xpQaXA=",
"shasum": "dzRQl3ZoJOO/JgVTiWHQbfti5MJuZJUcL0skXceVsTs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
40 changes: 13 additions & 27 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,38 +260,27 @@ export const onRpcRequest = async ({
);
}

const vc = credentials[0];

const res = await snap.request({
method: 'snap_dialog',
params: {
type: 'confirmation',
content: panel([
heading('Create proof'),

divider(),
heading('Generate a zero-knowledge proof?'),

text('Credential types'),
divider(),

...credentials.reduce((acc: TextField[], cred) => {
return [
...acc,

...cred.type.reduce((credAcc: TextField[], type) => {
return credAcc.concat([text(`${type}\n`)]);
}, []),
];
}, []),
text('**Credential**'),
text(`${vc.type?.[1]}\n`),

divider(),
text('Requirements'),
text('**Query**'),

...credentials.reduce((acc: TextField[], cred) => {
return [
...acc,

...Object.keys(cred.credentialSubject).reduce(
...(query.credentialSubject
? Object.keys(query.credentialSubject).reduce(
(accSubj: TextField[], fieldName) => {
const fieldOperators = cred.credentialSubject?.[fieldName];
const fieldOperators = query.credentialSubject?.[fieldName];

const isString = typeof fieldOperators === 'string';
const isNumber = typeof fieldOperators === 'number';
Expand All @@ -315,23 +304,20 @@ export const onRpcRequest = async ({
return accSubj.concat(textField);
},
[],
),
];
}, []),
)
: []),

divider(),

...(circuitId
? [divider(), text('Proof type'), text(circuitId)]
: []),
...(circuitId ? [text('**ZK Circuit**'), text(circuitId)] : []),
]),
},
});

if (res) {
const identity = await Identity.create(identityStorage.privateKeyHex);

const zkpGen = new ZkpGen(identity, createProofRequest, credentials[0]);
const zkpGen = new ZkpGen(identity, createProofRequest, vc);

// ================ LOAD STATE DETAILS =====================

Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7460,7 +7460,7 @@ __metadata:
languageName: node
linkType: hard

"@rarimo/[email protected].2, @rarimo/rarime-connector@workspace:^, @rarimo/rarime-connector@workspace:packages/connector":
"@rarimo/[email protected].3, @rarimo/rarime-connector@workspace:^, @rarimo/rarime-connector@workspace:packages/connector":
version: 0.0.0-use.local
resolution: "@rarimo/rarime-connector@workspace:packages/connector"
dependencies:
Expand Down Expand Up @@ -7505,7 +7505,7 @@ __metadata:
"@metamask/snaps-jest": ^4.0.0
"@metamask/snaps-sdk": ^1.1.0
"@metamask/snaps-utils": ^4.0.0
"@rarimo/rarime-connector": 2.0.2
"@rarimo/rarime-connector": 2.0.3
"@typechain/ethers-v5": 11.1.1
"@types/intl": 1.2.0
"@types/lodash": ^4.14.202
Expand Down
Loading