Skip to content

pallet-arweave

pallet-arweave is a Substrate runtime pallet that enables integration between a Substrate-based blockchain and Arweave.
It is designed to be used with offchain workers, allowing nodes to submit metadata from the Mubert Parachain to the Arweave.


Overview

The goal of this pallet is to provide a lightweight bridge for publishing data (e.g., music metadata, fingerprints, etc.) to Arweave, where it will be stored permanently and verifiably.
We integrated the Arweave Rust SDK and extended it to seamlessly support Substrate offchain workers.

Key features:

  • Offchain worker hooks for asynchronous Arweave submission.
  • Secure signing of Arweave transactions.

Workflow

  1. Extrinsic Dispatch
    A user or another pallet dispatches an extrinsic containing metadata that should be stored in Arweave.

  2. Offchain Worker
    When the extrinsic is included in a block, the offchain worker is triggered.
    The offchain worker: - Prepares an Arweave transaction with the provided metadata. - Signs the transaction using Arweave keys configured on the node. - Submits the transaction to the Arweave network.

  3. On-Chain Confirmation
    After successful submission, the Arweave transaction ID (a unique hash) is returned and stored on-chain for reference and verification.


Configuration

To enable the pallet:

impl pallet_arweave::Config for Runtime {
    type AuthorityId = pallet_arweave::crypto::arweave::AuthId;
    type TaskId = TaskId;
    type MaxDataLength = MaxDataLength;
    type MaxTxHashLength = MaxTxHashLength;
    type MaxSignedDataLength = MaxSignedDataLength;
    type RuntimeEvent = RuntimeEvent;
    type WeightInfo = ();
}