The Arweave protocol is based on HTTP, so any existing http clients/libraries can be used to interface with the network, for example Axios or Fetch for JavaScript, Guzzle for PHP, etc.
The default port is 1984.
Requests and queries can be sent to any Arweave node directly using their IP address, for example http://159.65.213.43:1984/info. Hostnames can also be used if configured with DNS, for example https://arweave.net/info.
let request =require("request");let options = { method:"GET", url:"https://arweave.net/info",};request(options,function (error, response, body) {if (error) {console.error(error); }console.log("Arweave network height is: "+JSON.parse(body).height);});
Integrations
Arweave specific wrappers and clients are currently in development to simplify common operations and API interactions, there are currently integrations for Go, PHP, Scala (which can also be used with Java and C#) and JavaScript/TypeScript/NodeJS.
Schema
Common data structures, formats, and processes explained.
Nodes and gateways accept transactions through the POST /tx endpoint. The body must be a JSON encoding of a transaction. Amounts are specified in winstons.
Transaction and block identifiers and wallet addresses, among some other fields, are encoded as Base64URL strings when sent over HTTP or put in the URLs or displayed in the block explorers.
Base64URL is case-sensitive.
For example, T414mkfW-EQWEwPtk__LMJAgawNdxZfdjxhGPQKMwDQ, t414mkfW-EQWEwPtk__LMJAgawNdxZfdjxhGPQKMwDQ, and t414mkfw-eqwewptk__lmjagawndxzfdjxhgpqkmwdq are three different addresses. It is impossible to recover tokens sent to a different case of the same address.
A transaction may be used for uploading data, transferring tokens, or both.
Currently supported formats are `1` and `2` (often referred to as v1 and v2 respectively). The v1 format is deprecated.
id
Yes
Base64URL string
A SHA-256 hash of the transaction signature.
last_tx
Yes
Base64URL string
An anchor - a protection against replay attacks. It may be either a hash of one of the last 50 blocks or the last outgoing transaction ID from the sending wallet. If this is the first transaction from the wallet then an empty string may be used. The recommended way is to use the value returned by GET /tx_anchor. Two different transactions can have the same last_tx if a block hash is used.
owner
Yes
Base64URL string
The full RSA modulus value of the sending wallet. The modulus is the n value from the JWK. The RSA public key.
tags
No
array of objects
A list of name-value pairs, each pair is serialized as {"name": "a BaseURL string", "value":" a Base64URL string"}. If no tags are being used then use an empty array []. The total size of the names and values may not exceed 2048 bytes. Tags might be useful for attaching a message to a transaction sent to another wallet, for example a reference number or identifier to help account for the transaction.
target
No
Base64URL string
The target address to send tokens to (if required). If no tokens are being transferred to another wallet then use an empty string. Note that sending tokens to the owner address is not supported. The address is the SHA-256 hash of the RSA public key.
quantity
No
Numerical string (winstons)
The amount to transfer from the owner wallet to the target wallet address (if required).
data_root
No
Base64URL string
Only use with v2 transactions. The merkle root of the transaction data. If there is no data then use an empty string.
data_size
No
Numerical string (bytes)
Only use with v2 transactions. The size in bytes of the transactin data. Use "0" if there is no data. The string representation of the number must not exceed 21 bytes.
data
No
Base64URL string
The data to be submitted. If no data is being submitted then use an empty string. For v2 transactions there is no need, although it is possible, to use this field even if there is data (means, data_size > 0 and data_root is not empty). In v1 transactions, data cannot be bigger than 10 MiB. In v2 transactions, the limit is decided by the nodes. At the time this was written, all nodes in the network accept up to 12 MiB of data via this field.
reward
Yes
Numerical string (winstons)
The transaction fee. See the price endpoint docs for more info.
signature
Yes
Base64URL string
An RSA signature of a merkle root of the SHA-384 hashes of transaction fields (except for id, which is the hash of the signature). See Transaction Signing for more.
Transaction signatures are generated by computing a merkle root of the SHA-384 hashes of transaction fields: format, owner , target , data_root, data_size, quantity, reward, last_tx, tags, then signing the hash. Signatures are RSA-PSS with SHA-256 as the hashing function.
Key Format
Arweave uses the JSON Web Key (JWK) format (RFC 7517) with 4096 length RSA-PSS keys. This JWK format allows for cryptographic keys to be represented as a JSON object where each property represents a property of the underlying cryptographic key. It's widely supported with libraries for most popular languages. It's possible to convert a JWK to a PEM file or other crypto key file format, support for this this will vary from language to language. If you're generating your own keys manually the public exponent (e) must be 65537. If any other value is used the transactions signed by these keys will be invalid and rejected.
Addressing
The n value is the public modulus and is used as the transaction owner field, and the address of a wallet is a Base64URL encoded SHA-256 hash of the n value from the JWK.
Sample JWK
The address for this wallet is GRQ7swQO1AMyFgnuAPI7AvGQlW3lzuQuwlJbIpWV7xk.
Winston is the smallest possible unit of AR, similar to a satoshi in Bitcoin, or wei in Ethereum.
1 AR = 1000000000000 Winston (12 zeros) and 1 Winston = 0.000000000001 AR.
The HTTP API will return all amounts as winston strings, this is to allow for easy interoperability between environments that do not accommodate arbitrary-precision arithmetic.
JavaScript for example stores all numbers as double precision floating point values and as such cannot natively express the integer number of winston. Providing these values as strings allows them to be directly loaded into most 'bignum' libraries.
Transactions
Endpoints for interacting with transactions and related resources.
A Content-Type tag-name can be submitted with a transaction, the tag-value will then be used as the Content-Type header when serving the data response, this allows you to submit binary files like images and have them served with correct content type headers over HTTP.
The default Content-Type is application/octet-stream.
Get Transaction Price
GEThttps://arweave.net/price/{bytes}/{target}
This endpoint is used to calculate the minimum fee (reward) for a transaction of a specific size, and possibly to a specific address.This endpoint should always be used to calculate transaction fees as closely to the submission time as possible. Pricing is dynamic and determined by the network, so it's not always possible to accurately calculate prices offline or ahead of time. Transactions with a fee that's too low will simply be rejected.
Path Parameters
Name
Type
Description
bytes*
String
The number of bytes to go into the transaction data field.
If sending AR to another wallet with no data attached, then 0 should be used.
target
String
The target wallet address if sending AR to another wallet.
Headers
Name
Type
Description
Accept
String
application/json
10000
An extra fee is taken for the first transaction sent to a new wallet address. This is intentional and to discourage wallet spam.
Examples
To get a fee for sending 10 AR to a wallet with address abc consult /price/0/abc.
To upload 123 bytes without transferring tokens consult /price/123.
To send some AR to the "abc" wallet and upload 123 bytes of data query /price/123/abc.
Submit a transaction
POSThttps://arweave.net/tx
Submit a new transaction to the network.The request body should be a JSON object with the attributes described in Transaction Format.
Headers
Name
Type
Description
Accept
String
application/json
Content-Type
String
application/json
OK
Transaction already processed.
Transaction verification failed.
Too Many Requests
Transaction verification failed.
Find more information about these fields and examples in the Transaction Format section.
Wallets
Endpoints for getting information about a wallet.
Get a Wallet Balance
GEThttps://arweave.net/wallet/{address}/balance
Get the balance for a given wallet. Unknown wallet addresses will simply return 0.
Path Parameters
Name
Type
Description
address
String
Wallet address
9554799572505
Invalid address.
Get Last Transaction ID
GEThttps://arweave.net/wallet/{address}/last_tx
Get the last outgoing transaction for the given wallet address.
Get the list of peers from the node. Nodes can only respond with peers they currently know about, so this will not be an exhaustive or complete list of nodes on the network.
Headers
Name
Type
Description
Accept
String
application/json
["127.0.0.1:1984","0.0.0.0:1984"]
Chunks
Upload Chunks
POSThttps://arweave.net/chunk
Upload Data Chunks.
Example json-data payload:
Headers
Name
Type
Description
Accept
String
application/json
Content-Type
String
application/json
OK
When chunk is bigger than 256 KiB.
{ "error":"chunk_too_big" }
or
When the proof is bigger than 256 KiB.
{ "error":"data_path_too_big" }
or
When the offset is bigger than 2 ^ 256.
{ "error":"offset_too_big" }
or
When the data size is bigger than 2 ^ 256.
{ "error":"data_size_too_big" }
or
When data_path is bigger than the chunk. NOTE: If the original data is too small, it should not be uploaded in chunks. Also, this does not apply to chunks which are the only chunks of their transaction and to the last chunk of every transaction.
{ "error":"chunk_proof_ratio_not_attractive" }
or
When the node hasn’t seen the header of the corresponding transaction yet.
{ "error":"data_root_not_found" }
or
The corresponding transaction is pending and it is either of:
Note: The values above are default values, any node may configure bigger limits.
{ "error":"exceeds_disk_pool_size_limit" }
or
{ "error": "invalid_proof" }
Note that data_size is requested in addition to data root, because one may submit the same data root with different transaction sizes. To avoid chunks overlap, data root always comes together with the size.
Download Chunks
Get Transaction Data
GEThttps://arweave.net/tx/{id}/data
The endpoint serves data regardless of how it was uploaded
Path Parameters
Name
Type
Description
id
String
Transaction ID
<Base64URL encoded data>
tx_data_too_big
When the node has not joined the network yet.
{ "error": "not_joined" }
or
{ "error": "timeout" }
Get Transaction Offset and Size
GEThttps://arweave.net/tx/{id}/offset
Get the absolute end offset and size of the transaction
Note that the client may use this information to collect transaction chunks. Start with the end offset and fetch a chunk via GET /chunk/<offset>. Subtract its size from the transaction size, if there are more chunks to fetch, subtract the size of the chunk from the offset and fetch the next chunk.