# GOAT RPC Node  
Bitcoin Layer 2

Connect to GOAT, the Layer 2 bringing DeFi and smart contracts to Bitcoin. Experience Bitcoin security with EVM compatibility and programmable BTC.

[Documentation](https://docs-rpc.crypto-chief.com/chains/goat) [Get a free endpoint ](https://auth.crypto-chief.com/registration)

##### 6 M+

Requests per Day

##### 99.9 %

Network Uptime

##### < 65 ms

Average Response Time

##### 24/7

Technical Support

## Specification GOAT Network

Technical characteristics and available endpoints

![GOAT Network](/img/protocols/goat.svg)

### GOAT Network

Mainnet & Testnet Support

Chain ID 2345

Protocol HTTPS / WSS

Uptime 99.9%

Type Bitcoin Layer 2

Security Bitcoin Anchored

EVM Compatible Yes

GOAT Network is a Bitcoin Layer 2 bringing DeFi, smart contracts, and programmability to Bitcoin while maintaining security anchoring to Bitcoin Layer 1\. Through EVM compatibility, GOAT enables Solidity developers to build on Bitcoin ecosystem without learning new languages or tools, unlocking Bitcoin's $1.3+ trillion liquidity for DeFi applications. By settling to Bitcoin for security while executing smart contracts on Layer 2, GOAT combines Bitcoin's battle-tested security and brand recognition with Ethereum's programmability and ecosystem maturity, creating best-of-both-worlds infrastructure for BTC DeFi.

#### Key capabilities:

- Bitcoin Layer 2 settlement
- EVM-compatible smart contracts
- Bitcoin-anchored security
- BTC liquidity access
- Full Solidity support
- Ethereum tooling compatibility
- Fast transaction finality
- Low transaction fees
- Growing BTC DeFi ecosystem

#### 🔗 RPC Endpoints

HTTPS

`https://rpc.crypto-chief.com/goat/{YOUR_API_KEY}`

WSS

`wss://rpc.crypto-chief.com/goat/ws/{YOUR_API_KEY}`

Replace {YOUR\_API\_KEY} with your actual API key from the dashboard.

## What is a GOAT RPC Node?

Access Bitcoin Layer 2

A GOAT RPC node provides applications with access to Bitcoin Layer 2 infrastructure enabling smart contracts, DeFi protocols, and programmable applications built on Bitcoin's security foundation. Bitcoin itself doesn't natively support complex smart contracts, limiting DeFi development. GOAT solves this through Layer 2 architecture — executing smart contracts off Bitcoin Layer 1 while periodically settling to Bitcoin for security. EVM compatibility means existing Ethereum developers can immediately build on Bitcoin ecosystem using familiar Solidity and tooling.

### Why Bitcoin needs Layer 2 DeFi

Bitcoin holds over $1.3 trillion value but lacks native DeFi infrastructure. BTC holders can't easily earn yield, provide liquidity, or participate in financial protocols without bridging to other chains (creating security risks). **GOAT brings DeFi to Bitcoin** — lending protocols, DEXs, derivatives, and yield opportunities built directly on Bitcoin-secured Layer 2\. This unlocks massive BTC liquidity for DeFi while maintaining Bitcoin's security properties and brand trust.

**GOAT advantages:**

- **Bitcoin security** — anchored to BTC Layer 1
- **EVM compatible** — familiar Solidity development
- **BTC liquidity** — access $1.3T+ Bitcoin value
- **Ethereum tooling** — use existing dev stack
- **Fast & cheap** — Layer 2 efficiency with L1 security
- **BTC DeFi** — native Bitcoin financial applications

### Bitcoin Layer 2 architecture

GOAT operates as **Bitcoin Layer 2** — smart contracts execute on GOAT chain for speed and low costs, while periodically settling state commitments to Bitcoin blockchain for security. This architecture provides Bitcoin's security guarantees without requiring all computation to happen on Bitcoin itself (impossible given Bitcoin's conservative design). Users interact with familiar EVM interfaces while ultimately secured by Bitcoin proof-of-work consensus.

**How GOAT Layer 2 works:**

