Ethereum – Art Market

Here is a contract that allows you to register as the owner of a digital artwork contained in a particular file (identified by its cryptographic hash value) at a particular URL. The use of a URL is inspired by the excellent Monegraph, which launched shortly after I started working on Ethereum contracts for art. Monegraph uses the existing NameCoin system, which can be implemented in Ethereum as a two line contract.

This contract is longer than that as it’s recording and managing more information. It also allows you to offer the artwork for sale (in exchange for Ether, Ethereum’s built-in currency), either to a specific individual or generally, or to transfer it to a specific individual without charging them within the contract.

{
 (def 'next-record 0x10)
 (def 'RECORD-SIZE 64)
 ;; Next record position
 ;; This starts one cell above the maximum value of RipeMD
 [[next-record]] 0x10000000000000000000000000000000000000000

 (return
   0x0
   (lll
     {
      ;; Action
      ;; 0 - first cell in message
      [action] (calldataload 0)
      (when (= @action "register")
        {
         ;;TODO: Check correct message length
         ;;TODO: Check digest in range
         ;; Artwork digest
         [digest] (calldataload 32)
         ;; If already registered, don't continue
         (when @@ @digest
           (return "Arwork already registered."))
         ;; Get storage for new record
         [storage] @@next-record
         ;; Store digest
         [[@storage]] @digest
         ;; Artist account
         [storage] (+ @storage 1)
         [[@storage]] (caller)
         ;; Artist resale percentage
         [storage] (+ @storage 1)
         [[@storage]] (calldataload 64)
         ;; Artist is the current owner
         [storage] (+ @storage 1)
         [[@storage]] (caller)
         ;; Skip purchaser and price
         [storage] (+ @storage 3)
         ;; Copy over the url and description
         ;; 96 is 32 x 3 = 3rd cell in message
         [source] 96
         (for [i] 6    (< @i 64)    [i] (+ @i 1)
              {
               [[@storage]] (calldataload @source)
               [storage] (+ @storage 1)
               [source] (+ @source 32)
               })
         ;; Store digest-to-record link
         [[@digest]] @@next-record
         ;; Increment next record position
         [[next-record]] (+ @@next-record RECORD-SIZE)
         })
      (when (= @action "offer")
        {
         ;;TODO: Check correct message length
         ;;TODO: Check digest in range
         ;; Get artwork record storage for digest or stop
         ;; 32 = second cell in message
         [storage] @@(calldataload 32)
         (when (not @storage)
           (return "Artwork not registered."))
         ;; If the caller is the owner
         (when (= @@ (+ @storage 3) (caller))
           {
            ;; Offer subject
            [[(+ @storage 4)]] (calldataload 64)
            ;; Offer price
            [[(+ @storage 5)]] (calldataload 96)
            })
         })
      (when (= @action "accept")
        {
         ;;TODO: Check correct message length
         ;;TODO: Check digest in range
         ;;TODO: Error messages for bad price or buyer
         ;; Get artwork record storage for digest or stop
         ;; 32 = second cell in message
         [storage] @@(calldataload 32)
         (when (not @storage)
           (return "Artwork not registered."))
         [buyer] @@(+ @storage 4)
         [price] @@(+ @storage 5)
         ;; If the caller is the buyer and it's the correct payment
         ;; Or there's no buyer and it's the correct nonzero payment
         (when (|| (&& (= @buyer (caller))
                       (= @price (callvalue)))
                   (&& (= @buyer 0)
                       (> @price 0)))
           {
            ;; For payment
            ;; Ethereum doesn't allow fractional amounts
            ;; Warn users about making prices divisible
            [hundredth] (/ @price 100)
            [arr] @@(+ @storage 2)
            ;; Pay artist
            (call (- (gas) 250) @@(+ @storage 1) (* @hundredth @arr) 0 0 0 0)
            ;; Pay owner
            (call (- (gas) 250) @@(+ @storage 3) (* @hundredth (- 100 @arr)) 0 0 0 0)
            ;; Transfer ownership
            [[(+ @storage 3)]] (caller)
            ;; Clear offer subject and price
            [[(+ @storage 4)]] 0
            [[(+ @storage 5)]] 0
            })
         })
      }
     0x0))}

Here’s the top and the bottom of the main UI (implemented in HTML and JavaScript for the AlethZero Ethereum client).

registry1
registry3
You can enter a URL and get the cryptographic hash for it.

registry2
If the artwork has already been registered, this will show its details.

registry5
Or if not you can register it.

registry4
Once you’ve registered an artwork you are the artist of it and you also own it. You can offer any artwork you own for sale.

registry6
And you can accept a sale offer, paying the specified amount of Ether.

registry7
The UI warns you how much Ether you are about to spend.

registry8
And when you buy an artwork it lets you know when the transfer is complete.

registry9
It’s a market in allographic digital art. In contrast to the existing art market it is entirely public and transparent. And in contrast to many jurisdictions it implements the controversial “Artist’s Resale Right” in a voluntary way (in a way similar to that suggested in “The Social Lives of Artistic Property“). If it’s prohibitively difficult to experiment in the existing art market, we can make new markets for new kinds of art. Like this one.

Posted in Art, Ethereum, Projects

Ethereum – Art Is…

Here is a contract that allows anyone to define what art is. It contains a single set of twelve statements about art. They are encoded as hexadecimal values which are interpreted as sentences in a simple subset of International Art English and displayed by the UI.

{
 ;; Constant values
 ;; Price base (wei), doubled for each definition up to DEFS-COUNT
 (def 'PRICE-BASE 10)
 ;; Add to the index to get the price base exponent
 (def 'PRICE-FACTOR-ADD 10)
 ;; Number of definitions
 (def 'DEFS-COUNT 12)
 ;; Range of values for definitions
 (def 'DEF-MIN 0x1)
 (def 'DEF-MAX 0x0F0F0F0F)

 ;; Storage locations
 (def 'artist 0x10)
 (def 'defs-base 0x100)
 (def 'theorists-base 0x200)

 ;; State
 ;; Contract owner/payee
 [[artist]] (caller)

 (return
   0x0
   (lll
     {
     [action] (calldataload 0)
      (when (= @action "set")
        {
         [index] (calldataload 32)
         [definition] (calldataload 64)
         [price] (exp PRICE-BASE (+ @index 1 PRICE-FACTOR-ADD))
         ;; If the index is in range and the caller paid enough to set it
         (when (&& (>= @definition DEF-MIN)
                   (<= @definition DEF-MAX)
                   (< @index DEFS-COUNT)
                   (= (callvalue) @price))
           {
            ;; Update definition
            [[(+ defs-base @index)]] @definition
            [[(+ theorists-base @index)]] (caller)
            (- (gas) 100) @@artist @price 0 0 0 0
            })
         })
      }
     0x0))
 }

The contract is in lll rather than Serpent this time.

Here’s what the UI looks like.
art_is1
And here’s what it looks like when a statement is being edited.
is_art2
The contract allows the statements to be edited but it costs progressively more to do so: the first costs 10 Wei, the third costs 1000 and so on. This ensures that art theorists place a value on their definition, thereby indicating how confident in and/or serious about their definition they are. The higher the value, the less likely it is to be changed by someone else. This combines art theory with behavioral economics.

Posted in Aesthetics, Art, Art Computing, Ethereum, Projects

Ethereum – This Contract Is Art

Here is a contract that can assert that it is art.

init:
    contract.storage[1000] = "may be"

code:
    if msg.data[0] == "toggle":
        if contract.storage[1000] == "is":
            contract.storage[1000] = "is not"
        else:
            contract.storage[1000] = "is"

It toggles its status as art when sent a message instructing it to do so.

Here’s what the UI for the contract looks like:

is1

Here it is while the artistic state of the contract is being toggled:

is2

And here it is after being toggled:
is3
Anyone can change the contract from not being art to being art (and vice versa). We’ll look at a more advanced contract that uses behavioural economics to address this next.

Posted in Art, Ethereum, Projects

Thinking About Value

36f1: A given multidimensional intrinsic motivation space will intersect the complement of a given multidimensional affordance space.

95a1: A multidimensional extrinsic motivation space is a non-affine projection of the former.

187e: Dimension-reducing extrinsic motivation space is a (mathematically!) degenerate projection of that.

0ecb: Monodimensional extrinsic motivation space (…money) is a (mathematical!) singularity.

f61d: (Points, badges and awards are as extrinsic as cash. Intrinsics may be culturally or historically determined or influenced.)

9833: Topological extrinsic motivation spaces with extrinsic motivational singularities are perverse (…incentives) to a degree that is a function of the relation of their centroid to that singularity.

cfe6: Extrinsic value command and market economies are (pretty much affine) reflections of each other, as they themselves argue, given this.

747a: Libertarian/market anarchists and socialist anarchists are probably extrinsic/intrinsic anarchists.

1c85: Intrinsic motivation may be learnt. Extrinsic motivation may be projected.

e2f5: Neither intrinsic nor extrinsic motivation is avoidable. They may complement or clash.

Posted in Politics

Ethereum – Hot Cold UI

One of the example contracts from “Identity, Ownership and Authenticity” was a conceptual art homage called hot_cold.se . Here’s an updated version:

init:
    contract.storage[1000] = "hot"
    contract.storage[1001] = "cold"

code:
    // Swap
    temp = contract.storage[1000]
    contract.storage[1000] = contract.storage[1001]
    contract.storage[1001] = temp

When it receives a message, it swaps the strings “hot” and “cold” in its memory.

We can access the contract’s memory in AlethZero using JavaScript and build an HTML UI for the contract. Here’s part of the code:

// The hot_cold contract
var contract = "0x84ea345a8c5ca28abee46681ff3a7cee526bb4e4";

// Update the spans with the data from the contact
var fetch = function() {
  document.getElementById("_1000").innerText = eth.storageAt(contract, 1000).bin();
  document.getElementById("_1001").innerText = eth.storageAt(contract, 1001).bin();
};

It fetches the values from the contract’s memory and assigns them to HTML elements. Like so:

hot-cold

Further JavaScript allows you to update the contract’s state (first warning you that doing so costs Ether in the form of Gas for the transaction):

gas

Once the transaction goes through, the JavaScript code is notified of a change to the contract’s state and updates the UI:

cold-hot

There’s only one version of the properties, so if someone else updates the contract you’ll see the results in your UI. And vice versa.

You can find the code in the repository for this series:

https://gitorious.org/robmyers/artworld-ethereum/

hot_cold.se is in the contracts directory, and hot_cold.html in the ui directory.

Posted in Art, Art Computing, Ethereum, Projects

The People’s Platform

The People’s Platform” (TPP) is a frustrating read. An anti-techno-utopian critique of the economics and politics of culture on the Internet, it contains much interesting research and some useful ideas but is hamstrung by a year zero activism approach to the history and current state of the struggle for liberty and sustainability in technology and media.

Year zero activism has two planks. Firstly, the situation has never been worse and only now are activists starting to tackle it. Secondly, anyone who may appear to have previously done so is actually part of the problem. Previous activism is at best ineffective and at worst exacerbatory, previous activists were tone deaf to or in reality made worse the very issues they sought to address.

In TPP this leads at times to an almost ‘pataphysical identity of opposites. Google and Wikipedia are both “open”. Chris Anderson and Richard Stallman both use the word “free”. The nadir of this approach comes later in the book when TPP is explaining the economic and thereby cultural harm of free culture and free software:

Cohen is highlighting a value that has long been central to any progressive movement: respect for labor. From this angle it’s clear that “copyleft”, as the free culture position on copyright is sometimes called, is not “left” in the traditional sense. As Richard Stallman told me, he designed copyleft to ensure the freedom of users to redistribute and modify copies of users to redistribute and modify copies of software. Freedom to tinker is the paramount value it promotes, but a left worthy of the name has to balance that concern with the demand for equality, for parity of wealth and power.

There’s no part of this that’s right.

Stallman’s creation of copyleft was a product of the political development of Free Software in reaction to the alienation of the products of hacker labour. It’s an answer to the property question, which is a question of the left “in the traditional sense”. It entails respect for labour, and ensures that workers can charge for and be paid for their labour.

Users who modify and “tinker” with software do so via programming, that is by working as programmers, by performing the labour of software development. Software developers are first of all software users. If you are not free to use software you are certainly not free to develop it. The same is true of cultural production, a point that TPP seems slightly more open to.

“Copyleft” is not a blanket term for free culture approaches to copyright, it is the name of a particular licensing approach that seeks to address the restrictions of copyright. There is no single free culture approach to copyright. There are copyright abolitionists, copyright libertarians, copyright socialists and those, like Stallman, for whom copyright’s ironisation by copyleft is a means to a political end.

Seeking to reduce free software and free culture to a progressive left wing movement rather than retain the nonpartisan approach that has seen their successes (or, as TPP would have it, has led to identity with their proprietary others) would undermine them. It’s classic entryism, finding a successful specific social cause to shame into attempting more general radical politics. It’s an approach that is doomed to failure.

And copyleft is precisely intended to equalise wealth and power in the use of software. You can share that wealth, and you cannot exert power over anyone else to prevent them from doing so as well. What you cannot do without breaking the effectiveness of copyleft, and what each new critic of copyleft is drawn to like a moth to a flame, is to yoke copyleft’s reflexive ironisation of copyright on software or cultural work to extraneous political objectives.

TPP continues:

Copyleft, with its narrow emphasis on software freedom, even when broadened to underscore the freedom of speech implications of such a position, offers a limited political response to entrenched systems of economic privilege, and it does not advance limits on profitability or promote fair compensation. Free culture, with its emphasis on access, does not necessarily lead to a more just social order.

Ignoring the slip from free software to free culture, the slip from social to economic justice, and the inaccurate characterization of free culture as emphasizing access, this is a political erasure. Free software and free culture may not have provided grossly coercive tools to the political left but they have, by TPP’s own explanation of their redistributive and deprivileging effects, led to a more just social order. And it requires precisely the ‘pataphysics of “free” and “open” that TPP develops to argue that they limit compensation but not profit.

Later, TPP calls for the development of more socialised alternatives to Web 2.0′s ad-driven surveillance model, and for the development of more equitable alternatives to unpaid cultural workers trying to live on whuffie while making Silicon Valley CEOS rich. I agree that this is vitally important. I’ve worked on several myself. I’ve seen creators paid, clients satisfied, citizens communicating, audiences enjoying media, with millions of dollars put into the cultural economy and tens of thousands of people engaged each month by projects I’ve been involved in. There is absolutely more work to do, but ignoring existing efforts or worse conflating them with the problems they exist to address will only ensure that this is always the case.

There is another key conclusion of TPP that I agree with wholeheartedly. We need a sustainable ecosystem for culture. That is, we need technological and economic systems that sustainably align consumption and production incentives with each other and with political and creative liberty. And state and corporate mechanisms for spreading risk absolutely have a part to play in this. But as blank media levies and the deep packet inspection consequences of the proposals of “Promises To Keep” show, this is a task that needs approaching with an insight and subtlety that both pro- and anti- free culture activists often lack.

In this sense at least TPP is not year zero, it is business as usual.

Posted in Free Culture, Free Software, Reviews

ace

ace
ace is a command-line development environment for Ethereum contracts.

It’s designed to simplify writing and testing contracts. The initial (alpha!) version supports Serpent contracts and local testing using pyethereum.

You can get it here:

https://gitorious.org/robmyers/ethereum-ace/

For an Emacs mode for editing Serpent code, see here:

http://robmyers.org/2014/05/20/serpent-mode-for-emacs/

Bug reports gratefully received.

Posted in Free Software, Projects

serpent-mode for Emacs

serpent-mode

serpent-mode is a GNU Emacs major mode for editing and compiling Serpent code.

Serpent is a Python-inspired language for writing smart contracts that compile to Ethereum Virtual Machine bytecode. It adds syntax highlighting and indentation for Serpent code, and allows files to be compiled from within Emacs.

You can get the serpent-mode here:

https://gitorious.org/robmyers/serpent-mode/

https://github.com/robmyers/serpent-mode

Some of the indentation code has been borrowed from Emacs’ built-in Python mode but any deficiencies are a result of my simplifying it to work with Serpent. Reports of errors and omissions gratefully received.

Posted in Free Software, Projects

Ethereum Contract Free Software Licensing

Here’s a simple example of a contract that is licensed under the GNU Affero General Public License:

LICENSE = ["Copyright 2014 Rob Myers", "Licensed GNU AGPL V3+"]
SOURCE = ["https:\/\/gitorious.org\/robmyers\/", "artworld-ethereum/"]

// Make sure we have enough gas to run the contact
if tx.value < tx.basefee * 100:
    // If not, stop
    stop

if msg.data[0] == "license":
   return(LICENSE, 2)
else if msg.data[0] == "source":
   return(SOURCE, 2)
else:
    // Return false
    return(0)

Assuming that being part of the blockchain doesn’t clash with the AGPL. Anyone? :-)

Posted in Free Software

Cryptocurrency Culture

http://thecypherfunks.com/

“”The Cypherfunks” is a network of musicians working individually & together to make music under the same name. A cryptocurrency [FUNK] acts as “stock” in the band.

Both the currency & band are completely decentralized. It is a grand experiment in permission-less, internet scale innovation in music, collaboration, and technology.”

http://www.monegraph.com/

http://techcrunch.com/2014/05/09/monegraph/

“monegraph helps anyone verify that a digital artwork is an original, exactly as created by the artist.

monegraph encourages a vibrant market around the sale and exchange of digital art.

monegraph uses the same technology as Bitcoin to let anyone participate in the digital art market.”

https://forum.ethereum.org/discussion/446/the-ephemeral-artcoin

The Ephemeral Artcoin (EA) is a platform designed to spark the creation of qualitative new works of non-commercial art in the post-bitcoin digital economy.

http://bitcoinmagazine.com/12259/fine-art-meets-bitcoin-rise-aesthetic-paper-wallet/

“Fine art meets bitcoin cold storage in Troy Fearow’s “labour of love”, CryptoArt, a project that took the fine art dealer 8 months to construct and launch.

Troy searches for and commissions high level artists, starting with Alexander Fedosov of the Ukraine, to produce fine art paper wallets in limited editions. These prints are meant for bitcoiners who wish to store their bitcoin safely and show them off in a beautiful way.”

http://saycheers.co/

“Cheers is an app that allows you to tip (or “Cheer”) any musician or band in the world using Bitcoin. You can Cheer any song or band, whether it’s your all-time favorite, or just a song that you loved on the radio that you’ve never heard before. See what your friends are Cheering, discover new music and reward them for finding it.”

Posted in Art, Art Computing, Culture

Archives

Categories