New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@civic/spl-identity

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@civic/spl-identity

SPL Identity is a Solana program, which adds the concept of Self-Sovereign Identity to the Solana blockchain. It allows other Solana programs to add "identity gate" functionality: A user can interact with the program only if they are in possession of a va

  • 0.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

SPL Identity - JS client

SPL Identity is a Solana program, which adds the concept of Self-Sovereign Identity to the Solana blockchain. It allows other Solana programs to add "identity gate" functionality: A user can interact with the program only if they are in possession of a valid identity, certified by a trusted identity validator.

A user's personal identity information is not stored on-chain, rather, the identity validator stores a hash of the data against a new account type called an "Identity Account"

This is the JS client for the Identity program.

Usage

Install

npm install @civicteam/spl-identity

or

yarn add @civicteam/spl-identity

Import

import { Identity } from '@civicteam/spl-identity';

Creating a new Identity

Given a funded owner Account:

const identityAccount = await identity.createAccount(owner.publicKey);

Get identity account information

const identityAccountInfo = await identity.getAccountInfo(identityAccount);

// A new identity has no attestations
expect(identityAccountInfo.attestation).to.be.undefined();
expect(identityAccountInfo.owner).to.deep.equal(owner.publicKey);

Add an attestation

Given a funded IDV Account:

const attestation = new Uint8Array(
  // an attestation must be 32 bytes in length
  Buffer.from('my attestation'.padStart(32, ' '), 'utf-8')
);

await identity.attest(identityAccount, idv, attestation);

Validate an attestation

const identityHasAttestation = await identity.hasAttestation(
    identityAccount,
    idv.publicKey,
    attestation
);

expect(identityHasAttestation).to.be.true;

Commands

To build using TSDX, use:

yarn start

This builds to /dist using Rollup, and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

To do a one-off build, use yarn build.

To run tests, use yarn test.

FAQs

Package last updated on 11 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc