Some thoughts on
#EthscriptionRollup. Under the premise of the current gas reduction, it continues to reduce gas, while packaging transactions to alleviate congestion on the main network, and has a certain real-time nature. A very imaginative project!
#Ethscriptions #eths #ERC20
If you are not concerned about the transaction order on the blockchain for some simple transfer transactions, you can consider using batch transactions. This involves submitting a group of transactions together, and indexing them in order sequentially.
The process can be understood in three stages:
Transfer of multiple tokens from a single address to another single address, which is similar to the principle of batch transfers in ESIP-5.
example_tx = {
'from': addressA,
'to': 0x0,
'data': "data:application/json,{'from': addressA, ’to': addressB, 'arg':[
{'token': A, 'amount': 1000},
{'token': B, 'amount': 1000},
{'token': C, 'amount': 1000}
], 'salt': '123141231251235'} "
}
Transfer of multiple tokens from a single address to multiple addresses, which is essentially combining multiple transactions from stage one into a single transaction.
example_tx = {
'from': addressA,
'to': 0x0,
'data': "data:application/json,{'from': addressA, 'arg': [
{'to': addressB, 'token': A, 'amount': 1000},
{'to': addressC, 'token': B, 'amount': 1000},
{'to': addressD, 'token': C, 'amount': 1000}
], 'salt': '123141231251235'} "
}
Transfer of multiple tokens from multiple addresses to multiple addresses.
The issue that needs to be discussed here: A third-party trusted virtual machine is required to execute the transactions, with addresses authorizing the virtual machine. The virtual machine collects the transfer requests from multiple addresses and merges them into one transaction for submission.
example_tx = {
'from': ROLL_UP_ADDRESS,
'to': 0x0,
'data': "data:application/json,{'arg': [
{'from': addressA, 'to': addressB, 'token': A, 'amount': 1000},
{'from': addressB, 'to': addressC, 'token': B, 'amount': 1000},
{'from': addressC, 'to': addressD, 'token': C, 'amount': 1000}
], 'salt': '123141231251235'} "
}