To address some of the difficulties dApps encounter with managing the multi-address architecture of UTXO chains, a few of us have come together to draft a specification for Nexa that aims to extend BIP44. This extension reserves accounts 1-99 in BIP44 compliant Nexa wallets to be used for special purposes. Any and all feedback or input is welcome on our initial draft of the spec.
NRC: 4
title: Nexa Special Purpose BIP-44 Accounts
author: dolaned, griffith, vgrunner, yendy
status: Draft
type: Standards Track
created: 2025-02-16
Abstract
This NRC defines an extension of the BIP44 allocating account numbers 1 - 99 for special use within the Nexa ecosystem.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.
This NRC uses the account numbers 1-99 in an otherwise BIP44 compliant wallet for special specific purposes that might have slightly different behaviour on the Nexa network.
Account 0 and 100+ - Default Accounts
Account 0 is the default account and uses BIP44 with no alterations. To create a second account that functions identically to this one on Nexa, skip to account 100 rather than simply incrementing to 1 as accounts 1-99 are reserved for special use.
Default Account Examples
coin | account | chain | address | path |
---|---|---|---|---|
Nexa | first | external | first | m / 44’ / 29223’ / 0’ / 0 / 0 |
Nexa | first | external | second | m / 44’ / 29223’ / 0’ / 0 / 1 |
Nexa | first | change | first | m / 44’ / 29223’ / 0’ / 1 / 0 |
Nexa | first | change | second | m / 44’ / 29223’ / 0’ / 1 / 1 |
Nexa | second | external | first | m / 44’ / 29223’ / 100’ / 0 / 0 |
Nexa | second | external | second | m / 44’ / 29223’ / 100’ / 0 / 1 |
Nexa | second | change | first | m / 44’ / 29223’ / 100’ / 1 / 0 |
Nexa | second | change | second | m / 44’ / 29223’ / 100’ / 1 / 1 |
Account 1 - HODL Vaults
m/44'/29223'/1'/*/*
Account 1 is used specifically for HODL vaults.
Account 2 - Single Address DApp Accounts
m/44'/29223'/2'/0/*
Account 2 is used for dApp accounts. A dApp account does not follow typical BIP44 conventions with regards to chain and index. All addresses in Account 2 are in the external chain. All addresses on the Account 2 external chain are intended to be handled as if they were each unique accounts. A dApp account intentionally only uses one address with change being returned back to the same address. Inputs for a dApp account should only ever come from one address.
DApp Account Examples
Path | Address |
---|---|
m/44’/29223’/2’/0/0 | DApp account 1 |
m/44’/29223’/2’/0/1 | DApp account 2 |
m/44’/29223’/2’/0/2 | DApp account 3 |
Acccount 3-99
m/44'/29223'/3-99'/*/*
These numbers are reserved for future use.
Account discovery
When the master seed is imported from an external source the software should
start to discover the accounts in the following manner:
- derive the first account’s node (index = 0)
- derive the external chain node of this account
- scan addresses of the external chain; respect the gap limit described below
- if the account index is less than 100, increase the account index by 1 and go to step 1
- else if no transactions are found on the external chain, stop discovery
- else if there are some transactions, increase the account index by 1 and go to step 1
This algorithm is successful because software should disallow creation of new
accounts if previous one has no transaction history, as described in chapter
“Account” above.
Please note that the algorithm works with the transaction history, not account
balances, so you can have an account with 0 total coins and the algorithm will
still continue with discovery.
Rationale
Traditionally, Defi has been primarily a feature of EVM based blockchains which use the accounting model rather than the UTXO model. In the accounting model a user typically only has a single address that they use to store funds where as BIP44 compliant wallets on a UTXO blockchains have accounts with multiple addresses. Bringing Defi to UTXO blockchains has its own set of problems and some adjustments to the existing BIP44 wallet scheme is necessary to facilitate activity that was not present at the time BIP44 was written.
Backwards Compatibility
Checking if the next account has addresses in the BIP44 spec is only supposed to occur when the previous account has had usage. Because accounts 1 through 99 are reserved in this spec, a second normal account would be placed in account number 100. Moving from a wallet that follows this NRC to one that is only BIP44 compliant might result in that BIP44 only wallet not checking account number 100 for use.
Test Cases
Reference Implementation
Security Considerations
Reusing a single address multiple times for a single dApp account has privacy implications. It will be very easy to track the dApp usage of that account compared to effort it takes to track other Nexa addresses.
Copyright
Copyright and related rights waived via CC0.