> For the complete documentation index, see [llms.txt](https://node1.gitbook.io/node1-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://node1.gitbook.io/node1-docs/solana/fast-landing/udp-api.md).

# UDP API

Send one UDP datagram = one transaction to node1-domain:16888. No handshake, no connection, no response.

> Registration automatically creates an Account UUID and enables Node1 Landing Service at 2 TPS. Use that UUID as the API key in this guide; request higher TPS through Discord.

## Packet

| Offset | Size    | Field    | Value / Note                                                   |
| ------ | ------- | -------- | -------------------------------------------------------------- |
| 0      | 4       | magic    | fixed \[43, 6, 58, 10]                                         |
| 4      | 1       | method   | 0                                                              |
| 5      | 16      | api\_key | your API-key (UUID) as 16 raw bytes, canonical UUID byte order |
| 21     | 2       | tx\_len  | u16 little-endian = number of tx bytes                         |
| 23     | tx\_len | tx       | serialized Solana transaction                                  |

Total length = 23 + tx\_len bytes, sent as one UDP datagram.

## Rules

* tx\_len must not exceed 1232 (a full Solana transaction); larger is rejected.
* No result is returned (fire-and-forget); the server replies nothing. Confirm landing on-chain by the transaction signature.
* One transaction per UDP packet.
* Malformed packets, or packets over your API-key rate limit, are dropped silently (no response means no error is returned).
* Resolve the domain once at startup (connect\_node1 in the example), then only send() on the hot path. Never pass a hostname to send\_to — it does a DNS lookup on every call (milliseconds, measured) and wrecks latency.

## Rust Example

```rust
use std::net::{ToSocketAddrs, UdpSocket};
use uuid::Uuid;

const MAGIC: [u8; 4] = [43, 6, 58, 10];

fn connect_node1(server: &str) -> std::io::Result<UdpSocket> {
    let addr = server
        .to_socket_addrs()?
        .next()
        .ok_or_else(|| std::io::Error::new(std::io::ErrorKind::NotFound, "DNS resolved to nothing"))?;
    let sock = UdpSocket::bind("0.0.0.0:0")?;
    sock.connect(addr)?;
    Ok(sock)
}

fn send_tx(sock: &UdpSocket, api_key: &Uuid, tx_bytes: &[u8]) -> std::io::Result<()> {
    assert!((1..=1232).contains(&tx_bytes.len()), "tx_len must be 1..=1232");
    let mut pkt = Vec::with_capacity(23 + tx_bytes.len());
    pkt.extend_from_slice(&MAGIC);                                  // magic[4]
    pkt.push(0);                                                    // method = 0
    pkt.extend_from_slice(api_key.as_bytes());                     // api_key[16]
    pkt.extend_from_slice(&(tx_bytes.len() as u16).to_le_bytes());  // tx_len[2] little-endian
    pkt.extend_from_slice(tx_bytes);                               // tx[tx_len]
    sock.send(&pkt)?;                                              // fire-and-forget, peer already connected
    Ok(())
}

fn main() -> std::io::Result<()> {
    let sock = connect_node1("fra.node1.me:16888")?;  // resolve once; use the node1 domain you were given
    let api_key = Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(); // your API-key
    let tx_bytes: Vec<u8> = todo!("your serialized transaction");
    send_tx(&sock, &api_key, &tx_bytes)?;
    Ok(())
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://node1.gitbook.io/node1-docs/solana/fast-landing/udp-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
