To instruct the EVM to CRUD/run smart contract, we need a way of passing arbitrary data in a transaction. Currently our only way of doing this is via 32 byte memos in the notes. If we create a description included in the transaction that contains an arbitrary length data field we can pass data to the EVM.
The data field in a standard ethereum transaction is abi encoded and the first four bytes delineates what function call is being made. We can handle the same data in ironfish for EVM, but we can extend the concept for future data bundles if needed.
Goals
Update Transaction structure to contain data descriptions that can be used to create, update, destroy, and execute a contract.
Should be able to contain data of arbitrary raw bytes
Motivation and Use Cases
The first use case for passing arbitrary data with a transaction will be EVM integration. We need this field in order to pass/initialize transactions in the EVM. Another example application is passage of metadata for bridging providers, or exchange metadata inclusion (outside of the standard memo fields).
Scope
In scope
Add data description
Versioning of transaction
Updating ser/de
Out of scope
Fee/Gas updates associated with arbitrary data size
Defining EVM data schema (ie abi encoding or alternative scheme)
Design
Magic byte at start saying this description is for EVM execution (allows reuse of this description in future).
// hex strings for known data types
enum DataTypes = {
Undefined: 1;
EVM: 2;
...
}
Update to Transaction structure
pub struct Transaction {
version: TransactionVersion = TransactionVersion.3,
...
// First byte of data is DataType
**data: Vec<DataDescription>**
}
pub struct DataDescription {
data_type: u8
data: Vec<u8>
}
Open questions:
decide whether we want this as a separate description or if just data field is sufficient
do we want a separate field for data type, or is encoding first byte sufficient
Data Description
Background
To instruct the EVM to CRUD/run smart contract, we need a way of passing arbitrary data in a transaction. Currently our only way of doing this is via 32 byte memos in the notes. If we create a description included in the transaction that contains an arbitrary length
data
field we can pass data to the EVM.The
data
field in a standard ethereum transaction is abi encoded and the first four bytes delineates what function call is being made. We can handle the same data in ironfish for EVM, but we can extend the concept for future data bundles if needed.Goals
Transaction
structure to contain data descriptions that can be used to create, update, destroy, and execute a contract.Motivation and Use Cases
The first use case for passing arbitrary data with a transaction will be EVM integration. We need this field in order to pass/initialize transactions in the EVM. Another example application is passage of metadata for bridging providers, or exchange metadata inclusion (outside of the standard memo fields).
Scope
In scope
Out of scope
Design
Open questions:
data
type, or is encoding first byte sufficient