prove-solana-wallet
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    Prove-Solana-Wallet

    This library proves ownership of a Solana wallet to off-chain verifiers.

    It is compatible with standard browser wallet adapters, such as sol-wallet-adapter, and can be extended to others.

    Install

    npm install @identity.com/prove-solana-wallet

    or

    yarn add @identity.com/prove-solana-wallet

    Usage

    Prove ownership of a keypair

    Prover side:

    const {prove} = require('@identity.com/prove-solana-wallet');
    const proof = await prove(myKeypair);

    Verifier side:

    const {verify} = require('@identity.com/prove-solana-wallet');
    verify(proof, expectedPublicKey);

    Prove ownership of an external wallet (e.g. sol-wallet-adapter). See here for more details.

    Prover side:

    const {prove} = require('@identity.com/prove-solana-wallet');
    import Wallet from "@project-serum/sol-wallet-adapter";
    
    const providerUrl = 'https://www.sollet.io';
    const wallet = new Wallet(providerUrl);
    wallet.on('connect', async (publicKey) => {
      // once the wallet is connected, we can prove ownership
      const signer = (transaction:Transaction) => wallet.signTransaction(transaction);
    
      const proof = await prove(myKeypair);
    });

    Verifier side:

    const {verify} = require('@identity.com/prove-solana-wallet');
    verify(proof, expectedPublicKey);

    Keywords

    none

    Install

    npm i prove-solana-wallet

    DownloadsWeekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    214 kB

    Total Files

    15

    Last publish

    Collaborators

    • dankelleher