1. Users bridge BTC to GOAT Layer 2
2. Smart contracts execute on GOAT EVM chain
3. Transactions processed fast with low fees on L2
4. State commitments periodically anchored to Bitcoin L1
5. Bitcoin security validates L2 state transitions
6. Users exit back to Bitcoin L1 with cryptographic proofs

### Unlocking Bitcoin DeFi potential

GOAT enables **Bitcoin-native DeFi ecosystem** — lending protocols where BTC holders earn yield, DEXs trading BTC and BTC-backed assets, derivatives and options on Bitcoin price, stablecoins backed by BTC collateral, and yield aggregators optimizing Bitcoin returns. All built with EVM smart contracts familiar to Ethereum developers but settling to Bitcoin for security. This creates sustainable Bitcoin DeFi without forcing BTC holders to bridge to completely separate ecosystems.

This infrastructure represents evolution of Bitcoin from store-of-value to programmable financial system.

## Technical Documentation

Quick start for developers

### Supported RPC Methods

GOAT supports all standard Ethereum JSON-RPC methods:

- **eth\_blockNumber** — current block number
- **eth\_getBalance** — GOAT token balance
- **eth\_call** — execute read-only contract functions
- **eth\_sendRawTransaction** — broadcast signed transactions
- **eth\_getTransactionReceipt** — get transaction confirmation
- **eth\_getLogs** — query event logs
- **eth\_gasPrice** — current gas price
- **eth\_estimateGas** — estimate transaction gas cost
- **eth\_subscribe** — WebSocket event subscriptions

### Code Examples

💻

#### JavaScript (ethers.js) — GOAT Bitcoin DeFi:

```
const { ethers } = require('ethers');

const provider = new ethers.JsonRpcProvider('https://rpc.crypto-chief.com/goat/YOUR_API_KEY');

// Verify connection to GOAT Bitcoin L2
const network = await provider.getNetwork();
console.log('Chain ID:', network.chainId); // 2345
console.log('Network:', network.name); // goat

// Get GOAT balance
const address = '0x...';
const balance = await provider.getBalance(address);
console.log('GOAT Balance:', ethers.formatEther(balance));

// Bitcoin-secured DeFi protocol
const BTC_LENDING_PROTOCOL = '0x...';
const lendingABI = [
  'function depositBTC(uint256 amount) external',
  'function borrowAgainstBTC(uint256 collateralAmount, uint256 borrowAmount) external',
  'function getApy() view returns (uint256)',
  'function getUserPosition(address user) view returns (uint256 deposited, uint256 borrowed)'
];

const lending = new ethers.Contract(BTC_LENDING_PROTOCOL, lendingABI, wallet);

// Deposit BTC to earn yield
const depositAmount = ethers.parseEther('1'); // 1 BTC
const depositTx = await lending.depositBTC(depositAmount);
await depositTx.wait();

console.log('BTC deposited in Bitcoin-secured lending protocol!');
console.log('Earning yield on Bitcoin for the first time!');

// Query current APY
const apy = await lending.getApy();
console.log('Current APY:', ethers.formatUnits(apy, 2), '%');

// Check position
const position = await lending.getUserPosition(address);
console.log('Deposited:', ethers.formatEther(position.deposited), 'BTC');
console.log('Borrowed:', ethers.formatEther(position.borrowed), 'BTC');
console.log('All secured by Bitcoin L1!');
```

💻

#### Python (web3.py) — Bitcoin DEX:

