mirror of
https://github.com/logos-messaging/go-zerokit-rln.git
synced 2026-01-04 06:03:09 +00:00
chore: add json marshalling annotations
This commit is contained in:
parent
310a9442c4
commit
d338ed9d40
19
rln/types.go
19
rln/types.go
@ -26,32 +26,32 @@ type ZKSNARK = [128]byte
|
||||
type MembershipKeyPair = struct {
|
||||
// user's identity key (a secret key) which is selected randomly
|
||||
// see details in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Membership
|
||||
IDKey IDKey
|
||||
IDKey IDKey `json:"idKey"`
|
||||
// hash of user's identity key generated by
|
||||
// Poseidon hash function implemented in rln lib
|
||||
// more details in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Membership
|
||||
IDCommitment IDCommitment
|
||||
IDCommitment IDCommitment `json:"idCommitment"`
|
||||
}
|
||||
|
||||
type RateLimitProof struct {
|
||||
// RateLimitProof holds the public inputs to rln circuit as
|
||||
// defined in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Public-Inputs
|
||||
// the `proof` field carries the actual zkSNARK proof
|
||||
Proof ZKSNARK
|
||||
Proof ZKSNARK `json:"proof"`
|
||||
// the root of Merkle tree used for the generation of the `proof`
|
||||
MerkleRoot MerkleNode
|
||||
MerkleRoot MerkleNode `json:"root"`
|
||||
// the epoch used for the generation of the `proof`
|
||||
Epoch Epoch
|
||||
Epoch Epoch `json:"epoch"`
|
||||
// shareX and shareY are shares of user's identity key
|
||||
// these shares are created using Shamir secret sharing scheme
|
||||
// see details in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Linear-Equation-amp-SSS
|
||||
ShareX MerkleNode
|
||||
ShareY MerkleNode
|
||||
ShareX MerkleNode `json:"share_x"`
|
||||
ShareY MerkleNode `json:"share_y"`
|
||||
// nullifier enables linking two messages published during the same epoch
|
||||
// see details in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Nullifiers
|
||||
Nullifier Nullifier
|
||||
Nullifier Nullifier `json:"nullifier"`
|
||||
// Application specific RLN Identifier
|
||||
RLNIdentifier RLNIdentifier
|
||||
RLNIdentifier RLNIdentifier `json:"rlnIdentifier"`
|
||||
}
|
||||
|
||||
type MembershipIndex = uint
|
||||
@ -80,6 +80,7 @@ const HASH_HEX_SIZE = int(HASH_BIT_SIZE / 8)
|
||||
const STATIC_GROUP_SIZE = 100
|
||||
|
||||
// STATIC_GROUP_KEYS is a static list of 100 membership keys in the form of (identity key, identity commitment)
|
||||
//
|
||||
// keys are created locally, using createMembershipList proc from waku_rln_relay_utils module, and the results are hardcoded in here
|
||||
// this list is temporary and is created to test the performance of waku-rln-relay for the static groups
|
||||
// in the later versions, this static hardcoded group will be replaced with a dynamic one
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user