今日已更新 264 条资讯 | 累计 23847 条内容
关于我们

标签:#blockchain

找到 67 篇相关文章

AI 资讯

A .NET Dinosaur in Web3. Day 18 - Automated Market Maker

🏦 Day 6 of 7: Building a Mini Uniswap in 80 Lines of Solidity Imagine a vending machine. It has 1,000 coffee beans and 1,000 coins. No menu, no cashier — just one iron rule: the product of the two numbers inside must never decrease. That's it! This is how Uniswap works — and this is what I built on Day 6, coming from .NET. Here's how, why it's elegant, and where you can step on a rake. Why an Order Book Doesn't Work on a Blockchain Traditional exchanges — Binance, NYSE, any CEX — run on an order book . Market makers post bids and asks. A matching engine pairs them. Millions of updates per second, all in a centralised database. In a blockchain, this is impossible. Transactions take 12 seconds. Every state change costs gas. Storing millions of constantly changing orders would eat all the profit before a single trade completes. Uniswap's solution: replace the order book with a liquidity pool — a smart contract holding two tokens — and replace the matching engine with pure math. Just a formula — below. x · y = k — The Formula That Broke Finance The Constant Product Invariant : x · y = k Where x is the reserve of Token0, y is the reserve of Token1, and k is a constant that must never decrease during swaps. When a trader sells Token0 into the pool, x increases. To keep k constant, y must decrease — the contract sends out Token1. The price is determined automatically by the ratio of reserves. Live example with numbers: Pool: 1,000 Token0, 1,000 Token1. k = 1,000,000. Trader sells 100 Token0: amountOut = (reserveOut × amountIn) / (reserveIn + amountIn) amountOut = (1000 × 100) / (1000 + 100) amountOut = 100,000 / 1,100 amountOut ≈ 90.9 Token1 The trader gets ~90.9, not 100. That gap is slippage — and it's not a bug. It's the formula protecting the pool. The more you buy relative to pool size, the worse your price gets. Naturally. Mathematically. After the swap: pool has 1,100 Token0 and ~909.1 Token1. k ≈ 1,000,000. Invariant holds. The Contract: SimpleAMM Three functions.

2026-05-31 原文 →
AI 资讯

Autonomous AI Agents in Cryptocurrency Portfolio Management

Architecture of Autonomous Portfolio Agents Autonomous AI agents managing cryptocurrency portfolios operate on a foundation of continuous on-chain data aggregation, sentiment analysis, and real-time execution logic. Unlike traditional algorithmic traders that rely primarily on technical indicators, these agents integrate multiple data streams: price feeds from decentralized exchanges (DEXs), liquidity pool metrics, transaction volume patterns, whale movement tracking, and off-chain market sentiment. The system architecture typically consists of an inference engine powered by a large language model (LLM) or specialized neural network, a risk management module, an execution layer connected to blockchain RPC endpoints, and a monitoring feedback loop that adjusts parameters based on portfolio performance. The core insight enabling these agents is that blockchain data is transparent and immutable. Every transaction, every token transfer, every smart contract interaction leaves a permanent record on-chain. This transparency creates an information advantage: agents can detect patterns in whale behavior, liquidity migrations, and protocol changes far faster than traditional market participants can react to publicly available news. The agent's role is to process this data stream continuously, identify meaningful signals, and execute portfolio rebalancing in response. Data Integration: On-Chain and Sentiment Signals An effective portfolio agent must ingest and synthesize diverse data sources in near-real-time. The agent retrieves price data from oracles like Chainlink or Pyth, historical candle data from indexing services like The Graph or Covalent, and liquidity information directly from smart contract states. Current liquidity depth, slippage curves, and available yield opportunities in DeFi protocols must be sampled with sufficient frequency to detect arbitrage windows and avoid trades that would incur unacceptable slippage. Sentiment analysis layers onto this foundation b

2026-05-30 原文 →
AI 资讯

Hiring an AI Development Company? 7 Questions to Ask First

Hiring an AI Development Company? Ask These 7 Questions First Most AI projects fail long before deployment. Not because the model is bad. Because teams skip the hard engineering questions. If you're evaluating an AI development company, ask these 7 questions first: 1. How is data secured? AI systems process sensitive business information. Ask: Where is data stored? Is encryption enabled at rest and in transit? Who has access to prompts, logs, and embeddings? Are enterprise security standards followed? Security should be designed in from day one. 2. What observability exists? You can't improve what you can't monitor. A production AI system should include: Request tracing Prompt/version tracking Latency monitoring Cost visibility Error reporting If nobody can explain what happened after a bad output — that's a problem. 3. How do you handle model drift? AI performance changes over time. Questions to ask: How are outputs evaluated? Is feedback collected? How are prompts/versioning managed? What happens when accuracy drops? Production systems need iteration loops. 4. What happens during failure? No system is perfect. Ask: Is there fallback logic? Human review? Retry handling? Graceful degradation? Failure handling matters more than demos. 5. How is access controlled? Enterprise AI systems require permissions. Examples: Role-based access API authentication Audit logs Team-level controls Not everyone should access everything. 6. What compliance assumptions exist? Especially important for regulated industries. Ask whether the system considers: GDPR SOC2 HIPAA Financial or internal compliance rules Compliance cannot be an afterthought. 7. Who owns the infrastructure? Clarify ownership before signing anything. Ask: Who owns the source code? Cloud infrastructure? Models and prompts? Data pipelines? You should avoid vendor lock-in. AI success is rarely about flashy demos. It's about secure infrastructure, reliability, observability, and long-term maintainability. What question

