Canonical: https://solanashreds.xyz/compare/decoder-languages

# Which language should decode your Solana transactions?

Rust vs Go for a Solana decoder, compared stage by stage with Python and TypeScript, so you can choose one language or mix them in one stack.

Use Rust for the stages that touch raw shreds, because only Rust has the official Agave crates for shred recovery and entry parsing. Go and Python decode finished transactions well, including v1. TypeScript suits alerting and glue code. Many teams run a Rust receiver and decode the rest wherever their product already lives.

## The five stages every decoder runs

### Receive

Read UDP datagrams from the port you gave us and hand them on without blocking. Every language here has a standard socket API, so this stage is about discipline (a dedicated reader, a large enough buffer), not about libraries.

### Reassemble

Group shreds by slot and erasure set, recover missing data shreds where the coding shreds allow it, and stitch the payloads back into the byte stream the leader produced. This is the stage with the least library support outside Rust.

### Decode transactions

Split the reassembled bytes into entries, and each entry into signed transactions. Three formats are live: legacy, v0 and v1 (E4 tech facts T-01), and a decoder has to recognise all three from the first bytes, as [versioned transactions](https://solanashreds.xyz/learn/versioned-transactions) explains.

### Decode programs

Turn instruction bytes into meaning: an Anchor discriminator plus Borsh arguments, or a hand-written layout for older programs such as SPL Token. This stage is about knowing the layouts, and any language can do it.

### Write

Send decoded rows to a bus, a database or an alert channel. Your existing stack usually decides this stage for you.

## Stage by stage, language by language

| Stage | Rust | Go | Python | TypeScript |
| --- | --- | --- | --- | --- |
| Receive UDP | std or tokio sockets; no garbage collector pauses | `net` package; goroutine per reader | `socket` or `asyncio`; the default build runs Python code on one thread at a time | `dgram` on the event loop; keep handlers short |
| Reassemble shreds | Official crates: `solana-ledger` (shred types) and `solana-entry` (entries) | No official package; port the parsing and verify against fixtures | No official package; better done offline or by a Rust front end | No official package; port the entry framing yourself |
| Decode transactions | `solana-transaction` 5.x (matching solana-entry): legacy, v0, v1 | `solana-go` v1.26.0: legacy, v0, v1 | `solders` 0.29.0: legacy, v0, v1 | `@solana/kit` 8.6.0: legacy, v0, v1 |
| Decode programs | Borsh and IDL types; full control | Borsh libraries; IDL work by hand | Borsh libraries; quick to iterate in notebooks | Borsh libraries; IDL tooling common in the JavaScript world |
| Write | Any client | Any client | Strong for Parquet and dataframes | Strong for webhooks and chat alerts |

Read the table by row. If one row is hard in your language, that row is the candidate for a second language, not the whole pipeline.

## What each language's tooling offers today

**Rust.** The shred and entry types live in Agave's own crates, `solana-ledger` and `solana-entry`, both at 4.4.1 on the check date. They need Agave's unstable API feature, and `solana-ledger` builds only with the dependency patches Agave pins in its own workspace, so plan an afternoon for the first build (E4 tech facts C-01 and C-02). Transaction types come from `solana-transaction` and `solana-message`; use the 5.x line that `solana-entry` 4.4.1 depends on, so the types match, and it parses all three formats (C-01, T-09).

**Go.** `solana-go` v1.26.0 parses legacy, v0 and v1 transactions from bytes. One trap: its message version getter returns an enum where v1 is the value 2, so compare against the named constant (E4 tech facts C-08). In its favour, its `TransactionFromDecoder` stops at the exact end of one transaction for all three formats, so it can walk the transactions inside an entry one after another (E4 tech facts C-11). The [Go decoder](https://solanashreds.xyz/docs/decode/go) walks through that version check.

**Python.** `solders` 0.29.0 parses all three formats into typed message objects (C-07). It is a good fit for offline captures, notebooks and research tables; see [decoding in Python](https://solanashreds.xyz/docs/decode/python).

**TypeScript.** The official JavaScript library decodes transactions. At version 8.6.0, `@solana/kit` decoded every legacy, v0 and v1 transaction in our fixture set, matching signature, version and fee payer (E4 tech facts C-09). One trap: its decoder's `read()` treats everything after the offset as a single transaction, so inside an entry, where transactions sit back to back, you have to measure each transaction's length yourself before decoding it (E4 tech facts C-10). The [TypeScript decoder guide](https://solanashreds.xyz/docs/decode/typescript) shows the length walk. The [TypeScript walk-through](https://solanashreds.xyz/docs/decode/typescript) covers the entry framing you write by hand.

## When two languages beat one

A split stack is common and sensible. A small Rust process receives packets, reassembles shreds and emits serialized transactions. Everything after that, from program decoding to alerts, runs in the language your team already ships. The boundary is a plain byte format, so the downstream side never needs the Agave crates.

Split when the receive and reassemble rows are your bottleneck, or when the people who maintain the product do not write Rust. Keep one language when a single developer owns the whole pipeline and the traffic is modest. Where the two halves run is a separate choice, covered in [in-process or a separate service](https://solanashreds.xyz/compare/decoder-in-process-vs-service).

## What this comparison does not claim

There are no throughput or timing figures on this page. Speed depends on your machine, your traffic and how carefully each stage is written, and a number from someone else's hardware would mislead you. Measure each stage on your own server with your own fixtures before you commit to a rewrite.

## Language questions

### Is Python too slow for decoding Solana transactions?

For offline analysis and research datasets, Python with solders is a reasonable choice. For a live path that must keep up with every packet, put the receive and reassemble stages in a compiled language and let Python consume decoded rows.

### Can TypeScript handle raw shreds?

It can read the datagrams, but you write the shred and entry parsing yourself, since the official parsing code is Rust. Many teams use TypeScript only after a Rust front end.

### Does Go have an official shred parser?

No official one on the check date. `solana-go` covers transactions; the shred and entry layers are yours to port and test.

### Which language do the official Agave crates support?

Rust only. That is the main reason the reassembly row favours Rust.

## When the language is not your real problem

If your receiver drops packets because the socket buffer is too small or the reader thread blocks, a rewrite in another language will not fix it. Likewise, if you need execution results such as balances or logs, no decoder language helps, because shreds do not carry them. Fix the socket setup or pick a data source with execution results first.

## Pick a starting point

Start from the [Rust transaction decoder](https://solanashreds.xyz/docs/decode/rust) if you want the official crates end to end, or open the [quickstart](https://solanashreds.xyz/docs/quickstart) to decode a first transaction from the stream before you settle on a stack. The [shred parser library cards](https://solanashreds.xyz/compare/shred-parsing-libraries) list what exists for each language.

Whatever the language, allocation is where parsers lose time first, which [zero copy parsing](https://solanashreds.xyz/blog/zero-copy-parsing) addresses in Rust.
