PHPackages                             arweave/arweave-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arweave/arweave-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arweave/arweave-sdk
===================

Arweave PHP SDK

v0.4.0(6y ago)2355917[7 issues](https://github.com/ArweaveTeam/arweave-php/issues)GPL-2.0PHPPHP ^7.0

Since May 2Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ArweaveTeam/arweave-php)[ Packagist](https://packagist.org/packages/arweave/arweave-sdk)[ Docs](https://arweave.org)[ RSS](/packages/arweave-arweave-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Arweave PHP SDK
---------------

[](#arweave-php-sdk)

This package allows us to interact with the Arweave network, we can use it to read and write transactions and data to the network.

Installation
------------

[](#installation)

We strongly recommend using [composer](https://getcomposer.org) for installation.

`composer require arweave/arweave-sdk`

Or add the following to your project `composer.json` file.

```
"require": {
   "arweave/arweave-sdk": "0.2.0"
}

```

Quick Examples
--------------

[](#quick-examples)

#### Sending data to the network

[](#sending-data-to-the-network)

```
include __DIR__ . '/vendor/autoload.php';

$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);

$jwk = json_decode(file_get_contents('jwk.json'), true);

$wallet =  new \Arweave\SDK\Support\Wallet($jwk);

$transaction = $arweave->createTransaction($wallet, [
    'data' => 'Some page',
    'tags' => [
        'Content-Type' => 'text/html'
    ]
]);

printf('Your transaction ID is %s', $transaction->getAttribute('id'));

// commit() sends the transaction to the network, once sent this can't be undone.
$arweave->api()->commit($transaction);
```

#### Getting data from the network

[](#getting-data-from-the-network)

```
$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);

$arweave->api()->getTransactionData('mvscO3JBlwweOnfkkHpc3fINQ6cUtn_g5aFY9af5TfQ')
```

Usage
-----

[](#usage)

#### Instantiation

[](#instantiation)

Start by creating a `Arweave` object, this is the primary SDK class your application should use, it contains the public methods for creating, sending and getting transactions.

```
$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);
```

Provide any valid Arweave node hostname or IP address

#### Getting a Transaction

[](#getting-a-transaction)

Once we have our `Arweave` object we can now get transactions from the network using a valid transaction ID.

For example:

```
$arweave->api()->getTransaction('mvscO3JBlwweOnfkkHpc3fINQ6cUtn_g5aFY9af5TfQ');
```

The above will return the following `Transaction` object:

```
object(Arweave\SDK\Support\Transaction)#23 (1) {
  ["attributes":protected]=>
  array(10) {
    ["id"]=> string(43) "mvscO3JBlwweOnf..."
    ["last_tx"]=> string(43) "3MFrfH0-HI9GeMf..."
    ["owner"]=> string(683) "1Q7Rfgt23rfUDp..."
    ["target"]=> string(0) ""
    ["quantity"]=> string(1) "0"
    ["data"]=> string(60) "eyJib2R5IjoiVGVz..."
    ["reward"]=> string(10) "1825892857"
    ["signature"]=> string(683) "BUmdaf4rzlyT_3..."
    ["tags"]=> array(0) {}
  }
}
```

#### Getting data from a Transaction

[](#getting-data-from-a-transaction)

There are two methods for getting data from a transaction, we can either:

```
$data = $arweave->api()->getTransactionData($transaction_id);
//string(45) "{"body":"Test body","subject":"Test subject"}"
```

This method returns the original and decoded data from a transaction. This is the simplest method and probably the one you'll need most often.

Alternatively, if we need the encoded data or need other transaction attributes we can do the following:

```
$transaction = $arweave->api()->getTransaction($transaction_id);

$encoded_data = $transaction->getAttribute('data');
//string(60) "eyJib2R5IjoiVGVzdCBib2R5Iiwic3ViamVjdCI6IlRlc3Qgc3ViamVjdCJ9"

$original_data = base64_decode(\Arweave\SDK\Support\Helpers::base64urlDecode($encoded_data));
//string(45) "{"body":"Test body","subject":"Test subject"}"
```

#### ArQL

[](#arql)

```
$transactionIds = $arweave->api()->arql([
    'op' => 'equals',
    'expr1' => 'App-Name',
    'expr2' => 'arweaveapps'
]);

// array(31) {
//   [0]=>
//   string(43) "NXg2OaRRygb7RJZFbkcEYlS2LNNfsqxxobzUqz7ELnc"
//   [1]=>
//   string(43) "i3_aC8xIO_4TpMqp5sR4WVUwbA1p2sPCu11cLVKN89U
// ...
```

#### Loading a Wallet

[](#loading-a-wallet)

To load a wallet you need a Key file. Arweave uses JSON Web Keys (JWK) as the key file format, a JWK is simply a JSON representation of a public/private key pair and they look something like this:

```
{
  "kty": "RSA",
  "ext": true,
  "e": "AQAB",
  "n": "1Q7Rfgt23rfU...",
  "d": "Yk_Z0tGLpar_...",
  "p": "_lrlR3LXDjR4...",
  "q": "1m-NU2BaG2vU...",
  "dp": "qfU3LFSrN52...",
  "dq": "gk_Sb5cFAQQ...",
  "qi": "k65nfXdh4qx..."
}
```

We first need to decode our JWK file to a PHP array, then we can simply pass that array into a new `Wallet` object.

**You should treat your JWK as you would treat an API key or a password**. You should **never** expose them or place them in any publicly accessible location and **never** commit them to any version control system, **doing so will compromise your wallet and its contents**.

```
$jwk = json_decode(file_get_contents('jwk.json'), true);

$wallet =  new \Arweave\SDK\Support\Wallet($jwk);`
```

This is just one suggested method of storing your JWK but there's no requirement that you store in as a JSON file, you could also store it in an environment variable, a database, a PHP file, or anywhere else. As long as it ends up as a PHP array it should work just fine.

#### Creating a Transaction

[](#creating-a-transaction)

Transactions need to be signed for them to be accepted by the network, so **this step requires a wallet**.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~128 days

Total

3

Last Release

2309d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ca11c2e89942229f564168cf58fce3754696afd8bd48b8a8d9686bad6fb6c32?d=identicon)[arweave](/maintainers/arweave)

---

Top Contributors

[![arweave-kyle](https://avatars.githubusercontent.com/u/37296451?v=4)](https://github.com/arweave-kyle "arweave-kyle (12 commits)")[![mattstauffer](https://avatars.githubusercontent.com/u/151829?v=4)](https://github.com/mattstauffer "mattstauffer (4 commits)")[![crypto-guys](https://avatars.githubusercontent.com/u/50590698?v=4)](https://github.com/crypto-guys "crypto-guys (2 commits)")

---

Tags

arweave

### Embed Badge

![Health badge](/badges/arweave-arweave-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/arweave-arweave-sdk/health.svg)](https://phpackages.com/packages/arweave-arweave-sdk)
```

###  Alternatives

[jenssegers/optimus

Id obfuscation based on Knuth's integer hash method

1.3k4.8M27](/packages/jenssegers-optimus)[phpseclib/mcrypt_compat

PHP 5.x-8.x polyfill for mcrypt extension

28029.7M34](/packages/phpseclib-mcrypt-compat)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[codercat/jwk-to-pem

Convert JWK to PEM format.

1004.5M20](/packages/codercat-jwk-to-pem)[salla/zatca

A helper to generate the QR code and signed it for ZATCA e-invoicing

159416.7k2](/packages/salla-zatca)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
