nitowa 18afeffcad re-add progressCallback | 1 місяць тому | |
---|---|---|
src | 1 місяць тому | |
test | 1 місяць тому | |
.drone.yml | 2 роки тому | |
.gitignore | 2 роки тому | |
.npmignore | 2 роки тому | |
LICENSE.md | 2 роки тому | |
README.md | 2 роки тому | |
package-lock.json | 1 місяць тому | |
package.json | 1 місяць тому | |
tsconfig.json | 3 роки тому |
xrpio is a library that allows you to write and read arbitrary data in the ripple blockchain.
npm i xrpio
Transactions on the ripple blockchain are allowed to carry up to 1kB of arbitrary data via the memo field. We can use this to store data of any size by building a tree of references between these transactions that can then be reassembled by reading them back from the blockchain. In order to generate these transactions xrpio sends payments with the minimum denomination between two wallets controlled by the user.
xrpio automatically takes care of the logistics behind this technique as well as compression of the data.
Highly simplified, you can visualize the process like this:
In practice each node does of course store significantly more data.
This library is in an early stage of development and breaking changes may occur spontaneously and without regard of semantic versioning until the v1.0.0 release.
import { xrpIO } from "xrpio"
const api = new xrpIO("wss://some_ripple_node.net:51233")
await api.connect()
txHash = await api.treeWrite("arbitrary text 123", receiveWallet.address, sendWallet.secret)
data = await api.treeRead([txHash])
console.log(data) //"arbitrary text 123"