create

fun create(oldToken: DustToken, feeAmount: BigInteger, secretKey: String, newNonce: String): DustSpend

Creates a DustSpend from an old token and fee amount.

Algorithm:

  1. Calculate old nullifier = Hash(secret_key, old_nonce, ...)

  2. Calculate new value = old_value - fee

  3. Create new dust token with new_value

  4. Calculate new commitment = Hash(new_initial_value, owner, new_nonce, ctime)

  5. Generate zero-knowledge proof

Note: Not yet implemented.

Return

DustSpend

Parameters

oldToken

The dust token being spent

feeAmount

Amount to pay in fees (Specks)

secretKey

Dust secret key (hex-encoded)

newNonce

New nonce for the change token