2026-05-30 原文 →
AI 资讯

This week in agent commerce: seven moves, and where atomic settlement actually sits

"Settlement layer for the agent economy" has become a phrase used by more than one architecture this month. Some of those architectures are venues. Some are payment rails. Some are identity stacks. One is what we build — a trust-minimized atomic settlement primitive — and we keep getting asked how it sits next to the others. So this is a short, opinionated week-in-review. Seven moves that landed recently in agent-commerce infrastructure, what each one actually is, and where atomic settlement fits underneath. No leaderboard. No "who wins." Just the layers. 1. Coinbase's Base MCP (May 26) Coinbase shipped a Base MCP server: ChatGPT, Claude, and Cursor can connect directly to Base wallets, with built-in Uniswap and Morpho integrations. Two-line install, agent-driven swaps, on-chain account control from inside the model client. What it is: a wallet-side, exchange-aligned MCP. The agent drives a wallet on Base; Coinbase has thought hard about UX, key handling, and AI client ergonomics. If your agent is already operating inside the Coinbase + Base orbit, this is a meaningful drop in friction. What it isn't: a cross-chain settlement layer. It is one L2, deeply integrated. The agent's trust assumptions are "Coinbase wallet infrastructure + Base + the DEXes that Base MCP integrates with." That is a reasonable trust budget for a lot of trades; it is not the budget for an agent that wants to trade BTC for ETH without picking a venue. 2. The x402 Foundation (Coinbase + Cloudflare) Coinbase and Cloudflare announced an x402 Foundation this month. x402 is the HTTP-based agent payment standard — a 402 response code carrying payment metadata, designed so an agent can pay for an API call inline. Cloudflare joining elevates this from a Coinbase-led initiative to a multi-party standards effort. Cloudflare also runs an enormous slice of the internet's edge; if x402 becomes a default payment rail, it will be visible from the edge first. What it is: a payment-handshake protocol. How an ag

2026-05-30 原文 →
AI 资讯

Gas Optimization Part 4: Solidity Tips for Cheaper Contracts

Every line of your smart contract costs something. Some lines cost more than others. In this part of our gas saving series, we’ll explore how to write smarter Solidity code that keeps your contract lean and efficient. Here are six simple and practical ways to reduce gas costs while writing Solidity smart contracts. 1. Use payable Only When Needed, But Know It Saves Gas In Solidity, a function marked payable can actually use slightly less gas than a non-payable one. Even if you're not sending ETH, the EVM skips some internal checks when the function is marked payable. See this example: function hello() external payable {} // 21,137 gas function hello2() external {} // 21,161 gas That tiny difference may not seem like much, but across thousands of calls, it adds up. Only use payable when your function is actually meant to accept ETH 2. Use unchecked for Safe Arithmetic When You’re Sure Since Solidity 0.8.0, all arithmetic operations automatically check for overflows and underflows. While this makes contracts safer, it also uses extra gas. When you're certain that overflow won't occur, you can use the unchecked keyword to skip these safety checks. uint256 public myNumber = 0; function increment() external { unchecked { myNumber++; } } Gas used: 24,347 (much cheaper than using safe math) Warning: Use unchecked carefully. Only when you're confident there's no risk of overflow. 3. Turn On the Solidity Optimizer The Solidity Optimizer is like a smart helper that cleans up and tightens your compiled bytecode. It does not change how your contract works, but it removes waste and makes it cheaper to run. If you’re using tools like Hardhat or Remix, always enable the Optimizer before deploying to mainnet. 4. Use uint256 Instead of Smaller Integers (Most of the Time) Smaller types like uint8 or uint16 might look more efficient, but they can cost more gas during execution. That’s because the EVM automatically converts them to uint256 behind the scenes. So, if you're not tightly p

2026-05-29 原文 →
AI 资讯

Custodial vs trust-minimized: two settlement layers for the agent economy

"Settlement layer for the agent economy" is suddenly a crowded sentence. In the last few weeks, two very different things have started competing for it. OKX Agent Payments Protocol (APP) announced in May 2026 — backed by AWS, Alibaba Cloud, Uniswap, Paxos, QuickNode, with ecosystem support from Base, Ethereum Foundation, Solana, Sui, Aptos, Optimism — describes itself as the settlement layer where AI agents pay each other. AEON's $8M pre-seed (May 20, YZi Labs) described itself the same way. There is a list now, and it is getting longer. We build one of the things on this list, and we think the framing is wrong. These are not rivals jostling for the same slot. They are two different layers, and they answer two different versions of the same question: what does an agent need to settle a trade? This piece walks through the two layers, where each is the right answer, and why an honest comparison gets you further than picking sides. What APP and other custodial-venue protocols actually do A useful way to read OKX APP — and similar moves coming from the larger exchanges — is to treat them as a venue layer . An exchange already holds inventory across many chains. It already has the risk engines, the liquidity, the legal arrangements with banks and partners. Adding an agent-facing API on top of that machinery is a relatively short walk. What an agent gets, in exchange, is breadth. Many chains, many assets, batched and netted settlement against deep internal books, and fast execution because the exchange is just moving entries in its own ledger. For an agent whose job is "find a price somewhere and execute now," that is a powerful primitive. What the agent gives up, in exchange, is a counterparty. At any moment between deposit and withdrawal, the agent's balance is the venue's promise to pay. That promise is normally good. The agent has no way to verify, from inside its own logic, that it still is. This is not a criticism of OKX APP. It is the structural shape of any venue-

2026-05-28 原文 →