Skip to content

Commit

Permalink
Merge branch 'main' into alexlmiller-docathan-platformfaq
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwaits committed Oct 25, 2023
2 parents 8cfaec9 + 9b04b38 commit 8db1ad0
Show file tree
Hide file tree
Showing 34 changed files with 903 additions and 1,963 deletions.
2 changes: 1 addition & 1 deletion .github/mlc_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
"timeout": "10s",
"retryOn429": true,
"retryCount": 5,
"aliveStatusCodes": [200, 206, 406]
"aliveStatusCodes": [200, 206, 406, 400]
}
8 changes: 4 additions & 4 deletions .github/workflows/stylecheck-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ on:
pull_request:
branches: [main]
paths:
- "**.md"
- '**.md'

jobs:
stylecheck:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: get changed Files
id: get_changed_files
uses: lots0logs/gh-action-get-changed-files@2.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: run vale
uses: errata-ai/vale-action@master
uses: errata-ai/vale-action@reviewdog
with:
files: "${{ steps.get_changed_files.outputs.all }}"
files: '${{ steps.get_changed_files.outputs.all }}'
onlyAnnotateModifiedLines: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 2 additions & 4 deletions docs/build-apps/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ This guide explains how to authenticate users with the [`connect`](https://githu

Authentication provides a way for users to identify themselves to an app while retaining complete control over their credentials and personal details. It can be integrated alone or used in conjunction with [transaction signing](/build-apps/transaction-signing) and [data storage](/build-apps/data-storage), for which it is a prerequisite.

Users who register for your app can subsequently authenticate to any other app with support for the [Blockchain Naming System](https://docs.stacks.co/build-apps/references/bns) and vice versa.

See the [To-dos example app](/example-apps/to-dos) for a concrete example of this feature in practice.
Users who register for your app can subsequently authenticate to any other app with support for the [Bitcoin Naming System](https://docs.stacks.co/build-apps/references/bns) and vice versa.

## How it works

The authentication flow with Stacks is similar to the typical client-server flow used by centralized sign in services (for example, OAuth). However, with Stacks the authentication flow happens entirely client-side.

An app and authenticator, such as [the Stacks Wallet](https://www.hiro.so/wallet/install-web), communicate during the authentication flow by passing back and forth two tokens. The requesting app sends the authenticator an `authRequest` token. Once a user approves authentication, the authenticator responds to the app with an `authResponse` token.
An app and authenticator, such as [the Leather Wallet](https://leather.io/install-extension), communicate during the authentication flow by passing back and forth two tokens. The requesting app sends the authenticator an `authRequest` token. Once a user approves authentication, the authenticator responds to the app with an `authResponse` token.

These tokens are based on [a JSON Web Token (JWT) standard](https://tools.ietf.org/html/rfc7519) with additional support for the `secp256k1` curve used by Bitcoin and many other cryptocurrencies. They are passed via URL query strings.

Expand Down
4 changes: 2 additions & 2 deletions docs/build-apps/data-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ See the authentication guide before proceeding to integrate the following data s

Gaia serves as a key-value store in which data is saved and retrieved as files to and from Gaia hubs owned by, or managed for, users.

The default Gaia hub for users who authenticate to apps with [the Stacks Wallet](https://www.hiro.so/wallet/install-web) is run by Hiro PBC at `https://gaia.blockstack.org/`. It supports files up to 25 megabytes in size.
The default Gaia hub for users who authenticate to apps with [the Leather Wallet](https://leather.io/install-extension) is run by Hiro PBC at `https://gaia.blockstack.org/`. It supports files up to 25 megabytes in size.

:::tip

Expand Down Expand Up @@ -115,7 +115,7 @@ Encrypted files need `decrypt` set to `true` so the app knows to decrypt the dat

## Get data for other user

Apps can also retrieve public data saved by users other than the one with the active session, granted those users have registered usernames via the [Blockchain Naming System](https://docs.stacks.co/build-apps/references/bns).
Apps can also retrieve public data saved by users other than the one with the active session, granted those users have registered usernames via the [Bitcoin Naming System](https://docs.stacks.co/build-apps/references/bns).

Simply indicate the username of such a user in the `options` object:

Expand Down
8 changes: 4 additions & 4 deletions docs/build-apps/integrate-stacking-delegation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ In this guide, you'll learn how to integrate the Stacking delegation flow by int
This guide highlights the following capabilities:

- As an account holder: delegate STX tokens
- As a delegator: Stack STX token on behalf of the account holder
- As a delegator: Commit to Stacking with all delegated STX tokens
- As a delegator: stack STX token on behalf of the account holder
- As a delegator: commit to Stacking with all delegated STX tokens

## Prerequisites

Expand Down Expand Up @@ -102,7 +102,7 @@ This method calls the [`delegate-stx`](https://docs.stacks.co/references/stackin

:::tip

To avoid handling private keys, it is recommended to use the [Stacks Wallet](https://www.hiro.so/wallet) to sign the delegation transaction
To avoid handling private keys, we recommend using [Leather](https://leather.io/install-extension) to sign the delegation transaction

:::

Expand All @@ -126,7 +126,7 @@ This method calls the [`revoke-delegate-stx`](https://docs.stacks.co/references/

:::tip

To avoid handling private keys, it is recommended to use the [Stacks Wallet](https://www.hiro.so/wallet) to sign the revoke transaction
To avoid handling private keys, we recommend using [Leather](https://leather.io/install-extension) to sign the revoke transaction

:::

Expand Down
12 changes: 6 additions & 6 deletions docs/build-apps/message-signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import StacksjsStartersNote from '../stacks.js/includes/\_stacks.js-starters-not

This guide explains how to prompt users to sign a message.

The user will be prompted a popup from the Hiro Wallet showing the message you would like them to sign.
The user will be prompted a popup from the Leather Wallet showing the message you would like them to sign.

The user can then click on the ‘Sign’ button which will return the signature data and the user's publicKey to your app. You can then verify the signature by passing the signature data and the public key to the [`stacks.js`](https://github.com/hirosystems/stacks.js) `verifySignature` method.

Expand All @@ -21,7 +21,7 @@ Internally the string will be hashed using `sha256` and signed with `secp256k1`

:::tip

In order to utilize the latest transaction signing with the Hiro Wallet, use a version >= 6.6.0 of the `@stacks/connect` NPM package.
In order to utilize the latest transaction signing with the Leather Wallet, use a version >= 6.6.0 of the `@stacks/connect` NPM package.

:::

Expand All @@ -33,7 +33,7 @@ npm install @stacks/connect

## Initiate session

Users must authenticate to an app before you request message signing. Users can install an authenticator like [the Hiro Wallet](https://www.hiro.so/wallet/install-web).
Users must authenticate to an app before you request message signing. Users can install an authenticator like [the Leather Wallet](https://leather.io/install-extension).

See the [authentication guide](https://docs.hiro.so/build-apps/authentication) before proceeding to integrate the following message signing capabilities.

Expand Down Expand Up @@ -169,7 +169,7 @@ const MyComponent = () => {

## Signature request / response payload

Under the hood, `@stacks/connect` will serialize and deserialize data between your app and the Hiro Wallet.
Under the hood, `@stacks/connect` will serialize and deserialize data between your app and the Leather Wallet.

These payloads are tokens that conform to the [JSON Web Token (JWT) standard](https://tools.ietf.org/html/rfc7519) with additional support for the `secp256k1` curve used by Bitcoin and many other cryptocurrencies.

Expand Down Expand Up @@ -208,9 +208,9 @@ interface SignatureData {

## StacksProvider injected variable

When users have the [Hiro Wallet](https://www.hiro.so/wallet/install-web) extension installed, the extension will inject a global `StacksProvider` variable into the JavaScript context of your web app. This allows your JavaScript code to hook into the extension, and make authentication, transaction and signature requests. `@stacks/connect` automatically detects and uses this global variable for you.
When users have the [Leather Wallet](https://leather.io/install-extension) extension installed, the extension will inject a global `StacksProvider` variable into the JavaScript context of your web app. This allows your JavaScript code to hook into the extension, and make authentication, transaction and signature requests. `@stacks/connect` automatically detects and uses this global variable for you.

At the moment, only the Hiro Wallet extension includes a `StacksProvider`, however, ideally more wallets (and mobile wallets) will support this format, so that your app can be compatible with any Stacks wallet that has functionality to embed web applications.
At the moment, only the Leather Wallet extension includes a `StacksProvider`, however, ideally more wallets (and mobile wallets) will support this format, so that your app can be compatible with any Stacks wallet that has functionality to embed web applications.

In your web application, you can check to see if the user has a compatible wallet installed by checking for the presence of `window.StacksProvider`.

Expand Down
4 changes: 2 additions & 2 deletions docs/build-apps/transaction-signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ npm install @stacks/connect

## Initiate session

Users must authenticate to an app before the `connect` package will work to prompt them for signing and broadcasting transactions to the Stacks blockchain with an authenticator such as [the Stacks Wallet](https://www.hiro.so/wallet/install-web).
Users must authenticate to an app before the `connect` package will work to prompt them for signing and broadcasting transactions to the Stacks blockchain with an authenticator such as [the Leather Wallet](https://leather.io/install-extension).

See the authentication guide before proceeding to integrate the following transaction signing capabilities in cases where `userSession.isUserSignedIn()` returns `true`.

Expand Down Expand Up @@ -416,7 +416,7 @@ interface TransactionResponse {

## StacksProvider injected variable

When users have the [Stacks Wallet for Web](https://www.hiro.so/wallet/install-web) browser extension installed, the extension will inject a global `StacksProvider` variable into the JavaScript context of your web app. This allows your JavaScript code to hook into the extension, and make authentication and transaction requests. `@stacks/connect` automatically detects and uses this global variable for you.
When users have the [Leather wallet](https://leather.io/install-extension) browser extension installed, the extension will inject a global `StacksProvider` variable into the JavaScript context of your web app. This allows your JavaScript code to hook into the extension, and make authentication and transaction requests. `@stacks/connect` automatically detects and uses this global variable for you.

At the moment, only the Stacks Wallet for Web browser extension includes a `StacksProvider`, however, ideally more wallets (and mobile wallets) support this format, so that your app can be compatible with any Stacks Wallet that has functionality to embed web applications.

Expand Down
1 change: 0 additions & 1 deletion docs/example-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ The example apps provided in this section demonstrate key features of the Stacks

You can use the example apps provided here as a basis for your own Stacks application or just as a reference for how to implement specific features.

- [To-dos](/example-apps/to-dos): A to-do list app that demonstrates authentication with the web wallet and storing data off-chain with Gaia.
- [Billboard](/example-apps/billboard): An app that stores a simple message on the blockchain and allows you to view it. Demonstrates the DevNet local development environment of [Clarinet](https://github.com/hirosystems/clarinet).
- [Heystack](/example-apps/heystack): A public chat app featuring a comprehensive demonstraction of the web wallet, Clarity smart contracts, and the Stacks API.
6 changes: 3 additions & 3 deletions docs/example-apps/billboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Billboard app

import NodeLTS from '../includes/\_node-lts-version.mdx';

This example app demonstrates the integration between a simple web app and a Clarity smart contract. Using the [DevNet](/smart-contracts/devnet), a local version of the Stacks blockchain is used as a development and integration environment for the full stack app. This app builds a frontend to the [Billboard smart contract](/tutorials/clarity-billboard), and demonstrates the use of the [Stacks API](/api) in React. The full source of the app is provided and is completely open source for you to modify. This page is a case study highlighting important code snippets and design patterns to help you develop your own Stacks app, as well as use the DevNet feature to integrate your frontend and backend without deploying to a live testnet.
This example app demonstrates the integration between a simple web app and a Clarity smart contract. Using the [DevNet](/clarinet/how-to-guides/how-to-set-up-local-development-environment), a local version of the Stacks blockchain is used as a development and integration environment for the full stack app. This app builds a frontend to the [Billboard smart contract](/tutorials/clarity-billboard), and demonstrates the use of the [Stacks API](/api) in React. The full source of the app is provided and is completely open source for you to modify. This page is a case study highlighting important code snippets and design patterns to help you develop your own Stacks app, as well as use the DevNet feature to integrate your frontend and backend without deploying to a live testnet.

This app showcases the following features of Stacks and Clarinet:

Expand Down Expand Up @@ -86,9 +86,9 @@ To avoid errors, it is recommended that you bring up the local DevNet and allow

### DevNet configuration

DevNet is a highly configurable instance of the Stacks blockchain. You can configure many of the properties of the DevNet through modifying values in the `settings/DevNet.toml` file. When you create a new project with Clarinet, this file is populated with sensible default vales for the local blockchain. If you would like to [change any of the default values](/smart-contracts/devnet#blockchain-configuration), uncomment the line containing the configuration parameter, and change the value to your intended configuration.
DevNet is a highly configurable instance of the Stacks blockchain. You can configure many of the properties of the DevNet through modifying values in the `settings/DevNet.toml` file. When you create a new project with Clarinet, this file is populated with sensible default vales for the local blockchain. If you would like to change any of the default values, uncomment the line containing the configuration parameter, and change the value to your intended configuration.

The DevNet configuration file also contains [definitions for predefined wallets](/smart-contracts/devnet#accounts-configuration) in the local chain. These wallets are pre-populated with STX tokens, and can be used for testing and integration. The configuration file provides the seed phrase and private key for each wallet as well.
The DevNet configuration file also contains definitions for predefined wallets in the local chain. These wallets are pre-populated with STX tokens, and can be used for testing and integration. The configuration file provides the seed phrase and private key for each wallet as well.

## Running the billboard frontend

Expand Down
12 changes: 6 additions & 6 deletions docs/example-apps/heystack.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ available on [Github][heystack_gh]. This page assumes some familiarity with [Rea

## Heystack overview

Heystack is a web application for chatting with other Stacks users. The application uses the [Stacks web wallet][] to
Heystack is a web application for chatting with other Stacks users. The application uses the [Leather wallet][] to
authenticate users in the frontend. When a user logs in to Heystack, they're given a genesis amount of $HEY fungible
tokens, which allows them to send and like messages on the platform.

Heystack is powered by Clarity smart contracts so each message is a transaction on the Stacks blockchain. Each time a
user sends a message on the platform, they must sign the message with the [Stacks web wallet][] (or another compatible
user sends a message on the platform, they must sign the message with the [Leather wallet][] (or another compatible
wallet) and pay a small gas fee in STX. A user spends a $HEY token to send every message, and receives a $HEY token for
every like that their messages receive.

Expand Down Expand Up @@ -217,7 +217,7 @@ Authentication is handled through the [`@stacks/connect-react`][] and [`@stacks/
compatible Stacks wallet extensions and provide methods for interacting with a user session respectively. [Jotai][]
provides application state management.

The [connect wallet button component][] implements the interface with the Stacks web wallet through the
The [connect wallet button component][] implements the interface with the Leather wallet through the
[`@stacks/connect-react`][] package.

```tsx
Expand Down Expand Up @@ -542,7 +542,7 @@ typing.

## Reading BNS names

An important feature of Stacks is the [Blockchain Naming System][] (BNS). BNS allows users to register a human-readable
An important feature of Stacks is the [Bitcoin Naming System][] (BNS). BNS allows users to register a human-readable
identity to their account, that can act as both a username and a web address.

Names registered to a user can be read from a Stacks API endpoint, as demonstrated in [`src/store/names.ts`][].
Expand Down Expand Up @@ -616,7 +616,7 @@ specific implementation details.

[heystack]: https://heystack.xyz
[stacks.js]: https://github.com/blockstack/stacks.js
[stacks web wallet]: https://www.hiro.so/wallet/install-web
[Leather wallet]: https://leather.io/install-extension
[react]: https://reactjs.org/
[heystack_gh]: https://github.com/hirosystems/heystack
[data maps]: https://docs.stacks.co/references/language-functions#define-map
Expand All @@ -635,7 +635,7 @@ specific implementation details.
[`/src/store/auth.ts`]: https://github.com/hirosystems/heystack/blob/main/src/store/auth.ts
[clarity types in javascript]: #clarity-types-in-javascript
[`@stacks/transactions`]: https://github.com/blockstack/stacks.js/tree/master/packages/transactions#constructing-clarity-values
[blockchain naming system]: https://docs.stacks.co/build-apps/references/bns
[bitcoin naming system]: https://docs.stacks.co/build-apps/references/bns
[`src/store/names.ts`]: https://github.com/hirosystems/heystack/blob/main/src/store/names.ts
[javascript types to clarity types]: #clarity-types-in-javascript
[`@stacks/blockchain-api-client`]: https://github.com/hirosystems/stacks-blockchain-api/tree/master/client
Expand Down
Loading

0 comments on commit 8db1ad0

Please sign in to comment.