Sidechain

sidechain_eth_create_address_operation

Used to generate address in ETH blockchain. After the address is generated eth_address_object(s) will be created in echo db and can be retrieved using get_eth_address method. Until one of the objects will receive sufficient amount of approvals the number of objects connected to account id can be more than one.

User use this operation to generate ethereum address which can be used to interact with eth sidechain. Before user can use the address it must be approved by the committee.

struct sidechain_eth_create_address_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type account;
extensions_type extensions;
account_id_type fee_payer()const { return account; }
};

JSON Example

[
40,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"extensions": []
}
]

sidechain_eth_approve_address_operation

An internal operation by which committee members confirm the created Ethereum address.

Committee member sends this operation to approve created address. After the required number of approvals has been collected user can use his eth address to interact with eth sidechain.

struct sidechain_eth_approve_address_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
std::vector<account_id_type> malicious_committeemen;
account_id_type account;
eth_address_type eth_addr;
sha256 transaction_hash;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
41,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"malicious_committeemen": [],
"account": "1.2.0",
"eth_addr": "0000000000000000000000000000000000000000",
"transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"extensions": []
}
]

sidechain_eth_deposit_operation

An internal operation by which committee members confirm Ethereum deposit.

This operation is sent by the committee member to indicate that eth transaction with deposit was processed in the echo.

struct sidechain_eth_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
uint64_t deposit_id;
account_id_type account;
uint64_t value;
sha256 transaction_hash;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
42,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"deposit_id": 0,
"account": "1.2.0",
"value": 0,
"transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"extensions": []
}
]

sidechain_eth_send_deposit_operation

An internal operation by which committee members confirm Ethereum deposit after 24h and credit eETH.

This operation is sent by the committee member after 24h after receiving deposit to approve deposit. After the required number of approvals has been collected eETH are credited to the account to which the eth address is attached.

struct sidechain_eth_send_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
eth_deposit_id_type deposit_id;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
43,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"deposit_id": "1.14.0",
"extensions": []
}
]

sidechain_eth_withdraw_operation

Used to withdraw the eETH and receive ETH to provided address.

User use this operation to withdraw eETH and receive back ethereum to provided address.

struct sidechain_eth_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type account;
eth_address_type eth_addr;
uint64_t value;
extensions_type extensions;
account_id_type fee_payer() const { return account; }
};

JSON Example

[
44,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"eth_addr": "0000000000000000000000000000000000000000",
"value": 0,
"extensions": []
}
]

sidechain_eth_send_withdraw_operation

An internal operation by which committee members confirm the withdrawal of ETH after 24h.

This operation is used by the commitee member to approve withdrawal of ETH after 24h.

struct sidechain_eth_send_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
eth_withdraw_id_type withdraw_id;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
45,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"withdraw_id": "1.15.0",
"extensions": []
}
]

sidechain_eth_approve_withdraw_operation

An internal operation by which committee members confirm the withdrawal of ETH and burn the eETH.

This operation is used by the commitee member to approve withdrawal. After the required number of approvals has been collected indicated amount of ETH is transfered back to provided address and eETH are burned.

struct sidechain_eth_approve_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
uint64_t withdraw_id;
sha256 transaction_hash;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
46,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"withdraw_id": 0,
"transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"extensions": []
}
]

sidechain_eth_update_contract_address_operation

An internal operation, sent by committee member to propose update of the eth contract address.

This operation is used by the committee only through proposals to change address of the eth sidechain contract.

struct sidechain_eth_update_contract_address_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = ECHO_BLOCKCHAIN_PRECISION; };
asset fee;
eth_address_type new_addr;
extensions_type extensions;
account_id_type fee_payer() const { return ECHO_COMMITTEE_ACCOUNT; }
};

JSON Example

[
47,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"new_addr": "0e7057518879d5DE1F842b77e8F6F3e22931a1be",
"extensions": []
}
]

sidechain_issue_operation

Virtual operation, which reports that the money entered with the help of sidechain.

This operation is used to credit sidechain assets.

struct sidechain_issue_operation : public base_operation
{
sidechain_issue_operation() = default;
sidechain_issue_operation(asset v, account_id_type a, deposit_eth_id_type d) :
value(v), account(a), deposit_id(d) {}
asset value;
account_id_type account;
object_id_type deposit_id;
extensions_type extensions;
account_id_type fee_payer()const { return ECHO_NULL_ACCOUNT; }
};

JSON Example

[
48,
{
"value": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"deposit_id": "0.0.0",
"extensions": []
}
]

sidechain_burn_operation

Virtual operation, which reports that the conclusion was successful and funds burned(withdrawn).

This operation is used to burn sidechain assets.

struct sidechain_burn_operation : public base_operation
{
sidechain_burn_operation() = default;
sidechain_burn_operation(asset v, account_id_type a, withdraw_eth_id_type w) :
value(v), account(a), withdraw_id(w) {}
asset value;
account_id_type account;
object_id_type withdraw_id;
extensions_type extensions;
account_id_type fee_payer()const { return account; }
};

