supdoggie
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# SNIP 24.1: Blanket Permits This specification introduces a backwards-compatible extension to [SNIP-24](./SNIP-24.md) that adds "blanket" permits, which allow the permit holder to use them with any compatible token. The idea is that a user signs a single message to grant an application permission to query all current and future SNIP tokens. ## Data Structures The revised `PermitMsg` schema is defined as: ```ts export type PermitMsg = { type: 'query_permit'; value: { permit_name: string; allowed_tokens: `secret1${string}`[] | ['ANY_TOKEN']; permissions: ( | 'balance' // ability to query balance | 'history' // ability to query histories | 'allowance' // ability to query allowances | 'owner' // ability to query everything | string // custom permissions defined by contract )[]; created?: Iso8601UtcDateTime; // {YYYY}-{MM}-{DD}T{hh}:{mm}:{ss}.{uuu}Z expires?: Iso8601UtcDateTime; }; }; ``` The changes to the schema are summarized as: - Ability to specify `"ANY_TOKEN"` as the single item in the `allowed_tokens` list - Ability to specify a datetime at `created` for when this message was signed - Ability to specify a datetime at `expires` for when this permit shall no longer be valid ### Mandatory `created` Permits using the `"ANY_TOKEN"` keyword MUST include a value for `created`. For all other cases, the `created` and `expires` fields are encouraged but optional. ## Messages ### RevokeAllPermits Revokes all permits. Client can supply a datetime for `created_after`, `created_before`, both, or neither. - `created_before` -- makes it so any permits using a `created` value less than this datetime will be rejected - `created_after` -- makes it so any permits using a `created` value greater than this datetime will be rejected - **both** `created_before` and `created_after` -- makes it so any permits using a `created` value **between** these two datetimes will be rejected - _neither_ -- makes it so **ANY** permit will be rejected. in this case, the contract MUST return a revocation ID of `"REVOKED_ALL"`. this action is idempotent <!-- If the client specifies exactly one of `created_before` or `created_after` and a previous revocation of that type exists, one of the following two things will happen: 1. the new revocation is temporally closed by the existing one, in which case it is ignored. e.g., `new_revocation.created_before <= old_revocation.created_before` 2. the old revocation is temporally closed by the new one, in which case the exiting one is deleted and replaced by the new one. e.g., `new_revocation.created_before >= old_revocation.created_before` > NOTE: The above rule means that order of operations matters. If the client wants --> ##### Limitations Contract implementors MAY enforce an upper bound on the number of revocations an account is allowed to make. If an attempt is made to exceed this limit, the contract MUST throw an error. #### Request ```ts export type RevokeAllPermitsExecutionRequest = { revoke_all_permits: { interval?: { // both specified in seconds since unix epoch created_before?: Uint64Str; created_after?: Uint64Str; }; }; } ``` #### Response ```ts export type RevokeAllPermitsExecutionResponse = { revoke_all_permits: { status: "success"; revocation_id?: string; // if a new revocation was created }; }; ``` ### DeletePermitRevocation Deletes a previously issued permit revocation. #### Request ```ts export type DeletePermitRevocationExecutionRequest = { delete_permit_revocation: { revocation_id: string; }; }; ``` #### Response ```ts export type DeletePermitRevocationExecutionResponse = { delete_permit_revocation: { status: "success"; }; }; ``` ## Queries ### ListPermitRevocations Enumerates permit revocations that have been previously made. #### Request ```ts export type ListPermitRevocationsQueryRequest = { list_permit_revocations: { page_size?: number; page?: number; }; }; ``` #### Response ```ts export type ListPermitRevocationsQueryResponse = { list_permit_revocations: { revocations: Array<{ revocation_id: string; interval: { // both specified in seconds since unix epoch created_before?: Uint64Str; created_after?: Uint64Str; }; }>; }; }; ``` ## Using Query Permits The contract shall enforce the following additional rules when verifying query permits: - If `created` is specified: - assert that it is in the past - check if any revocations apply to that datetime and if so, deny the query - If `expires` is specified: - assert that it is in the future - If the `allowed_tokens` list includes an item `"ANY_TOKEN"`: - assert the list has an exact length of `1` - assert that `created` is specified <!-- ```ts type Iso8601Utc = `${YYYY}-${MM}-${DD}T${HH}:${NN}:${SS}.${UUU}Z`; type YYYY = Digits_x4; type MM = Digits_x2; type DD = Digits_x2; type HH = Digits_x2; type NN = Digits_x2; type SS = Digits_x2; type UUU = Digits_x3; type Digits_x4 = `${Digit}${Digit}${Digit}${Digit}`; type Digits_x3 = `${Digit}${Digit}${Digit}`; type Digits_x2 = `${Digit}${Digit}`; type Digit = `${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |9}`; ``` -->

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully