diff --git a/docs/ai/introduction.md b/docs/ai/introduction.md index 6190b31fb9d..df3a068b514 100644 --- a/docs/ai/introduction.md +++ b/docs/ai/introduction.md @@ -2,7 +2,15 @@ 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." +--- + +## Quick Answer + +**Build AI agents that control blockchain accounts and execute on-chain actions.** NEAR enables User-Owned AI through two frameworks: **Shade Agents** (verifiable, non-custodial, multichain AI agents in TEEs) and **NEAR AI** (agent network infrastructure with monetization). Agents can sign transactions, manage wallets, and operate autonomously while keeping users in control. + +**Key difference:** Your AI agent can't lose access to its funds, and you own the agent's behavior and data—not a corporation. + --- 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. @@ -38,3 +46,34 @@ Shade Agents power [Agentic Protocols](./shade-agents/concepts/what-can-you-buil - End-to-end confidential iterations with agents 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. + +--- + +## Which Framework Should I Use? + +| Framework | Best For | Key Feature | Complexity | +|-----------|----------|-------------|-----------| +| **Shade Agents** | Production agents with funds | Non-custodial, verifiable, multichain | Advanced | +| **NEAR AI** | Monetizing AI agents | Agent marketplace, payments | Moderate | + +**Choose Shade Agents** for trustless agents controlling real assets across chains. +**Choose NEAR AI** for building agent networks with monetization. + +--- + +## Common Questions + +### What makes NEAR's AI approach different? +**User ownership.** Your agent, your data, your control. Traditional AI platforms own your interactions and can shut down your agents. NEAR agents persist on-chain. + +### Can AI 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. + +### Do I need to know blockchain development? +Some smart contract knowledge helps for both Shade Agents and NEAR AI, but you can start with basic tutorials and build up from there. + +### How do agents get paid? +NEAR AI has built-in monetization. Users pay agents for services in cryptocurrency. Agents can also earn by providing services to other agents. + +### What chains do these agents support? +Shade Agents: Bitcoin, Ethereum, NEAR, and any chain NEAR's Chain Signatures supports. NEAR AI: Primarily NEAR with cross-chain capabilities. diff --git a/docs/chain-abstraction/chain-signatures/getting-started.md b/docs/chain-abstraction/chain-signatures/getting-started.md index 404b1bc6d8f..4ceddbd74bc 100644 --- a/docs/chain-abstraction/chain-signatures/getting-started.md +++ b/docs/chain-abstraction/chain-signatures/getting-started.md @@ -4,6 +4,14 @@ title: Getting Started with Chain Signatures description: "Learn how to sign and execute cross-chain transactions" --- +## Quick Answer + +**Control Bitcoin, Ethereum, and other blockchain addresses from your NEAR account.** Chain Signatures uses Multi-Party Computation (MPC) to let NEAR accounts sign transactions for external chains without bridges. Derive addresses on any blockchain, build DeFi on Bitcoin, create multichain apps with one contract, or enable account abstraction across all chains. + +**Key capabilities:** Sign Bitcoin/Ethereum/etc transactions, control external addresses, no wrapped tokens, programmable cross-chain interactions. + +--- + Chain Signatures is a groundbreaking technology built on NEAR that enables all accounts, including smart contracts, to sign and execute transactions across multiple blockchains. ![img](https://pages.near.org/wp-content/uploads/2024/02/acct-abstraction-blog-1.png) @@ -12,6 +20,17 @@ This innovation leverages Multi-Party Computation (MPC) and a distributed networ Chain Signatures enhances blockchain interoperability, giving ownership of diverse assets, cross-chain accounts, and data to a single NEAR account. +### 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 | + --- ## How does it work? @@ -101,6 +120,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? +Signing a transaction costs ~0.1 Ⓝ ($0.02-0.05). The actual transaction fee on the target blockchain (BTC network fees, ETH gas) is paid separately. + +--- + ## 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..2d52af100e9 100644 --- a/docs/smart-contracts/quickstart.md +++ b/docs/smart-contracts/quickstart.md @@ -11,6 +11,12 @@ import TabItem from '@theme/TabItem'; import Card from '@site/src/components/UI/Card'; import MovingForwardSupportSection from '@site/src/components/MovingForwardSupportSection'; +## Quick Answer + +**Create a NEAR smart contract in under 5 minutes.** This guide walks you through writing a "Hello World" contract in JavaScript, Rust, Python, or Go, then deploying it to testnet. You'll write a contract that stores a greeting and exposes two functions: `set_greeting` (write) and `get_greeting` (read). Uses NEAR CLI for testing and deployment. No mainnet account needed. + +--- + Welcome! [NEAR accounts](../protocol/account-model.md) can store small apps known as smart contracts. In this quick tutorial, we will guide you in creating your first contract on the NEAR **testnet**! Join us in creating a friendly auction contract, which allows users to place bids, track the highest bidder and claim tokens at the end of the auction. @@ -219,12 +225,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. + --useFaucet`. + +### How much does it cost to deploy? +On testnet: free. On mainnet: ~0.1-0.5 Ⓝ depending on contract size (typically $0.10-$0.50). + +### Can I update a contract after deploying? +Yes. Redeploy with `near deploy `. The account stays the same, code updates. + +### Which language should I choose? +- **Rust** for production apps (most tooling, best performance) +- **JavaScript** for rapid prototyping (easiest for web devs) +- **Python** for AI/data science use cases +- **Go** if you're already a Go developer + +### 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..1a1bf388a6f 100644 --- a/docs/web3-apps/quickstart.md +++ b/docs/web3-apps/quickstart.md @@ -9,6 +9,12 @@ import TabItem from '@theme/TabItem'; import {CodeTabs, Language, Github} from '@site/src/components/UI/Codetabs'; import MovingForwardSupportSection from '@site/src/components/MovingForwardSupportSection'; +## Quick Answer + +**Build a NEAR-enabled frontend in 10 minutes.** Create a React/Next.js app with wallet login and smart contract interaction. Uses `create-near-app` to scaffold a complete dApp with wallet selector (supports MyNearWallet, Meteor, Metamask). Users can sign in, call contract functions, and see results. Includes testnet example contract (`hello.near-examples.testnet`). + +--- + 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**. :::tip Searching to integrate NEAR in your App? @@ -89,10 +95,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 +136,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-wallet-selector/core` and follow our [integration guide](./tutorials/web-login/wallet-selector.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.