David Meister
    • 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
# Migrations RFC: v2 ###### tags: `update` `migrate` `URI` ## Context - Migrations: v1 https://hackmd.io/uuzBdsOKRRqS1m2Q4wyeCg?both - Go proto update: https://medium.com/holochain/holochain-progress-update-migrations-80ef5290fb67 ## Light touch spec - Decomplect "cleanup/setup" and "update discovery" and "agency transfer" - Keep core functionality to a minimum and encourage community driven design/governance patterns in zome/client code - Historical gets are a phase 2+ concern - Not dealing with holochain core changes yet ### Zome API functions #### Relay Attempts a relay (see below). Triggers relay validation. Commits relay system entry on successfull validation. Arguments: - `Entry::Relay` ### Validation Callbacks #### Accept THE official DNA update Validates that a DNA has been accepted per the built-in validation rules for software updates. The built-in validation rules are implemented as a callback in the zome. There can be only one. Hence THE official update. ??Watch this space for singleton CRDT flows?? Arguments: - `Entry::DNAUpdate` Example validation logic: - Signed by main developer's key - M of N signatures of dev committee - Signed decision proof from bridged "voting" app #### Validate Relay Validates that a relay can be committed pointing to _either_ the official DNA or a agent-provided relay. Returns true if all setup/cleanup (e.g. accounts are tallied and closed) is valid and so the relay can be finalised. Relay can be incoming or outgoing. zome validation must cover both. Arguments: - `Entry::Relay` - `Entry::DNAUpdate` - Local source chain Example validation logic: - Accounting is opened/closed correctly - One relay per chain - Official updates only ### Data structures #### Official DNA Update System entry variant `Entry::DNAUpdate`. Represents a signed official update. Various governance models can be implemented with the validation callback (above). As the official DNA update is a system entry we should implement network behaviour that treats the DNAUpdate as 100% replicated. (not MVP tho) Everyone needs the data eventually, might as well push it to them! Even though `Entry::DNAUpdate` is a system entry variant, it DOES have a callback for validation (i.e. exposing system entry to the conscious, see above). ```rust type Proofs = Signatures type DNAAddress = Address enum Entry { // ... everything else .. DNAUpdate(Proofs, DNAAddress) } ``` #### Relay System entry variant `Entry::Relay`. ```rust enum RelayDirection { Incoming, Outgoing, } struct DNAAddress(Address) enum Entry { // ... everything else here ... Relay (DNAAddress, RelayDirection), } ``` This is missing all the extra data like value, sources, etc. from previous iterations because (as above) "account close" style entries should be app entries + app validation logic. A relay is only valid if all cleanup/setup tasks are already complete and committed successfully to the local chain. Even though `Entry::Relay` is a system entry variant, it DOES have a callback for validation (i.e. exposing system entry to the conscious, see above). #### Conventions: **Closing sequence:** 1. closing entry (summary of state when applicable) 2. capabilities token for app bridging 3. relay entry **Opening sequence:** 1. relay entry 2. capabilities token for app bridging 3. opening entry (summary of transferred state which must match closing entry) ### Broad comments re: previous/updated thinking: - Branching histories are probably too far future to build towards now - WASM performance/resourcing is just too heavy RN to support many parallel zomes for full historical GETs - Can always be simulated client side if needed - Don't have clear use-cases from real world usage to use for planning - Merging histories are definitely in the too hard basket for now - At least branching histories have a linear history from each branch, merged histories don't even have that - Decomplect the ideas of references between DNAs and closing/opening accounts - Closing/opening is an accounting process - This is an app entry as accounting is always domain-specific - Should prevent further accounting transactions once a chain is closed - Referencing/migrating is a social/technical process - This is a system entry as moving through DNAs is a holochain managed process - Does not prevent accounting transactions itself but may not be valid without a prior valid account closing entry (see below) - Need validation callbacks for the DNA hashes themselves - E.g. Hit this URL from the developer and get the hash back as a "checksum" - Allows for pre-migration governance - Want a better name for Migrate entries to be clearer about what is happening - Need validation callback against the system migrate entries + local source chain + DNA hash - E.g. don't stick a migration reference in the local chain before closing the account! - GET should NOT run through all histories _by default_ - _get_ should just be for one zome at a time - _getHistorical_ can get until we find a match + provide a DNA - _getArcheological_ can get all matches across all DNAs (probably too slow with current performance characteristics) - queries (chain-only, no live DHT) could be for all historical data potentially as this just whips through the CAS following migration references - everything other than the default/single get needs to return the DNA hash alongside the found entries - High level approach is "light touch" core + community driven patterns - Wordpress/Drupal/Saas CMS -> Zome - Zome -> Zome - Holochain Migrator Agent + Migrator CMS adapter ### Open questions - Types of branching: - single branch / closing entry --> permanent move (301) - for now? permanent move can be achieved with the right callback logic - multi-branch --> also find me here (302) - opening entry - Can a "Migrate From" entry be added anywhere other than genesis? - e.g. balance transfer - Singleton nature of official updates - Encourages community coherence - Doesn't allow amicable/equal splitting of communities (e.g. always need to pick a "real" version) - Requires CRDT for global singleton behaviour - Simplifies UI/UX - Phishing tradeoffs - Stronger for official update - Weaker for potentially legit forks - How to handle changes to holochain core? - How much change is "breaking"? - Zomes are hashed so break immediately on any change but core can arbitrarily chug along underneath? - Even "non breaking" changes can totally be breaking for someone - e.g. node version 8.14.0 vs. 8.14.2 breaking in cyprus - e.g. "edge cases" in constantinople ETH delays due to performance improvements that threw cpu/gas price usage out of alignment leading to weird vulnerabilities - Sem ver is insufficient for what we are trying to do - Can developers maintain/publish a list of core commits/hashes/versions that zomes are compatible with? - What is the process/ramifications for tracking core lifecycle vs. zome lifecycle? - parallel versions of holochain running? - relays? - data migrations? ### Holochain URI / URN / XDI format - In a multiDNA world, what is the full URI to CAS, because it isn't just the address - `hc:[<Agent-pubkey>@]<DNA-hash>/<CAS-hash>[?Captoken=09jj0shs8e]` (For context and type information, you may want to reference the header for an entry rather than direct reference to the entry itself.) Technically, this is performing an implicit GET. - Also we should think about [web DIDs](https://w3c-ccg.github.io/did-spec/#dfn-did-method) for identifiers - https://tools.ietf.org/html/rfc3986 ### Solid inter-operability > [name=Nicolas Luck] After looking into Solid and all those W3C specs and ontologies, I believe it makes a lot of sense to equate Holochain DNAs/DHTs with Solid's pods and use their link annotation spec. > > If we make the pod/DHT URLs match real DNS names on Holo, we could have (gateway-public) Holochain data inter-operable with Solid apps and other web apps / front-ends. [Solid](https://solid.inrupt.com) is mainly about having standards and ontology for resources that live on their own central servers, called PODs. At the core of how inter-operability works with Solid are [links](https://solid.inrupt.com/docs/intro-to-linked-data). Example from their docs: ```url <https://mypod.solid/comments/36756> <http://www.w3.org/ns/oa#hasTarget> <https://yourpod.solid/photos/beach>. ``` Imagine we would build our equivalent to a chain-explorer into Holo that could be activated for Holo hosted apps, such that entries could be retrieved with a link that includes the DNA and entry address: ```url <http://holo.host/<DNA-hash>/entries/<CAS-hash>[?Captoken=...]> ``` We could then use Solid's [Turtle syntax](https://solid.inrupt.com/docs/expressing-ld-with-turtle) or the [Web Annotion syntax for links](https://www.w3.org/TR/annotation-vocab/#linking) to represent links between DNAs. ```url <http://holo.host/<DNA-hash>/entries/<CAS-hash>[?Captoken=...]> a oa:Annotation ; oa:hasTarget <http://holo.host/<DNA-hash>/entries/<CAS-hash>> ; rdf:type <http://holo.host/<DNA-hash>/link_types/comments> oa:motivatedBy oa:linking . ``` **Benefit**: Holochain DNAs could link to external Solid data and vice versa.

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