constants

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package constants declares system-wide constants.

Index

Constants

View Source
const (
	// DebugMode is a flag to indicate whether the application is in debug mode.
	// If disabled some options won't be available
	DebugMode = true

	// NonceLength indicates number of bytes used for any nonces.
	NonceLength = 32
)

Variables

View Source
var (
	// DEPRECATED: replaced by Zeta Status
	// SpentZetaPrefix represents prefix for each zeta in the database to indicate it has been spent.
	SpentZetaPrefix = []byte("SpentZeta")

	// ZetaStatusPrefix represents prefix for each zeta in the database to indicate its status
	// (spent, being verified, unspent)
	ZetaStatusPrefix = []byte("ZetaStatus")

	// AggregateVkKey represents the database entry for the aggregate verification key of the threshold number
	// of issuing authorities of the system. It is used for credential verification.
	AggregateVkKey = []byte("AggregateVerificationKey")

	// IaKeyPrefix represents the prefix for particular issuing authority to store their keys.
	IaKeyPrefix = []byte("IssuingAuthority")

	// EthereumWatcherKeyPrefix represents the prefix for storing public keys of trusted watchers.
	EthereumWatcherKeyPrefix = []byte("EthereumWatcher")

	// CredentialVerifierKeyPrefix represents the prefix for storing public keys of trusted verifiers.
	CredentialVerifierKeyPrefix = []byte("CredentialVerifier")

	// TokenRedeemerKeyPrefix represents the prefix for storing public key of trusted redeemers.
	TokenRedeemerKeyPrefix = []byte("TokenRedeemer")

	// AccountsPrefix represents prefix for each account in the database to indicate amount of associated tokens.
	AccountsPrefix = []byte("account")

	// CoconutHsKey represents the database entry for the EC points of G1 as defined by
	// the public, system-wide coconut parameters.
	CoconutHsKey = []byte("coconutHs")

	// SeenNoncePrefix represents prefix for each seen nonce in the database.
	SeenNoncePrefix = []byte("NONCE")

	// CredentialRequestKeyPrefix represents prefix attached to key field of kvpair in the tags of response
	// to a successful request to transfer tokens to the pipe account.
	CredentialRequestKeyPrefix = []byte("GETCREDENTIAL")

	// RedeemCredentialRequestKeyPrefix represents prefix attached to key field of kvpair in the tags of response
	// to a successful request to move redeem attached credential and move tokens into corresponding Nym account.
	RedeemCredentialRequestKeyPrefix = []byte("REDEEMCREDENTIAL")

	// RedeemTokensRequestKeyPrefix represents prefix attached to key field of kvpair in the tags of response
	// to a successful request to move tokens to the corresponding ERC20 account.
	RedeemTokensRequestKeyPrefix = []byte("REDEEMTOKENS")

	// EthereumWatcherNotificationPrefix represents prefix for database entry
	// to indicate given watcher has already notified about particular transfer.
	EthereumWatcherNotificationPrefix = []byte("HOLDTRANSFNOTIF")

	// CredentialVerifierNotificationPrefix represents prefix for database entry
	// to indicate given verifier has already notified about particular credential status.
	CredentialVerifierNotificationPrefix = []byte("CREDVERIFNOTIF")

	// TokenRedeemerNotificationPrefix represents prefix for database entry
	// to indicate given redeemer has already notified and confirmed given user's intent to redeem tokens.
	TokenRedeemerNotificationPrefix = []byte("TOKENREDNOTIF")

	// PipeAccountTransferNotificationCountKeyPrefix represents prefix for the key for number of watchers
	// confirming given transfer
	PipeAccountTransferNotificationCountKeyPrefix = []byte("COUNT HODLTRANSFNOTIF")

	// CredentialVerificationNotificationCountKeyPrefix represents prefix for the key for number of verifiers
	// verifying given credential
	CredentialVerificationNotificationCountKeyPrefix = []byte("COUNT CREDVERIFNOTIF")

	// TokenRedemptionNotificationCountKeyPrefix represents prefix for the key for number of redeemers
	// confirming user's intent to redeem tokens
	TokenRedemptionNotificationCountKeyPrefix = []byte("COUNT TOKENREDNOTIF")

	// WatcherThresholdKey represents key under which watcher threshold as initially set in genesis state is stored.
	WatcherThresholdKey = []byte("WatcherThreshold")

	// VerifierThresholdKey represents key under which verifier threshold as initially set in genesis state is stored.
	VerifierThresholdKey = []byte("VerifierThreshold")

	// RedeemerThresholdKey represents key under which redeemer threshold as initially set in genesis state is stored.
	RedeemerThresholdKey = []byte("RedeemerThreshold")

	// PipeContractKey represents key under which address of the pipe account
	// as initially set in genesis state is stored.
	PipeContractKey = []byte("PipeContractAddress")

	// HashFunction defines a hash function used during signing and verification of messages sent to tendermint chain
	HashFunction = ethcrypto.Keccak256

	// ErrNotInDebug indicates error thrown when trying to access functionalities only available in debug mode
	ErrNotInDebug = errors.New("could not proceed with request. App is not in debug mode")
)

nolint: gochecknoglobals

Functions

This section is empty.

Types

type ZetaStatus

type ZetaStatus byte
const (
	// Given Zeta can have 3 states:
	// Unspent - when it was never sent to the chain before
	// Being Verified - SP sent deposit request but verifiers have not reached consensus on credential validity yet
	// Spent - SP has already been credited for credential value
	// Unspent status is never explicitly written to the database, it's being implied from lack of any entry
	ZetaStatusUnspent       ZetaStatus = 0
	ZetaStatusSpent         ZetaStatus = 1
	ZetaStatusBeingVerified ZetaStatus = 2
)

func (ZetaStatus) DbEntry

func (status ZetaStatus) DbEntry() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL