Skip to content
apeirsPublic

About

Transfer a Firo Spark Name between wallets safely: request / approve / complete over your own firod. One stdlib Python file, MIT.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sparkname

Transfer a Firo Spark Name from one wallet to another without typing raw RPC calls into the debug console.

Since the November 2025 network upgrade a Spark Name can move to a new Spark address. The node supports it, but the official guide still has the two people paste three console commands back and forth, and all three must repeat the exact same name, addresses, years and additional data. One typo and the transfer is rejected at broadcast, after the receiver has already decided to pay the fee. sparkname does the bookkeeping:

  • the values travel between the two parties as small JSON files, so nothing gets retyped;
  • before signing, the sender's own node recomputes the request hash and compares it with the file, so the sender only signs a transfer to the address shown on screen;
  • every precondition the chain enforces is checked up front (current owner, renewals since the request, the 15-year validity cap, private balance for the fee, address ownership), with an error that says what to do next;
  • status --txid follows the transfer until it is mined.

One Python file, standard library only (Python 3.8+). It talks to your own firod / Firo Core over JSON-RPC and never sees your keys: signing happens inside the wallet.

Install

curl -O https://raw.githubusercontent.com/apeirs/sparkname/main/sparkname.py
python3 sparkname.py --help

Run Firo Core with the RPC server enabled (server=1 in firo.conf, or firod -daemon). sparkname finds the credentials the same way firo-cli does: rpcuser/rpcpassword from ~/.firo/firo.conf, otherwise the .cookie file in the data directory. Use --datadir, --conf, --rpcurl, --rpcuser, --rpcpassword and --testnet / --regtest as needed.

How a transfer works

step who command node RPC used
1 receiver (new owner) sparkname request NAME -o request.json requestsparknametransfer
2 sender (current owner) sparkname approve request.json -o proof.json requestsparknametransfer (to verify), transfersparkname
3 receiver sparkname complete request.json proof.json registersparkname (transfer form)
any anyone sparkname status NAME [--txid TXID] getsparknamedata, getsparknametxdetails

The receiver pays the name fee for the years they add (1,000 / 100 / 10 / 10 / 10 FIRO per year for 1–5 character names, 1 FIRO per year for longer ones) from their private (Spark) balance, plus the network fee. The sender pays nothing. sparkname fee NAME --years N prints the fee without a node.

Buying a name from a stranger is an off-chain deal: the transfer itself is atomic on chain, but payment between the two of you is not part of it. Agree on that first.

Worked example

Alice holds @coffee and is handing it to Bob. Addresses are shortened here; real Spark addresses start with sm1 and are much longer.

1. Bob asks for the name (in his wallet; the default is a fresh address from his wallet):

bob$ python3 sparkname.py request coffee --years 1 -o request.json
Wrote request.json. Send it to the current owner of coffee; they run:
  sparkname approve request.json

request.json holds everything both sides must agree on:

{
  "additional_data": "",
  "created_at_height": 1402113,
  "fee_firo": 1,
  "kind": "firo-sparkname-transfer-request",
  "name": "coffee",
  "name_valid_until": 1512870,
  "network": "main",
  "new_address": "sm1qbob…",
  "old_address": "sm1qalice…",
  "request_hash": "6f1c…",
  "version": 1,
  "years": 1
}

Bob sends the file to Alice any way he likes; it contains no secrets.

2. Alice approves (in the wallet that holds @coffee):

alice$ python3 sparkname.py approve request.json --unlock -o proof.json
Transfer coffee
  from  sm1qalice…
  to    sm1qbob…
  term  +1 year(s), new owner pays 1 FIRO
Give coffee away to the address above? This can't be undone. [y/N] y
Wallet passphrase:
Wrote proof.json. Send it back to the receiver; they run:
  sparkname complete request.json proof.json

Alice's node checked that the chain still maps @coffee to her address, that her wallet holds it, and that the hash in the file really is the hash of what she was shown. --unlock asks for the passphrase, unlocks for 60 seconds and locks again.

3. Bob broadcasts:

bob$ python3 sparkname.py complete request.json proof.json
Register coffee to sm1qbob… for +1 year(s), paying 1 FIRO plus network fee
Broadcast the transfer? [y/N] y
3a9e…c41d
Broadcast. Check progress with:
  sparkname status coffee --txid 3a9e…c41d

4. Anyone checks:

$ python3 sparkname.py status coffee --txid 3a9e…c41d
{
  "address": "sm1qbob…",
  "blocks_left": 320997,
  "days_left": 557.3,
  "height": 1402119,
  "name": "coffee",
  "registered": true,
  "transaction": {"confirmations": 2, "name": "coffee", "new_address": "sm1qbob…", "transfer_complete": true, "txid": "3a9e…c41d"},
  ...
}

The years Bob bought are added to whatever validity the name had left, up to the 15-year maximum.

Firo relays Spark transactions with Dandelion++, so for up to a minute after complete the transfer may not show in other nodes' mempools. status reports "confirmations": 0 until it is mined.

When something goes wrong

message meaning
the request hash does not match its contents; refusing to sign the request file was edited after it was made; ask for a fresh one
the name was renewed after this request was made the proof is bound to the name's current expiry; make a new request
this wallet does not hold NAME run approve in the wallet that owns the name
remaining validity plus N year(s) exceeds 15 years use the suggested smaller --years
private balance … is below the … FIRO name fee mint to Spark first; the fee is paid privately
the new address already has a Spark Name one name per address: use getnewsparkaddress
Spark name transaction was rejected firod's debug.log has the reason

approve and complete ask before doing anything irreversible; --yes skips the question for scripts.

Tests

python3 -m unittest -v

The tests run offline against a fake node that enforces the same rules as firod (hash binding, ownership, renewal, balance, validity cap) and against a local HTTP stand-in for the RPC transport.

Tested against a real node (regtest, 2026-10-14)

Two firod instances (one wallet each, peered) from the official Firo Core v0.14.18.1 release (firo-0.14.18.1-linux64.tar.gz, SHA-256 6b2bdf9e663294bf73c5a5268e93a8fc88de54417d2669ecb25bf2e353811752, matching the SHA256SUMS file signed by [email protected], key 0186 454D 63E8 3D85 EF91 DE4E 1290 A1D0 FA7E E109). The regtest chain was mined past the Spark Names v2 (2500) and v2.1 (2700) activation heights.

step txid height result
alice registers coffee (plain registersparkname) cc635b445506e7ac22b214c472b15571e5812209e28a097004e95c87ada82668 2822 valid until 213062
alice → bob with request / approve / complete, +1 year 275d8cc876a3e8b9a29e5656fa58fc37860264b8fc7aa8c703851bc377a11175 2823 bob holds it, valid until 423302; bob paid 1 FIRO + 0.00076728 network fee
bob → alice, bob's wallet encrypted (approve --unlock), +2 years, --data "hello from regtest" 65f56763f7f2c2e13c3049905942ed11914a7aaf9d9ac9310bf8558c59558322 2824 alice holds it, valid until 843782, additional info stored

Regtest is a private chain, so these ids can't be looked up on an explorer; the steps above reproduce them. Transcript of the first transfer (addresses shortened):

bob$ sparkname --regtest request coffee --years 1 -o request.json
Wrote request.json. Send it to the current owner of coffee; they run:
  sparkname approve request.json

alice$ sparkname --regtest approve request.json -o proof.json --yes
Transfer coffee
  from  sr1x7tndhg5fy4tu5nzt…p02dq2pyh4e
  to    sr13rrnaaxkp29v5kywy…glzmwrf
  term  +1 year(s), new owner pays 1 FIRO
Wrote proof.json. Send it back to the receiver; they run:
  sparkname complete request.json proof.json

bob$ sparkname --regtest complete request.json proof.json --yes
Register coffee to sr13rrnaaxkp29v5kywy…glzmwrf for +1 year(s), paying 1 FIRO plus network fee
275d8cc876a3e8b9a29e5656fa58fc37860264b8fc7aa8c703851bc377a11175

bob$ sparkname --regtest status coffee --txid 275d8cc8…1175
{ "held_by_this_wallet": true, "valid_until": 423302,
  "transaction": {"confirmations": 1, "transfer_complete": true, ...}, ... }

The same session also checked the refusals against the real node: a request file edited to a different new address (the request hash does not match its contents; refusing to sign), approving from a wallet that no longer holds the name, replaying an old request and proof after the name had moved, a --to address from another wallet, an unregistered name, the 15-year cap (use --years 11 or less), bad RPC credentials and a stopped node. Two things only the real node showed, both fixed in this version: a locked encrypted wallet reports a non-zero unlocked_until, so --unlock now reacts to firod's "unlock needed" error instead; and requestsparknametransfer accepts a wrong old address without complaint, which is why request and approve read the current owner from the chain themselves.

License

MIT, see LICENSE.

About

Transfer a Firo Spark Name between wallets safely: request / approve / complete over your own firod. One stdlib Python file, MIT.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages