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

Allow coinbases to interact with contracts with data field #2344

Open
mibuono opened this issue Nov 6, 2024 · 0 comments
Open

Allow coinbases to interact with contracts with data field #2344

mibuono opened this issue Nov 6, 2024 · 0 comments
Assignees
Milestone

Comments

@mibuono
Copy link

mibuono commented Nov 6, 2024

To support liquid mining tokens, we must allow inbound coinbase ETXs to interact with smart contracts. This will come in the form of a function signature in the data field of the ETX. If a coinbase ETX has a 'to' address that is a contract (has code) but there is no function signature in the data field (or if the function execution fails) the coinbase is lost. In addition, if the miner puts some data in the data field but the 'to' address is not a contract, the coinbase is also lost. Therefore it is up to the miners to put correct data in their coinbases.
If a miner puts a function signature in the data field and the 'to' address is a contract, the average gas price of the last n blocks will be chosen and multiplied by some gas limit, and then deducted from the coinbase value to pay for execution.
The miner of a block can modify their coinbase ETX to include data and a gas limit, but currently a workshare miner cannot. This may require modifying work objects to include data and gas limits.
The lockup byte will have to move to a field in the ETX.

@mibuono mibuono added this to the Mainnet milestone Dec 9, 2024
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

2 participants