NIP-9_Add BTC/ETH assets to the NULS main network for gas fees

  NIP: 9
  Title: Add BTC/ETH assets to the NULS main network for gas fees
  Author: Reaper Ran <reaper@nuls.io>, Berzeck <Berzeck@nulstar.com> 
  Discussions-To: 
  Status: Draft
  Type: Core
  Created: 2024-02-24

Abstract

BTC and ETH have become the primary assets in the blockchain industry, and NULS is dedicated to innovation and exploration in this industry.

We propose that the NULS technical community add BTC/ETH as gas assets on the NULS mainnet, making it a multi-gas blockchain. This move will also benefit other Layer 2 networks created using NULS ChainBox with BTC/ETH as the primary assets and integrated into NULS parallel chains.

Motivation

The NULS blockchain network will attract more users and communities to build in the NULS network by providing use cases for major assets.

Specification

Gas Fees: It is used to reward the network node for block packaging and the stakers on the node, which means that the fee will be distributed to the node and the stakers on the node will receive BTC/ETH.

Gas Fee Calculation:

  • 0.000001 BTC/KB
  • 0.00002 ETH/KB

Calculation of Gas Fees for Transfer Transactions

The transaction size (in bytes) is used to calculate the gas fee. For every 1024 bytes, 0.000001 BTC or 0.00002 ETH is charged. Plus, a smaller fee is applied for transaction sizes below 1024 bytes.

Calculation of Gas Fees for Smart Contract Execution

Total fee = Gas usage * Gas price

The execution of a smart contract can be calculated. Each statement and each built-in function have fixed Gas prices and usage. At each invocation of a smart contract, all or a subset of the statements and built-in functions will be executed. There is a minimum price to pay for calling a contract, even if the call does nothing. This is to prevent malicious calls.

This is a subset of the pricing table. Prices will be added in subsequent updates.

Operation Gas Consumption Operation Explanation
Add 1 addition
Sub 1 subtraction
Mul 1 multiplication
Div 1 division
Step 1 Execute each step
Stop 0 Stop execution
Store 100 Store value
Load 100 Load (read in) value
Hash 20 Hash function
Create 50000 Create contract fee
Call 500 Call base fee
Balance 20 Get balance

Smart Contract transactions have three parameters:

  1. Sender: The sender of the transaction.
  2. Gas limit: The upper limit of gas usage. If the gas limit is reached and the transaction is not completed, the transaction will be canceled, and the changes will be reversed.
  3. Data: The data consists of specified parameters. Data is a hexadecimal encoding structure.

The total fee for a single contract transaction consists of three parts:

  1. The handling fee is calculated by transaction size. The transaction size (in bytes) is used to calculate the gas fee for every 1024 bytes 0.000001 BTC or 0.00002 ETH is charged. Plus, a smaller fee is applied for transaction sizes below 1024 bytes.
  2. The Smart Contract execution cost calculation. Gas is the execution cost based upon the total cost of executed statements and functions. Gas is multiplied by the Price of the execution. For BTC, the execution price is 1 SAT (1 SAT is one hundred millionth of a BTC). If there is remaining Gas, it will be refunded to the transaction.
9 Likes

The proposal involves the development and upgrade of the NULS core protocol. The propsol will be vote after 15 days. In accordance with the requirements of the community charter, the community support rate for the core protocol upgrade reaches 90%, and NTC will be coded according to the community vision.

6 Likes

:smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

2 Likes

Will this decrease the mainnet gas consumption?

1 Like

增加这2个资产用于Gas,有助于BTC/ETH社区的人走进NULS生态来玩。
加油!让NULS生态内增加更多BTC/ETH的资产应用场景,牛市多搞事情!

1 Like

It is hoped that nuls public chain will do a good job in serving the leading blockchain, gain more consensus and traffic, and provide players with fast and cheap handling fees

1 Like

For a transaction that have reached a has limit and it is yet to be executed, does the initiator of the transaction gets refunded their gas?

1 Like

I think it is a very important step to exponentially increase nuls’ user base and to facilitate integrations with bitcoin and ethereum in the future, such as developing a staking system with these cryptocurrencies.

1 Like

I like idea for l2 bitcoin

It sounds good enough for the moment. Maybe I would like another protocol or even a L2 from ETH to be involved in this because ETH will have more traction this coming months and fees will go up like crazy. It’s good to make fees hybrid but I think ETH is not the one to be there in my honest opinión.

Good project sir

I think it is a very important step to exponentially increase nuls’ user base and to facilitate integrations with bitcoin and ethereum in the future, such as developing a staking system with these cryptocurrencies.

Tebrikler :clap::clap:

super excited

Wooow amazing congrats