Feat: Hierarchical Deterministic Note

Hi there,
I’m working on a new feature for torn CLI

so the idea is to use BIP39 - hierarchical deterministic keys to create multiple deposits while only having to keep one new note.

to explain the idea, let’s say you wanna deposit 100 times.

normally you have to create 100 notes and deposit them one by one.
then you’ll have to keep 100 notes safe. and maybe also keep track of what you already used.

with the new feature, you can

  • generate a new HD-note
  • you can then make 100 deposits
  • you can later withdraw with HD-note + index (e.g. deposit no. 69)

this is still a work in progress. would love to get some feedback before I spend more time on it.

can take a look at the POC in this PR

img.

2 Likes

The problem with seed phrases is that they are harder to manage and synchronize. For example when you want to initialize a new device, it needs to scan all possible derivation paths. And it can contain gaps for notes that you generated but never funded.

This is one of the reasons Tornado Cash went in the direction of encrypted notes instead. It uses your Metamask account to encrypt and post it onchain along with the deposit. Then when a user wants to sync he just needs to scan all cyphertexts and try to decrypt them. In this case each note is still an independent random byte sequence.

2 Likes

By the way, check out Tornado Cash Nova that solves this problem altogether by allowing arbitrary amounts and splits/joins.

nova sound like fun.
are there anyway I can contribute to that?

It’s always great to contribute to CLI tooling, docs, code readability improvements and comments, maybe some extra tools