5️⃣Withdraw

To perform an unstaking operation, you would need to mint withdraw inscriptions that represent the removal of staked tokens from the staking pool. Similar to the staking process, the withdraw inscriptions are associated with the pool ID (PI) that identifies the specific staking pool. It is important to note that for an unstaking operation, the user should have a sufficient staked balance in the specified staking pool. If the unstaked balance exceeds the available staked balance, the system will automatically unstake the maximum amount that was originally staked on behalf of the user.

{
  "P": "brc20-staking",
  "op": "withdraw",
  "pn": "brst-aot",
  "pi": "",
  "amt": "100",
}
Key
Required
Description

p

yes

Protocol: brc20-staking

op

yes

Operation: withdraw event, specify type of event

pn

yes

Pool Name: staking pool name

pi

yes

Pool Identifier: the inscription number of the staking pool deployment

amt

yes

Amount: user withdraw amount

circle-info

💡 If a user mints a new transfer inscription for their staking token and the minted transfer amount exceeds the available balance, a portion of the staked balance will be converted into transferable balance. This conversion occurs as a result of the user performing an unstaking operation.

Last updated