Expand description
This crate defines our domain models and logic for the xand ledger. IE: This is the code that determines how transactions are validated/processed, as well as the shape of those transactions. It is free of major dependencies and should remain so to provide a clean environment for concentrating on domain code.
Practically speaking this code is consumed in other places for two purposes:
- Validating transactions (within the substrate runtime)
- Constructing transactions (everywhere else)
The crate has an std feature that is enabled by default. Disabling the feature allows the
crate to compile in no-std mode. The substrate runtime requires this, and no-std support must
be maintained.
Re-exports§
pub use curve25519_dalek;
Modules§
- crypto
- Zero Knowledge Implementation
- esig_
payload - verifiable_
encryption
Structs§
- Cash
Confirmation Transaction - Issued by the trust to confirm a pending create request
- Clear
Redeem Output - Clear
Redeem Request Transaction - A clear (non-confidential) redeem request transaction
- Clear
Transaction Output - Compact
Encrypted Signer - Compact representation of the verifiable signer encryption. Useful to store the encrypted values after proofs have already been verified.
- Confidential
Redeem Request Record - Core
Create Request Transaction - Encapsulates all the fields of the create request transaction except the signature.
- Core
Exiting Redeem Request Transaction - Encapsulates all the details of a
ExitingRedeemRequestTransactionother than the proof with signature. - Core
Redeem Request Transaction - Encapsulates all the details of a
RedeemRequestTransactionother than the proof with signature. - Core
Send Claims Transaction - The CoreTransaction contains all the details of a Transaction except the signature and proof. A serialized version of the CoreTransaction is then signed as part of the main proof. A Transaction contains a CoreTransaction and a proof cum signature.
- Create
Cancellation Transaction - Issued by the trust (or intrinsically) to cancel an outstanding create request
- Create
Request Processor - A collection of repositories that when combined are capable of processing create requests, and implement CreateRequestHandler
- Create
Request Record - A record of a confidential pending create request - a user does not submit this directly, rather it is created and stored as a result of processing a create request transaction.
- Create
Request Transaction - A create request, as issued by a member
- Create
Request TxnInputs - All the (nonrandom) inputs required to construct a CreateRequestTransaction
- Curve
Vector - Encrypted
- Encryption
Key - A Encryption key representing the public portion of some private key, and hence a (potential) sender or receiver of encrypted messages.
- Exiting
Redeem Output - Exiting
Redeem Request Processor - Exiting
Redeem Request Transaction - An exiting redeem request transaction
- Identity
Tag - An piece of info that identifies an entity as a verified participant. Each (applicable) transaction must include one such valid tag (mixed among decoys).
- Invalid
Cancellation Reason - KeyImage
- There is a unique key-image for every TransactionOutput, but the key-image cannot be efficiently matched with the corresponding TransactionOutput by any polynomial time probabilistic algorithm with a non-negligible probability without using the private key. If a Transaction contains a key-image that has already been used, then the corresponding TransactionOutput has been spent already, which means that the transaction is invalid.
- Milliseconds
- Milliseconds - often used as millis since epoch to form a timestamp
- Monetary
Value - NotA
Public Key - Error type specifying that a public key cannot be derived from Identity Tag
- OneTime
Key - Represents a public key that is specific to an individual txo
- Opened
Transaction Output - An
OpenedTransactionOutputrepresents a UTXO and the information needed to reveal/open it. - Private
Exiting Redeem Request Inputs - Inputs for a participant issuing an exiting redeem request
- Private
Inputs - Private
Redeem Request Inputs - Inputs for a participant issuing a redeem request
- Proof
- Public
Input Set - Public
Key - A cryptographic public key representing a public identity
- Redeem
Cancellation Transaction - Issued by the trust (or intrinsically) to cancel an outstanding redeem request
- Redeem
Fulfillment Transaction - Issued by the trust to confirm a redeem fulfillment
- Redeem
Output - Redeem
Request Processor - Redeem
Request Transaction - A redeem request transaction
- Reward
Processor - Send
Claims Output - Transfer TxO and associated data
- Send
Claims Processor - Send
Claims Transaction - A send claims transaction representing the transfer of value from one registered member to another
- Spending
Output - Transaction
Input Set - A collection of TransactionOutput(s). The are used in a transaction as a collection of inputs
that are summed up to make the total value of the transaction. A transaction includes multiple
TransactionInputSets, only one of which is the realTransactionInputSetbeing spent. - Transaction
Output - A transaction output, or TXO, represents a commitment to some value, and information about who owns the right to spend that value (claims).
- Vector
Tuple - Verifiable
Encryption OfSigner Key
Enums§
- Banned
State - State of banned member
- Correlation
IdUsed By - Expresses reasons a correlation id is already used. Is returned by CorrelationIdRepository::is_used
- Create
Cancellation Reason - The reason a create request was cancelled
- Encryption
KeyError - Failure
Reason - Failures that may occur during transaction validation
- Ledger
Transaction - All transactions in
xand_ledger - Monetary
Value Error - Redeem
Cancellation Reason - The reason a redeem request was cancelled
- Redeem
Signer - Transaction
Builder Errors - Transaction
Validation Error - TxoStatus
- The status of a TransactionOutput
- ZkPlmt
Error
Traits§
- Block
Info Repository - Provides access to info about the currently executing/processing block
- Cash
Confirmation Handler - Implementors are capable of processing cash confirmation transactions
- Clear
Redeem Request Handler - Implementors are capable of processing clear redeem request transactions
- Clear
Transaction Output Repository - Provides access to information stored in the ledger regarding ClearTransactionOutputs
- Correlation
IdRepository - Provides access to information stored in the ledger regarding CorrelationIds
- Create
Cancellation Handler - Implementors are capable of processing create cancellation transactions
- Create
Request Handler - Implementors are capable of processing create request transactions
- Create
Request Repository - Provides access to and storage of info in the ledger about pending create requests in the form of CreateRequestRecords
- Decrypt
Signer - Dispatcher
- A dispatcher is capable of accepting transactions and executing them. This functionality is important because sometimes you would like a transaction to “happen” as a result of processing another transaction, or simply periodically (ex: every block). This mechanism allows us to ensure the other transaction is counted as a proper transaction - and not just an identical modification of state (IE: It shows up as it’s own transaction in the block).
- Exiting
Redeem Request Handler - IUtxo
- Identity
TagRepository - Provides access to information stored in the ledger regarding IdentityTags
- KeyImage
Repository - Provides access to information stored in the ledger regarding KeyImages
- Member
Repository - Trait for managing the storage of member data
- Pending
Create Request Expire Time - Provides access to configurable expiration time for pending create requests
- Redeem
Cancellation Handler - Implementors are capable of processing redeem cancellation transactions
- Redeem
Fulfillment Handler - Implementors are capable of processing redeem fulfillment transactions
- Redeem
Request Handler - Implementors are capable of processing redeem request transactions
- Redeem
Request Repository - Provides access to and storage of info in the ledger about pending unfulfilled redeem requests in the form of RedeemRequestRecords
- Reward
Transaction Handler - Implementors are capable of processing reward transactions
- Send
Claims Handler - Implementors are capable of processing send claims transactions
- Total
Issuance Repository - Trait for tracking the current total number of claims
- Transaction
Data Repository - Provides access to information stored in the ledger regarding TransactionOutputs
- Trust
Metadata - Provides access to the metadata about the trust. Specifically, it gives access to the public key of the trust.
- Validator
Repository - Trait for managing the storage of validator data
Functions§
- check_
identity_ tag_ ownership - Returns whether the identity tag matches the private key
- check_
txo_ ownership - Given a TransactionOutput, check whether it is owned by the private key provided.
- construct_
clear_ redeem_ request_ transaction - construct_
create_ request_ transaction - Builds a create request
- construct_
exiting_ redeem_ request_ transaction - construct_
redeem_ request_ transaction - construct_
send_ claims_ transaction - decode_
one_ time_ key - Determine the PublicKey associated with a given OneTimeKey. The OneTimeKey is derived using the message body, the txo index, and the message sender’s private key to form a random value that is only reproducible for the sender.
- find_
secret_ input_ index - Find row in
inputsthat matches the givenkey_imagesandprivate_key.
Type Aliases§
- Block
Number - A block number
- Clear
Redeem Request Record - Correlation
Id - A unique identifier to associate an on-chain transaction with some real-world event, for now, a cash transfer at a Xand-Enabled Bank.
- Encrypted
Blob - Some blob of binary data that has been encrypted
- Private
Key - A private key, as held by a transaction signer / creator.
- Redeem
Request Record - Reward
Transaction - Salt
- Transaction
Result - The result of processing/validating a transaction