DiegoOlivier
    • 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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Money settlement between businesses always follows a **process** ## Examples of business processes ### Process 1 - A is required to send 10 trucks of goods to B between times T0 and T1 - When a truck arrives, it is checked and receipt is signed by responsible from A and responsible from B - After T1, if all the trucks have arrived, A sends an invoice to B - B pays within 30 days ### Process 2 - A is required to send 10 trucks of goods to B between times T0 and T1 - After T1, only 9 trucks have arrived - A requests B for an agreement "we will deliver the last truck in the next 3 business days" - B refuses the agreement - A sends an invoice for 9 trucks minus contractual penalty - B pays within 30 days ### Process 3 - A is required to send 10 trucks of goods to B between times T0 and T1 - After T1, only 9 trucks have arrived - A requests B for an agreement "we will deliver the last truck in the next 3 business days" - B accepts the agreement : T1 is moved to T1 + 3, the contractual penalty is doubled - (the last truck doesn't arrive) - A sends an invoice for 9 trucks minus contractual penalty - B pays within 30 days ### Process 4 - A buys a house from B - C agrees to lend money to A - C sends the money to B - B adds a hypothec on the house and transfers the house to A - A has to make monthly payments to C - Once payments are finished, hypothec on the house is removed ### Process 5 - A buys house from B, the house has a hypothec and monthly payments to C - X buys the hypothecated house from A, now X needs to make the payments to C - if X fails to make the monthly payment to C, the house is sent back to C ### Process 6 - A owns a house - A borrows money from B using 50% of his house as collateral - A borrows money from C using 50% of his house as collateral - A fails a monthly payment to B - B now fully owns 50% of the house - X buys the 50% hypothec from A and 50% ownership from B - X continues the payments to C - After all the payments are over, X owns the house ## Concepts Processes are less about making sure that the money is paid and more about managing the complexity of thousands of simultaneous business agreements. Imagine a company specialized in transportation, or lending for the housing market. They have thousands of customers in different stages of each process and they need to have global visibility of their position. The important concepts are - **FT** : anything that behaves like money - **NFT** : rights (e.g. a "talk stick" is a stick that allows you to talk in a meeting. You cannot talk without the stick. You need to request it from the person that has it if you want to talk. There may be a timer on how long you can keep the stick. The talk stick materializes "the right to talk") - **Time** - External **messages** We need to design a process language that - is obvious for most professionals - covers our typical use cases There are some external business process modeling (BPM) languages but they seem a little convoluted (https://en.wikipedia.org/wiki/Business_process_modeling) ![](https://upload.wikimedia.org/wikipedia/commons/a/af/BPMN-AProcessWithNormalFlow.svg) But the global idea is correct - A process is a sequence of states S1 -> S2 -> S3 -> S4 - Each state is guarded by a logical expression over variables - The state transitions can modify those variables - External messages (signed messages) request a change of state ### Process 1 seen as a state machine ```javascript S condition: double signature of agreement state: N = 0 S -> C(0) pre-condition: message at T > T0 signed by A state: N = 0 C(N) -> C(N+1) pre: message signed by A and B (asserting a truck has arrived) state: N integer C(N) -> I pre: message signed by A at time T > T1 (requesting to move to invoice) && N = 10 state: N integer ``` ### Parametric transition systems Automata + variables and guarded transitions is almost the core language of parametric model-checking systems (Cubicle in OCaml allows more complex code to be present in the transitions). DOFP is in favor of using a sublanguage of parametric transition systems ```f# init (unit) init (unit) -> count (int) | when m == signed(A,B, (Init, t)) && T > T0 // Syntax to deconstruct messages count (int) -> count (int) | {N} when m == signed(A,B, (Truck, t)) && t < T1 -> { N : N + 1 } count (int) -> invoice (unit) | {N = 10} when m == signed(A, (Invoice, t)) && t > T1 -> {} ``` These systems can easily be transformed into a diagram for visual aid ```graphviz digraph { init -> "count n " [fontname="Courier" label=" T > 0"] "count n " -> "count n " [fontname="Courier" label=" n -> n+1"] "count n " -> invoice [fontname="Courier" label=" n == 10 && T > 10"] } ``` Such a process language can represent most of the current processes when augmented with - the ability to recognize messages and signatures - simple primitives (*transfer*, etc) The only problem is the **representation of property**, which is exemplified by processes 4,5,6 above, in other words - how to limite the usage of a resource (a hypothecated house) - how to sell a complex resource (a hypothecated house) ### More complex rewriting system Fred suggests more complex processes can be written as a rewriting system over a store of objects ```fsharp resource S resource Truck resource C(int) start: () -> S * C(0) send_truck: S -> S * Truck count_truck: Truck * C(i) -> C(i + 1) pay: C(10) -> () condition: T <= T1 ``` A production rule like ``S -> S * Truck`` requires a ``S`` object in the store, that it will consume at each usage, and generate in exchange an ``S`` and a ``Truck``. This is reminiscent of the [RETE algorithm](https://en.wikipedia.org/wiki/Rete_algorithm). If there are rules of the type ``C(i) -> C(j) * C(k)`` the number of states can be infinite even if parametrized. In the absence of such rules, the system is equivalent to a state (s,t,c) and the transitions ```fsharp transitions | -> (0,0,0) | (0,0,0) -> (1,0,1) | (1,t,_) -> (1,t+1,_) | (_,t,c) when t >= 0 -> (1,t-1,c+1) | (_,_,10) -> . ``` where ``(_,_,k) ~ C(k)`` ## Blockchain representation of property and rights Currently blockchain has 2 concepts - **full property** : you own an address and you can do whatever you want with it - **holdings** : a group of people agree to create a holding, the rules / rights of the holding participants are described in a smart contract, and the holding has full property of the assets Holding rules / rights are **opaque** and are not **future proof** : if you don't plan in advance all the uses cases (for instance the capability of selling your "place" in the holding) then that freedom is removed forever and unrecoverable. Because **holding rules are positive** (you are forbidden to do anything except what is allowed in the rules), holding contracts are lengthy for very little usefulness. **Real life contracts are negative** (you are allowed to do anything you want except what is limited by the contract). ## Internal representation

    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