solpayments / solana-payment-processor

Solana payment processor for e-commerce applications
18 stars 9 forks source link

Stop using derived accounts #19

Closed moshthepitt closed 3 years ago

moshthepitt commented 3 years ago

Using derived accounts for orders and subscriptions make the whole system less scalable.

moshthepitt commented 3 years ago

Leaning towards:

  1. merchant accounts should be derived from a simple user-supplied seed
  2. order accounts should not be derived but should be regular accounts
  3. subscription accounts should be derived using a key that is a hash of merchant pubkey + subscription name
  4. the hash function to be used should probably be murmur3
    • we don't need a cryptographic hash function
    • murmur3 does not use rand so can work in bpf unlike other hash functions e.g. xxhash
    • murmur3 has a quick and easy js implementation