Browse Source

docs: fixes based on feedback, more delegation info

feat/new-clarity-onboarding
Alexander Graebe 4 years ago
committed by Alexander Graebe
parent
commit
3b3e62ae98
  1. 12
      src/pages/understand-stacks/integrate-stacking-delegation.md
  2. 6
      src/pages/understand-stacks/stacking.md
  3. 2
      src/pages/understand-stacks/technical-specs.md

12
src/pages/understand-stacks/integrate-stacking-delegation.md

@ -45,7 +45,7 @@ curl -XPOST "https://stacks-node-api.testnet.stacks.co/extended/v1/faucets/stx?a
## Step 1: Integrate libraries ## Step 1: Integrate libraries
Install the stacking, network, transactions libraries and bn.js for large number handling: Install the stacking, network, transactions libraries, and bn.js for large number handling:
```shell ```shell
npm install --save @stacks/stacking @stacks/network @stacks/transactions bn.js npm install --save @stacks/stacking @stacks/network @stacks/transactions bn.js
@ -55,7 +55,7 @@ npm install --save @stacks/stacking @stacks/network @stacks/transactions bn.js
## Step 2: Delegate STX tokens ## Step 2: Delegate STX tokens
To get started, delegate STX tokens as an account holder: To get started, delegate STX tokens as an account holder.
```js ```js
import { getNonce } from '@stacks/transactions'; import { getNonce } from '@stacks/transactions';
@ -130,7 +130,7 @@ const delegatorClient = new StackingClient(delegatorAddress, network);
const delegetateStackResponses = await delegatorClient.delegateStackStx({ const delegetateStackResponses = await delegatorClient.delegateStackStx({
stacker: address, stacker: address,
amountMicroStx, amountMicroStx,
poxAddress: delegatePoxAddress, // if set in step 2, this needs to match `poxAddress` poxAddress: delegatePoxAddress, // if set by the user, this needs to match what was set earlier
burnBlockHeight, burnBlockHeight,
cycles, cycles,
privateKey: delegatorPrivateKey, privateKey: delegatorPrivateKey,
@ -143,7 +143,11 @@ const delegetateStackResponses = await delegatorClient.delegateStackStx({
``` ```
This function calls the [`delegator-stack-stx`](/references/stacking-contract#delegate-stack-stx) method of the Stacking contract to lock up the STX token from the account holder. This function calls the [`delegator-stack-stx`](/references/stacking-contract#delegate-stack-stx) method of the Stacking contract to lock up the STX token from the account holder.
This method must be called until the delegator locked up enough STX tokens required to participate in Stacking. The delegator must call this method multiple times (for all stackers), until enough tokens are locked up to participate in Stacking.
-> Reward slots are assigned based on number of STX tokens locked up for a specific Bitcoin reward address
If users set their own Bitcoin reward address, the delegator has to stack tokens with that address. This would prompt reward payouts directly to the user. However, in this case, a single user will only qualify for a reward slot if the minimum Stacking threshold for the set Bitcoin reward address is reached (~70k STX at the time of writing). If the threshold is not reached, multiple users can set the same Bitcoin reward address to accumulate enough STX tokens to reach the minimum.
## Step 4: Commit to Stacking ## Step 4: Commit to Stacking

6
src/pages/understand-stacks/stacking.md

@ -22,8 +22,8 @@ The Stacking mechanism can be presented as a flow of actions:
1. Make API calls to get details about the upcoming reward cycle 1. Make API calls to get details about the upcoming reward cycle
2. For a specific Stacks account, confirm eligibility 2. For a specific Stacks account, confirm eligibility
3. Confirm the BTC reward address and the lockup duration 3. Confirm the BTC reward address and the lockup duration
4. The transaction is broadcasted and the Stacks (STX) tokens will be locked-up 4. The transaction is broadcasted and the Stacks (STX) tokens will be locked-up. This needs to happen before the prepare phase of the next reward cycle (last 100 bitcoin blocks of the ongoing reward phase)
5. The Stacking mechanism executes reward cycles. With each mined block, it sends out rewards to 2 BTC reward addresses. With 1000 blocks in each cycle, that's 2000 rewards per cycle. 5. The Stacking mechanism executes reward cycles and sends out rewards to the set BTC reward address
6. During the lockup period, details about unlocking timing, rewards and more can be obtained 6. During the lockup period, details about unlocking timing, rewards and more can be obtained
7. Once the lockup period is passed, the tokens are released and accessible again 7. Once the lockup period is passed, the tokens are released and accessible again
8. Display reward history, including details like earnings for previous reward cycles 8. Display reward history, including details like earnings for previous reward cycles
@ -77,7 +77,7 @@ Miners have to run a software (mining client, aka "miner") on their machines to
Stacks (STX) token holders do not automatically receive Stacking rewards. Instead, they must: Stacks (STX) token holders do not automatically receive Stacking rewards. Instead, they must:
- Commit to participation before a reward cycle begins - Commit to participation before a reward cycle begins
- Hold ~94,000 Stacks (STX) tokens (at the moment of writing; increases over time) - At the time of writing: Hold ~70,000 Stacks (STX) tokens - or pool with others to reach the minimum
- Lock up Stacks (STX) tokens for a specified period - Lock up Stacks (STX) tokens for a specified period
- Set a Bitcoin address to receive rewards - Set a Bitcoin address to receive rewards

2
src/pages/understand-stacks/technical-specs.md

@ -33,7 +33,7 @@ description: Summary of technical specifications of Stacks 2.0
## Stacking ## Stacking
- Stacking works in 2 phases - Stacking works in 2 phases
1. Prepare phase: In this phase an "anchor block" is chosen. The qualifying set of addresses ("reward set") is determined based on the snapshot of the chain at the anchor block. Length of prepare phase is 100 blocks. 1. Prepare phase: In this phase an "anchor block" is chosen. The qualifying set of addresses ("reward set") is determined based on the snapshot of the chain at the anchor block. Length of prepare phase is 100 blocks. Stacking commitments need to be confirmed before this phase starts
2. Reward phase: In this phase miner BTC commitments are distributed amongst the reward set. Reward cycle length is 2000 BTC blocks (~2 weeks). 2. Reward phase: In this phase miner BTC commitments are distributed amongst the reward set. Reward cycle length is 2000 BTC blocks (~2 weeks).
- Two reward addresses / block, for a total of 4000 addresses every reward cycle. The addresses are chosen using a VRF (verifiable random function), so each node can deterministically arrive at the same reward addresses for a given block. - Two reward addresses / block, for a total of 4000 addresses every reward cycle. The addresses are chosen using a VRF (verifiable random function), so each node can deterministically arrive at the same reward addresses for a given block.
- Stacking threshold: 0.025% of the participating amount of STX when participation is between 25% and 100% and when participation is below 25%, the threshold level is always 0.00625 of the liquid supply of STX. - Stacking threshold: 0.025% of the participating amount of STX when participation is between 25% and 100% and when participation is below 25%, the threshold level is always 0.00625 of the liquid supply of STX.

Loading…
Cancel
Save