{"_id":"@agoric/pixel-demo","_rev":"15-b12ec19faff55d22354e87f2e23a9f86","name":"@agoric/pixel-demo","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@agoric/pixel-demo","version":"0.0.1","keywords":["smart","contract","cryptocurrency","exchange","tokens"],"author":{"name":"Agoric"},"license":"Apache-2.0","_id":"@agoric/pixel-demo@0.0.1","maintainers":[{"name":"michaelfig","email":"michael@fig.org"},{"name":"katesills","email":"kate@agoric.com"},{"name":"warner","email":"warner-npm@lothar.com"},{"name":"erights","email":"erights@gmail.com"}],"homepage":"https://github.com/Agoric/agoric-sdk#readme","bugs":{"url":"https://github.com/Agoric/agoric-sdk/issues"},"dist":{"shasum":"cdebe5cae2e6289f3b44362233012a3d7affaae4","tarball":"https://registry.npmjs.org/@agoric/pixel-demo/-/pixel-demo-0.0.1.tgz","fileCount":19,"integrity":"sha512-m7zJxs+pYgK5cPTJQ/84qnKhmMIqJ7sK2FgMb2ub2LY3nqUp+oD/DZslz/3Xgriezn7dHEbMiiFV76rCazRbHQ==","signatures":[{"sig":"MEUCIHoSljdHl43BPFtk9HN1g+OAmjI20tY5oSEVLNGmHT0CAiEAigacB2MFJz0QbfsgFDWupNl4iaNwVK9Mgtvt/9qqGgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":647747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOLr9CRA9TVsSAnZWagAAOB8P+way+R0fdG1Cx6p4eABo\neqb7j8nS1PRE8/8TbwSpjEu0T3UxVcm7epTF10U0c1qc/5sg0XfulmU2/s7L\nTPBxxuo8tGXz2vVr4f68cy434yNKwqQWWYIuB+4UB2yQ9s0AIKjiLBm++2lG\nEeYcro7s0iyI0/b8IeI8axC5cEYEg9YqTKf2oTMlEHU0on848yGBcliB5q90\niFpI4uzgD3VZA8b8GqLPfdUKEuvOHtu6As8ixo1zXKaiNWbXPiCj/izP95Mn\nbD4cunrTWOAgDTz5fKeS2zsG2ytJ0zxn3eQsGVUQnZ+SqerHkpW1uRL6SXjR\n70RbQp303rgUnlrBk8utC4d41V9jXWQwZzzhnsZ75QfLfBa0EDWIinWcbuHZ\nC4lWKHcHtwnq5P6ETYRdLpga4blevwWgv/DWrfVf5Rs3s/DJ79GfpI/yxJFS\naDfDb78KEz8hAY93TjDk/bH2to/vQ4oFkf1gr5w0Dr5tWGbnTKLE+HnRZsYa\ni9P2LfnyUy4CGlcfAEeNhvEiL0nR2x+EHUAyTF4sPsb7RUE7ewcKmxH6mE0V\nTkz5dX82MNly6+F/qD3KlKC+LliKOLziA+PDyxwd2c5X3Bh1tHM7tK77aJiK\nNvqwg2jWqlXb+N/PDDl4M2jz/yTc7g9/dyrCKMGj3YQXQU56bB4No3Nd7H0q\n06E8\r\n=SZ0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/gallery.js","engines":{"node":">=11.0"},"scripts":{"test":"tape -r esm 'test/**/test*.js' | tap-spec","build":"exit 0","lint-fix":"eslint --fix '**/*.js'","lint-check":"eslint '**/*.js'","lint-fix-jessie":"eslint -c '.eslintrc-jessie.js' --fix '**/*.js'","lint-check-jessie":"eslint -c '.eslintrc-jessie.js' '**/*.js'"},"_npmUser":{"name":"katesills","email":"kate@agoric.com"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"url":"git+https://github.com/Agoric/agoric-sdk.git","type":"git"},"description":"An example non-fungible token and app using ERTP","directories":{},"dependencies":{"@agoric/nat":"^2.0.1","@agoric/ertp":"^0.2.0","@agoric/store":"^0.0.1","@agoric/harden":"^0.0.4","@agoric/insist":"^0.0.1","@agoric/spawner":"^0.0.1"},"eslintConfig":{"env":{"es6":true},"rules":{"strict":"off","no-console":"off","arrow-parens":"off","no-loop-func":"off","no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_"}],"no-return-assign":"off","no-param-reassign":"off","no-restricted-syntax":["off","ForOfStatement"],"no-inner-declarations":"off","no-unused-expressions":"off","function-paren-newline":"off","implicit-arrow-linebreak":"off","import/prefer-default-export":"off"},"extends":["airbnb-base","plugin:prettier/recommended"]},"eslintIgnore":["bundle-*.js"],"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","tape":"^4.11.0","tap-spec":"^5.0.0","tape-promise":"^4.0.0","@agoric/evaluate":"^2.2.0","@agoric/swingset-vat":"^0.3.0","@agoric/sharing-service":"^0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/pixel-demo_0.0.1_1580776188991_0.9524766380771181","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@agoric/pixel-demo","version":"0.0.2","keywords":["smart","contract","cryptocurrency","exchange","tokens"],"author":{"name":"Agoric"},"license":"Apache-2.0","_id":"@agoric/pixel-demo@0.0.2","maintainers":[{"name":"erights","email":"erights@gmail.com"},{"name":"katesills","email":"kate@agoric.com"},{"name":"michaelfig","email":"michael@fig.org"},{"name":"warner","email":"warner-npm@lothar.com"}],"homepage":"https://github.com/Agoric/agoric-sdk#readme","bugs":{"url":"https://github.com/Agoric/agoric-sdk/issues"},"dist":{"shasum":"06e1925bb07a310d4a6d28c7a8ee3eeff91d14c5","tarball":"https://registry.npmjs.org/@agoric/pixel-demo/-/pixel-demo-0.0.2.tgz","fileCount":19,"integrity":"sha512-Lh7MRmTrnvI2V8/qBzYm5AW8et4EuNmqXWlLq5gMXM1jcB2eOjU1ZwS60ej06rPU3zJyS1wd6NKtaFN+IEgCNQ==","signatures":[{"sig":"MEYCIQC1nCntP+LAQz/OpJGsMwGkQ2NjAZcJsYYaxyKijFx9LgIhAOi2+6n0M/hiJYEaljQLYBIcrTuw0EyfqPJcBjkUR1VH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":647839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeONIpCRA9TVsSAnZWagAABsgP/0TiF8fCS+ClzteNQhO7\nzeUUCAmS2Yx8G3P2TzRdfcplx0aoPe6Zvrl8fRmwaYaMVENOgMLyFst2Y5Yj\nMvPm7qyCbPG2hv3X79Z2EDy9x3b0gPXbK71rcOPTmZZQ2WbNHeJZ0vbCh86C\nMizpd27GUkmzFCoca0AWzmYiQGjfzOxe4oTZZHSID4oblauid1lsA9xO/Uqj\n0HYW6aMeAlwc9OonuZA4z92MGQLY1HJcMLLZ+cxkM4JB9/njZPzfO1yRoz/7\nKu6VymnD95r67XnlUxhsp6N8eskVb2OltuPDdCi1cZUu2wz5AOWaJeeGxEyZ\nEccwaXuUaN4GjB+CLpYffsK01shfpd1IR8wz/bQnJNXLWpqNJ3v6tIa7OQfI\n7YSPa+C8+kyUkWxdrSluXnnnFn0jHWSGzCCnA/W2yXBiquG9M6LjmrSq37bX\nS4WgjGImEL6ELUlTgfrF8ePVTVd3nhNtctaCQOP6ZTpObsxddXXiB6FUqRXg\nqlfw8ss6wP/lu5dGQWZIg1TQkaneryARmcp8Or4L5qa7vl6s8SQKw9FsSvDR\nxqpA3bKgSCOodqG7h6iFd7SQ6lWMYMt8FSlNKUgm5L6Dafk+Dp3Mu26tPeH9\nJdwDyA6z76NzXWTnfG48oFXwn9IofjMMu2BIjJRFxn0spoOJJhD4s07z/3Hh\n1DdP\r\n=4duh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/gallery.js","engines":{"node":">=11.0"},"scripts":{"test":"tape -r esm 'test/**/test*.js' | tap-spec","build":"exit 0","lint-fix":"eslint --fix '**/*.js'","lint-check":"eslint '**/*.js'","lint-fix-jessie":"eslint -c '.eslintrc-jessie.js' --fix '**/*.js'","lint-check-jessie":"eslint -c '.eslintrc-jessie.js' '**/*.js'"},"_npmUser":{"name":"katesills","email":"kate@agoric.com"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"url":"git+https://github.com/Agoric/agoric-sdk.git","type":"git"},"description":"An example non-fungible token and app using ERTP","directories":{},"dependencies":{"@agoric/nat":"^2.0.1","@agoric/ertp":"^0.3.0","@agoric/store":"^0.0.1","@agoric/harden":"^0.0.4","@agoric/insist":"^0.0.1","@agoric/spawner":"^0.0.2"},"eslintConfig":{"env":{"es6":true},"rules":{"strict":"off","no-console":"off","arrow-parens":"off","no-loop-func":"off","no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_"}],"no-return-assign":"off","no-param-reassign":"off","no-restricted-syntax":["off","ForOfStatement"],"no-inner-declarations":"off","no-unused-expressions":"off","function-paren-newline":"off","implicit-arrow-linebreak":"off","import/prefer-default-export":"off"},"extends":["airbnb-base","plugin:prettier/recommended"]},"eslintIgnore":["bundle-*.js"],"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","tape":"^4.11.0","tap-spec":"^5.0.0","tape-promise":"^4.0.0","@agoric/evaluate":"^2.2.0","@agoric/swingset-vat":"^0.3.0","@agoric/sharing-service":"^0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/pixel-demo_0.0.2_1580782120800_0.34183876867575225","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@agoric/pixel-demo","version":"0.0.3","keywords":["smart","contract","cryptocurrency","exchange","tokens"],"author":{"name":"Agoric"},"license":"Apache-2.0","_id":"@agoric/pixel-demo@0.0.3","maintainers":[{"name":"erights","email":"erights@gmail.com"},{"name":"katesills","email":"kate@agoric.com"},{"name":"michaelfig","email":"michael@fig.org"},{"name":"warner","email":"warner-npm@lothar.com"}],"homepage":"https://github.com/Agoric/agoric-sdk#readme","bugs":{"url":"https://github.com/Agoric/agoric-sdk/issues"},"dist":{"shasum":"4c914c3cf8ed56d2e7af34e566ce5255997020ab","tarball":"https://registry.npmjs.org/@agoric/pixel-demo/-/pixel-demo-0.0.3.tgz","fileCount":19,"integrity":"sha512-6cNKjnCc4qr8pG77kuMsYC1YsVEiZaUV5JMPSx5l7iL16+WlzTk1UWKtWHqclsLlw9SNIO+3oGcA21tVHI4PIg==","signatures":[{"sig":"MEYCIQDpuhHAFxSjgf1zjNFh129JDo8faVp2jBkcGnGMeoDNQwIhAOzaRbdDfj7a/SAl6Snqp3c5IyaSNLAZl7fhixC9P8UA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":647932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOcgfCRA9TVsSAnZWagAAcDMP/2SC4l4FqdR2IZQ/zhf7\n5ijb+EOdxNZ6MAWqm7mkl82XvqEYuZq7zPlK0T9P94TsUeGLC2niFFLtu9y1\n0JZ6BNMy/u1Ri/O75XudTSwFsUM1l0KiiQz4mgUuWx1VjCmAiyCU5Af1pYko\nuL024i2jFTU4pSXskYTcQoJgoJDwONFGGK0C9ohQWTb1mY/aGEyghX6HtYHz\nI1kpwc/xc4hHzpGhlOgpoaGZ2eDnGFvCEnraOOionMsqlk4iSOfVDyhDecgT\nqbyMmaMZ9UDQ8nqR9nEYJ+G3bJInZ66H7yJhnF1rD8gS35fCOHVh0CHJjxY3\nOrc2fXFC7oZowzU9nhjQLitG0L5+tJ2F0xwOq5cXYdrbnzHD9j1v5V3p7pMj\nqlRKtk3/cUXhzwNwHwt67wy1aa/8wmUeSuTQ/6PyN9DiQYjjby71ongCaEd4\nF5LShHytwgvhXrh5Y2a2i9m869osVYZoEfHu9kp6Ym1vza4XFZLQZffr9mGX\noANMe9eEf1I0eJxObr8Q1TWE/15izVHm8e8URcmCr7TetUJJmMDMo4La9il9\nkiScITifAoslGXi8FSpgk0TYxEKmJAzAwRVu5I1zJ5KgNxMw/adwyr9Z0RUi\nG709+xeBaUU97DZUNy10cULlDYmiwHQX5oC/31gOEInY/POs/Pj7Qz6LM9oL\nRMTE\r\n=PxsG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/gallery.js","engines":{"node":">=11.0"},"scripts":{"test":"tape -r esm 'test/**/test*.js' | tap-spec","build":"exit 0","lint-fix":"eslint --fix '**/*.js'","lint-check":"eslint '**/*.js'","lint-fix-jessie":"eslint -c '.eslintrc-jessie.js' --fix '**/*.js'","lint-check-jessie":"eslint -c '.eslintrc-jessie.js' '**/*.js'"},"_npmUser":{"name":"katesills","email":"kate@agoric.com"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"url":"git+https://github.com/Agoric/agoric-sdk.git","type":"git"},"description":"An example non-fungible token and app using ERTP","directories":{},"dependencies":{"@agoric/nat":"^2.0.1","@agoric/ertp":"^0.3.1","@agoric/store":"^0.0.1","@agoric/harden":"^0.0.4","@agoric/insist":"^0.0.1","@agoric/spawner":"^0.0.3"},"eslintConfig":{"env":{"es6":true},"rules":{"strict":"off","no-console":"off","arrow-parens":"off","no-loop-func":"off","no-unused-vars":["error",{"argsIgnorePattern":"^_","varsIgnorePattern":"^_"}],"no-return-assign":"off","no-param-reassign":"off","no-restricted-syntax":["off","ForOfStatement"],"no-inner-declarations":"off","no-unused-expressions":"off","function-paren-newline":"off","implicit-arrow-linebreak":"off","import/prefer-default-export":"off"},"extends":["airbnb-base","plugin:prettier/recommended"]},"eslintIgnore":["bundle-*.js"],"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","tape":"^4.11.0","tap-spec":"^5.0.0","tape-promise":"^4.0.0","@agoric/evaluate":"^2.2.0","@agoric/swingset-vat":"^0.3.0","@agoric/sharing-service":"^0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/pixel-demo_0.0.3_1580845087067_0.26561573489370005","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-02-04T00:29:48.763Z","modified":"2026-05-05T21:00:47.297Z","0.0.1":"2020-02-04T00:29:49.116Z","0.0.2":"2020-02-04T02:08:41.112Z","0.0.3":"2020-02-04T19:38:07.273Z"},"bugs":{"url":"https://github.com/Agoric/agoric-sdk/issues"},"author":{"name":"Agoric"},"license":"Apache-2.0","homepage":"https://github.com/Agoric/agoric-sdk#readme","keywords":["smart","contract","cryptocurrency","exchange","tokens"],"repository":{"url":"git+https://github.com/Agoric/agoric-sdk.git","type":"git"},"description":"An example non-fungible token and app using ERTP","maintainers":[{"email":"erights@gmail.com","name":"erights"},{"email":"mathieu+npmjs@agoric.com","name":"mhofman"},{"email":"michael@fig.org","name":"michaelfig"},{"email":"kris.kowal@cixar.com","name":"kriskowal"},{"email":"devops@agoric.com","name":"agoricbot"},{"email":"mujahidkay@gmail.com","name":"mujahidkay"},{"email":"richard.gibson@gmail.com","name":"gibson042"},{"email":"sam@agoric.com","name":"samsiegart"}],"readme":"# Pixel Demo\n\nThis demo is roughly based on [Reddit's\nr/Place](https://en.wikipedia.org/wiki/Place_(Reddit)), but has a \nnumber of additional features that showcase the unique affordances of\nthe Agoric platform, including: higher-order contracts, easy creation\nof new assets, and safe code reusability.\n\n| ![Reddit's r/place](readme-assets/rplace.png) | \n|:--:| \n| *Reddit's r/place as a social experiment in cooperation* |\n\n\n## Installation\n\n| <img src=\"readme-assets/pixel-demo.png\" alt=\"Pixel Gallery\"> | \n|:--:| \n| *The testnet pixel demo. Slightly fewer pixels.* |\n\n\nThe pixel demo runs on [our private\ntestnet](https://github.com/Agoric/cosmic-swingset#agorics-cosmic-swingset).\nFor instructions on how to run a local, off-chain version for\nyourself, please see [Scenario 3](https://github.com/Agoric/cosmic-swingset#different-scenarios).\nThe testnet documentation also includes a [short walkthrough of the\ndemo with sample commands](https://github.com/Agoric/cosmic-swingset#gallery-pixel-demo). If you would rather view the code and learn\nmore about how the demo works, feel free to read on.\n\n## ERTP: Electronic Rights Transfer Protocol\n\nThe pixel demo uses our smart contract framework, called ERTP, or the\nElectronic Rights Transfer Protocol. Throw away all you know about\npublic key hashes mapped to account balances, because ERTP doesn't use\n'em. In fact, ERTP itself doesn't have any concept of cryptography.\nInstead, it uses object capabilities to enforce access control.\nInstead of having to prove ownership of a corresponding private key,\nin the world of object capabilities, if your program has a reference\nto an object, it can call methods on that object. If it doesn't have a\nreference, it can't. For more on object capabilities, see [Chip\nMorningstar's\npost](http://habitatchronicles.com/2017/05/what-are-capabilities/).\nFor more on ERTP, [see a quick tutorial](README.md) and the ERTP\ninterface descriptions [for assay.js](core/assay.chainmail),\n[unitOps.js](core/unitOps.chainmail) and [contractHost.js](core/contractHost.chainmail).\n\n\n## A preemption hierarchy of rights\n\nAll of the pixels (individual squares) on the demo webpage\nare owned by the gallery, the code that administrates the pixels. The\ngallery has the power to revoke the pixels from any user at any time. When a user\ncalls `gallery!tapFaucet()`, the gallery takes the least recently\ncolored pixel from its current holder (if anyone holds it) and gives\nit to the user in the form of an ERTP payment. \n\n| ![The hierarchy of rights in the pixel demo](readme-assets/hierarchy-pixel-rights.png) | \n|:--:| \n| *The preemption hierarchy of rights in the pixel demo* |\n\nThe gallery is able to revoke the pixels held by users because the\npixel demo creates a customized version of ERTP in which rights are\n*hierarchical*. Hierarchical rights are familiar in property. For\ninstance, a property owner might lease an apartment to a tenant, who\nmight in turn, lease it to a subtenant. Anyone higher in the hierarchy\ncan take away access from anyone lower in the hierarchy, and give it\nto someone else. \n\n## Using Pixels\n\nERTP provides a `makeMint` function that takes in a configuration\nfunction. The pixel demo configuration implements the hierarchical\nrights and allows us to add additional methods to purses and payments.\n\nTo be able to color a pixel, the user must first get a \"use object\"\nfrom a purse or payment that contains pixels:\n\n```js\nconst useObj = E(payment).getUse()\n```\n The \"use object\" that they receive acts just like any\nother JavaScript object. It has methods (in this case, all associated\nwith coloring the pixels in the underlying purse or payment) that can\nbe called. To color, the user does:\n\n```js\nE(useObj).changeColorAll('#000000');\n```\n\nwith the hex color of their choice. \n\n## Transferring revocable rights\n\nWhen a user wants to give another user the ability to color a pixel,\nbut wants to be able to revoke that ability later, the user can call\n`claimChild` and pass the childPayment to the other user. The\nother user can tell that they aren't getting a payment on the same\nlevel as one that the gallery would give out, and it could be revoked\nat any point if `claimChild()` is called again on the original\npayment. \n\n## Buying and selling pixels\n\nThe users can buy and sell pixels with the gallery at any time by\ncalling `sellToGallery(pixelUnits)` and\n`buyFromGallery(pixelUnits)`. They must pass in a `units` that\ndescribes exactly what they want to sell or buy. If successful, they\nwill get an invitation from the gallery for a simple, secure escrow\nexchange of the pixels for \"dust\", the currency that the gallery\ntransacts in. Users do not start out with any dust - they only start\nout with access to the faucet.  \n\nIn order to amass the pixels that they want in order to draw their\nmasterpiece, the user will need to sell some pixels to get dust. The\ngallery will always buy pixels back, but it values pixels near the\ncenter much more than pixels on the periphery. \n","readmeFilename":"README.md"}