@bnb-chain/greenfield-zk-crypto
v1.0.0
Published
Zk crypto wasm module
Downloads
409
Maintainers
Readme
Zk Crypto
NPM Wrap for zkbnb-js-sdk.
Usage
> npm i @bnb-chain/greenfield-zk-crypto
Browsers
ESM
import {getEddsaCompressedPublicKey} from "@bnb-chain/greenfield-zk-crypto"
// set wasm path: CDN or your server path
window.__PUBLIC_ZKCRYPTO_WASM_PATH__ = 'zk wasm path';
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
console.log(res)
})()
UMD
<script src="https://cdn.jsdelivr.net/npm/@bnb-chain/greenfield-zk-crypto/dist/umd/index.js"></script>
<script>
// set wasm path
window.__PUBLIC_CROSS_WASM_PATH__ = 'https://cdn.jsdelivr.net/npm/@bnb-chain/greenfield-zk-crypto/dist/node/zk-crypto.wasm';
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
console.log(res)
})()
</script>
Nodejs
const { getEddsaCompressedPublicKey } = require("@bnb-chain/greenfield-zk-crypto");
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
})()