navio-blsct
Version:
TypeScript bindings for the `libblsct` library used by the [Navio](https://nav.io/) blockchain to construct confidential transactions based on the BLS12-381 curve.
19 lines (18 loc) • 645 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewTag = void 0;
const blsct_1 = require("./blsct");
const publicKey_1 = require("./keys/publicKey");
const viewKey_1 = require("./keys/childKeyDesc/txKeyDesc/viewKey");
class ViewTag {
value;
constructor(blindingPubKey, viewKey) {
this.value = (0, blsct_1.calcViewTag)(blindingPubKey.value(), viewKey.value());
}
static random() {
const blindingPubKey = publicKey_1.PublicKey.random();
const viewKey = viewKey_1.ViewKey.random();
return new ViewTag(blindingPubKey, viewKey);
}
}
exports.ViewTag = ViewTag;