MoneyDemo

1 cent

1 cent bill

This is a demo how money in Askemos could work.

Note: It is not ready for real world use until the distributed virtual machine actually works distributed (which is a technial and a social problem).

Assumed it did, this document would have a value of some money.

This bill is currently offered to:

(let ((p (me 'protection))) (or (and (pair? p) (pair? (cdr p)) (entry-name (cadr p))) "(nobody)"))

and it is owned by:

(entry-name (car (me 'protection)))

You can change the offer here. By submitting a blank field, you make the money yours, no longer offerend to anybody. Otherwise you might enter any valid name or oid here.

(make element gi: 'input attributes: `((name "offer") (value ,(entry-name (msg 'dc-creator))) (type "text") (size "33")))

How can you be sure that this really works? Besides that it doesn't yet (see above), you need to be sure that the process is persistant, no administrative power can overrule your decision, no change in software can happen, the oid () is universally unique, you know how the process works etc. Furthermore, to work like real world money, there must be no trace who gave the particular bill to whom. But at least there should be an authority unforgeably identified, who issued the bill.

All these requirements must be build into the base mechanism of an autonomous distributed operating system.

(let ((t (data (form-field 'offer (current-node))))) (if (equal? t "") (symbol->string (msg 'dc-creator)) (string-append (symbol->string (msg 'dc-creator)) "/" (oid->string (entry-name->oid t)))))

Source code:

<xsl:stylesheet xmlns:dsssl="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:mind="http://www.askemos.org/2000/CoreAPI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- 

The first template here will match when the incoming message is of
'*read* type, which is the view in MVC.  This template must provide
a presentation of the current state of the process.  It's unable to
change any values.

 -->
 <xsl:template match="*[@type=&quot;read&quot;]">
  <html>
   <head>
    <title>1 cent</title>
   </head>
   <body bgcolor="white">
    <h1>1 cent bill</h1>
    <p>This is a demo how money in
     <a href="http://www.askemos.org/">Askemos</a> could work.</p>
    <p>Note: It is not ready for real world use until the
     <a href="/A849640f672ed0df0958abc0712110f3c/DVM">distributed
virtual machine</a> actually works
<a href="/A849640f672ed0df0958abc0712110f3c/InformationSpace">distributed</a>
(which is a technial and a social problem).</p>
    <p>Assumed it did, this document would have a value of some money.</p>
<!-- 

You can embedd DSSSL expressions instead of XSLT.  See NameSpaceDSSSL.

The service-level implements an access control.  See AskemosProtection
for details.

 -->
    <dsssl:if test="(service-level)">
     <p>This bill is currently offered to:</p>
     <p align="center">
<!-- 

The code has further access to two objects.  The data anvironment of
ThePlace (compares to address space in conventional operating syste)
called *me* and *msg*, which is a frame representing the message.

The AskemosProtection system operates on two slots *capabilities* and
*protection*.  /my-oid/ represents an object impossible to access.

 -->
      <dsssl:a href="(let ((p (me &apos;protection)))
                    (string-append
                      &quot;/&quot;
                      (symbol-&gt;string (or (and (pair? p) (pair? (cdr p))
                                          (cadr p))
                                          (my-oid)))))">
       <dsssl:copy-of select="#CONTENT">
       (let ((p (me 'protection)))
         (or (and (pair? p) (pair? (cdr p)) (entry-name (cadr p)))
         "(nobody)"))
     </dsssl:copy-of>
      </dsssl:a>
     </p>
     <p>and it is owned by:</p>
     <p align="center">
      <dsssl:a href="(string-append &quot;/&quot;
                         (symbol-&gt;string (car (me &apos;protection))))">
       <dsssl:copy-of select="#CONTENT">
       (entry-name (car (me 'protection)))
     </dsssl:copy-of>
      </dsssl:a>
     </p>
<!-- 

write-locator abstracts from the notation of access path, which is
tied to transport protocols. Usually it yields to a http-something
prefix.

 -->
     <form method="post">
      <xsl:attribute name="action">
       <dsssl:copy-of select="(write-locator
               (msg &apos;location-format)
               (symbol-&gt;string (me &apos;get &apos;id)))"></dsssl:copy-of>
      </xsl:attribute>
      <p>You can change the offer here. By submitting a blank field,
you make the money yours, no longer offerend to anybody.
Otherwise you might enter any valid name or oid here.</p>
      <p>
<!--  F* S*, a new bug?
     <input name="offer" type="text"><xsl:attribute name="value"
><dsssl:copy-of select="(symbol->string (me 'get 'id))"/></xsl:attribute>
     </input>
 -->
<!-- 

Some DublinCore attributes are maitained by the kernel to assure you
can trust the system.  Besides *capabilities* those include the
creator of a message.

 -->
       <dsssl:copy-of select="#CONTENT">
(make element
  gi: 'input
  attributes: `((name "offer")
                (value ,(entry-name (msg 'dc-creator)))
                (type "text") (size "33")))
</dsssl:copy-of>
       <input type="submit"></input>
      </p>
     </form>
    </dsssl:if>
    <p>How can you be sure that this really works?
Besides that it doesn't yet (see above), you need to be sure that
the process is persistant, no administrative power can overrule
your decision, no change in software can happen,
the <a href="/A849640f672ed0df0958abc0712110f3c/OID">oid
(<dsssl:copy-of select="(me &apos;get &apos;id)"></dsssl:copy-of><!--  the
OID of that one cent place  -->)</a>
is universally unique,
you <a href="http://www.opensource.org/">know</a> how the process
<a href="http://www.askemos.org/">works</a> etc.
Furthermore, to work like real world money,
there must be no trace who gave the particular bill to whom.
But at least there should be an
<dsssl:a href="(symbol-&gt;string (me &apos;dc-creator))">authority</dsssl:a>
unforgeably identified, who issued the bill.</p>
    <p>All these requirements must be build into the base mechanism
of an autonomous distributed operating system.</p>
   </body>
  </html>
 </xsl:template>
<!-- 

The second template here is the /stored procedure/, which is activated
for *write* requests.  It's supposed to implement the transition ob
object state, in MVC words: the controller.

The example is simple in so far as the stylesheet does never change.
(You don't want money to change what it does, do you?)
Hence the first node in the result is the groove-root,
which resolves to the stylesheet node itself.

Then, if access is permitted, a second node is included concerning the
protection aspect.  Whoever has sufficient access to the bill (means
is either the owner or the one whom it is offered) becomes the owner.

If there's some value in the form (which has been converted in XML by
the protocol adaptor), it's taken as the one who has the functional
right to take the bill over.

 -->
 <xsl:template match="*[@type=&quot;write&quot;]">
  <mind:reply>
   <dsssl:copy-of select="(document-element (grove-root (current-node)))"></dsssl:copy-of>
   <dsssl:if test="(service-level)">
    <mind:protection>
     <dsssl:copy-of select="#CONTENT">
(let ((t (data (form-field 'offer (current-node)))))
 (if (equal? t "")
     (symbol-&gt;string (msg 'dc-creator))
     (string-append (symbol-&gt;string (msg 'dc-creator))
                      "/"
                      (oid-&gt;string (entry-name-&gt;oid t)))))
      </dsssl:copy-of>
    </mind:protection>
    <dsssl:if test="(service-level)"></dsssl:if>
   </dsssl:if>
  </mind:reply>
 </xsl:template>
</xsl:stylesheet>

Diese Seite findet man von: overview, .




Letzte Modifikation: Thu, 06 Feb 2003 14:44:24 +0100

Autor(en): jfw,

Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391 geliefert an public um Fri, 22 Aug 2008 00:16:32 +0200