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.
28 lines (22 loc) • 525 B
text/typescript
import {
calcViewTag,
} from './blsct'
import { PublicKey } from './keys/publicKey'
import { ViewKey } from './keys/childKeyDesc/txKeyDesc/viewKey'
export class ViewTag {
value: number
constructor(
blindingPubKey: PublicKey,
viewKey: ViewKey
) {
this.value = calcViewTag(
blindingPubKey.value(),
viewKey.value()
)
}
static random(): ViewTag {
const blindingPubKey = PublicKey.random()
const viewKey = ViewKey.random()
return new ViewTag(blindingPubKey, viewKey)
}
}