Adam Burdett
    • 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
    • Invite by email
      Invitee

      This note has no invitees

    • 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
    • Note Insights
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
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
  • Invite by email
    Invitee

    This note has no invitees

  • 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
    DIDs ==== did_doc [example](https://w3c-ccg.github.io/did-spec/#example-19-advanced-did-document-example) ``` { "@context": "https://w3id.org/future-method/v1", "id": "did:example:123456789abcdefghi", "publicKey": [{ "id": "did:example:123456789abcdefghi#keys-1", "type": "RsaVerificationKey2018", "controller": "did:example:123456789abcdefghi", "publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n" }, { "id": "did:example:123456789abcdefghi#keys-3", "type": "Ieee2410VerificationKey2018", "controller": "did:example:123456789abcdefghi", "publicKeyPem": "-----BEGIN PUBLIC KEY...END PUBLIC KEY-----\r\n" }], "authentication": [ // this mechanism can be used to authenticate as did:...fghi "did:example:123456789abcdefghi#keys-1", // this mechanism can be used to biometrically authenticate as did:...fghi "did:example:123456789abcdefghi#keys-3", // this mechanism is *only* authorized for authentication, it may not // be used for any other proof purpose, so its full description is // embedded here rather than using only a reference { "id": "did:example:123456789abcdefghi#keys-2", "type": "Ed25519VerificationKey2018", "controller": "did:example:123456789abcdefghi", "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV" } ], "service": [{ "id": "did:example:123456789abcdefghi#oidc", "type": "OpenIdConnectVersion1.0Service", "serviceEndpoint": "https://openid.example.com/" }, { "id": "did:example:123456789abcdefghi#vcStore", "type": "CredentialRepositoryService", "serviceEndpoint": "https://repository.example.com/service/8377464" }, { "id": "did:example:123456789abcdefghi#xdi", "type": "XdiService", "serviceEndpoint": "https://xdi.example.com/8377464" }, { "id": "did:example:123456789abcdefghi#hub", "type": "HubService", "serviceEndpoint": "https://hub.example.com/.identity/did:example:0123456789abcdef/" }, { "id": "did:example:123456789abcdefghi#messaging", "type": "MessagingService", "serviceEndpoint": "https://example.com/messages/8377464" }, { "type": "SocialWebInboxService", "id": "did:example:123456789abcdefghi#inbox", "serviceEndpoint": "https://social.example.com/83hfh37dj", "description": "My public social inbox", "spamCost": { "amount": "0.50", "currency": "USD" } }, { "type": "DidAuthPushModeVersion1", "id": "did:example:123456789abcdefghi#push", "serviceEndpoint": "http://auth.example.com/did:example:123456789abcdefghi" }, { "id": "did:example:123456789abcdefghi#bops", "type": "BopsService", "serviceEndpoint": "https://bops.example.com/enterprise/" }] "proof": { "type": "LinkedDataSignature2015", "created": "2016-02-08T16:02:20Z", "creator": "did:example:8uQhQMGzWxR8vw5P3UWH1ja#keys-1", "signatureValue": "QNB13Y7Q9...1tzjn4w==" } } ``` ## Mapping of libindy did methods to Aries SDK methods. |libindy |Aries_SDK |Dependencies | |------------------------------|----------------------|------------------------| |`indy_create_and_store_my_did`|`did_create` |`_did_create` | | | |`wallet` | | | |`[indyre._nym_resolve]` | | | |`[indyre._nym_create]` | ||| |`indy_replace_keys_start` |`did_add_keys` |`dev._key_create` | | | |`did_update` | | | |`wallet` | | | |`[indyre._nym_update]` | ||| |`indy_replace_keys_apply` |`did_remove_keys` |`did_update` | | | |`wallet` | | | |`[indyre._nym_update]` | ||| |`indy_store_their_did` |`did_store` |`wallet` | | | |`[indyre._nym_resolve]` | ||| |`indy_key_for_did` |`did_key_get` |`wallet(check cache)` | | | |`indyre._nyms_resolve` | ||| |`None` |`did_inactivate` |`indyre._nym_inactivate`| | | |`wallet` | ||| |`None` |`did_rotate_key` |`_key_create` | | | |`wallet` | | | |`[indyre._nym_update]` | ||| |`indy_key_for_local_did` |`did_key_get` |`_dids_read` | | | |`wallet` | ||| |`indy_set_endpoint_for_did` |`did_endpoint_set` |`did_update` | | | |`wallet` | | | |`[indyre._nym_update]` | ||| |`indy_get_endpoint_for_did` |`did_endpoint ` |`dids_read` | | | |`wallet` | ||| |`indy_set_did_metadata` |`did_metadata_set` |`did_update` | | | |`wallet` | | | |`[indyre._nym_update]` | ||| |`indy_get_did_metadata` |`did_metadata_get` |`dids_read` | | | |`wallet` | ||| |`indy_get_my_did_with_meta` |`my_did_metadata_get` |`dids_read` | | | |`wallet` | ||| |`indy_list_my_dids_with_meta` |`my_did_metadata_list`|`dids_read` | | | |`wallet` | ||| |`None` |`did_delete` |`wallet` | ||| |`indy_abbreviate_verkey` |`abbreviate_verkey` |`_abbreviate_verkey` | ||| |`None` |`key_did_get` |`wallet` | [Optional] _internal_method ## Aries SDK, consumer did methods ### Deprecated , maps old API to did doc ```c ~~did_metadata_set()~~ // does not map to did doc did_metadata_get() // metadata my_did_metadata_get() // metadata + verkey my_did_metadata_list() // all did + metadata + verkey ~~did_endpoint_set~~ // does not map to did doc did_endpoint_get() ``` ### DID doc ```c int32_t aries_did_create(int32_t wallet_handle, const char* const did_options_json, const char* did, const char* vk, const struct ExternError* err); int32_t aries_did_store(int32_t wallet_handle, const char* const did_json, const struct ExternError* err); int32_t aries_did_update(int32_t wallet_handle, const char* const did_update_json, const struct ExternError* err); int32_t aries_did_delete(int32_t wallet_handle, const char* const did, const struct ExternError* err); // Originally wanted to combine ledger reads and wallet reads into one // method. This is unreasoable since we need to have both wallet and ledger // info passed in when only one of the two will be used. Splitting it up. int32_t aries_did_read(int32_t wallet_handle, const char* const did, const char* did_doc, const struct ExternError* err); /** * Resolve a DID Doc from a ledger. */ int32_t aries_did_resolve(int32_t resolver_handle, const char* const did, const char* did_doc, const struct ExternError* err); int32_t aries_did_commit(int32_t wallet_handle, int32_t resolver_handle, const char* const did, const char* did_doc, const struct ExternError* err); // not mutable //did_context_set() // Don't think this makes sense to include. It is always the same. //int32_t did_context_get() int32_t aries_did_authentication_add(int32_t wallet_handle, const char* const did, const char* const authentication, const struct ExternError* err) int32_t aries_did_authentication_get(int32_t wallet_handle, const char* const did, const struct ExternError* err) int32_t aries_did_authentication_remove(int32_t wallet_handle, const char* const did, const char* const authentication, const struct ExternError* err) int32_t aries_did_authentication_list(int32_t wallet_handle, const struct ExternError* err) int32_t aries_did_key_add(int32_t wallet_handle, const char* const did, const char* const key, const struct ExternError* err) int32_t aries_did_key_get(int32_t wallet_handle, const char* const did, const struct ExternError* err) int32_t aries_did_key_remove(int32_t wallet_handle, const char* const did, const char* const key, const struct ExternError* err) int32_t aries_did_key_list(int32_t wallet_handle, const struct ExternError* err) int32_t aries_did_service_add(int32_t wallet_handle, const char* const did, const char* const service, const struct ExternError* err) int32_t aries_did_service_get(int32_t wallet_handle, const struct ExternError* err) int32_t aries_did_service_remove(int32_t wallet_handle, const char* const service, const struct ExternError* err) int32_t aries_did_service_list(int32_t wallet_handle, const struct ExternError* err) int32_t aries_abbreviate_verkey(const char* const verkey, const struct ExternError* err) ``` ### Example of Aries SDK Usage ```python from aries import did, key, wallet, resolver # Separate "key" api? wallet_config = { #... } # Note the abscence of async. Maybe we include a python wrapper # that does make the calls async. wallet_handle = wallet.create(wallet_config) # Leaving the wallet selection up to the wrapper/framework/app makes sense. # They can decided how they want to handle multiple open wallets. # Create a "public" DID sov_did, sov_vk = did.create( wallet_handle, {'method': 'sov', 'seed': '...'}, { 'service': [{}, {}], #imagine proper service blocks 'authentication': [{}], 'key': [] # If empty or omitted, only sov_vk is included in publicKey list of DIDDoc } ) # Optionally update DIDDoc elements with update after creation: did.update( # Overwrites? What happens to sov_key? wallet_handle, sov_did, { 'service': [{}, {}], #imagine proper service blocks 'authentication': [{}], 'key': [] # If empty or omitted, only sov_vk is included in publicKey list of DIDDoc } ) # Create and add another key another_key = key.create(wallet_handle, {'type': sov_vk['type']}) did.key_add(wallet_handle, sov_did, another_key) # Open and commit to ledger resolver_handle = resolver.open({'method': 'sov'}) did.commit(wallet_handle, resolver_handle, sov_did) # Read DIDDoc info out of the wallet? Or pass it in? resolver.close(resolver_handle) wallet.close(wallet_handle) ``` ## Aries dev, wallet internal did resource methods // need better names specific to wallet interface did_create(args,result,error) did_update(args,error) did_read({return_fields:[],selection_criteria:'did=123'},result,error) did_delete(args,error) ## Indy resolver, ledger nym resource methods _nym_create(args, result, error) _nym_resolve() _nym_update(args, result, error) _nym_inactivate(args, Result, Error) ## Aries, did constructors _did_create(args,result,error) _key_create() _linked_key_create(DidArgs, Result, Error) ???_abbreviate_verkey(args,result,error) ???_did_parse(DidArgs, Result, Error) ## Aries dev Inputs - the resource methods are designed to provide a complete CRUD interface to the wallet. - creation of new objects in the wallet takes three arguments, args, result and error. - args is a struct with all needed parameters to create the new object to be inserted into the wallet. - result is a pointer to where the results will be written - error is a pointer to where any errors will be written - update and delete takes two arguments, args and error. - args is a struct that contains all information needed to update the object in the wallet - error is a pointer to where any errors will be written - read takes three arguments, args, result and error. - args is a struct that contains all information needed to update the object in the wallet - the method type can be thought of as a table in the wallet db. - return_fields is a list of fields to be returned - selection_criteria is the constraints to be applied on what will be returned. - result is a pointer to where the results will be written - error is a pointer to where any errors will be written - security of the wallet is yet to be solved. ## Questions - should dids have a meta data or is all data in docs. - Should aries did create take a "doc" as an argument for easy cloning of # Rich Schema ## Indy resolver, ledger schema resource methods ## Aries Anon_cred consumer SDK ```c extern int32_t aries_schema_validate(const char* const schema, const struct ExternError* err); extern int32_t aries_schema_commit(int32_t wallet_handle, const char* const did, const char* schema_json, const struct ExternError* err); extern int32_t aries_context_validate(const char* const context, const struct ExternError* err); extern int32_t aries_context_commit(int32_t wallet_handle, const char* const did, const char* context_json, const struct ExternError* err); extern int32_t aries_mapping_validate(const char* const mapping, const struct ExternError* err); extern int32_t aries_mapping_commit(int32_t wallet_handle, const char* const did, const char* mapping_json, const struct ExternError* err); extern int32_t aries_encoding_validate(const char* const encoding, const struct ExternError* err); /* Encodings: * UTF-8_SHA-256 * DateRFC3339_SecondsSince1970 * DateRFC3339_DaysSince1900 * HeightISO18013_HeightInInches * Double_BigDecimal * 32Integer_256Integer */ extern int32_t aries_encode_attribute(const char* const encoding, const char* const attribute, const char* encoded_attribute, const struct ExternError* err); extern int32_t aries_pres_def_validate(const char* const pres_def, const struct ExternError* err); extern int32_t aries_pres_def_commit(int32_t wallet_handle, const char* const did, const char* pres_def_json, const struct ExternError* err); extern int32_t aries_cred_def_create(int32_t wallet_handle, const char* const cred_def_options_json,// mapping_id, schema_id, context_id, const char* const did, const char* cred_def, const struct ExternError* err); extern int32_t aries_cred_def_commit(int32_t wallet_handle, const char* const did, const char* cred_def_json, const struct ExternError* err); ```

    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