BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Transfers from blind to blind. More...
#include <confidential.hpp>
Classes | |
struct | fee_params_t |
Public Member Functions | |
account_id_type | fee_payer () const |
void | validate () const |
share_type | calculate_fee (const fee_params_t &k) const |
void | get_required_authorities (vector< authority > &a) const |
Public Member Functions inherited from graphene::protocol::base_operation | |
virtual | ~base_operation ()=default |
template<typename T > | |
share_type | calculate_fee (const T ¶ms) const |
virtual void | get_required_active_authorities (flat_set< account_id_type > &) const |
virtual void | get_required_owner_authorities (flat_set< account_id_type > &) const |
fc::optional< fc::future< void > > | validate_parallel (uint32_t skip) const |
Public Attributes | |
asset | fee |
vector< blind_input > | inputs |
vector< blind_output > | outputs |
Additional Inherited Members | |
Static Public Member Functions inherited from graphene::protocol::base_operation | |
static uint64_t | calculate_data_fee (uint64_t bytes, uint64_t price_per_kbyte) |
Transfers from blind to blind.
There are two ways to transfer value while maintaining privacy:
When doing account to account transfers, everyone with access to the memo key can see the amounts, but they will not have access to the funds.
When using stealth transfers the same key is used for control and reading the memo.
This operation is more expensive than a normal transfer and has a fee proportional to the size of the operation.
All assets in a blind transfer must be of the same type: fee.asset_id The fee_payer is the temp account and can be funded from the blinded values.
Using this operation you can transfer from an account and/or blinded balances to an account and/or blinded balances.
Stealth Transfers:
Assuming Receiver has key pair R,r and has shared public key R with Sender Assuming Sender has key pair S,s Generate one time key pair O,o as s.child(nonce) where nonce can be inferred from transaction Calculate secret V = o*R blinding_factor = sha256(V) memo is encrypted via aes of V owner = R.child(sha256(blinding_factor))
Sender gives Receiver output ID to complete the payment.
This process can also be used to send money to a cold wallet without having to pre-register any accounts.
Outputs are assigned the same IDs as the inputs until no more input IDs are available, in which case a the return value will be the first ID allocated for an output. Additional output IDs are allocated sequentially thereafter. If there are fewer outputs than inputs then the input IDs are freed and never used again.
Definition at line 238 of file confidential.hpp.
share_type graphene::protocol::blind_transfer_operation::calculate_fee | ( | const fee_params_t & | k | ) | const |
Definition at line 137 of file confidential.cpp.
account_id_type graphene::protocol::blind_transfer_operation::fee_payer | ( | ) | const |
graphene TEMP account
If fee_payer = temp_account_id, then the fee is paid by the surplus balance of inputs-outputs and 100% of the fee goes to the network.
Definition at line 97 of file confidential.cpp.
|
inlinevirtual |
Reimplemented from graphene::protocol::base_operation.
Definition at line 254 of file confidential.hpp.
|
virtual |
This method can be computationally intensive because it verifies that input commitments - output commitments add up to 0
by requiring all inputs to be sorted we also prevent duplicate commitments on the input
Reimplemented from graphene::protocol::base_operation.
Definition at line 106 of file confidential.cpp.
asset graphene::protocol::blind_transfer_operation::fee |
Definition at line 245 of file confidential.hpp.
vector<blind_input> graphene::protocol::blind_transfer_operation::inputs |
Definition at line 246 of file confidential.hpp.
vector<blind_output> graphene::protocol::blind_transfer_operation::outputs |
Definition at line 247 of file confidential.hpp.