TLSNotary SDK Module

Browser-based HTTPS attestation using MPC-TLS with token-based management.

import { TLSNotary, TLSNotaryService } from '@kynesyslabs/demosdk/tlsnotary';

const demos = new Demos();
await demos.connect('https://node.demos.sh');
await demos.connectWallet(mnemonic);

// Token-based flow (recommended for production)
const service = new TLSNotaryService(demos);

// 1. Request attestation token (burns 1 DEM)
const { proxyUrl, tokenId } = await service.requestAttestation({
targetUrl: 'https://api.github.com/users/octocat'
});

// 2. Perform attestation
const tlsn = await demos.tlsnotary();
const result = await tlsn.attest({
url: 'https://api.github.com/users/octocat',
});

// 3. Store proof on-chain (burns 1 + proof_size_kb DEM)
const { txHash } = await service.storeProof(
tokenId,
JSON.stringify(result.presentation),
{ storage: 'onchain' }
);

console.log('Proof stored:', txHash);
import {
Prover, Presentation, NotaryServer, Transcript,
init as initTlsnWasm
} from '@kynesyslabs/demosdk/tlsnotary';

// Initialize WASM (required before using Prover/Presentation)
await initTlsnWasm({ loggingLevel: 'Info' });

// Now you can use the classes directly without installing tlsn-js
const notary = NotaryServer.from('wss://notary.example.com');
const prover = await new Prover({ serverDns: 'api.example.com' });

References

Renames and re-exports TLSNotary