
Utilities and common functionality for cryptocurrency accounts, transactions, mnemonics, cryptographic operations, address generation, seed management, and proof-of-work computation. Includes benchmarks for performance testing.
A multiplatform library of building blocks for Atto applications. It provides primitives (mnemonics, keys, addresses, blocks), client tooling to talk to a node, wallet utilities, and proof‑of‑work workers (CPU/OpenCL/remote). Kotlin/JVM, Kotlin/JS, and Kotlin/Wasm are supported where applicable.
NOTE: The API is evolving and may include breaking changes between releases.
@attocash/commons-js.Each module has its own README with detailed examples based on tests. Start here for a quick taste.
Gradle coordinates vary per module, for example:
dependencies {
// Core primitives
implementation("cash.atto:commons-core:<version>")
// Node client (remote over HTTP)
implementation("cash.atto:commons-node-remote:<version>")
// Wallet utilities
implementation("cash.atto:commons-wallet:<version>")
// CPU worker (pure Kotlin)
implementation("cash.atto:commons-worker:<version>")
// OpenCL worker (JVM)
runtimeOnly("cash.atto:commons-worker-opencl:<version>")
}On JS/Node you can use the NPM package:
npm i @attocash/commons-jsval mnemonic = AttoMnemonic.generate()
val seed = mnemonic.toSeed()val privateKey = seed.toPrivateKey(0U)
val publicKey = privateKey.toPublicKey()
val address = AttoAddress(AttoAlgorithm.V1, publicKey)val client = AttoNodeClient.remote("http://localhost:8080")
val worker = AttoWorker.remote("http://localhost:8085")val wallet = AttoWallet.create(client, worker, seed)
// Open index 0 (often the genesis in tests) and a few more
wallet.openAccount(0U.toAttoIndex())
wallet.openAccount(1U.toAttoIndex(), 3U.toAttoIndex())
// Query balances
val balance0 = wallet.getAccount(0U.toAttoIndex())!!.balance
// Send 1 ATTO from account 0 to account 2
val amount = AttoAmount.from(AttoUnit.ATTO, "1")
val toAddress = wallet.getAddress(2U.toAttoIndex())
val tx = wallet.send(0U.toAttoIndex(), toAddress, amount)val accountMonitor = client.createAccountMonitor()
val txnMonitor = accountMonitor.toTransactionMonitor { 1U.toAttoHeight() }
// Collect first message
val msg = txnMonitor.stream().first()
msg.acknowledge()For full examples and advanced flows (auto-receive, account-entry monitor, OpenCL), see the module READMEs below.
A multiplatform library of building blocks for Atto applications. It provides primitives (mnemonics, keys, addresses, blocks), client tooling to talk to a node, wallet utilities, and proof‑of‑work workers (CPU/OpenCL/remote). Kotlin/JVM, Kotlin/JS, and Kotlin/Wasm are supported where applicable.
NOTE: The API is evolving and may include breaking changes between releases.
@attocash/commons-js.Each module has its own README with detailed examples based on tests. Start here for a quick taste.
Gradle coordinates vary per module, for example:
dependencies {
// Core primitives
implementation("cash.atto:commons-core:<version>")
// Node client (remote over HTTP)
implementation("cash.atto:commons-node-remote:<version>")
// Wallet utilities
implementation("cash.atto:commons-wallet:<version>")
// CPU worker (pure Kotlin)
implementation("cash.atto:commons-worker:<version>")
// OpenCL worker (JVM)
runtimeOnly("cash.atto:commons-worker-opencl:<version>")
}On JS/Node you can use the NPM package:
npm i @attocash/commons-jsval mnemonic = AttoMnemonic.generate()
val seed = mnemonic.toSeed()val privateKey = seed.toPrivateKey(0U)
val publicKey = privateKey.toPublicKey()
val address = AttoAddress(AttoAlgorithm.V1, publicKey)val client = AttoNodeClient.remote("http://localhost:8080")
val worker = AttoWorker.remote("http://localhost:8085")val wallet = AttoWallet.create(client, worker, seed)
// Open index 0 (often the genesis in tests) and a few more
wallet.openAccount(0U.toAttoIndex())
wallet.openAccount(1U.toAttoIndex(), 3U.toAttoIndex())
// Query balances
val balance0 = wallet.getAccount(0U.toAttoIndex())!!.balance
// Send 1 ATTO from account 0 to account 2
val amount = AttoAmount.from(AttoUnit.ATTO, "1")
val toAddress = wallet.getAddress(2U.toAttoIndex())
val tx = wallet.send(0U.toAttoIndex(), toAddress, amount)val accountMonitor = client.createAccountMonitor()
val txnMonitor = accountMonitor.toTransactionMonitor { 1U.toAttoHeight() }
// Collect first message
val msg = txnMonitor.stream().first()
msg.acknowledge()For full examples and advanced flows (auto-receive, account-entry monitor, OpenCL), see the module READMEs below.