Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Planning #1

Open
ermvrs opened this issue Feb 12, 2024 · 1 comment
Open

Project Planning #1

ermvrs opened this issue Feb 12, 2024 · 1 comment

Comments

@ermvrs
Copy link
Collaborator

ermvrs commented Feb 12, 2024

In this project, we are aiming to develop an intermediate client that parses inputs and forwards calls to Starknet RPCs and also formats returning data to fit Ethereum RPC outputs. We can develop this project in two stages. In the first one, we can call MVP, it works with excluded write calls (sendTransaction, sendRawTransaction). In the second part, we can add this feature, this separation because additional security is needed for that part as well, also stability can be done in this part.

With this project done, we achieve native Ethereum libraries, protocols will be able to integrate into starknet without any changes on their side.

The table below shows how we implement data transformation i/o between Ethereum RPC and Starknet RPC. Table derived from starkness-specs.

Ethereum Method How to Implement
eth_blockNumber Returns starknet block number. Formatted exact same Ethereum output.
eth_chainId Returns chain id as same as Ethereum. SN_MAIN value.
eth_getBlockByNumber Formats starknet_getBlockByNumber into Ethereums output. Blank or null non-existent properties.
eth_getBlockTransactionCountByHash Formats starknet-related output into Ethereum.
eth_getBlockTransactionCountByNumber Formats starknet-related output into Ethereum.
eth_getTransactionByBlockHashAndIndex Formats starknet-related output into Ethereum.
eth_getTransactionByBlockNumberAndIndex Formats starknet-related output into Ethereum.
eth_pendingTransactions Formats starknet-related output into Ethereum.
eth_getBlockByHash Formats starknet-related output into Ethereum.
eth_protocolVersion Formats starknet-related output into Ethereum.
eth_syncing Formats starknet-related output into Ethereum.
eth_getStorageAt The returned object will be exactly the same. Pad felts to provide 256-bit output.
eth_getTransactionByHash Formats starknet-related output into Ethereum.
eth_getTransactionReceipt Formats starknet-related output into Ethereum.
eth_getCode Class hash can be returned. Will return exact same output as Ethereum with nulled, non-existent properties and padded felts.
eth_sendTransaction Just input formatting and forward to starknet rpc. [NOT SURE]
eth_sendRawTransaction Just input formatting and forward to starknet rpc. [NOT SURE]

Most of the rpc calls can be implemented with minimal formatting on both the input and output sides. Personally, call and send transactions are the most challenging ones. However, Starknet allows us to get abi from rpc call, so we know how to format contract calls without abi, it allows us to re-design input according to target contracts input from Ethereum input.

For development tech, we can use NodeJS or Rust. I don't think stability will be a huge problem here however, this project is just an intermediate client. There won't be block processes, so NodeJS can be enough and easy to maintain. Rust will be more robust.
I don't have an opinion on tech side, but if we go with NodeJS project will be completed faster compared that Rust

@ermvrs
Copy link
Collaborator Author

ermvrs commented Feb 13, 2024

Adsız-2024-02-13-1236

Very simple arch. to explain how can address conversion done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant