0.0.24 • Published 1 year ago
@symfoni/vc-tools v0.0.24
Welcome to Symfoni Verfiable Credentials tools.
A library for issuing and verifying verifiable credentials. Based on Veramo.
Who uses @symfoni/vc-tools
...
How It Works
...
Useage
VC Issuer
On Goerli
const issuer = await VCIssuer.init({
dbName: "test",
walletSecret: "test test test test test test test test test test test junk",
chains: [
{
default: true,
chainId: 5,
provider: {
url: "https://eth-goerli.g.alchemy.com/v2/YOUR_ALCHEMY_APP_KEY"
},
},
],
});
const vc = await issuer.createVC({
credentialSubject: {
identityNumber: "123456789",
},
});
const vp = await issuer.createVP({
verifiableCredential: [vc],
});
VC Verifier
On Goerli
const verifier = await VCVerifier.init({
dbName: "test",
walletSecret: "test test test test test test test test test test test junk",
chains: [
{
default: true,
chainId: 5,
provider: {
url: "https://eth-goerli.g.alchemy.com/v2/YOUR_ALCHEMY_APP_KEY"
},
},
],
});
const verifiedVC = await verifier.verifyVC({
credential: vc.proof.jwt, // or just vc
});
const verifiedVP = await verifier.verifyVP({
presentation: vp,
policies: {
audience: false,
},
});
On a network without standard DIDRegistry
const verifier = await VCVerifier.init({
dbName: "test",
walletSecret: "test test test test test test test test test test test junk",
chains: [
{
default: true,
chainId: 5,
didRegistry: "0x5FbDB2315678afecb367f032d93F642f64180aa3", // Address to the DID Registry
provider: new ethers.providers.JsonRpcProvider("http://localhost:8545"), // can also just put provider: { url: "http://localhost:8545",}
},
],
});
....
Development
- Clone repo
- pnpm install
- copy .env.example to .env
- pnpm test
0.0.24
1 year ago
0.0.23
2 years ago
0.0.22
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.3
2 years ago
0.0.1
2 years ago