Protocol

CashShuffle is an extension to CoinShuffle. The CoinShuffle protocol defines a sequence of 5 phases (+ a 6th blame phase for identifying protocol violators). Several details are left implementation defined.

cashshufflejs uses this configuration for the variable details:

  • Message types are defined with protobuf.
  • Messages on the wire are preceded by a byte length count represented as an unsigned 32-bit integer in big endian byte order.
protocol.Phase()

Phase enumeration.

Arguments:
  • None (number) – Before protocol start. Value 0.
  • Announcement (number) – Phase 1. Participants announce themselves. Value 1.
  • Shuffle (number) – Phase 2. Blind shuffling of output addresses. Value 2.
  • Broadcast (number) – Phase 3. Verify output addresses. Value 3.
  • EquivocationCheck (number) – Phase 4. Verify no equivocation. Value 4.
  • Signing (number) – Phase 5a. Sign transaction. Value 5.
  • VerificationSubmission (number) – Phase 5b. Submit transaction to Bitcoin Cash network. Value 6.
  • Blame (number) – Out of band phase 6. Identify protocol violator. Value 7.
protocol.Reason()

Blame reason enumeration.

Arguments:
  • InsufficientFunds (number) – Insufficient funds. Value 0.
  • DoubleSpend (number) – Double spend. Value 1.
  • EquivocationFailure (number) – Equivocation failure. Value 2.
  • ShuffleFailure (number) – Shuffle failure. Value 3.
  • ShuffleEquivocationFailure (number) – Shuffle and equivocation failure. Value 4.
  • InvalidSignature (number) – Invalid signature. Value 5.
  • MissingOutput (number) – Missing output. Value 6.
  • Liar (number) – Liar. Value 7.
  • InvalidFormat (number) – Invalid format. Value 8.
protocol.Invalid()

Invalid message.

Provides access to an invalid message as a byte string.

Arguments:
  • invalid= (bytes) – Bytes of message.
protocol.Address()

Bitcoin Cash address.

Arguments:
  • address= (CashAddr) – Bitcoin Cash address.
protocol.DecryptionKey()

Description key.

Arguments:
  • key= (string) – Decryption key as string.
  • public= (string) –
protocol.EncryptionKey()

Encryption key.

Arguments:
  • key= (string) – Encryption key as string.
protocol.Hash()

Message hash.

Enables validating message integrity.

Arguments:
  • hash= (bytes) – Hash as byte string.
protocol.InputSignature()

Input signature.

Arguments:
protocol.Registration()

Registration request.

Arguments:
  • amount= (uint64) – Amount of Bitcoin Cash to shuffle.
protocol.Signature()

Digital signature.

Enables verifying message authenticity.

Arguments:
  • signature= (bytes) – Signature as byte string.
protocol.Transaction()

Bitcoin Cash transaction.

Arguments:
  • transaction= (bytes) – Bitcoin Cash transaction as byte string.
protocol.VerificationKey()

Verification key.

Public key of a participant. Used to identify sender and recipient in messages.

Arguments:
  • key= (string) – Verification key as string.
protocol.Message()

Core message.

Arguments:
protocol.Packet()

Packaged message.

Message with envelope and packaging details.

Arguments:
protocol.Signed()

Signed packaged message.

Packaged message with signature.

Arguments:
protocol.Packets()

List of signed packets.

Arguments:
  • packet= (Array.<protocol.Signed>) – Signed packets.
protocol.Blame()

Blame details.

Arguments: