read.cash Log in

@dr.unstoppable

Joined 14 July 2021 · 2 posts

I make street art

120 KT

0 KT · $1.00 received · 0 KT · $1.34 given

Posts

@dr.unstoppable

BCH NFTs that do Smart things I’m a programmer who loves to make street art. I'm working on an NFT system that expands the functionality of BCH SLP thus avoiding the gas prices of ETH. I intend to work with the community to develop this system. I'm calling it a Buyer Gift NFT (BGNFT?) and I'm using it to sell canvas implementations of my street art. How Buyer Gift NFTs Work: Every time the token is sold, I take 10%. If that’s $50 or more, I’ll ship the buyer a physical implementation of the asset. Limit 1 per person per week. $60 if non-US shipping. My Plan: I need to get feedback from the SLP community, particularly the developers of juungle.net, to figure out a good implementation for my Buyer Gift business model. So far, I can think of 2 ways to do it. I would love your feedback on my ideas. https://www.juungle.net Idea 1, Multi-Sig Wallets: One way of implementing my model would be to restrict tokens I make to only be held in multi-signature wallets. My server would have a signature and the current owner would have one. I (the artist) would set up an API on my server to facilitate these wallets. The idea is that my server will only sign a transaction if I have been paid the 10% and if the recipient is also a multi-sig wallet of which it is a signatory. When purchasing a token I made in a marketplace, buyers will be informed that they need to set up a special wallet to receive the token before they buy it. The marketplace can then use my API to generate the wallet internally. The buyer will either opt out of the gift or specify a shipping address in the wallet setup dialogue. If the buyer wants the token sent to an external wallet the marketplace can check with my server if the destination is valid. Alternatively, the marketplace can just not do the check and leave buyer hanging but that wouldn’t be very nice. My server will have instructions and human web interfaces for handling transactions between wallets outside of marketplaces. Pros: The shipping address can be gathered when the wallet is set up. Works with existing systems. No SLP wallet or protocol change would be needed. Cons: The artist’s server could be a point of failure. Dishonest artists could try to adjust their cut after the token is minted. Buyers wouldn’t have as much control over their tokens. Idea 2, On-Chain Transactions: Use Bitcoin Cash smart contracts to create UTXOs (unspent transaction outputs) on the chain which enforce the artist’s cut and maintain the contract. In this case my Buyers Gift NFT deal isn’t an essential feature but rather will be facilitated by instructing buyers to send me their shipping addresses in a signed message on the site linked in the NFT. In this model users will track and buy NFTs on the blockchain through the wallet rather than marketplaces. I hope artists will be able to pay sites like marketplaces to list their NFTs and perhaps record user feedback ratings and other analysis. Otherwise, it could be hard for buyers to find NFTs for sale. I've included some CashScript code in this article and some explanation of how it works. If you are a more casual reader, feel free to skim this briskly or even just scroll past it. I recommend picking up again at the Pros and Cons part at the end of the page. https://cashscript.org/ The smart contract would have 2 functions: `buy`: Allows anyone to buy the NFT by paying everyone, changing the owner to themselves and setting a price. `setPrice`: Allows the owner to control the price as long as they are the owner. The buy function insures there are exactly 4 outputs of the transaction: The new contract output with the new owner that anyone can get at the set price. The 10% artist's cut. The 90% previous owner's cut. The change which goes back to the buyer. Here is the general idea of the code I’m proposing: `pragma cashscript ^0.6.0` `contract NFT(`                 `bytes20 owner,`                 `int price,` `){`                 `function buy(int newval,bytes20 buyer){`                                 `bytes newContract = 0x18 + newval + buyer + tx.bytecode.split(24)[1];`                                 `out1 = new OutputP2SH(bytes8(dust),hash160(newContract));`                                 `out2 = new OutputP2PKH(bytes8(price/10),ArtistKey);`                                 `out3 = new OutputP2PKH(bytes8(price - price/10),owner);`                                 `out4 = new OutputP2PKH(bytes8(int(bytes(tx.value)) - price - dust - 1000),buyer);`                                 `require(hash256(out1+out2+out3+out4) == tx.hashOutputs);`                 `}`                 `function setPrice(int newval,pubkey pk, sig s){`                                 `require(hash160(pk)==owner);`                                 `require(checkSig(s,pk))`                                 `bytes newContract = 0x04+newval+tx.bytecode.split(4)[1];`                                 `out1 = new OutputP2SH(bytes8(dust),hash160(newContract));`                                 `out2 = new OutputP2PKH(bytes8(int(bytes(tx.value)) - dust - 1000),owner);`                                 `require(hash256(out1+out2) == tx.hashOutputs);`                 `}` `}` Pros: Buyers have full control over tokens. The contract is mostly implemented on-chain. Would require some ecosystem changes but at least it doesn't need a BCH fork. Cons: Users would need to adopt new wallets. Will take substantially more effort to implement than the multi-sig idea. May cause mining fee bidding wars over competing attempts to spend a UTXO. I'm eager to hear your thoughts!

@dr.unstoppable

Compiling GS++ This article is intended for the GS++ developers. I hope other people find it useful. https://slp.dev/tooling/gs++/#introduction I want to run a BCH SLP graph search server, but I’m having trouble compiling the code. About me: I have a degree in Computer Science and 10 years work experience. I also love making street art. I use my computer-controlled laser cutter to make stencils. Then I send building owners anonymous letters asking if I can use the stencils on their wall to make art. I’m hoping I can further the BCH SLP NFT world and promote my art at the same time. My set up: I got a beefy server from a provider who allows full node wallets and has enough disk space to run a node (350Gb). It’s based in Los Angelis under the domain bchd.la1.aoe.art. Bitcoind is running and has the up-to-date BCH chain. I also installed Boost, SWIG 3 and gRPC. https://bchd.la1.aoe.art My gs++ compile time bug: After I “cmake ..” I run “make” (without the -j) and get: “`error: invalid use of incomplete type” on line 906 of the file “type_traits`” Doing some research, the nlohmann library lets a program use JSON objects in C++ but the dynamic object declaration is a little non-standard for some C++ compilers. One fix is to change the order in which files are included when the library is used. When I try running “`make nlohmann-json`” I get the same error. In the file unit-concepts.cpp, I moved line 32 “`#include <nlohmann/json.hpp>`” up to line 29, just above “`#include "doctest_compatibility.h"`” but that didn’t work. I then tried commenting out all the code in the unit-concepts.cpp file to be sure I was on the right track. However, this time when I compiled, I got an unrelated error: “`/usr/local/bin/grpc_cpp_plugin: error while loading shared libraries: libgrpc_plugin_support.so.1.41: cannot open shared object file: No such file or directory`” That sounds like a permissions thing, but I still want to solve the problem with the nlohmann library. Thank you for your help!