Coder Social home page Coder Social logo

lnft's Introduction

Token Ocean

Token Ocean is a web-based platform for issuing and transacting with non-fungible tokens on the Bitcoin Liquid Network. Blockstream is sponsoring its development and hosting an exemplary curated instance of it for use by Bitcoin artists at Raretoshi.

The plan is to separate out any Raretoshi-specific features from the core platform functionality so that anyone can adapt the platform to host their own Liquid-based NFT site but that's currently a work in progress

Features

  • User accounts and profiles for artists and collectors include custom avatars, contact info and biography
  • Users can follow other artists and collectors and like/favorite individual artworks
  • Artists can upload digital media files (jpg, png, gif, mp4) representing an artwork and add metadata like a title, description, and tags
  • Selected metadata is published in the liquid asset registry so that tokens can be recognized by external wallets
  • Media files are added to the IPFS network upon being uploaded and are given a unique content identifier (CID) derived from the SHA256 hash of the file
  • The CID is embedded in the Liquid token issuance transaction contract, permanently and provably linking the file to the token
  • Artworks are listed in a searchable/sortable/filterable marketplace gallery
  • Artists can list an artwork for sale by setting an optional listing price, royalty rate, and/or auction period
  • Bids and sales are conducted peer-to-peer using atomic swaps so the platform host does not need to escrow funds
  • Listings, bids, transfers and new artwork activity are logged and presented in a site-wide feed
  • A web-based liquid wallet is integrated into the user's profile page and allows them to fund their accounts with L-BTC or any kind of liquid asset
  • Wallets can be backed up and imported using a 12-word BIP mnemonic seed phrase
  • Built-in integration with the coinos.io API allows users to instantly convert BTC to L-BTC by depositing to an on-chain address or paying a lightning network invoice
  • Royalties and auction holding periods are enforced through a 2-of-2 signing server that only signs off on transactions that meet certain conditions

Tech stack summary

Front-end

Back-end

3rd-party APIs:

Installation pre-requisites

Setup local development environment

pnpm install
cd hasura
cp .env.sample .env
docker run -it -v $PWD/app:/app --entrypoint pnpm asoltys/lnft-server install
docker-compose up -d
hasura migrate apply
hasura metadata apply
hasura seeds apply
hasura metadata reload
sudo cp ../static/user.png storage/QmcbyjMMT5fFtoiWRJiwV8xoiRWJpSRwC6qCFMqp7EXD4Z
docker exec -it ipfs ipfs add /export/QmcbyjMMT5fFtoiWRJiwV8xoiRWJpSRwC6qCFMqp7EXD4Z
docker restart lapp
cd ..
pnpm dev   # site is available at http://localhost:3000/

Setup pre-commit git hooks

We have a pre-commit git hook for running prettier on all files to keep the formatting consistent.

git config core.hooksPath "./git_hooks" - This will set the git config path to use this directory for hooks.

chmod +x ./git_hooks/pre-commit - This will give the hook the necessary permissions to run.

Setup local development with cloud tools - VS CodeSpaces https://vscode.dev

 npm i -g pnpm
 pnpm install
 curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
 cd hasura
 cp .env.sample .env
 docker run -it -v $PWD/app:/app --entrypoint pnpm asoltys/lnft-server install
 docker-compose up -d
 hasura migrate apply
 hasura metadata apply
 hasura seeds apply
 hasura metadata reload
 sudo cp ../static/user.png storage/QmcbyjMMT5fFtoiWRJiwV8xoiRWJpSRwC6qCFMqp7EXD4Z
 docker exec -it ipfs ipfs add /export/QmcbyjMMT5fFtoiWRJiwV8xoiRWJpSRwC6qCFMqp7EXD4Z
 docker restart lapp
 cd ..
 pnpm dev   # site is available at http://localhost:3000/
 chmod +x mine.sh
./mine.sh   # this script will run continually to mine regtest blocks, you may want to run it in a separate terminal window or tab

