Funding / withdrawing
Users fund nodes to pay for uploads. Funds can be withdrawn at any time.
Tracking Deposits
Each Irys node has a collection of per-token wallets and an internal ledger system.
The per-token wallets collect user deposits. All deposits for a given token are consolidated into a single designated wallet address.
An internal ledger maintains a list of user wallet addresses, and records the amount deposited by each user into the node's corresponding wallet. This enables the system to accurately track each user's deposit history.
To see the list of wallets for a given node, append /info
to the network address.
- https://arweave.mainnet.irys.xyz/info (opens in a new tab)
- https://arweave.devnet.irys.xyz/info (opens in a new tab)
Example:
{
"version": "0.2.0",
"addresses": {
"arweave": "ZE0N-8P9gXkhtK-07PQu9d8me5tGDxa_i4Mee5RzVYg",
"ethereum": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"matic": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"bnb": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"avalanche": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"solana": "AFxXJjdXd4i4pvdFbYAd2TmJqQFu9aYCysAFRmPZ4jTo",
"arbitrum": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"boba-eth": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"boba": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"chainlink": "0x474E7A206bd6186B0C51ad9b1D406c12c4fed9c1",
"near": "bundlr2.near",
"aptos": "0xed50b11ce7f4402bee43f357e593ca46515f530ecca991d1460dc0557617d033"
},
"gateway": "gateway.irys.xyz"
}
How funding works
The funding process is as follows:
- Tokens are transferred from the user's wallet to the node's wallet address associated with the relevant token.
- The transaction ID from the first step is forwarded to the selected Irys node.
- The Irys node verifies that the transaction was directed to one of its designated wallets.
- Once verified, the node proceeds to update an internal ledger that tracks the sender's wallet and the number of tokens transferred.
How withdrawing works
The withdrawing process is as follows:
- The node performs a validation of the request's field order and format, creates a deep hash of the supplied data, and subsequently verifies it using the provided signature.
- The node checks if the request comes from a wallet listed on its internal ledger.
- The node confirms if the requested withdrawal amount does not exceed the user's balance.
- The requested funds are transferred back to the user from the node's wallet, with the user responsible for paying the associated gas fees for the transfer.
- The internal ledger is updated with the user's new balance.
The request for withdrawal is sent as a JSON object with the following fields:
const data = {
nonce,
publicKey,
token,
amount,
signature,
sigType,
};
Field | Description |
---|---|
nonce | A counter tracking the total number of withdrawals performed by this wallet (used to prevent man-in-the-middle attacks (opens in a new tab)) |
publicKey | The user's public key |
token | The token being withdrawn |
amount | The amount being withdrawn |
signature | Signature generated by hashing and then signing the token, amount, and nonce |
sigType | Used internally |
For implementation and usage details, see the SDK documentation for fund()
and
withdrawBalance()
).