privacy

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 15 Imported by: 7

README

Privacy README

This file holds notes for privacy core team.

coins: - Get coin commitments - .Init()

- .Bytes()

coin object: - coin.ParseCoinObjectToInputCoin

Proofs: - Get output coins - Get input coins

Fix packages for v2: RPC, incognitokey, blockchain, transaction, privacy.

.ConvertOutputCoinToInputCoin()

When integrating v2 into v1 there are 3 scenarios that can happen:

- 1: inputs only coin_v1

- 2: inputs only coin_v2

- 3: inputs have coin_v1 with coin_v2
  • output must be coin_v2

Things need to be done when coding new version:

- 1: Code new version in transaction package (txprivacy.go, txversion_interface.go, txver1.go, txver2.go, ...).

- 2: Code new version for proof (if change)

- 3: Code new version for rangeproof (if change)

- If have 2, 3 then: Check batchtransaction.go file and change

Documentation

Index

Constants

View Source
const (
	CStringBurnAddress    = "burningaddress"
	Ed25519KeySize        = operation.Ed25519KeySize
	CStringBulletProof    = operation.CStringBulletProof
	CommitmentRingSize    = privacy_util.CommitmentRingSize
	CommitmentRingSizeExp = privacy_util.CommitmentRingSizeExp

	PedersenSndIndex        = operation.PedersenSndIndex
	PedersenValueIndex      = operation.PedersenValueIndex
	PedersenShardIDIndex    = operation.PedersenShardIDIndex
	PedersenPrivateKeyIndex = operation.PedersenPrivateKeyIndex
	PedersenRandomnessIndex = operation.PedersenRandomnessIndex

	RingSize           = privacy_util.RingSize
	MaxPrivacyAttempts = coin.MaxAttempts
	TxRandomGroupSize  = coin.TxRandomGroupSize

	CoinPrivacyTypeTransfer = coin.PrivacyTypeTransfer
	CoinPrivacyTypeMint     = coin.PrivacyTypeMint
)

Public Constants

View Source
const (
	MaxSizeInfoCoin = coin.MaxSizeInfoCoin // byte
)

Variables

View Source
var DeriveShardInfoFromCoin = coin.DeriveShardInfoFromCoin
View Source
var ErrCodeMessage = errhandler.ErrCodeMessage
View Source
var LoggerV1 = &zkp.Logger
View Source
var LoggerV2 = &privacy_v2.Logger

Functions

func ArrayScalarFromBytes

func ArrayScalarFromBytes(b []byte) (*[]*operation.Scalar, error)

func ArrayScalarToBytes

func ArrayScalarToBytes(arr *[]*operation.Scalar) ([]byte, error)

func CheckDuplicateScalarArray

func CheckDuplicateScalarArray(arr []*Scalar) bool

func GetShardIDFromPublicKey

func GetShardIDFromPublicKey(pk PublicKey) byte

func IsPointEqual

func IsPointEqual(pa *Point, pb *Point) bool

func IsScalarEqual

func IsScalarEqual(pa *Scalar, pb *Scalar) bool

func NewCoinCA

func NewCoinCA(p *coin.CoinParams, tokenID *common.Hash) (*CoinV2, *Point, error)

func NewCoinParams

func NewCoinParams() *coin.CoinParams

Types

type AggregatedRangeProof

type AggregatedRangeProof = agg_interface.AggregatedRangeProof

type AggregatedRangeProofV1

type AggregatedRangeProofV1 = aggregatedrange.AggregatedRangeProof

type AggregatedRangeProofV2

type AggregatedRangeProofV2 = bulletproofs.AggregatedRangeProof

type Coin

type Coin = coin.Coin

type CoinObject

type CoinObject = coin.CoinObject

type CoinV1

type CoinV1 = coin.CoinV1

type CoinV2

type CoinV2 = coin.CoinV2

func NewCoinFromAmountAndTxRandomBytes

