Heliax
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    --- title: Realizing intents with a resource model tags: presentation type: slide slideOptions: theme: solarized transition: 'fade' --- # Realizing intents with a resource model _Christopher Goes Research Day 2023_ --- ## Introduction ---- ## Inspiration ![](https://hackmd.io/_uploads/H1lwvPebr3.png) *(thanks Andrew Miller!)* ---- ## Inspiration part deux ![](https://hackmd.io/_uploads/ryylwxZr2.png) *(thanks Xyn from Flashbots!)* ---- ## What this talk is not about - VMs, but... - Not your grandma's von Neumann VM. ---- ## von Neumann architecture - Processing unit (CPU) - Instruction set - Registers, stack - Volatile memory - Non-volatile storage - Designed to _execute programs sequentially_ ---- ![](https://hackmd.io/_uploads/SkXSTpgH3.png) ---- ## EVM ![](https://hackmd.io/_uploads/r1W706eSn.png) *Bonus credit 1: where is this from?* ---- ## EVM is a ... von Neumann machine - Instruction set - Volatile memory (stack, first 16 = registers) - Non-volatile storage - Designed to _execute programs sequentially_ ---- ## What is a VM, anyways? - von Neumman VMs are designed to _execute programs sequentially_ - Intent-centric VMs (this talk) are designed to _match conditional commitments atomically_ - Commitments probably involve programs! - **We'll come back to message-passing and sequential scheduling later ---- ## But... Turing-completenesssssssss! ![](https://hackmd.io/_uploads/rJRLulbHn.png) *Bonus credit 2: where is this from?* --- ## Research literature review ![](https://hackmd.io/_uploads/B1IP9xZHn.jpg) ---- ## A Non-cooperative Equilibrium for Supergames [Friedman 1971] ![](https://hackmd.io/_uploads/BJxHqlbH2.png) - Supergame = infinitely repeated game - Repeated interaction can result in any feasible, individually rational payoff ---- ## Program equilibria [Tennenholtz 2004] ![](https://hackmd.io/_uploads/SyLMWAeB2.png) ![](https://hackmd.io/_uploads/SJpnZRlBn.png) ---- ## What if we just sent around commitments? - Commitments are functions - Published to blockchain (somewhere) - Blockchain (somehow) calculates equilibrium ---- ## Four challenges - Termination / fix-point finding - Function introspection - Nominal/structural identities - Unclear information flow ---- ## Termination / fix-point finding - Higher-order commitments are mutually codependent. ```haskell= type Commitment = Commitment -> Strategy ``` - Need randomness, separate payoff, etc. to terminate. ```haskell= commitment = if rand() < 0.01 then Cooperate else if other(me) = Cooperate then Cooperate else Defect ``` - Randomness is possible, but annoying, slow to terminate, adds security assumption. - Separate payoff creates (arguably unnecessary) MEV. ---- ## Function introspection - Program equilibria use equality checks, but this doesn't work for complex preferences. - Would need to check arbitrary properties of other's commitment, need e.g. full dependent types. - Possible, but heavyweight, practical challenges. ---- ## Nominal vs. structural identity ![](https://hackmd.io/_uploads/B1XAae-Sn.png) - Players (& sometimes commitment devices) are nominally identified (indexed). - In the typical distributed context, the set of players is open, and we want to identify them _structurally_, by capability. - e.g. owing a token, ability to make some external move - We need to explicitly include all actions that matter. ---- ## Unclear information flow - Magic commitment-executing computer - Has to take all the commitments at once - Unclear how to compose - Information flow control (programmable privacy) would require TEE-like embedding --- ## Resource logic to the rescue! ---- ## Sequential commitment execution ![](https://hackmd.io/_uploads/Sy_Nmb-B3.png) ---- ## One weird trick: speculative execution ```haskell= type Commitment = Set Strategy -> Bool commitment (Defect, Defect) = True commitment (Cooperate, Cooperate) = True commitment _ = False ``` ---- ## No one cared about the path anyways ![](https://hackmd.io/_uploads/H1oGVbWrh.png) ---- ## Basic structure: resource ```haskell= data Change = Created | Consumed data ResourceLogic = ResourceLogic { predicate :: PartialTx -> Change -> Bool, arguments :: ByteString } data Resource = Resource { logic :: ResourceLogic, prefix :: ByteString, suffix :: Nonce, quantity :: Integer, value :: ByteString } ``` ---- ## Basic structure: partial transaction ```haskell= data PartialTx = PartialTx { consumed :: Set Resource, created :: Set Resource, extradata :: ByteString } ``` ---- ## Basic structure: validity ```haskell= valid ptx@(PartialTx consumed created _) = all (map (\r -> logic r ptx Consumed) consumed) && all (map (\r -> logic r ptx Created) created) ``` ---- ## Basic structure: balance ```haskell= type Balance = [(ByteString, Integer)] denomination :: Resource -> ByteString denomination (Resource logic prefix _ _ _) = hash (logic, prefix) delta :: Resource -> Balance delta r = [(denomination r, quantity r)] balanced :: PartialTx -> Bool balanced ptx@(PartialTx consumed created _) = sum (map delta created) - sum (map delta consumed) = 0 ``` ---- ## Properties - Partial transactions compose - Join consumed and created resources - If `a` is valid and `b` is valid, `compose(a, b)` is also valid. - A "transaction" is just a balanced partial transaction ---- ## Example: prisonner's dilemma - Create a resource that says that you cooperate - Consume a resource that says that your counterparty cooperates - Symmetric partial transactions will balance ---- ## Example: token swap - Consume the tokens that you already have (& want to pay) - Create a resource of new tokens assigned to you - Symmetric partial transactions will balance (maybe with slack) ---- ## Addressing termination & introspection - Separation of computation from verification - Discontinuous jumps in configuration space ---- ## Addressing nominal vs. structural identities - Interactions are specified on the basis of resources - Resources connote the ability to do something - Inclusion of other players is explicit (checked by the predicate in the `PartialTx`, or by balance) ---- ## Addressing information flow - Separation of validity conditions from balance check - Once you have a valid partial transaction, this can be ZKP'ed (even if still unbalanced) - Validity constraints "forwarded". ---- ## Spicy take - This resource structure is pretty much inevitable. - You can still use EVM for program execution if you want. - But this "virtualised atomic resource logic" will live on top, and programs will be dependent on it. - EVM's sequential message-passing execution is neither suitable nor necessary for conditional commitments because it is _path-dependent_. --- ## Towards a substrate for information flow control ---- ### Viaduct [Recto 2009] ![](https://hackmd.io/_uploads/SyhFWWbS2.png) ---- ### Language vs runtime - Information flow control language specifies (declaratively) - Constraints on desired information flow - Trust assumptions - Cryptographic assumptions - etc. - Compiler selects organisation of primitives - Runtime executes primitives in correct sequence with real data - "Least powerful primitive" rule ---- ### Example: solver selection - Users send their partial transactions to known solvers - Maybe ones they're willing to trust to enforce information flow control policies - Partial transactions produced by those solvers _compose_ ---- ### Example: batching ("Penumbra-on-Anoma") - Consume tokens to create (threshold-encrypted) resources - Those resources are threshold-decrypted next round - Those resources can only be consumed in a batch - Checks fairness condition (optimal arbitrage) ---- ### Example: threshold FHE (aggregate statistics) - Each token spend, increment a threshold encrypted counter - Validators have instructions to periodically decrypt counter ---- ### The case for the resource model - Clear atomic units of data & logic packaged together - Information flow control policies can apply to these - Explicit state inclusion (instead of implicit global state) - No path-dependence - Information flow also doesn't care about this, once you know `x`, you can know any `f(x)` --- ## Conclusion and future directions ---- ### Three points 1. Intent-centric VM design is not a von Neumman problem. 2. Speculative execution + atomicity is a powerful tool. Users care about equilibria, not paths. 3. The resource model is probably inevitable. ---- ### Open questions - Better formal languages for information flow control - Particularly ones amenable to conditional disclosure - Most suitable abstract intermediate representation for programs - Solver privacy improvements - (see open questions page) ---- ### Thanks! Find me: - @cwgoes (while Twitter lasts) - here :smiley:

    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