diff --git a/docs/ai/introduction.md b/docs/ai/introduction.md index 6190b31fb9d..8afb2874915 100644 --- a/docs/ai/introduction.md +++ b/docs/ai/introduction.md @@ -2,27 +2,36 @@ id: introduction title: AI and NEAR sidebar_label: Introduction -description: "Introduction to NEAR's User-Owned AI vision, featuring Shade Agents, NEAR AI, and Bitte Protocol." +description: "Introduction to NEAR's User-Owned AI vision, featuring Shade Agents and NEAR AI." --- -NEAR's vision is to create a future of **User-Owned AI**, where AI and agents serve their users, not corporations. For this vision to become a reality, AI must protect user data, prioritize the user's interests, and operate on a sustainable, user-aligned economic model. The NEAR ecosystem has multiple technologies to enable User-Owned AI. +Building AI agents that control accounts and assets on all blockchains has never been easier. NEAR enables AI agents to transact on any chain, while +our **Shade Agent Framework** allows to create verifiable and trustless AI agents with multi-chain capabilities out of the box. ![img](/assets/docs/welcome-pages/9.near-nodes.png) +:::tip Using AI to build on NEAR? + +Searching for how to use AI to help you build NEAR dApps, check our [Building NEAR Apps with AI](./llms.md) documentation + +::: + + --- -## Shade Agents +## Let Your Agent use NEAR + +AI Agents can easily control account and assets on all blockchains thanks to NEARs unique features. You simply need to give them access to a NEAR account and they can start interacting with smart contracts, sending transactions, and managing assets everywhere. -[Shade Agents](./shade-agents/getting-started/introduction.md) are an AI agent framework to create verifiable agents that can control accounts across multiple blockchains with the assurance that the agent cannot lose access to its accounts and that its private keys will never be revealed. They are the first truly **verifiable**, **non-custodial**, **multichain AI agents** with no single point of failure. +Check our [NEAR MCP](./near-mcp.md) documentation to get started. -Current Web3 agents fall into one of two camps: -1. They are trustless and verifiable by creating and using a private key within a trusted execution environment (TEE), but if the TEE goes down, the accounts and funds are lost. -2. The accounts are persistent, but the agents are centralized. +--- -Shade Agents provide verifiability, non-custody, and persistent accounts by operating in TEEs and implementing decentralized key management. Any agent running with the same code inside a TEE can access the same accounts. +## Build Trustless Multi-Chain Agents -These agents can autonomously sign transactions across any chain, interact with AI models and external data sources, manage assets, and perform privacy-preserving, verifiable computations, offering the flexibility and performance of Web2 with the verifiability of Web3. +The [Shade Agent Framework](./shade-agents/getting-started/introduction.md) enables to build **verifiable** **multi-chain AI agents**. These agents operate in Trusted Execution Environments (TEEs) and leverage NEAR features such as multi-key management and Chain Signatures to securely manage assets and sign transactions across multiple blockchains. +Shade agents can autonomously sign transactions on any chain, interact with AI models and external data sources, and perform privacy-preserving, verifiable computations. :::info Shade Agents power [Agentic Protocols](./shade-agents/concepts/what-can-you-build#agentic-protocols): a new type of decentralized application designed to be autonomous, proactive, and intelligent. @@ -30,11 +39,23 @@ Shade Agents power [Agentic Protocols](./shade-agents/concepts/what-can-you-buil --- -## NEAR AI +## Which Docs Should I Use? + +| Docs | Best if you... | +|--------------------------------------------------------------------------------|------------------------------------------------------------------------------------------| +| [AI + NEAR](./near-mcp.md) | Already have an AI Agent, and want to connect it to NEAR (and other chains) | +| [Building NEAR Apps with AI](./llms.md) | Are building a NEAR App, and want your Code Agents to help you better | +| [Trustless Multi-chain Agents](./shade-agents/getting-started/introduction.md) | Are building an agent from zero and need to securely handle funds across multiple chains | + +--- + +## Common Questions + +### Can Trustless Agents lose access to their wallets? +Not with Shade Agents. They use decentralized key management—any instance of the agent with the same code can access the same accounts. -[NEAR AI](https://docs.near.ai/) is building **agent network infrastructure** to support User-Owned Agents. Their work includes: -- Monetizable open-source AI agents -- Agent-to-agent communication -- End-to-end confidential iterations with agents +### Do I need to know blockchain development? +Our tools and resources help to abstract away the complexity of blockchain development. -Agents are accessible through the [NEAR AI Assistant](https://chat.near.ai/chat), a single interface that intelligently selects the most appropriate agents to handle user requests and connects multiple agents together for more complex tasks. The assistant can take actions for the user, has integrated payments, and can dynamically generate frontends on the fly based on user requests. +### What chains can my agent interact with? +NEAR accounts allow to transact on all chains, including Bitcoin, Ethereum and Solana thanks to Chain Signatures. diff --git a/docs/chain-abstraction/chain-signatures/getting-started.md b/docs/chain-abstraction/chain-signatures/getting-started.md index 404b1bc6d8f..e86d57ff57c 100644 --- a/docs/chain-abstraction/chain-signatures/getting-started.md +++ b/docs/chain-abstraction/chain-signatures/getting-started.md @@ -4,13 +4,25 @@ title: Getting Started with Chain Signatures description: "Learn how to sign and execute cross-chain transactions" --- -Chain Signatures is a groundbreaking technology built on NEAR that enables all accounts, including smart contracts, to sign and execute transactions across multiple blockchains. + +Chain Signatures allows all NEAR accounts - including smart contracts - to sign transactions for other blockchains (such as Bitcoin, Ethereum or Solana). ![img](https://pages.near.org/wp-content/uploads/2024/02/acct-abstraction-blog-1.png) This innovation leverages Multi-Party Computation (MPC) and a distributed network of node operators to create joint signatures from arbitrary payloads, allowing NEAR accounts to control external blockchain accounts. -Chain Signatures enhances blockchain interoperability, giving ownership of diverse assets, cross-chain accounts, and data to a single NEAR account. +Derive addresses on any blockchain, build DeFi on Bitcoin, create multi-chain apps with one contract, or enable account abstraction across all chains - all without the need for traditional bridges or wrapped tokens + +### Chain Signatures vs. Traditional Bridges + +| Feature | Chain Signatures | Traditional Bridges | +|----------------------------|--------------------------------------|---------------------------------| +| **Security Model** | Decentralized MPC nodes | Trusted validators or relayers | +| **Asset Type** | Native tokens (real BTC, ETH) | Wrapped tokens (wBTC, wETH) | +| **Smart Contract Support** | Yes, contracts can sign transactions | Usually user-only | +| **Chains Supported** | Any blockchain | Specific pairs only | +| **Bridge Risk** | No locked funds, no bridge exploits | Billions locked, frequent hacks | +| **UX** | Seamless, single account | Multiple wallets needed | --- @@ -101,6 +113,28 @@ Chain Signatures can be used to build a wide range of applications that leverage --- +## Common Questions + +### What blockchains are supported? +Bitcoin, Ethereum, Dogecoin, Ripple, Cosmos chains, and any blockchain that supports ECDSA or EdDSA signatures. More chains are continuously being added. + +### Do I need to lock tokens in a bridge? +No. Chain Signatures directly control native assets on the target blockchain. No wrapped tokens, no bridge risk. + +### Can smart contracts use Chain Signatures? +Yes! NEAR smart contracts can sign transactions for other blockchains, enabling programmable cross-chain applications. + +### How secure is the MPC system? +The MPC network is decentralized across multiple node operators. No single node has access to the full private key. Requires threshold consensus to sign. + +### What's the difference from account abstraction? +Chain Signatures *enables* account abstraction across all chains. Your NEAR account (with passkeys, 2FA, etc.) can now control assets on Bitcoin, Ethereum, and more. + +### How much does it cost? +You can sign transactions on NEAR for free, but the external account will still need tokens to pay for gas fees in the target blockchain. + +--- + ## Where to Learn More? To dive deeper into Chain Signatures and its applications, you can explore the following resources: diff --git a/docs/smart-contracts/quickstart.md b/docs/smart-contracts/quickstart.md index 942870e2db9..41aae75936b 100644 --- a/docs/smart-contracts/quickstart.md +++ b/docs/smart-contracts/quickstart.md @@ -219,12 +219,23 @@ For this tutorial we chose to name the project `auction`, but feel free to use a --- -## The Contract +## What Does This Contract Do? The auction smart contract allows users to place bids, track the highest bidder and claim tokens at the end of the auction. Do not worry about the code just yet — for now, it is enough to know that the most relevant function is `bid`, which allows users to place bids by attaching NEAR tokens: +### Language Comparison + +| Language | Best For | Build Time | Ecosystem Maturity | +|----------|----------|------------|-------------------| +| **JavaScript/TypeScript** | Rapid prototyping, web developers | Fast (~2s) | Mature | +| **Rust** | Production apps, performance-critical code | Moderate (~30s) | Most mature | +| **Python** | Data science, AI integration | Fast (~3s) | Growing | +| **Go** | Backend developers, microservices | Fast (~5s) | New | + +Choose JavaScript for quick experiments, Rust for production, Python for AI/data apps, Go if you're already a Go developer. + `. The account stays the same, code updates. + +### Which language should I choose? +To build production apps prefer **Rust**, as it offers the most mature tooling and best performance. Otherwise, if you are just prototyping or learning, you can choose between your favorite language between **JavaScript**, **Python** or **Go**. + +### How do I test without deploying? +All languages support sandbox testing (shown in this guide). Tests run locally with a simulated NEAR environment. + +--- + ## Moving Forward
diff --git a/docs/web3-apps/quickstart.md b/docs/web3-apps/quickstart.md index c67364ea8bf..61f3a05723a 100644 --- a/docs/web3-apps/quickstart.md +++ b/docs/web3-apps/quickstart.md @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem'; import {CodeTabs, Language, Github} from '@site/src/components/UI/Codetabs'; import MovingForwardSupportSection from '@site/src/components/MovingForwardSupportSection'; -In this guide we will show you how to quickly spin up a frontend where users can **login** using their wallets and interact with a **contract**. +In this guide we will show you how to **build a React app connected to NEAR**, where users can **login** using their wallets and interact with a **contract**. :::tip Searching to integrate NEAR in your App? @@ -89,10 +89,19 @@ The navigation bar implements a button to allow users to `login` and `logout` wi --- -## Interacting with NEAR +## How Do I Call Smart Contract Functions? Now that you understand how the landing page works, we can move to the `Near Integration` page, which retrieves a greeting from the [hello.near-examples.testnet](https://testnet.nearblocks.io/address/hello.near-examples.testnet) contract. +### Read vs. Write Operations + +| Operation Type | Method | Cost | Requires Signature | +|---------------|--------|------|-------------------| +| **Read (view)** | `viewMethod()` | Free | No | +| **Write (call)** | `callMethod()` | Gas fees (~0.0001 Ⓝ) | Yes | + +View methods query contract state without modifying it. Call methods change state and require the user to sign a transaction. + ![img](/assets/docs/tutorials/examples/hello-near-gateway.png) *View of the `Near Integration` page* @@ -121,6 +130,25 @@ On the other hand, when the user submits a new greeting, we use `callFunction` t --- +## Common Questions + +### Do users need NEAR tokens to login? +No. Wallet login is free. Users only pay gas fees when they call contract functions that modify state. + +### What wallets can users connect with? +NEAR wallets (MyNearWallet, Meteor, HERE Wallet) and Ethereum wallets (Metamask, WalletConnect, Coinbase Wallet via EVM support). + +### How do I avoid users signing every transaction? +Create a **function-call access key** by setting `createAccessKeyFor: ` in the wallet selector config. This allows the app to sign non-payable methods automatically. + +### Can I use this with an existing React app? +Yes. Install `near-connect-hooks` and follow our [integration guide](./tutorials/wallet-login.md). + +### Why Next.js instead of plain React? +Next.js is recommended but not required. You can use Vite/React, Vue, Svelte, or any framework. Check `create-near-app` templates for options. + +--- + ## Moving Forward That's it for our quickstart tutorial. You have now seen a fully functional frontend that can talk with NEAR contracts and render Web3 components. diff --git a/website/static/llms.txt b/website/static/llms.txt new file mode 100644 index 00000000000..20b12c2e368 --- /dev/null +++ b/website/static/llms.txt @@ -0,0 +1,103 @@ +# NEAR Protocol Documentation + +## Overview +NEAR is a blockchain platform designed for building scalable, user-friendly decentralized applications. This documentation provides comprehensive guides for developers building on NEAR. + +## Primary Resources + +### Getting Started +- **Smart Contracts Quickstart**: /smart-contracts/quickstart + Create your first NEAR smart contract in JavaScript, Rust, Python, or Go. Includes setup, testing, deployment. + +- **Web3 Apps Quickstart**: /web3-apps/quickstart + Build a frontend application with NEAR wallet integration. React/Next.js example with wallet login and contract interaction. + +### Core Concepts +- **Account Model**: /protocol/account-model + NEAR uses human-readable account IDs. Accounts can store smart contracts, hold tokens, and have access keys. + +- **Smart Contracts**: /smart-contracts/anatomy/anatomy + Contracts are small programs stored on accounts. Write in JavaScript, Rust, Python, or Go. Compiled to WebAssembly. + +- **Access Keys**: /protocol/access-keys + Two types: Full Access (complete control) and Function Call (limited permissions for dApp UX). + +### Chain Abstraction +- **Chain Signatures**: /chain-abstraction/chain-signatures/getting-started + Control addresses on other blockchains (Bitcoin, Ethereum, etc.) from NEAR accounts using MPC signatures. + +- **Intents**: /chain-abstraction/intents + User-centric transaction model where users declare desired outcomes, not step-by-step instructions. + +### AI Integration +- **NEAR AI**: /ai/introduction + Build AI agents that can execute on-chain actions, manage wallets, and interact with smart contracts. + +- **Shade Agents**: /ai/shade-agents/getting-started/introduction + Framework for creating autonomous AI agents with on-chain identity and capabilities. + +### Developer Tools +- **NEAR CLI**: /tools/cli + Command-line interface for deploying contracts, managing accounts, calling functions. + +- **Wallet Selector**: /tools/wallet-selector + Modal for users to choose their preferred NEAR wallet (MyNearWallet, Meteor, etc.). + +- **Ethereum Wallets**: /web3-apps/tutorials/web-login/ethereum-wallets + Connect Metamask and other EVM wallets to NEAR apps. + +### Data & Indexing +- **NEAR Lake**: /data-infrastructure/near-lake-framework + Stream blockchain data in real-time. Subscribe to on-chain events. + +- **BigQuery**: /data-infrastructure/big-query + Query historical NEAR blockchain data using SQL. + +### Primitives +- **NFTs**: /primitives/nft/nft + NEAR NFT standard (NEP-171). Mint, transfer, and manage non-fungible tokens. + +- **Fungible Tokens**: /primitives/ft + NEAR FT standard (NEP-141). Create and manage tokens. + +## Key Differences from Other Blockchains + +- **Human-readable accounts**: Use `alice.near` instead of `0x123...abc` +- **Progressive gas fees**: Users can get function-call access keys to sign non-payable transactions without wallet prompts +- **Built-in account abstraction**: No need for separate AA solutions +- **Native chain abstraction**: Control other chains' addresses from NEAR accounts +- **Sharded architecture**: Scales horizontally (not just layer-2s) + +## Common Developer Questions + +**How do I deploy a contract?** +Use `near deploy ` via NEAR CLI. + +**Which language should I use?** +JavaScript/TypeScript for rapid prototyping, Rust for production, Python/Go for specific use cases. + +**How do I test contracts?** +NEAR provides sandbox testing environments. Run `npm test` (JS), `cargo test` (Rust), or `uv run pytest` (Python). + +**What's a function-call access key?** +Limited permission key that can only call specific contract methods. Enables wallet-less UX for users. + +**How do I integrate wallet login?** +Use @near-wallet-selector/core package. Supports multiple wallets in a single modal. + +**Can I connect Ethereum wallets?** +Yes, NEAR supports Metamask and other EVM wallets through chain signatures. + +## Support + +- **Discord**: https://discord.gg/near +- **Telegram**: https://t.me/NEARProtocol +- **GitHub**: https://github.com/near +- **Forum**: https://gov.near.org + +## Last Updated +January 2026 + +--- + +This documentation is maintained by the NEAR DevHub team. For corrections or improvements, open an issue on GitHub.