Skip to content

Commit 94dd1a0

Browse files
werner-stacksgitbook-bot
authored andcommitted
GITBOOK-9: PoX page: add Coming from PoX-4 section
1 parent cbf602b commit 94dd1a0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎docs/cookbook/clarity/example-contracts/proof-of-transfer-pox.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,25 @@ There is no `delegate-stx` and no `pox-addr` argument. Where a staker's rewards
6363
* [Bitcoin Staking](https://docs.stacks.co/learn/bitcoin-staking) for the concepts.
6464
* [Stake to an Existing Signer-Manager](https://docs.stacks.co/operate/staking-stx/stack-with-a-pool) and [Ending or Changing a Bond Position](https://docs.stacks.co/operate/protocol-bonds/ending-or-changing-a-bond-position) for the flows.
6565
* [Deploy a Signer Manager Contract](https://docs.stacks.co/operate/deploy-a-signer-manager-contract) for the other side of the `signer-manager` trait.
66+
67+
## Coming from PoX-4
68+
69+
How PoX-4 calls map to PoX-5, for apps and contracts written against `.pox-4`.
70+
71+
| PoX-4 | PoX-5 |
72+
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
73+
| `stack-stx` | `stake`, to a signer-manager. Solo staking means staking to one you run. |
74+
| `delegate-stx`, `delegate-stack-stx` | `stake`, to the pool's signer-manager. There is no delegation step. |
75+
| `stack-extend`, `stack-increase`, `delegate-stack-extend`, `delegate-stack-increase` | `stake-update`, in one call. |
76+
| `revoke-delegate-stx` | `unstake`, the closest equivalent. |
77+
| `stack-aggregation-commit`, `stack-aggregation-commit-indexed`, `stack-aggregation-increase` | None. The signer-manager calls `register-signer` once. |
78+
| `set-signer-key-authorization` | `grant-signer-key`, the closest equivalent. |
79+
| `allow-contract-caller`, `disallow-contract-caller` | None. See below. |
80+
| `get-stacker-info` | `get-staker-info`, or `get-bond-membership` for a bond. |
81+
82+
**No contract-caller allowance.** PoX-4 let a contract stack for a user only after the user called `allow-contract-caller` ([pox-4.clar L587-L588](https://github.com/stacks-network/stacks-core/blob/4.0.4/stackslib/src/chainstate/stacks/boot/pox-4.clar#L587-L588)). PoX-5 has no such check. `stake`, `stake-update`, `unstake`, `register-for-bond`, `update-bond-registration` and `unstake-sbtc` act on `tx-sender`, so any contract a user calls can change that user's position. Guard those calls with [staking and PoX post-conditions](https://docs.stacks.co/post-conditions/implementation#staking-post-conditions-sip-045).
83+
84+
Two cases are stricter:
85+
86+
* `announce-l1-early-exit` must be called by the staker directly ([L1219-L1222](https://github.com/stacks-network/stacks-core/blob/4.0.4/stackslib/src/chainstate/stacks/boot/pox-5.clar#L1219-L1222)).
87+
* `claim-rewards` and `claim-staker-rewards-for-signer` act on `contract-caller`, so a signer-manager can claim only for itself ([L2392](https://github.com/stacks-network/stacks-core/blob/4.0.4/stackslib/src/chainstate/stacks/boot/pox-5.clar#L2392), [L2449](https://github.com/stacks-network/stacks-core/blob/4.0.4/stackslib/src/chainstate/stacks/boot/pox-5.clar#L2449)).

0 commit comments

Comments
 (0)