npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@endcorp/photoverifier-sdk

v0.2.2

Published

PhotoVerifier SDK for photo verification with blockchain anchoring

Downloads

180

Readme

@endcorp/photoverifier-sdk

PhotoVerifier SDK for React Native/Expo apps that need tamper-evident photo proofs anchored on Solana.

Features

  • BLAKE3 photo hashing
  • H3 location cell derivation (privacy-preserving geospatial bucket)
  • Integrity payload canonicalization
  • Presigned S3 upload helpers
  • Solana transaction builders for compressed photo-proof flows

Install

npm install @endcorp/photoverifier-sdk

Quick Start

import { Connection, PublicKey } from '@solana/web3.js';
import { Base64 } from 'js-base64';
import { Buffer } from 'buffer';
import {
  blake3HexFromBytes,
  locationToH3Cell,
  h3CellToU64,
  canonicalizeIntegrityPayload,
  requestAttestedPresignedPut,
  putToPresignedUrl,
  buildRecordPhotoProofTransaction,
} from '@endcorp/photoverifier-sdk';

async function submitPhotoProof(params: {
  photoBytes: Uint8Array;
  owner: PublicKey;
  signMessage: (m: Uint8Array) => Promise<Uint8Array>;
  sendTx: (tx: any) => Promise<string>;
  presignEndpoint: string;
  wallet: string;
  location: { latitude: number; longitude: number };
}) {
  const connection = new Connection('https://api.devnet.solana.com', 'confirmed');
  const hashHex = blake3HexFromBytes(params.photoBytes);
  const hash32 = Uint8Array.from(Buffer.from(hashHex, 'hex'));
  const h3Cell = locationToH3Cell(params.location, 7);

  const latest = await connection.getLatestBlockhashAndContext();
  const slot = latest.context.slot;
  const blockhash = latest.value.blockhash;
  const timestampSec = (await connection.getBlockTime(slot)) ?? Math.floor(Date.now() / 1000);
  const nonce = BigInt(Date.now());
  const key = `photos/${params.wallet}/${hashHex}.jpg`;

  const integrityPayload = {
    hashHex,
    h3Cell,
    h3Resolution: 7,
    timestampSec,
    wallet: params.wallet,
    nonce: nonce.toString(),
    slot,
    blockhash,
  };
  const canonical = canonicalizeIntegrityPayload(integrityPayload);
  const signature = Base64.fromUint8Array(
    await params.signMessage(new TextEncoder().encode(canonical))
  );

  const presign = await requestAttestedPresignedPut(params.presignEndpoint, {
    key,
    contentType: 'image/jpeg',
    integrity: { version: 'v1', payload: integrityPayload, signature },
  });

  await putToPresignedUrl({
    url: presign.uploadURL,
    bytes: params.photoBytes,
    contentType: 'image/jpeg',
  });

  const txBuild = await buildRecordPhotoProofTransaction({
    connection,
    owner: params.owner,
    hash32,
    nonce,
    timestampSec,
    h3CellU64: h3CellToU64(h3Cell),
    attestationSignature64: presign.attestationSignature64,
  });
  const txSig = await params.sendTx(txBuild.transaction);
  await connection.confirmTransaction(txSig, 'confirmed');
  return txSig;
}

Peer Dependencies

This package expects your app to provide:

  • expo, react, react-native
  • expo-camera, expo-location, expo-file-system, expo-media-library
  • @solana/web3.js, @solana/spl-token

Use this package when you want the full SDK surface and direct control over capture, attestation, upload, and on-chain commit flows.