func NewCoinFromAmountAndTxRandomBytes(amount uint64, publicKey *operation.Point, txRandom *TxRandom, info []byte) *CoinV2

func NewCoinFromPaymentInfo

func NewCoinFromPaymentInfo(p *coin.CoinParams) (*CoinV2, error)

type HybridCipherText

type HybridCipherText = hybridencryption.HybridCipherText

type OTAKey

type OTAKey = key.OTAKey

type OTAReceiver

type OTAReceiver = coin.OTAReceiver

type PaymentAddress

type PaymentAddress = key.PaymentAddress

func GeneratePaymentAddress

func GeneratePaymentAddress(privateKey []byte) PaymentAddress

type PaymentInfo

type PaymentInfo = key.PaymentInfo

type PaymentWitness

type PaymentWitness = zkp.PaymentWitness

type PaymentWitnessParam

type PaymentWitnessParam = zkp.PaymentWitnessParam

type PlainCoin

type PlainCoin = coin.PlainCoin

type PlainCoinV1

type PlainCoinV1 = coin.PlainCoinV1

type Point

type Point = operation.Point

func HashToPoint

func HashToPoint(b []byte) *Point

func RandomPoint

func RandomPoint() *Point

type PrivacyError

type PrivacyError = errhandler.PrivacyError //nolint:revive

type PrivateKey

type PrivateKey = key.PrivateKey

func GeneratePrivateKey

func GeneratePrivateKey(seed []byte) PrivateKey

type Proof

type Proof = proof.Proof

func NewProofWithVersion

func NewProofWithVersion(version int8) Proof

type ProofV1

type ProofV1 = zkp.PaymentProof

type ProofV2

type ProofV2 = privacy_v2.PaymentProofV2

func ProveV2

func ProveV2(inputCoins []PlainCoin, outputCoins []*CoinV2, sharedSecrets []*Point, hasPrivacy bool, paymentInfo []*PaymentInfo) (*ProofV2, error)

type PublicKey

type PublicKey = key.PublicKey

type Scalar

type Scalar = operation.Scalar

func ComputeAssetTagBlinder

func ComputeAssetTagBlinder(sharedSecret *Point) (*Scalar, error)

func HashToScalar

func HashToScalar(data []byte) *Scalar

func RandomScalar

func RandomScalar() *Scalar

Point and Scalar operations

type SchnSignature

type SchnSignature = schnorr.SchnSignature

type SchnorrPrivateKey

type SchnorrPrivateKey = schnorr.SchnorrPrivateKey

type SchnorrPublicKey

type SchnorrPublicKey = schnorr.SchnorrPublicKey

type TransmissionKey

type TransmissionKey = key.TransmissionKey

type TxRandom

type TxRandom = coin.TxRandom

type ViewingKey

type ViewingKey = key.ViewingKey

func GenerateViewingKey

func GenerateViewingKey(privateKey []byte) ViewingKey

Directories

Path Synopsis
Package operation allows for basic manipulation of scalars & group elements
Package operation allows for basic manipulation of scalars & group elements
edwards25519
Package edwards25519 implements group logic for the twisted Edwards curve
Package edwards25519 implements group logic for the twisted Edwards curve
edwards25519/field
Package field implements fast arithmetic modulo 2^255-19.
Package field implements fast arithmetic modulo 2^255-19.
v1
privacy_v1
bulletproofs
Package bulletproofs manages the creation, proving & verification of Bulletproofs.
Package bulletproofs manages the creation, proving & verification of Bulletproofs.
bulletproofs/v1
Package bulletproofs manages the creation, proving & verification of Bulletproofs.
Package bulletproofs manages the creation, proving & verification of Bulletproofs.
mlsag
variable names to match names in the crypto protocol Package mlsag contains the implementation of MLSAG, a ring signature scheme.
variable names to match names in the crypto protocol Package mlsag contains the implementation of MLSAG, a ring signature scheme.

Jump to

Keyboard shortcuts

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