Fund a wallet with regtest coins

Get a deposit address from the wallet page or users table in the db and send an amount with this command

docker exec -it liquid elements-cli -datadir=/home/elements/.elements sendtoaddress <address> <amount>

lnft's People

Contributors

asoltys avatar eskyee avatar grubles avatar ihorml avatar kononenkomg avatar mysolso avatar omgmanu avatar prochronist avatar secondl1ght avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lnft's Issues

List price transaction executes but new ownership not reflected

There have been a few cases where a list price swap transaction has been broadcast and confirmed but the transaction wasn't logged in the database properly so the artwork ownership isn't updated.

We should do a periodic balance check on all owner addresses to verify if the artworks are where the database thinks they are, and update the database accordingly.

In the case that an artwork moves to an address we don't recognize we can presume that it's still with the last known owner but should indicate that it's no longer for sale on the platform.

Cannot apply "has one bid" filter on the market page

Description

I've set up the project and submitted 2 artworks (one listed & one non-listed).

When I'm trying to apply "Has one bid" filter I've got the following error:
Screenshot 2021-08-10 at 00 57 35

After that, the whole app freeze and I can't click anywhere.

Demonstration
market-toggle-bug

Assets pages should have HTML meta descriptions

Right now sharing the assets on the web just displays a generic description of the site instead of the asset

  • It's very helpful to be able to share the NFTs on the web.
  • The link should include a preview of the NFT so people can share the links on twitter/telegram/whats/etc.

Current Behaviour:
Screen Shot 2021-10-26 at 15 22 37

Expected Behaviour:
Screen Shot 2021-10-26 at 15 24 48

Multiple royalty recipients

Owners should be able to specify additional royalty recipients besides just the original artist. In some cases, the operators of the platform itself may want to receive a percentage of every sale. In other cases, multiple artists/collaborators may want to set up a kind of profit sharing agreement, or have a deal in place with some third party agent or agency that receives a percentage of the sales.

Validate media formats

We need to add validation to prevent people from uploading files with unsupported extensions

creating a new user, & edit profile save bug

Reproducing my bug on jungle master branch.

the profile pic, avatar is not saving bug. At the first attempt. ..

Create a new user

Skip set up wallet.

Click back to profile.

Click edit profile.

Click Change Avatar.

Add any pic...

Click Save Details... Nothing happens here..
but I see the new picture added in the top right nav bar.. but not in the profile box, so Strange Error,


Now.. After I Refresh the page.. and adding new pic again then save.. its working ok!! Save details works

I see picture in the top right nav bar. And profile box now.

But Not sure how to debug this. Error

Maybe I got a temporary timeout socket problem?? @asoltys

Unhandled Promise Rejection: Error: {"statusCode":500,"code":"ECONNRESET","error":"Internal Server Error","message":"socket hang up"}

SVG Artwork uploads, but SVG image shows as image broken in card.. this is front page only

a SVG uploads ok, and showed on page ok product page, but the image shows image link broken in card.. front page only!!

also Adam is it possible get a list of compatible formats. for upload on Raretoshi
as I can't seem to find..
also is zip file possible ??
And is there a max mint limited on artists accounts ??
also upload size limit ??

also when im doing multi editions minted, 1/50 can we group them on front page under a artist ??, as to make market page look cleaner.. with Artists drops.. I dig the code and see if I can understand more!!

just testing out some formats MP4, bitrates, etc

but does wave or MP3 listed as a format, or just MP4 lossless, AAC ?? etc etc

cheers @asoltys

Failing: Setup local development environment

From windoze power shell

git clone https://github.com/liquidnft/lnft
cd lnft
yarn
cd hasura
cp .env.sample .env
cd app
yarn
cd ..
docker run -it -v ${PWD}/app:/app --entrypoint yarn asoltys/lnft-server
docker-compose up -d
hasura migrate apply

