mirror of
https://github.com/pezkuwichain/pezkuwi-wasm.git
synced 2026-11-02 00:11:06 +00:00
The package shipped only compiled output, and no repository held its source. lib/ is @scure/sr25519 0.2.0 with three edits made directly in the compiled files: signing context 'substrate' -> 'bizinikiwi' and the two header comment lines. index.ts is upstream's 0.2.0 source with the same edits; compiled with its own tsconfig it reproduces lib/*.js and lib/*.d.ts byte for byte. Only the source maps change, since the hand-edited ones still described upstream's file. - index.ts, tsconfig.json, tsconfig.cjs.json, upstream MIT LICENSE - yarn build:scure-sr25519 rebuilds lib/ - scripts/check-scure-sr25519.sh, run in CI, fails when lib/ is not a build of index.ts - README: what differs from upstream, how to build; it said the context was 'bizinikiwi' instead of 'bizinikiwi'
1.3 KiB
1.3 KiB
@pezkuwi/scure-sr25519
SR25519 cryptography for PezkuwiChain with bizinikiwi signing context.
Fork of @scure/sr25519 with PezkuwiChain-specific signing context.
Installation
npm install @pezkuwi/scure-sr25519
Usage
import { getPublicKey, sign, verify, secretFromSeed } from '@pezkuwi/scure-sr25519';
// Generate keypair from 32-byte seed
const secret = secretFromSeed(seed);
const publicKey = getPublicKey(secret);
// Sign message
const signature = sign(secret, message);
// Verify
const valid = verify(message, signature, publicKey);
Difference from @scure/sr25519
index.ts is @scure/sr25519 0.2.0
with three changes:
- the signing context is
bizinikiwiinstead ofsubstrate(BIZINIKIWI_CONTEXT, used bysignandverify), so signatures match PezkuwiChain's runtime; - the two header comment lines name Pezkuwi instead of Polkadot.
Nothing else differs; lib/ is the TypeScript output of index.ts.
Building
yarn build:scure-sr25519 # from the repository root; writes lib/
./scripts/check-scure-sr25519.sh # CI: lib/ must equal a fresh build
License
MIT. See LICENSE; the copyright notice is upstream's.