Contracts/Oracles/Vms

How do we exactly get paid for those things?
how do we mine that?

A contract is created using a Contract create transaction, the miner is paid for the transaction, the size of the contract and the Gas (* GasPrice) used to initialize it. A contract is called via a contract call transaction, the miner is paid for the transaction, the size of the transaction and the Gas (* GasPrice) for the contract execution.

Oracle transactions (Register, Extend, Query, Response) all have a transaction fee, the miner also gets paid for the size of the transaction, and for how long the different objects stays in the oracle state tree.

All of this is documented (in terms of Gas) in protocol/consensus.md at master · aeternity/protocol · GitHub

2 Likes

If I am reading you correctly, you are saying that the VM is only ran by the node that is the block leader gets to execute those transactions?

Yes and no. The VM is of course run by all nodes that is syncing the chain. After all the micro blocks containing the transactions needs to be validated. But the one getting the reward for running the transaction is the miner that includes it in a block.

2 Likes

So how do we get to be oracles? That is what I am asking. because it seemed to be a way to get paid before.

You register an oracle with an oracle register transaction. Anyone can query this oracle, and the oracle will be rewarded for providing an answer to the query. When you register an oracle you set the fee for getting a response from the oracle (note that this fee should cover the fee for including the response transaction on the chain :slight_smile: )

For further details see protocol/oracles.md at master · aeternity/protocol · GitHub

1 Like

And so, who gets paid? the miner? or the oracle?
If it is the oracle, how can we create such services?

That is my question.

I think that is all explained in the linked document?

But in short. The miner is paid for all transactions. The oracle (any account can register to be an oracle) pays for the register and the response transaction. The entity asking a query pays for the query transaction, and part of that payment is given to the oracle when the oracle posts an answer to the query.

2 Likes

I read the given link, completely, and it was not 100% clear that the oracle got paid.

thanks.

1 Like