All steps complete OK until hasura migrate apply fails with a table does not exist error:

WARN [cli: v2.0.9] [server: v1.3.3] version mismatch: cli and server does not match
time="2021-09-12T10:56:30+10:00" level=fatal msg="{\n  \"internal\": {\n    \"statement\": \"\\n                SELECT table_schema, table_name, is_enum, configuration::json\\n                FROM hdb_catalog.hdb_table\\n                 WHERE is_system_defined = 'f
alse'\\n                ORDER BY table_schema ASC, table_name ASC\\n                    \",\n    \"prepared\": false,\n    \"error\": {\n      \"exec_status\": \"FatalError\",\n      \"hint\": null,\n      \"message\": \"relation \\\"hdb_catalog.hdb_table\\\" does n
ot exist\",\n      \"status_code\": \"42P01\",\n      \"description\": null\n    },\n    \"arguments\": []\n  },\n  \"path\": \"$.args\",\n  \"error\": \"database query error\",\n  \"code\": \"unexpected\"\n}"

What am I missing?

Highlight Market current page

Description

Currently, the 3rd page is opened in the Market. But the user cannot see that. We should highlight the current page

Screenshot 2021-08-12 at 16 58 17

Wallet derivation path

People have tried importing their 12-word phrase into Aqua and Jade and don't see their funds show up. We should see if we can use the same derivation path they're using or possibly give users the option to specify a custom path when they setup their wallet.

Display the Fund dialog if user has unsufficent balance to create Art Item

it's supposed to popup a dialog prompting you to add funds to your account if you don't have enough to cover the issuance transaction fee. the dialog file is 'InsufficientFunds.svelte'. there's some logic that dismisses the dialog once funds are received. I think probably a bug is causing it to dismiss the dialog prematurely before it even gets a chance to display

Right now, if user press "submit" and he has insufficient funds to process the transaction - nothing happen

raretoshi-submit-issue

Global & Personalized Activity tabs

It would be nice to have 2 separate tabs in the "Activity" page to visualize site-wide activity and personalized activity for things more relevant to you (e.g. your bids, artwork or artists you are following...)

Send NFTs to other raretoshi users

It would be nice to have an easy flow for artists to list and send “free” NFTs.

Example: Artist is minting an NFT in Raretoshi but is making the physical artwork auction in a different platform (e.g. Scarcity). Once the physical artwork auction is over, the artist can then send the Raretoshi NFT to the winner of the auction. Ideally, the artist could send the NFT to a Raretoshi user wallet or an external Liquid wallet.

Also the site should reflect the new ownership of the NFT even though there was no actual bid&sell process

Meta for Artwork Page is not correct

During my work on a redesign, I noticed that in Head.svelte we have the following code:

