Shuffling Operations
Coin shuffling can be used to perform mixing of BLX, MS currencies (unless created as non-shuffleable), or AE assets. Any account can create a new shuffling, specifying the holding to be shuffled, the shuffle amount, number of participants required, and registration deadline.
Get Account Shufflings
Retrieves info about shufflings for a specific account.
Request:
requestType
isgetAccountShufflings
account
is the account IDincludeFinished
istrue
to include completed shufflings (optional)includeHoldingInfo
istrue
to include holding info (optional)firstIndex
is a zero-based index to the first tagged data to retrieve (optional)lastIndex
is a zero-based index to the last tagged data to retrieve (optional)adminPassword
is a string with the admin password (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
requestProcessingTime
(N) is the API request processing time (in millisec)shufflings
(A) is an array containing the shuffling object (refer to Get Shuffling)
Example: Refer to Get Account Shufflings example.
Get All Shufflings
Retrieves info about all shufflings.
Request:
requestType
isgetAllShufflings
includeFinished
istrue
to include completed shufflings (optional)includeHoldingInfo
istrue
to include holding info (optional)finishedOnly
istrue
to omit not yet finished shufflings (optional)firstIndex
is a zero-based index to the first tagged data to retrieve (optional)lastIndex
is a zero-based index to the last tagged data to retrieve (optional)adminPassword
is a string with the admin password (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
requestProcessingTime
(N) is the API request processing time (in millisec)shufflings
(A) is an array containing the shuffling object (refer to Get Shuffling)
Example: Refer to Get All Shufflings example.
Get Assigned Shufflings
Retrieves info about a shufflings that are currently assigned to a specific account.
Request:
requestType
isgetAssignedShufflings
account
is the account IDincludeHoldingInfo
istrue
to include holding info (optional)firstIndex
is a zero-based index to the first tagged data to retrieve (optional)lastIndex
is a zero-based index to the last tagged data to retrieve (optional)adminPassword
is a string with the admin password (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
requestProcessingTime
(N) is the API request processing time (in millisec)shufflings
(A) is an array containing the shuffling object (refer to Get Shuffling)
Example: Refer to Get Assigned Shufflings example.
Get Holding Shufflings
Retrieves info about shufflings for a specific holding and/or stage.
Request:
requestType
isgetHoldingShufflings
holding
is the holding ID (optional)stage
is the stage of the shuffling (See Get Constants for type definitions) (optional)includeFinished
istrue
to include completed shufflings (optional)firstIndex
is a zero-based index to the first tagged data to retrieve (optional)lastIndex
is a zero-based index to the last tagged data to retrieve (optional)adminPassword
is a string with the admin password (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
requestProcessingTime
(N) is the API request processing time (in millisec)shufflings
(A) is an array containing the shuffling object (refer to Get Shuffling)
Example: Refer to Get Holding Shufflings example.
Get Shufflers
Retrieves info about active shufflers on the current node.
Request:
requestType
isgetShufflers
account
is account ID (optional)shufflingFullHash
is shuffling full hash (optional)secretPhrase
is secret phrase of the account doing the shuffling (required if adminPassword is not provided)adminPassword
is the admin password (required if secretPhrase is not provided)includeParticipantState
to include each shuffling participant's state (optional)
Response:
shufflers
(A) is an array containing all currently running shuffling processes on the node.account
(S) is account IDaccountRS
(S) is the account Reed Solomon addressrecipient
(S) is the recipient account ID to where the funds will be sent once the shuffling is completedrecipientRS
(S) is the recipient account Reed Solomon address to where the funds will be sent once the shuffling is completedshuffling
(S) is the shuffling IDshufflingFullHash
(S) is the shuffling full hashparticipantState
(N) is the state for the participant (For more info, see shufflingParticipantStates array in Get Constants)
requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get Shufflers example.
Get Shuffling
Retrieves info about a shuffling.
Request:
requestType
isgetShuffling
shuffling
is the shuffling IDincludeHoldingInfo
istrue
to include holding info (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
blocksRemaining
(N) number of blocks remaining until current stage is finished.amount
(S) the amount ofholdingType
to be shuffledshufflingStateHash
(S) state hash of the shufflingshufflingFullHash
(S) the full hash of the shufflingissuer
(S) is the issuer account IDissuerRS
(S) is the Reed-Solomon address of the issuer accountassignee
(S) is the current assignee account IDassigneeRS
(S) is the Reed-Solomon address of the current assignee accountshuffling
(S) is the shuffling IDholding
(S) is the asset or currency IDholdingType
(N) is the holding type (See Get Constants for type definitions)stage
(N) is the current stage of the shuffling (See Get Constants for type definitions)participantCount
(N) is the number of participants required to start the shufflingregistrantCount
(N) is the number of registrered participantsrecipientPublicKeys
(A) is an array of recipient public keysholdingInfo
(A) is an array containing the asset or currency info (ifincludeHoldingInfo
istrue
and holdingType is not Blue0x)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get Shuffling example.
Get Shuffling Participants
Retrieves info about participants in a shuffling.
Request:
requestType
isgetShufflingParticipants
shuffling
is the shuffling IDrequireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
participants
(A)shuffling
(S) is the shuffling IDaccount
(S) is the account IDaccountRS
(S) is the account Reed Solomong addressstate
(N) is the state for the participant (For more info, see shufflingParticipantStates array in Get Constants)nextAccount
(S) is the account ID of the next account in turnnextAccountRS
(S) is the account Reed Solomon address of the next account in turn
requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get Shuffling Participants example.
Shuffling Cancel
Cancels a shuffling
Request: Refer to Create Transaction Request for common parameters.
requestType
isshufflingCancel
shuffling
is the shuffling IDshufflingStateHash
is the state hash of the shufflingcancellingAccount
is the account ID (optional)
Response Refer to Create Transaction Response.
Shuffling Create
Creates a new shuffling.
Request: Refer to Create Transaction Request for common parameters.
requestType
isshufflingCreate
holding
is the holding id (optional if holdingType is 0)holdingType
is the holding type (See Get Constants for type definitions) (optional)amount
is the amount of the holding to shuffleparticipantCount
is the number of participantsregistrationPeriod
is the number of blocks the participants have to register until the shuffle is cancelled
Response Refer to Create Transaction Response.
Example: Refer to Shuffling Create example.
Shuffling Process
Manually process the shuffling for a specific participant. Note that the shuffling must be in processing stage and the secretPhrase
must match the current shuffling assignee.
Request: Refer to Create Transaction Request for common parameters.
requestType
isshufflingProcess
shuffling
is the shuffling IDrecipientSecretPhrase
is the secret phrase of the recipient account (optional ifrecipientPublicKey
is provided)recipientPublicKey
is the public key of the recipient account (optional ifrecipientSecretPhrase
is provided)
Response Refer to Create Transaction Response.
Example: Refer to Shuffling Process example.
Shuffling Register
Registers a new participant to an existing shuffling. The shuffling must be in stage registration.
Request: Refer to Create Transaction Request for common parameters.
requestType
isshufflingRegister
shufflingFullHash
is the full hash of the shuffling to register
Response Refer to Create Transaction Response.
Example: Refer to Shuffling Register example.
Shuffling Verify
Sends a verification that an account's recipient public key is found within a shuffling.
Request: Refer to Create Transaction Request for common parameters.
requestType
isshufflingVerify
shuffling
is the shuffling IDshufflingStateHash
is the current state hash of the shuffle
Response Refer to Create Transaction Response.
Example: Refer to Shuffling Verify example.
Start Shuffler
Starts a automated Shuffler. Once started, the Shuffler monitors the blockchain state for transactions relevant to the specified shuffle, and automatically submits the required transactions on behalf of the user, performing shuffle processing, verification, or cancellation as needed.
Request:
requestType
isstartShuffler
secretPhrase
is the secret phrase of the account entering the shufflingshufflingFullHash
the full hash of the shufflingrecipientSecretPhrase
the secret phrase of the recipient account (optional ifrecipientPublicKey
is present)recipientPublicKey
the public key of the recipient account (optional ifrecipientSecretPhrase
is present)
Response
shuffling
(S) is the shuffling IDshufflingFullHash
(S) is the full hash of the shufflingaccount
(S) is the account IDaccountRS
(S) is the account Reed Solomong addressrecipient
(S) is the account ID of the recipient accountrecipientRS
(S) is the account Reed Solomon address of the recipient accountrequestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Start Shuffler example.
Stop Shuffler
Stops a previously started automated Shuffler.
Request:
requestType
isstopShuffler
account
is the account ID (optional ifshufflingFullHash
orsecretPhrase
oradminPassword
is provided)shufflingFullHash
the full hash of the shuffling (optional ifaccount
oradminPassword is provided)
secretPhrase
is the secret phrase of the account entering the shuffling (optional ifadminPassword
is provided)adminPassword
is the admin password (optional ifsecretPhrase
is provided)
Response
stoppedShuffler
(B) means the specified shuffler was stoppedstoppedAllShufflers
(B) means all shufflers on the node was stopped (only ifadminPassword
is provided in request)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Stop Shuffler example.