JSON Example

[
49,
{
"value": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"withdraw_id": "0.0.0",
"extensions": []
}
]

sidechain_erc20_register_token_operation

Used to register a token in the sidechain.

User use this operation to register his erc20 token in echo network.

struct sidechain_erc20_register_token_operation : public base_operation
{
struct fee_parameters_type {
uint64_t fee = 5000 * ECHO_BLOCKCHAIN_PRECISION;
uint64_t pool_fee = 5 * ECHO_BLOCKCHAIN_PRECISION;
};
asset fee;
account_id_type account;
eth_address_type eth_addr; // address of the contract in ethereum
std::string name;
std::string symbol;
uint8_t decimals;
extensions_type extensions;
account_id_type fee_payer() const { return account; }
};

JSON Example

[
50,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"eth_addr": "0000000000000000000000000000000000000000",
"name": "",
"symbol": "",
"decimals": 0,
"extensions": []
}
]

sidechain_erc20_deposit_token_operation

An internal operation by which committee members confirm the entry of tokens.

This operation is sent by the committee member to indicate that eth transaction with erc20 deposit was processed in the echo.

struct sidechain_erc20_deposit_token_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
std::vector<account_id_type> malicious_committeemen;
account_id_type account;
eth_address_type erc20_token_addr; // address of the contract in ethereum
std::string value;
sha256 transaction_hash;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
51,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"malicious_committeemen": [],
"account": "1.2.0",
"erc20_token_addr": "0000000000000000000000000000000000000000",
"value": "",
"transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"extensions": []
}
]

sidechain_erc20_send_deposit_operation

An internal operation by which committee members confirm the entry of tokens after 24h and credit token.

This operation is sent by the committee member after 24h after receiving erc20 deposit to approve deposit. After the required number of approvals has been collected provided amount of tokens are credited to the account in the echo network.

struct sidechain_erc20_send_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
erc20_deposit_token_id_type deposit_id;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
52,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"deposit_id": "1.17.0",
"extensions": []
}
]

sidechain_erc20_withdraw_token_operation

Executed by the user and initiates the withdrawal of the token from the Echo network to the specified address.

User use this operation to withdraw erc20 tokens and receive back this tokens to provided eth address.

struct sidechain_erc20_withdraw_token_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type account;
eth_address_type to; // withdrawal address
erc20_token_id_type erc20_token; // contract id of the token
std::string value;
extensions_type extensions;
account_id_type fee_payer() const { return account; }
};

JSON Example

[
53,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"to": "0000000000000000000000000000000000000000",
"erc20_token": "1.17.0",
"value": "",
"extensions": []
}
]

sidechain_erc20_send_withdraw_operation

An internal operation by which committee members confirm the removal of tokens after 24h.

This operation is used by the commitee member to approve withdrawal of erc20 tokens after 24h.

struct sidechain_erc20_send_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
erc20_withdraw_token_id_type withdraw_id;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
54,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"withdraw_id": "1.18.0",
"extensions": []
}
]

sidechain_erc20_approve_token_withdraw_operation

An internal operation by which committee members confirm the removal of tokens.

This operation is used by the commitee member to approve withdrawal. After the required number of approvals has been collected indicated amount of erc20 tokens is transfered back to provided address and erc20 tokens are burned.

struct sidechain_erc20_approve_token_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
uint64_t withdraw_id;
sha256 transaction_hash;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
55,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"withdraw_id": 0,
"transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"extensions": []
}
]

sidechain_erc20_issue_operation

Virtual operation which issues erc20 token.

This operation is used to credit erc20 tokens.

struct sidechain_erc20_issue_operation : public base_operation
{
erc20_deposit_token_id_type deposit;
account_id_type account;
erc20_token_id_type token;
string amount;
extensions_type extensions;
account_id_type fee_payer() const { return ECHO_NULL_ACCOUNT; }
};

JSON Example

[
56,
{
"deposit": "1.18.0",
"account": "1.2.0",
"token": "1.17.0",
"amount": "",
"extensions": []
}
]

sidechain_erc20_burn_operation

Virtual operation which burns erc20 tokens.

This operation is used to burn erc20 tokens.

struct sidechain_erc20_burn_operation : public base_operation
{
erc20_withdraw_token_id_type withdraw;
account_id_type account;
erc20_token_id_type token;
string amount;
extensions_type extensions;
account_id_type fee_payer() const { return ECHO_NULL_ACCOUNT; }
};

JSON Example

[
57,
{
"withdraw": "1.19.0",
"account": "1.2.0",
"token": "1.17.0",
"amount": "",
"extensions": []
}
]

sidechain_btc_create_address_operation

Used to generate address in BTC blockchain. After the address is generated btc_address_object(s) will be created in echo db and can be retrieved using get_btc_address method.

User use this operation to generate bitcoin address which can be used to interact with btc sidechain. Backup address must be only P2PK.

struct sidechain_btc_create_address_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type account;
std::string backup_address;
extensions_type extensions;
account_id_type fee_payer() const { return account; }
};

JSON Example

[
58,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"backup_address": "n4cLNDfyVPGoNFUpUEyBP8TzDPRNaVBm6E",
"extensions": []
}
]

sidechain_btc_create_intermediate_deposit_operation

An internal operation by which committee members processed deposit to account.

This operation is sent by the committee member to indicate that btc transaction with deposit was processed in the echo.

struct sidechain_btc_create_intermediate_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
account_id_type account;
btc_address_id_type btc_address_id;
btc_transaction_details tx_info;
extensions_type extensions;
account_id_type fee_payer()const { return committee_member_id; }
};

JSON Example

[
59,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"account": "1.2.0",
"btc_address_id": "1.19.0",
"tx_info": {
"block_number": 0,
"out": {
"tx_id": "0000000000000000000000000000000000000000000000000000000000000000",
"index": 0,
"amount": 0
}
},
"extensions": []
}
]

sidechain_btc_intermediate_deposit_operation

An internal operation by which committee members send from intermediate address to deposit address.

This operations is used by the committee member to send btc from intermediate address to deposit address.

struct sidechain_btc_intermediate_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
btc_intermediate_deposit_id_type intermediate_address_id;
btc_signature_type signature;
extensions_type extensions;
account_id_type fee_payer()const { return committee_member_id; }
};

JSON Example

[
60,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"intermediate_address_id": "1.20.0",
"signature": [],
"extensions": []
}
]

sidechain_btc_deposit_operation

An internal operation by which committee members processed deposit to deposit address from intermediate address.

This operation is used by the committee member to indicate that transfer from intermediate address to deposit address was processed.

struct sidechain_btc_deposit_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
account_id_type account;
btc_intermediate_deposit_id_type intermediate_deposit_id;
btc_transaction_details tx_info;
extensions_type extensions;
account_id_type fee_payer() const { return committee_member_id; }
};

JSON Example

[
61,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"account": "1.2.0",
"intermediate_deposit_id": "1.20.0",
"tx_info": {
"block_number": 0,
"out": {
"tx_id": "0000000000000000000000000000000000000000000000000000000000000000",
"index": 0,
"amount": 0
}
},
"extensions": []
}
]

sidechain_btc_withdraw_operation

Used to withdraw the eBTC and receive BTC to provided address.

User use this operation to withdraw eBTC and receive back bitcoins to provided address.

struct sidechain_btc_withdraw_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type account;
std::string btc_addr;
uint64_t value;
extensions_type extensions;
account_id_type fee_payer()const { return account; }
};

JSON Example

[
62,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"account": "1.2.0",
"btc_addr": "n4cLNDfyVPGoNFUpUEyBP8TzDPRNaVBm6E",
"value": 0,
"extensions": []
}
]

sidechain_btc_aggregate_operation

An internal operation by which committee members collect an aggregate transaction.

This operation is used to collect all deposits and withdrawals into aggregate transaction.

struct sidechain_btc_aggregate_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
std::set<btc_deposit_id_type> deposits;
std::set<btc_withdraw_id_type> withdrawals;
fc::sha256 transaction_id;
p2sh_p2wsh sma_address;
commitee_pub_keys_map_t committee_member_ids_in_script;
uint64_t aggregation_out_value = 0;
uint32_t btc_block_number = 0;
fc::optional<btc_aggregating_id_type> previous_aggregation;
uint8_t cpfp_depth = 0;
std::map<std::uint32_t, btc_signature_type> signatures;
extensions_type extensions;
account_id_type fee_payer()const { return committee_member_id; }
};

JSON Example

[
63,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"deposits": [],
"withdrawals": [],
"transaction_id": "0000000000000000000000000000000000000000000000000000000000000000",
"sma_address": "2NBVhof6ntL76Kpy1D4znTqqt13Rt5J8SeS",
"committee_member_ids_in_script": [],
"aggregation_out_value": 0,
"btc_block_number": 0,
"previous_aggregation": "1.23.0", // optional
"cpfp_depth": 0,
"signatures": [],
"extensions": []
}
]

sidechain_btc_approve_aggregate_operation

An internal operation by which committee members confirm the aggregate transaction.

Used by the committee member to approve aggregate transaction. After the required number of approvals has been collected aggregate transaction is sent to bitcoin network and eBTC are credited/burned.

struct sidechain_btc_approve_aggregate_operation : public base_operation
{
struct fee_parameters_type { uint64_t fee = 0; };
asset fee;
account_id_type committee_member_id;
fc::sha256 transaction_id;
uint64_t block_number = 0;
extensions_type extensions;
account_id_type fee_payer()const { return committee_member_id; }
};

JSON Example

[
64,
{
"fee": {
"amount": 0,
"asset_id": "1.3.0"
},
"committee_member_id": "1.2.0",
"transaction_id": "0000000000000000000000000000000000000000000000000000000000000000",
"block_number": 0,
"extensions": []
}
]