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

Manage ethereum based identities #200

Merged
merged 38 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9895873
create ethereum based identities
daveroga Mar 21, 2024
5aeda0e
fix rebase
daveroga Mar 22, 2024
3e96c51
remove log
daveroga Mar 22, 2024
6f0c5ac
pass parameter for ethereum identity
daveroga Mar 22, 2024
2c375b2
update state transition ethereum identities
daveroga Mar 27, 2024
c638453
method update for testing in Mumbai deployment
daveroga Mar 27, 2024
dca0556
update auth test with integration test for ethereum identities
daveroga Mar 27, 2024
2bf7b91
restore method helper iden3
daveroga Mar 27, 2024
8ec2133
update current state when creating auth credential in ethereum identi…
daveroga Mar 28, 2024
a86992c
remove unused import
daveroga Mar 28, 2024
7e43f84
add test ethereum identity flow (not integration)
daveroga Mar 28, 2024
39a2dfa
remove only in test
daveroga Mar 28, 2024
c048e0b
update mumbai for aloy
daveroga Apr 2, 2024
b31c69b
update id test
daveroga Apr 2, 2024
a68a6dd
changes proposed from review
daveroga Apr 2, 2024
d6740c1
update tests
daveroga Apr 3, 2024
17a4bf1
suggested changes from review
daveroga Apr 3, 2024
bf4d208
throw error if not ethSigner
daveroga Apr 3, 2024
f7e784d
add transit state logic to identiy wallet
daveroga Apr 3, 2024
8819374
typo and make new function to add bjj key and transit state
daveroga Apr 3, 2024
42c2c25
fix sec256k1 private key generation less than 32 bytes
daveroga Apr 4, 2024
4a1030a
updates from reviewed comments
daveroga Apr 4, 2024
48e126a
updates from review comments
daveroga Apr 5, 2024
368fdf8
updates from review
daveroga Apr 5, 2024
a19871a
update prover parameter in identity wallet
daveroga Apr 5, 2024
bb236e3
separate creation options for createIdentity and createEthereumBasedI…
daveroga Apr 5, 2024
c7409cc
update add bjj credential and test
daveroga Apr 8, 2024
cc25463
update core claim in mtp proof and revocation
daveroga Apr 8, 2024
a6eba8a
add key rotation use case test
daveroga Apr 8, 2024
2b29963
remove only in test
daveroga Apr 8, 2024
e6f1187
add transit state after revoke credential
daveroga Apr 8, 2024
60a0c50
update query proof with v3
daveroga Apr 9, 2024
571234c
check issue credentials in issuer revocation keys
daveroga Apr 9, 2024
f6728c9
revoke user keys and check
daveroga Apr 9, 2024
a48de78
changes
daveroga Apr 10, 2024
c652718
add function to get mtp from core claim
vmidyllic Apr 10, 2024
38fad21
fix
vmidyllic Apr 10, 2024
ca6cf87
remove level of nested structure
daveroga Apr 12, 2024
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
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
publishState: async () => {
return '0xc837f95c984892dbcc3ac41812ecb145fedc26d7003202c50e1b87e226a9b33c';
},
publishStateGeneric: async () => {
return '0xc837f95c984892dbcc3ac41812ecb145fedc26d7003202c50e1b87e226a9b33c';
},
getGISTProof: () => {
return Promise.resolve({
root: 0n,
Expand Down
12 changes: 10 additions & 2 deletions src/credentials/status/reverse-sparse-merkle-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IStateStorage } from '../../storage';
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
import { CredentialStatus, RevocationStatus, State } from '../../verifiable';
import { VerifiableConstants, CredentialStatusType } from '../../verifiable/constants';
import { isGenesisState } from '../../utils';
import { isEthereumIdentity, isGenesisState } from '../../utils';
import { IssuerResolver } from './sparse-merkle-tree';

/**
Expand Down Expand Up @@ -173,11 +173,19 @@ export class RHSResolver implements CredentialStatusResolver {
return this.getRevocationStatusFromIssuerData(issuerDID, issuerData, genesisState);
}
const currentStateBigInt = Hash.fromHex(stateHex).bigInt();
if (!isGenesisState(issuerDID, currentStateBigInt)) {

const isEthIdentity = isEthereumIdentity(issuerDID);

if (!isEthIdentity && !isGenesisState(issuerDID, currentStateBigInt)) {
throw new Error(
`latest state not found and state parameter ${stateHex} is not genesis state`
);
}

if (isEthIdentity) {
throw new Error(`State must be published for Ethereum based identity`);
}

latestState = currentStateBigInt;
}

Expand Down
Loading
Loading