```
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://rpc.crypto-chief.com/goat/YOUR_API_KEY'))

print('Connected to GOAT Bitcoin L2:', w3.is_connected())
print('Chain ID:', w3.eth.chain_id)  # 2345
print('Latest block:', w3.eth.block_number)

# Bitcoin DEX contract
BTC_DEX_ADDRESS = '0x...'
btc_dex_abi = [
    {
        'name': 'swapBTCForToken',
        'type': 'function',
        'inputs': [
            {'name': 'amountIn', 'type': 'uint256'},
            {'name': 'tokenOut', 'type': 'address'},
            {'name': 'minAmountOut', 'type': 'uint256'}
        ],
        'outputs': [{'name': 'amountOut', 'type': 'uint256'}]
    },
    {
        'name': 'addLiquidity',
        'type': 'function',
        'inputs': [
            {'name': 'btcAmount', 'type': 'uint256'},
            {'name': 'tokenAmount', 'type': 'uint256'},
            {'name': 'tokenAddress', 'type': 'address'}
        ],
        'outputs': [{'name': 'liquidity', 'type': 'uint256'}]
    }
]

btc_dex = w3.eth.contract(
    address=BTC_DEX_ADDRESS,
    abi=btc_dex_abi
)

# Swap BTC for token on Bitcoin L2 DEX
tx_hash = btc_dex.functions.swapBTCForToken(
    w3.to_wei(0.5, 'ether'),  # 0.5 BTC
    token_address,
    min_amount_out
).transact({'from': user_address})

receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
print('BTC swapped on Bitcoin-native DEX!')
print('No bridging to other chains required!')

# Provide BTC liquidity
liquidity_tx = btc_dex.functions.addLiquidity(
    w3.to_wei(2, 'ether'),   # 2 BTC
    token_amount,
    token_address
).transact({'from': user_address})

w3.eth.wait_for_transaction_receipt(liquidity_tx)
print('Earning fees on BTC liquidity provision!')
print('Bitcoin DeFi is here!')
```

💻

#### WebSocket — Monitor Bitcoin DeFi:

```
const { ethers } = require('ethers');
const provider = new ethers.WebSocketProvider('wss://rpc.crypto-chief.com/goat/ws/YOUR_API_KEY');

// Monitor Bitcoin L2 blocks
provider.on('block', async (blockNumber) => {
  const block = await provider.getBlock(blockNumber);
  console.log(`\n=== GOAT Bitcoin L2 Block ${blockNumber} ===`);
  console.log('Transactions:', block.transactions.length);
  console.log('Secured by Bitcoin proof-of-work');
});

// Monitor BTC lending events
const BTC_LENDING = '0x...';
const lendingFilter = {
  address: BTC_LENDING,
  topics: [ethers.id('BTCDeposited(address,uint256)')]
};

provider.on(lendingFilter, (log) => {
  const decoded = ethers.AbiCoder.defaultAbiCoder().decode(
    ['address', 'uint256'],
    log.data
  );
  const amount = ethers.formatEther(decoded[1]);
  console.log('\n=== BTC Lending Deposit ===');
  console.log('User:', decoded[0]);
  console.log('Amount:', amount, 'BTC');
  console.log('Bitcoin earning yield on Layer 2!');
});

// Monitor Bitcoin DEX swaps
const BTC_DEX = '0x...';
const swapFilter = {
  address: BTC_DEX,
  topics: [ethers.id('BTCSwapped(address,uint256,uint256)')]
};

provider.on(swapFilter, (log) => {
  console.log('\n=== Bitcoin DEX Swap ===');
  console.log('Native BTC DeFi transaction!');
  console.log('No cross-chain bridges needed!');
});

console.log('Monitoring GOAT - Bitcoin Layer 2 DeFi...');
```

### GOAT Best Practices

- **Bitcoin Security:** Leverage Bitcoin L1 settlement for maximum security
- **BTC Focus:** Design applications specifically for Bitcoin holders and liquidity
- **Bridge Understanding:** Implement secure BTC bridging between L1 and L2
- **EVM Compatibility:** Use familiar Ethereum development tools and libraries
- **DeFi Innovation:** Build Bitcoin-native financial primitives and protocols
- **Layer 2 Optimization:** Design for L2 efficiency while settling to L1
- **Testing:** Thoroughly test on GOAT testnet before mainnet deployment

## Why choose us?

Bitcoin DeFi infrastructure

### Bitcoin-Native DeFi

Infrastructure enabling BTC DeFi with &lt;65ms RPC latency and Bitcoin L1 security anchoring.

### Bitcoin Security

Production infrastructure settling to Bitcoin blockchain achieving 99.9% uptime with PoW security.

### BTC DeFi Analytics

Comprehensive monitoring of Bitcoin lending, DEX activity, liquidity pools, and L2 settlement metrics.

### Global Infrastructure

Worldwide deployment supporting GOAT's Bitcoin Layer 2 DeFi ecosystem.

### BTC Liquidity Scaling

Infrastructure designed to unlock Bitcoin's $1.3T+ liquidity for DeFi applications.

### Bitcoin DeFi Experts

24/7 support from engineers specialized in Bitcoin Layer 2, BTC DeFi, and EVM smart contracts.

## Examples of Use

Build Bitcoin DeFi

GOAT's Bitcoin Layer 2 enables BTC lending protocols, Bitcoin DEXs, derivatives platforms, and applications unlocking Bitcoin liquidity for DeFi.

#### BTC Lending Protocols

Build lending platforms where Bitcoin holders earn yield or borrow against BTC collateral with Bitcoin security.

#### Bitcoin DEXs

Create decentralized exchanges for BTC and BTC-backed assets without cross-chain bridge risks.

#### BTC Derivatives

Launch derivatives, options, and structured products on Bitcoin settled to BTC Layer 1 security.

#### BTC Stablecoins

Develop stablecoins backed by Bitcoin collateral leveraging L2 efficiency with L1 security.

#### Bitcoin Yield Aggregators

Create platforms optimizing yield strategies across Bitcoin DeFi ecosystem.

#### BTC Asset Tokenization

Build tokenization platforms for real-world assets secured by Bitcoin blockchain.

## Got questions?  
we are here to help

## What is GOAT Network? 

GOAT is a Bitcoin Layer 2 enabling DeFi, smart contracts, and programmable applications with EVM compatibility while settling to Bitcoin for security.

## Why does Bitcoin need Layer 2 DeFi? 

Bitcoin holds $1.3T+ value but lacks native smart contracts for DeFi. GOAT brings lending, trading, and yield to Bitcoin ecosystem.

## Is GOAT EVM compatible? 

Yes, GOAT is fully EVM-compatible. Ethereum developers can build on Bitcoin using familiar Solidity and tooling.

## How does GOAT secure to Bitcoin? 

GOAT periodically settles state commitments to Bitcoin Layer 1, anchoring Layer 2 security to Bitcoin proof-of-work consensus.

## Can I earn yield on Bitcoin with GOAT? 

Yes! GOAT enables Bitcoin lending protocols, liquidity provision, and other DeFi opportunities for BTC holders.

## What is the GOAT token? 

GOAT is the native token used for transaction fees, network operations, and Layer 2 functionality on GOAT Network.

## How do I bridge BTC to GOAT? 

Users bridge Bitcoin from Layer 1 to GOAT Layer 2 through secure bridge infrastructure with cryptographic security guarantees.

## Are my Bitcoin safe on GOAT? 

GOAT leverages Bitcoin's security through L1 settlement and cryptographic proofs enabling secure exits back to Bitcoin mainchain.

## Do you support GOAT testnet? 

Yes, we provide RPC access to both GOAT mainnet (Chain ID 2345) and testnet for Bitcoin DeFi development.

## Why build Bitcoin DeFi on GOAT? 

GOAT combines Bitcoin's $1.3T liquidity and brand trust with EVM's DeFi capabilities, unlocking Bitcoin's potential for financial applications.

## Pricing that grows with your needs.

### Free

Start building on Web3 — no credit card.

##### $0

- 5 reqs/sec RPC
- 5 reqs/min Unified API
- 1 req/day AML
- Ultimate chains
- WSS, Statistics
- Community support

[Get started ](https://auth.crypto-chief.com/registration)

### Pay for use

Flexible pay-as-you-go for any workload.

##### From $10

- 400 reqs/sec RPC
- 300 reqs/min Unified API
- 5 reqs/sec AML
- EventStream
- Ultimate chains
- WSS, Whitelists, Statistics
- Support portal

[Get started](https://auth.crypto-chief.com/registration)

### Subscription

From $500 monthly plus 20% extra value.

##### From $500

- 400 reqs/sec RPC
- 300 reqs/min Unified API
- 5 reqs/sec AML
- EventStream
- Ultimate chains
- WSS, Whitelists, Statistics
- Support portal

[Get started ](https://auth.crypto-chief.com/registration)

### Enterprise

Tailored solution for expert builders

##### Custom terms

All Subscription features plus:

- Flexible rate limits
- Engineering team support
- Custom SLA
- Personal manager

[Contact Sales ](/contact/)
