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

Feature : EVM Support #54

Open
LucasMLK opened this issue Jun 23, 2021 · 5 comments
Open

Feature : EVM Support #54

LucasMLK opened this issue Jun 23, 2021 · 5 comments
Labels
feature Develop new features

Comments

@LucasMLK
Copy link
Contributor

The biggest source of Ethereum on the chain and the success of smart contracts, we see that the key to the success of the Ethereum ecosystem is the creation of an EVM virtual machine. At present, the realization of a virtual machine is very important for XDAG. The reasons are as follows:

  1. The throughput of Ethereum L1 15 tps/s causes high handling fees (>10$), which greatly limits the development of DAPP
  2. Ethereum 2.0 POS has not yet determined the specific launch date, which has a great degree of delay risk and security risk (the topic of POW vs POS is a cliché, not to argue here, but we believe that POW is more secure)
  3. XDAG has a natural high TPS design, and POW safety design, and has a good foundation for the development of higher performance DAPP

EVM Illustrated

ethereum evm illustrated-1

EVM INSTRUCTIONS

The EVM executes as a stack machine with a depth of 1024 items. Each item is a 256-bit word, which was chosen for the ease of use with 256-bit cryptography (such as Keccak-256 hashes or secp256k1 signatures).

During execution, the EVM maintains a transient memory (as a word-addressed byte array), which does not persist between transactions.

Contracts, however, do contain a Merkle Patricia storage trie (as a word-addressable word array), associated with the account in question and part of the global state.

Compiled smart contract bytecode executes as a number of EVM opcodes, which perform standard stack operations like XOR, AND, ADD, SUB, etc. The EVM also implements a number of blockchain-specific stack operations, such as ADDRESS, BALANCE, KECCAK256, BLOCKHASH, etc.
ethereum evm illustrated-2

@LucasMLK LucasMLK added the feature Develop new features label Jun 23, 2021
@wangxuguo
Copy link

How to calculate the gas cost of XDAG and the fee of the transaction?

@LucasMLK
Copy link
Contributor Author

How to calculate the gas cost of XDAG and the fee of the transaction?

1.Define the smallest unit of xdag gas
Sub-units of Ether:

Unit wei value wei ether value
wei 1 wei 1 10^-18 ETH
kwei 10^3 wei 1,000 10^-15 ETH
mwei 10^6 wei 1,000,000 10^-12 ETH
gwei 10^9 wei 1,000,000,000 10^-9 ETH
microether 10^12 wei 1,000,000,000,000 10^-6 ETH
milliether 10^15 wei 1,000,000,000,000,000 10^-3 ETH
ether 10^18 wei 1,000,000,000,000,000,000 1 ETH

Sub-units of Xdager:

Unit nano value nano xdager value
NANO_XDAG 1 NANO_XDAG 1 10^-9 XDAG
MICRO_XDAG 10^3 NANO_XDAG 1,000 10^-6 XDAG
MILLI_XDAG 10^6 NANO_XDAG 1,000,000 10^-3 XDAG
XDAG 10^9 NANO_XDAG 1,000,000,000 1 XDAG

For ease of use, we tentatively set (1 NANO_XDAG == 1 wei)

2.Each OP_CODE Standard Gas Prices

EIP-150 opcode gas costs

3.Estimating transaction costs

Name Mean
Gas Price price (in ether) of one unit of gas specified in the transaction
Gas Used is the total gas that is consumed by the transaction

Total cost = gasUsed * gasPrice

4.ERC-20 Token Gas for Example

Name Token Gas Price Gas Used ALL Gas
ETH ERC-20(USDT) 0.000000008 Ether 3,170,794 0.025366352

Fair Price Calculation:
ETH and XDAG Prices refer to market prices on Coinmarketcap at 2021-06-24

Gas Price ERC20 Cost $ Prices $ Total Price %
0.000000008 Ether 0.025366352 Ether $ 1,928.72 / 1 ETH $ 48 100%
0.000008000 Xdager 25.36635200 Xdager $ 0.00284 / 1 XDAG $ 0.072 0.15 %

@LucasMLK
Copy link
Contributor Author

LucasMLK commented Nov 1, 2022

It is planned to stabilize the network first, improve network stability, and then support for evm

@BourgesMind
Copy link

Is the plan still ongoing?

@LucasMLK
Copy link
Contributor Author

Is the plan still ongoing?

#230

Please read this article, I think there are too many chains about evm, and it is too complicated for community projects, we are looking for a more suitable way for XDAG to realize defi capabilities

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

No branches or pull requests

3 participants