# osAPI

**Ordiswap API: Bridging Bitcoin's Native Layer and BRC-20 Infrastructure**

Ordiswap's API serves as a bridge, connecting Bitcoin's native layer and the BRC-20 infrastructure. It facilitates seamless communication between these distinct blockchain environments, enabling a unified and interoperable ecosystem.

***

*Key Components:*

**Bitcoin Node Integration:** Ordiswaps API interacts directly with Bitcoin nodes to gather real-time information on the state of the Bitcoin blockchain. This includes transaction data, block information, and details about Bitcoin-based assets.

```bash
curl -X GET https://api.ordiswap.fi/bitcoin-node/transactions
```

**BRC-20 Token Operations:** Through our API, users can perform operations related to BRC-20 tokens. This involves querying token balances, executing transfers, and interacting with the BRC-20 network.

```bash
curl -X GET https://api.ordiswap.fi/brc20/token-balance?token=ORDS
```

**Off-chain AMM Logic:** Ordiswap employs an off-chain mechanism for executing Automated Market Maker (AMM) logic. The API handles order execution, liquidity provision, and price determination off-chain, ensuring efficient and low-latency operations.

```bash
curl -X POST https://api.ordiswap.fi/amm/execute-order -d '{"pair": "BTC-ORDS", "amount": 10, "side": "BUY"}'
```

**Cross-Blockchain Transactions:** Ordiswaps API supports cross-blockchain transactions, allowing users to seamlessly transfer assets. This functionality enhances liquidity and expands the utility of assets.

```bash
curl -X POST https://api.ordiswap.fi/cross-chain/transfer -d '{"asset": "BTC", "amount": 1, "destination": "BRC20"}'
```

***

*Security Considerations:* To ensure the security and integrity of transactions, the API employs cryptographic methods, secure key management, and encrypted communication protocols.

Ordiswap's API acts as a foundational component, fostering interoperability between Bitcoin and BRC-20, providing users with a powerful and efficient toolset to navigate seamlessly across these blockchain landscapes.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ordiswap.gitbook.io/ordiswap/protocol-concepts/osapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
