📣 Gate.io Post Crypto Observer Call to Action!
📈 Share Crypto News & Win Great Rewards Weekly!
💓 Don't hesitate, join now ⏬
1. Share daily crypto news, market trends, and insights into your post.
2. Include the #CryptoObservers# to successfully participate.
🎁 10 lucky "Crypto Observers" will be rewarded $20 points every Friday!
📌 The winners list will be announced every Friday, with rewards distributed the same day.
📌 Note: Posts may include only the tag #CryptoObservers# ; otherwise, no rewards.
💪 Crypto Observer can also register and become Gate Post Ambassador to enjoy exclusive benef
The community is growing rapidly and has raised more than 20 million US dollars. Why does the new public chain Nibiru become a potential competitor of dYdX?
The Layer1 public chain Nibiru Chain launched airdrop incentives at the end of January 2024. After a month of airdrop activities, its community grew more than three times, and the number of Twitter followers exceeded 500,000. As a new public chain with over US$20 million in financing, Nibiru Chain focuses on solving the security and speed of DeFi applications and will become a potential competitor of dYdX.
Currently, Nibiru Chain plans to launch its mainnet this week. **As a fast-growing Layer 1, what are the technical features and competitive advantages of Nibiru Chain? What safety issues need to be paid attention to in the development of its ecological projects? Today Beosin will analyze it one by one for everyone. **
NibiruChain protocol analysis
Nibiru Chain mainly focuses on DeFi transactions as its core business. Its core components have the following four components:
1. Here-Perps
On-chain perpetual contract trading allows users to trade with up to 10 times leverage on popular crypto assets such as BTC, ETH and ATOM. Stakers of $NIBI will have Nibi-Perps governance rights and transaction fee discounts.
2. Here-Swap
Nibiru's automated market maker protocol plans to support two types of LP pools: stable currency exchange pools and ordinary constant product pools.
3. $NUSD
The fully collateralized stablecoin of the Nibiru ecosystem. Nibiru plans to first support users to use $USDC and $NIBI to mint NUSD. The specific ratio between the two is determined by the Collateral Ratio. If CR= 80%, which means to mint 100 $NUSD, the user needs to provide 80$USDC and NIBI equivalent to 20NUSD.
In the future, Nibiru Chain will support more types of collateral. Currently, $NUSD is more like $FRAX of the Cosmos ecosystem.
4. Here-Oracles
Nibi-Oracles is Nibiru’s native oracle solution that allows validator operators to actively participate in oracle consensus voting, integrate off-chain data into the blockchain with high fidelity, and provide data from external APIs and smart contracts. Low latency feedback.
In 2024, Nibiru Chain will focus on expanding the ecosystem, and its main developments include multiple plans, such as integrating with major DeFi projects on multiple chains, listing on first-class centralized exchanges, completing parallel optimistic execution, and achieving comprehensive EVM compatibility.
Security Development Practices
If you develop an application on Nibiru Chain, the development process and required languages are almost identical to those on other Cosmos public chains. Following the following security guidelines can improve the contract security of the project:
Contract Development Security
Similar to developing contracts using Solidity, developers need to consider how to face attacks and fix vulnerabilities. Therefore, developers need to build upgradable smart contracts and develop risk response plans.
There are two valid representations of any valid Cosmos SDK address: all lowercase and all uppercase, such as: cosmos1uzwqa88hcqe5gs7u7lgjxekz7xc6sm0f7xwp6a vs.
COSMOS1UZWQA88HCQE5GS7U7LGJXEKZ7XC6SM0F7XWP6A are all the same address, and Nibiru is the same. When dealing with addresses in contracts, we need to consider this characteristic of addresses.
pub fn valid_transfer ( deps: DepsMut, info: MessageInfo, amount: Uint128, dest: String , ) -> Result { // 检查地址是否在黑名单 if let Some (is_in_blacklist) = BLACKLIST. may_load (deps.storage, &dest.to_string ( )? { if is_denied { return Err (ContractError::DeniedRecipient); } } else if let Some (is_in_blacklist) = BLACKLIST.may_load ( deps.storage , &info.sender.clone ( ) )? { if is_denied { return Err (ContractError::DeniedSender); } ......};
As shown in the above code, since dest is not standardized and the addresses commonly used are lowercase addresses, anyone can bypass BLACKLIST by providing uppercase addresses.
In the CosmWasm contract, developers need to pay attention to the risk of integer overflow or division by zero. **It is recommended that developers use CosmWasm's Uint256 and Uint512 types, and use the mathematical function full_mul() that does not overflow. **
**Access control is one of the main issues in program security. **There are countless security incidents caused by access control issues, which also need to be paid attention to in the Cosmwasm contract. The following is a typical case:
fn update_config( deps: DepsMut, msg: UpdateMsg) -> Result { let config = CONFIG.load(deps.storage)?;
let new_config = Config { rewards_vault_contract: msg.vault_address .map(|human| deps.api.addr_validate(&human)) .transpose()? .unwrap_or(config.rewards_vault_contract) }; CONFIG.save(deps.storage, &new_config)?;
Ok(Response::new().add_attribute("action", "update_config"))}
Due to the lack of checks and restrictions on the caller's address, the above code allows anyone to call update_config(), set their own address as the treasury address, and receive all rewards generated by the contract.
Cosmwasm contract operation sets a high gas limit, but improper use will exhaust gas. The CosmWasm contract may get stuck in an infinite loop by calling itself back in the ACK handler. **If developers transfer data packets between two CosmWasm contracts, please note that this may cause an infinite loop and consume a lot of gas fees. **
Project Security Practice
Smart contract audit is to systematically test and review the smart contract code to discover potential security loopholes as much as possible, eliminate security risks, and ensure that the code has no business logic loopholes and conforms to the expected operating process and results. Regular security audits of the project's smart contracts are crucial. It is recommended that the audit be conducted after the contract development is completed and before the mainnet is deployed.
Project parties need to consider using multi-signature wallets to manage project treasury and smart contracts. Multi-signature accounts need to be held by multiple entities to avoid potential access control risks and internal evil. **Currently Nibiru Chain has adopted the Nomos multi-signature solution, and project parties may consider using Nomos for asset management. **
Summarize
As a new Layer 1 public chain, Nibiru Chain provides an innovative platform for DeFi, games, RWA and other fields. It aims to solve the accessibility, security and performance issues of Web3 applications and provide developers and ordinary users with comprehensive and excellent services. services.