Nullifier
Nullifiers are used as a public commitment to a specific anonymous account, to forbid actions like double spending, or allow a consistent identity between anonymous actions.
RFC: https://github.com/o1-labs/o1js/issues/756
Paper: https://eprint.iacr.org/2022/1255.pdf
Extends
- {
"private": {"c":Field;"g_r":Group;"h_m_pk_r":Group; };"public": {"nullifier":Group;"s":Scalar; };"publicKey":Group; }
Constructors
new Nullifier()
new Nullifier(value: {
"private": {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
"public": {
"nullifier": Group;
"s": Scalar;
};
"publicKey": Group;
}): Nullifier
Parameters
• value
• value.private= undefined
• value.private.c: Field= Field
• value.private.g_r: Group= Group
• value.private.h_m_pk_r: Group= Group
• value.public= undefined
• value.public.nullifier: Group= Group
• value.public.s: Scalar= Scalar
• value.publicKey: Group= Group
Returns
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).constructor
Source
lib/provable/types/struct.ts:148
Properties
private
private: {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
c
c: Field = Field;
g_r
g_r: Group = Group;
h_m_pk_r
h_m_pk_r: Group = Group;
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).private
Source
lib/provable/crypto/nullifier.ts:26
public
public: {
"nullifier": Group;
"s": Scalar;
};
nullifier
nullifier: Group = Group;
s
s: Scalar = Scalar;
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).public
Source
lib/provable/crypto/nullifier.ts:22
publicKey
publicKey: Group = Group;
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).publicKey
Source
lib/provable/crypto/nullifier.ts:21
_isStruct
static _isStruct: true;
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, })._isStruct
Source
lib/provable/types/struct.ts:148
check()
static check: (value: {
"private": {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
"public": {
"nullifier": Group;
"s": Scalar;
};
"publicKey": Group;
}) => void;
Add assertions to the proof to check if value is a valid member of type T.
This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.
For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.
Parameters
• value
the element of type T to put assertions on.
• value.private= undefined
• value.private.c: Field= Field
• value.private.g_r: Group= Group
• value.private.h_m_pk_r: Group= Group
• value.public= undefined
• value.public.nullifier: Group= Group
• value.public.s: Scalar= Scalar
• value.publicKey: Group= Group
Returns
void
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).check
Source
lib/provable/types/provable-intf.ts:76
empty()
static empty: () => {
"private": {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
"public": {
"nullifier": Group;
"s": Scalar;
};
"publicKey": Group;
};
Returns
{
"private": {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
"public": {
"nullifier": Group;
"s": Scalar;
};
"publicKey": Group;
}
private
private: {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
private.c
c: Field = Field;
private.g_r
g_r: Group = Group;
private.h_m_pk_r
h_m_pk_r: Group = Group;
public
public: {
"nullifier": Group;
"s": Scalar;
};
public.nullifier
nullifier: Group = Group;
public.s
s: Scalar = Scalar;
publicKey
publicKey: Group = Group;
Inherited from
Struct({ publicKey: Group, public: { nullifier: Group, s: Scalar, }, private: { c: Field, g_r: Group, h_m_pk_r: Group, }, }).empty
Source
lib/provable/types/struct.ts:158
fromFields()
static fromFields: (fields: Field[]) => {
"private": {
"c": Field;
"g_r": Group;
"h_m_pk_r": Group;
};
"public": {
"nullifier": Group;
"s": Scalar;
};
"publicKey": Group;
};