-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
TRXID opcode #222
Comments
May be an OP_TXNONCE is better idea... This way you can put a condition filled only when two consecutive transactions happen. |
Interesting... Maybe even just call it |
Can you enumerate some of them? |
One use case for this is the "asynchronous oracle pattern", alluded to in ethereum/btcrelay#44 which discusses how REVERT + RETURNDATA can undermine synchronous oracles. For an asynchronous oracle (i.e. oracle contract is first sent a payment and request for data, then a callback tx is sent to get the return data), the oracle contract needs to to ensure that the payment call and the callback call originate from different tx's. Otherwise, the payment call could be reverted after the return data is received. Currently the only way for contracts to distinguish the transaction scope of two incoming calls is to check the block |
Had not heard of that example @cdetrio, that's great. My main goal here has to do with tokens and allowing temporarily negative balances within a transaction |
Personally out of all of the above I favor TXNUMBER. It's cleanest and simplest. |
@vbuterin Should TXNUMBER be the index of the transaction inside the block?, or should it be a global index that does not starts from zero on each block and goes always incrementing? |
I think global index is more useful, but |
You can adopt RSK TXINDEX implementation, which is very similar to the one discussed here. You can check RSK's TXINDEX here: |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
Hi github robot helper, no it looks like this is still not implemented but maybe a good suggestion! Thanks for the bump! |
@nmushegian If you want to pursue this idea, you should either create an EIP following instructions in EIP-1 or create a thread in the Ethereum Magicians forum to discuss it further. Closing this for now as this repository is no longer the right place for discussions like this. |
There are a number of interesting primitives that can be constructed if you can get a handle on the "current atomic interaction" aka "current transaction"
TRXID could be a simple increasing global nonce, or could be
sha3(origin,nonce)
.The closest you can get right now to a unique ID is
(origin,block)
plus enforcing one-origin-per-block which is awkward and incomplete.The text was updated successfully, but these errors were encountered: