The inspiration for the name comes from the meaning of the original greek word – riddle, puzzle, mystery – and describes Cloakcoin’s Enigma: private, secure, untraceable and decentralized transactions.
Enigma in cooperation with Cloakshield makes it impossible for any outside observers to trace payments done with CLOAKCOIN.
Enigma - Transaction Process
When a node sends funds via Enigma to an stealth address, the following happens:
- Sender generates inputs to cover amount sent, enigma reward (sent * (.2-1)%) and network fee (unknown at present, so ample reserved).
- Sender generates a CloakingRequest object (containing unique stealth nonce for this request).
- Sender generates 2 or 3 one-time stealth payment addresses using the recipients stealth address and splits the sent amount randomly between the addresses.
- Sender onion routes CloakRequest to network. The request contains the 'send amount' so that Cloakers know how much to reserve.
- Cloaker picks up CloakRequest and decides to participate.
- Cloaker supplies X inputs to sender and a stealth address and stealth hash (for their change).
- Cloaker sends CloakingAcceptResponse to Sender. This contains stealth address, stealth nonce and TX inputs.
- Sender waits until enough Cloakers have accepted.
- Sender creates Enigma transaction using own inputs and Cloaker inputs. Inputs are shuffled.
- Sender creates TX ouputs for all Cloakers. The outputs randomly split their change and return it to them. This also allocates the cloaking reward to Cloakers.
- Sender creates their own change returns for the Enigma TX. These are one-time stealth payment addresses.
- The Sender calculates the network TX fee and subtracts this from their own change return.
- The Sender sends the Enigma TX to the Cloakers for signing.
- Cloakers check the TX to ensure their inputs are present and correct and that there are one-time payment addresses linked to one of thier stealth addresses with payment that exceeds the input amount.
- Cloakers sign or reject the TX and send signatures to Sender.
- Sender collates the signatures and transmits the finalized, signed TX to the network.
- Nodes scan incoming transactions for stealth payments and Enigma payments and detect any payments or change. Keypairs and addresses are generated for any matching payments and generated keys/addresses are saved to the local wallet.
How are stealth and Enigma transactions detected/received?
- All incoming transactions are scanned. Stealth transactions are scanned for first (using the default ephemeral pubkey contained in a random OP_RETURN TX output). After this, Enigma transactions are then scanned for. Enigma transactions also use the standard ephemeral pubkey, but payments use an additional step involving a further derived key. Enigma outputs are generated using a hash of the ephemeral pubkey, a private stealth address hash and the output index.
- When scanning for Enigma transactions, the zero-index payment addresses are generated for each owned stealth address [HASH(ephemeral_pubkey, hash_stealth_secret, 0)]. If a match is found for the zero-index of a stealth address, additional addresses are generated for the remaining indexes [num_tx_outputs] and these are scanned against to detect payments. See FindEnigmaTransactions in wallet.cpp for more info.
- A similar scanning method is employed by Cloakers prior to signing an Enigma TX to ensure they are getting reimbursed correctly. See GetEnigmaOutputsAmounts in wallet.cpp for more info.
Analyzing a ENIGMA transaction with the Blockexplorer the inputs are located on the left and outputs on the right, the number depends on how many cloakers were used. If 21 cloakers/mixers are used, there will be 21 matching outputs on the right and also 21 times as many inputs on the left. Only the sender and recipient know who the real sender is. So, in essence, 20 other people pretended to also send coins, but really sent them back to themselves.