pub enum PrivateBalanceIntent {
InitPrivateBalance {
cell_id: AccountId,
agent_id: AccountId,
encrypted_balance: Vec<u8>,
commitment: [u8; 32],
commit_nonce: [u8; 16],
},
Deposit {
cell_id: AccountId,
agent_id: AccountId,
amount: u128,
new_encrypted_balance: Vec<u8>,
new_commitment: [u8; 32],
new_commit_nonce: [u8; 16],
old_commitment: [u8; 32],
},
Withdraw {
cell_id: AccountId,
agent_id: AccountId,
amount: u128,
recipient: AccountId,
new_encrypted_balance: Vec<u8>,
new_commitment: [u8; 32],
new_commit_nonce: [u8; 16],
old_commitment: [u8; 32],
},
ConfidentialTransfer {Show 13 fields
sender_cell_id: AccountId,
sender_agent_id: AccountId,
recipient_cell_id: AccountId,
amount_commitment: [u8; 32],
stark_proof: Vec<u8>,
sender_new_encrypted: Vec<u8>,
sender_new_commitment: [u8; 32],
sender_new_commit_nonce: [u8; 16],
sender_old_commitment: [u8; 32],
recipient_new_encrypted: Vec<u8>,
recipient_new_commitment: [u8; 32],
recipient_new_commit_nonce: [u8; 16],
recipient_old_commitment: [u8; 32],
},
FeeDeduct {
cell_id: AccountId,
agent_id: AccountId,
fee_amount: u128,
fee_recipient: AccountId,
new_encrypted_balance: Vec<u8>,
new_commitment: [u8; 32],
new_commit_nonce: [u8; 16],
old_commitment: [u8; 32],
},
}Variants§
InitPrivateBalance
Owner deploys private balance cell. Requires 100k TRTH staked.
Fields
Deposit
Deposit public TRTH into private balance. Amount is revealed (it’s a public debit). Balance before/after hidden.
Fields
Withdraw
Withdraw from private balance to public on-chain balance. Amount is revealed. Balance before/after hidden.
Fields
ConfidentialTransfer
Confidential transfer: amount and private balances stay hidden.
The submitted STARK proof binds sender, recipient, and amount commitments while proving the private balance conservation equations inside the AIR. The recipient receives a new encrypted balance and commitment without revealing the transferred amount on-chain.
Fields
FeeDeduct
Fee deduction by fee authority only.
Trait Implementations§
Source§impl Clone for PrivateBalanceIntent
impl Clone for PrivateBalanceIntent
Source§fn clone(&self) -> PrivateBalanceIntent
fn clone(&self) -> PrivateBalanceIntent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrivateBalanceIntent
impl Debug for PrivateBalanceIntent
Source§impl<'de> Deserialize<'de> for PrivateBalanceIntent
impl<'de> Deserialize<'de> for PrivateBalanceIntent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PrivateBalanceIntent
impl RefUnwindSafe for PrivateBalanceIntent
impl Send for PrivateBalanceIntent
impl Sync for PrivateBalanceIntent
impl Unpin for PrivateBalanceIntent
impl UnsafeUnpin for PrivateBalanceIntent
impl UnwindSafe for PrivateBalanceIntent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more