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:
requestTypeisgetAccountShufflingsaccountis the account IDincludeFinishedistrueto include completed shufflings (optional)includeHoldingInfoistrueto include holding info (optional)firstIndexis a zero-based index to the first tagged data to retrieve (optional)lastIndexis a zero-based index to the last tagged data to retrieve (optional)adminPasswordis a string with the admin password (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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:
requestTypeisgetAllShufflingsincludeFinishedistrueto include completed shufflings (optional)includeHoldingInfoistrueto include holding info (optional)finishedOnlyistrueto omit not yet finished shufflings (optional)firstIndexis a zero-based index to the first tagged data to retrieve (optional)lastIndexis a zero-based index to the last tagged data to retrieve (optional)adminPasswordis a string with the admin password (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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:
requestTypeisgetAssignedShufflingsaccountis the account IDincludeHoldingInfoistrueto include holding info (optional)firstIndexis a zero-based index to the first tagged data to retrieve (optional)lastIndexis a zero-based index to the last tagged data to retrieve (optional)adminPasswordis a string with the admin password (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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:
requestTypeisgetHoldingShufflingsholdingis the holding ID (optional)stageis the stage of the shuffling (See Get Constants for type definitions) (optional)includeFinishedistrueto include completed shufflings (optional)firstIndexis a zero-based index to the first tagged data to retrieve (optional)lastIndexis a zero-based index to the last tagged data to retrieve (optional)adminPasswordis a string with the admin password (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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:
requestTypeisgetShufflersaccountis account ID (optional)shufflingFullHashis shuffling full hash (optional)secretPhraseis secret phrase of the account doing the shuffling (required if adminPassword is not provided)adminPasswordis the admin password (required if secretPhrase is not provided)includeParticipantStateto 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:
requestTypeisgetShufflingshufflingis the shuffling IDincludeHoldingInfoistrueto include holding info (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ofholdingTypeto 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 (ifincludeHoldingInfoistrueand 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:
requestTypeisgetShufflingParticipantsshufflingis the shuffling IDrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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.
requestTypeisshufflingCancelshufflingis the shuffling IDshufflingStateHashis the state hash of the shufflingcancellingAccountis 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.
requestTypeisshufflingCreateholdingis the holding id (optional if holdingType is 0)holdingTypeis the holding type (See Get Constants for type definitions) (optional)amountis the amount of the holding to shuffleparticipantCountis the number of participantsregistrationPeriodis 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.
requestTypeisshufflingProcessshufflingis the shuffling IDrecipientSecretPhraseis the secret phrase of the recipient account (optional ifrecipientPublicKeyis provided)recipientPublicKeyis the public key of the recipient account (optional ifrecipientSecretPhraseis 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.
requestTypeisshufflingRegistershufflingFullHashis 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.
requestTypeisshufflingVerifyshufflingis the shuffling IDshufflingStateHashis 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:
requestTypeisstartShufflersecretPhraseis the secret phrase of the account entering the shufflingshufflingFullHashthe full hash of the shufflingrecipientSecretPhrasethe secret phrase of the recipient account (optional ifrecipientPublicKeyis present)recipientPublicKeythe public key of the recipient account (optional ifrecipientSecretPhraseis 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:
requestTypeisstopShuffleraccountis the account ID (optional ifshufflingFullHashorsecretPhraseoradminPasswordis provided)shufflingFullHashthe full hash of the shuffling (optional ifaccountoradminPassword is provided)secretPhraseis the secret phrase of the account entering the shuffling (optional ifadminPasswordis provided)adminPasswordis the admin password (optional ifsecretPhraseis provided)
Response
stoppedShuffler(B) means the specified shuffler was stoppedstoppedAllShufflers(B) means all shufflers on the node was stopped (only ifadminPasswordis provided in request)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Stop Shuffler example.