<svelte:head>
  <meta name="twitter:card" content="summary_large_image" />
  <meta name="twitter:site" content="@raretoshi" />
  <meta name="twitter:creator" content="@raretoshi" />

  {#if $art}
    <meta property="og:title" content={`Raretoshi - ${$art.title}`} />
    <meta property="og:image" content={`/api/ipfs/${$art.filename}`} />
    <meta property="og:url" content={`https://raretoshi.com/a/${$art.slug}`} />
    <meta name="twitter:title" content={`Raretoshi - ${$art.title}`} />
    <meta name="twitter:image" content={`/api/ipfs/${$art.filename}`} />
  {:else}
    <meta property="og:title" content="Raretoshi" />
    <meta property="og:image" content="https://raretoshi.com/splash.png" />
    <meta property="og:url" content="https://raretoshi.com/" />
    <meta name="twitter:title" content="Raretoshi" />
    <meta name="twitter:image" content="https://raretoshi.com/splash.png" />
  {/if}
</svelte:head>

But during my tests, I figured out that we don't display different meta for Artwork. For e.g. - https://raretoshi.com/a/toxic-money-fiat-scavenger-2-14181

  <meta name="keywords" content="Bitcoin Liquid NFT Art" />
  <meta name="twitter:card" content="summary_large_image" data-svelte="svelte-14cogqk">
  <meta name="twitter:site" content="@raretoshi" data-svelte="svelte-14cogqk">
  <meta name="twitter:creator" content="@raretoshi" data-svelte="svelte-14cogqk">
  <meta property="og:title" content="Raretoshi" data-svelte="svelte-14cogqk">
  <meta property="og:image" content="https://raretoshi.com/splash.png" data-svelte="svelte-14cogqk">
  <meta property="og:url" content="https://raretoshi.com/" data-svelte="svelte-14cogqk">
  <meta name="twitter:title" content="Raretoshi" data-svelte="svelte-14cogqk">
  <meta name="twitter:image" content="https://raretoshi.com/splash.png" data-svelte="svelte-14cogqk">

The meta remains the same

(UX enhancement) Move "Create Artwork" button in the first screen of Profile

Description

Currently, to create a new Artwork I should scroll down for 3 screens to be able to press the button. I think we should move it somewhere else for people, who already have at least one submitted artwork.

Screenshot of current implementation

screencapture-localhost-3000-u-ihor-million-2021-08-12-17_42_28

Proposal 1 - Move button to Profile Header

As only Artists can see that button, we can move it to the Header for them.

submit-artwork-ex1

Proposal 2 - Keep button on Profile page but move next to tabs

Currently, our tabs (Creations/Collection/Offers, etc.) are centered on the right side of the page. I think we can assign them to the left side and add the "Submit Artwork" button to the right side.

submit-artwork-ex3

Proposal 3 - Move button to the Profile Menu

Idea is just to move this button next to Edit Profile link

submit-artwork-ex2

Hasura GraphQL secret in .env causing issue

I don't normally make these, so this might suck but I'll try be as descriptive as possible - maybe I'm missing something.

Running everything according to the steps in the README I get to the point of running this command
docker-compose up -d

and get this error
unexpected character "\"" in variable name near "\"HS256\", \"key\": \"25C134A00CF05C9BF583727A12778F52D0E7BD560D3A3ACF8E79127E9A56119D\"}\nSIGNING_SERVER_MNEMONIC=\"actor plate kit job awful guilt myself reunion praise twenty exact firm\"\n\n# optional settings for prod\nCLOUDFLARE_TOKEN=\nCLOUDFLARE_ZONE=\nDOMAIN=localhost\nCOINOS_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJhcmV0b3NoaSIsImlhdCI6MTYzMDM1ODE2MX0._hCtzsXcagiWoUPa7m3Hn-HqRlXaMjI0xsIfppEn56U\nCOINOS_URL=http://app:3119\nSERVER_URL=\"http://localhost:3000\"\nSMTP_HOST=\"\"\nSMTP_PORT=587\nSMTP_USER=\"\"\nSMTP_PASS=\"\"\nSMTP_SENDER=\"\"\n"

so I updated the .env to this
HASURA_GRAPHQL_JWT_SECRET="25C134A00CF05C9BF583727A12778F52D0E7BD560D3A3ACF8E79127E9A56119D"

And most of the docker instances run, but Hasura doesn't.
On looking at the log i see this
Fatal Error:- Environment variable HASURA_GRAPHQL_JWT_SECRET: Error in $: endOfInput

So it seems like it wants the object formatted both ways maybe?

But also I'm really not sure if I'm just missing a thing?

Withdrawal fee not reported accurately

From HennethAnnun on Telegram:

Since I have this cypherpunk in a wallet (?) I tried to withdraw it somewhere (I choose coinos liquid address).
My liquid saldo was 0, so on withdrawal I got a message I need 0,000011 for fees. I funded the account via sideshift with 0.00002013, then proceeded to withdrawal. The actual fee deducted was 0.00001913 (interesting).
In the history the asset was not shown as withdrawn (to be expected since I think I'm exploiting a bug here).
Interestingly, details of the transaction show something went through.

Check migrations

Running the latest master with fresh install I can see the following errors:

Screenshot 2021-10-05 at 12 24 22

Screenshot 2021-10-05 at 12 23 06

Screenshot 2021-10-05 at 12 23 24

Follow function

A user reported following about 40 accounts and then later found they were only following 6. Need to investigate why the other follows didn't persist.

Show specific artwork image when sharing a raretoshi link

Current behaviour

Currently when a raretoshi users shares URL of a specific artwork in social media platform like Twitter, only a generic raretoshi banner is displayed.

Screen Shot 2021-09-02 at 11 34 44 AM

Right now, users have to do a workaround by posting a screenshot of the artwork

Screen Shot 2021-09-02 at 11 35 06 AM

Desired Behaviour

It would be nice that when sharing a URL of a specific artwork in raretoshi, an image or thumbnail of the artwork would be displayed in the social post

Balance shows zero when funds are locked up in a bid

When a user has an active bid or bids out, the UTXOs that are used to make those offers are marked as locked to prevent them from being selected for other bids and double spent. This currently prevents those UTXO's from being selected for the total wallet balance calculation though and causes users to see a zero balance.

Display followers, follow notifications

Users should be able to see who their followers are and be notified when someone new follows them so they can follow back. (Suggestion from CountBitcoin on Telegram)

Bad UX issuing multiple artworks

Description

I've tried to issue multiple Artworks and I had 2 different application behavior cases:

1. Issue multiple artworks & press "continue" issuing

When I press "continue" the issuing keeps processing on a background

issue-multiple-artworks

2. Issue multiple artworks & press "cancel" issuing

When I press "cancel" the issuing keeps processing on a background (the same behavior as I press continue)

issue-multiple-artworks-3

3. Issue multiple artworks (no window presented)

We don't display a dialog (like above) in some cases.

issue-multiple-artworks-2

Ideas & Proposals

I understand the technical side of this aspect and that we should issue artworks on a front-end side only. But issuing process can be interrupted if the user reloads the browser. I think we should provide a better UX for this:

  • First of all, we should keep issuing progress in localStorage and after page reload - continue to issue artworks
  • The second thing is, we should display somewhere informer (even on the left-bottom side of the screen) displaying progress but without overlay to let users use our app
  • The third thing, we should let user to cancel the issuing (because currently cancel button just hide the issuing window but continue to issue on a background)

Jumping Header

Description

When user scrolls down, our header becomes fixed and freeing space, so the content jumps up. The same jerking you can see if you scroll to top, header becomes regular element and content jumps down.

jumping-header

Royalty removal

If someone is receiving royalties from a particular artwork, there should be a mechanism for them to voluntarily opt out. This could involve signing some kind of a message with their pubkey.

Favorites not working

After favoriting an artwork by clicking the heart icon, the favorites counter increases and the icon turns active, but the artwork doesn't appear on the favorites tab within the user profile page.

Profile Creations sorting logic

(UX suggestion) I suppose that end users of the platform would like to see the recently created items at the top of Creations list. Currently, I don't understand what is the algorithm of sorting on this page:

screencapture-localhost-3000-u-ihor-million-2021-08-10-01_38_23

Watch-only wallets, external signing, Marina integration

It'd be nice to let users manage their keys with an external wallet and just provide their address or possibly an HD pubkey for transaction construction. We could generate PSET's for other wallets to sign and let users export them by copying to clipboard or request a signature via Marina's API.

Dutch auctions

It would be nice to support dutch auctions using timelocked swap transactions, as described here

Withdraw to BTC address or LN invoice

Right now we let users deposit via BTC or LN and automatically conver to L-BTC through coinos. We should support the reverse operation for withdrawing as well.

I couldn't see the offer from the original artist

Steps to reproduce:

  1. user1: Create an artwork
  2. user1: List that artwork
  3. user2: Offer the price
  4. user1: Accept the offer
  5. user2: List the purchased artwork
  6. user1: Offer the price
  7. user2: Can't see the offer

History screenshot of the item (user1 = ihor-million, user = test1)

Screenshot 2021-08-10 at 01 13 51

user2 offers

Screenshot 2021-08-10 at 01 14 20

Btw, user2 can accept the offer using a link in History, but he can't see the offer in Offers

Unable to sell Art - "not finalized" error pop-up

When I try to accept an offer from a dummy user i receive the "not finalized" error pop-up.
My System is Ubuntu 20.04

This is my log:


extractTransaction@http://localhost:3000/web_modules/@asoltys/liquidjs-lib.js:11841:53
accept@http://localhost:3000/_components/AcceptOffer.js:76:17
async*click_handler@http://localhost:3000/_components/TransactionTime.js:428:35
EventListener.handleEvent*listen@http://localhost:3000/web_modules/svelte/internal.js:238:10
listen_dev@http://localhost:3000/web_modules/svelte/internal.js:1616:27
mount@http://localhost:3000/_components/TransactionTime.js:246:15
mount@http://localhost:3000/_components/TransactionTime.js:138:29
mount@http://localhost:3000/_components/TransactionTime.js:337:27
createProxiedComponent/instrument/targetCmp.$$.fragment.m@http://localhost:3000/web_modules/svelte-hmr/runtime/hot-api-esm.js:163:25
mount_component@http://localhost:3000/web_modules/svelte/internal.js:1412:26
mount@http://localhost:3000/_components/Activity.js:185:19
createProxiedComponent/instrument/targetCmp.$$.fragment.m@http://localhost:3000/web_modules/svelte-hmr/runtime/hot-api-esm.js:163:25
mount_component@http://localhost:3000/web_modules/svelte/internal.js:1412:26
mount@http://localhost:3000/_app/routes/artwork/[id].js:2503:19
update@http://localhost:3000/_app/routes/artwork/[id].js:983:22
update@http://localhost:3000/_app/routes/artwork/[id].js:2997:41
update@http://localhost:3000/web_modules/svelte/internal.js:764:36
flush@http://localhost:3000/web_modules/svelte/internal.js:732:19
promise callback*schedule_update@http://localhost:3000/web_modules/svelte/internal.js:707:26
make_dirty@http://localhost:3000/web_modules/svelte/internal.js:1444:9
init/$$.ctx<@http://localhost:3000/web_modules/svelte/internal.js:1480:31
setup@http://localhost:3000/_app/routes/artwork/[id].js:3094:32
async*instance/$$self.$$.update@http://localhost:3000/_app/routes/artwork/[id].js:3381:12
init@http://localhost:3000/web_modules/svelte/internal.js:1485:8
U5Bidu5D@http://localhost:3000/_app/routes/artwork/[id].js:3434:7
createProxiedComponent@http://localhost:3000/web_modules/svelte-hmr/runtime/hot-api-esm.js:211:9
ProxyComponent@http://localhost:3000/web_modules/svelte-hmr/runtime/hot-api-esm.js:452:42
Proxy<[id]>@http://localhost:3000/web_modules/svelte-hmr/runtime/hot-api-esm.js:516:11
create_if_block@http://localhost:3000/_app/routes/a/[slug].js:43:14
update@http://localhost:3000/_app/routes/a/[slug].js:117:17
update@http://localhost:3000/web_modules/svelte/internal.js:764:36


Incorrect behaviour of the auction when it ends

From Raretoshi telegram chat:

Good morning, I do think that’s not good if auction ended and after that anybody can bid on that piece whenever they want and win it in seconds because Auction is already enden. The issue is here because they can bid on it after the auction. Is that possible to change?

image

If no one bids during the start-end period of the auction, the first bid with any price will win the auction even if it is not in progress.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.