Previously we have
<ts:transaction> <ts:ethereum function="…" > <data>…</data> <value ref="amount"/> </ts:ethereum> </ts:transaction>
Thanks to the introduction of
ethereum: namespace, which is introduced to pave the way for multi-blockchain support (e.g. Cardano), we replaced all
So the example code becomes:
<ts:transaction> <ethereum:call function="…" > <data>…</data> <value ref="amount"/> </ethereum> </ts:transaction>
Furthermore, I (Weiwu) made a change as noticed
value here, which represent the
value field in a transaction, is easily mistaken as the value reference in data. I figure that
less ambiguously mean that
amount amount of ether is to be transferred. That is, the following is less ambiguous:
<ts:transaction> <ethereum:call function="…" > <data>…</data> <ether ref="amount"/> </ethereum> </ts:transaction>
By Boon: But Ethereum docs and tutorials say:
- "call — invoke without gas + read-only"
- "transaction - invoke function with gas"
If we follow that, we might define a new element called
ethereum:transaction based on
ethereum:call, which has one additional element
<ts:transaction> <ethereum:transaction function="…" > <data>…</data> <ether ref="amount"/> </ethereum:transaction> </ts:transaction>
Now, at first, this may look confusing because you get a transaction element right nested into another transaction element. But that two transactions meant differently.
In database lingo (which TS borrows), a transaction is a bunch of operations that either success or fail together. Typically, two operations, one that changes the balance and the other changes the effect (e.g. one deducts $10 and the other prolongs Netflix subscription by 1 month).
In Ethereum lingo, a transaction is either a call to a smart contract function with some ether attached or a transfer of ether to a new address. It's not possible to do two operations in one transaction, but you can write a smart contract to do that.
Accept the lingo, and use transaction inside transactions (I can provide a few examples where this make sense).
<ts:transaction>to actually represent a call inside a transaction in terms of Ethereum. (A separate
ethereum:transferis usd to represent simple Ether transfers).
The current state quo is 2. Before I learned Boon's quote I thought this is the least confusing approach as we spared the user to learn the difference between
<ethereum:transaction>. Now I'm slightly more inclined to 1 since Vitalik already misdefined transaction.
Also, do you think we should use:
Or use this instead?