Skip to content
RicheySonPublic

About

Non-custodial NFT marketplace on Bitcoin Cash (CashTokens and CashScript). Tested on BCH Chipnet.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bazaar

Network: Bitcoin Cash Chipnet | CashTokens | CashScript covenants

A non-custodial NFT marketplace on Bitcoin Cash. Listings, auctions, royalties and related trades are enforced with CashScript covenants. Keys stay with the user. The public demo runs on BCH Chipnet, not mainnet.

Live demo: bazaar-three-gamma.vercel.app

Developed with the BCH-1 Hackcelerator.

Features

  • Fixed-price listings: NFT and BCH payment settle in a single atomic swap
  • English auctions: time-locked bidding with automatic refunds for outbid bidders
  • Creator royalties encoded in the covenant (configurable, including a 0-25% range in the original marketplace contract)
  • NFT minting, collections and scheduled drops
  • Fractionalised NFTs (fractional-vault.cash and fractional-claims.cash)
  • Instant sell, which tries collection bids first and can fall back to a pool offer
  • Floor sweep, so a collector can buy several of the cheapest listings in one flow
  • BCMR metadata badges when a collection publishes a registry URL
  • Activity feed and address-based profile pages
  • Nexus / Bazaar SDK for floor prices, listings, instant sell, bids and related market data
  • In-app HD wallet (BIP39 / BIP32), with WalletConnect support when a project id is set
  • Non-custodial signing in the browser
  • IPFS metadata storage via Pinata

Tech stack

  • Blockchain: Bitcoin Cash Chipnet
  • Token standard: CashTokens (CHIP-2022-02)
  • Contracts: CashScript (cashc / cashscript)
  • Frontend: Next.js 15 (App Router), React 19, TypeScript
  • Styling: Tailwind CSS, Framer Motion
  • State: Zustand
  • IPFS: Pinata
  • Wallet: @scure/bip39, @scure/bip32, @bch-wc2/web3modal-connector
  • Network: Electrum (Chipnet)

Quick start

npm install
cp .env.example .env.local
# Fill PINATA_JWT and any other values you need. Variable names only; do not commit secrets.
npm run dev

Then open http://localhost:3000.

Chipnet test coins

  1. Create a wallet in the app.
  2. Copy the address.
  3. Use the Chipnet faucet at tbch.googol.cash for tBCH.

Environment variables

Copy .env.example (and, if you use it, .env.local.example) to .env.local. Names used in those files:

  • PINATA_JWT
  • NEXT_PUBLIC_PINATA_GATEWAY
  • NEXT_PUBLIC_PINATA_UPLOAD_TIMEOUT_MS
  • PINATA_TIMEOUT_MS
  • NEXT_PUBLIC_ELECTRUM_HOST
  • NEXT_PUBLIC_ELECTRUM_PORT
  • NEXT_PUBLIC_ELECTRUM_SCHEME
  • NEXT_PUBLIC_ELECTRUM_SERVERS
  • NEXT_PUBLIC_ELECTRUM_TIMEOUT_MS
  • NEXT_PUBLIC_ELECTRUM_PING_MS
  • NEXT_PUBLIC_NETWORK
  • MARKETPLACE_INDEX_CACHE_MS
  • WALLET_CACHE_MS
  • WALLET_TIMEOUT_MS
  • WALLET_MAX_RETRIES
  • NEXT_PUBLIC_MARKETPLACE_FEE_PERCENT
  • NEXT_PUBLIC_DEFAULT_ROYALTY_PERCENT
  • NEXT_PUBLIC_LISTING_INDEX_ADDRESS
  • NEXT_PUBLIC_LISTING_INDEX_PKH
  • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID

Do not commit filled env files or API tokens.

Architecture

src/
├── app/                    # Next.js App Router pages
│   ├── page.tsx           # Landing page
│   ├── explore/           # Marketplace gallery
│   ├── create/            # Mint and list
│   ├── collections/       # Collections
│   ├── drops/             # Scheduled drops
│   ├── nft/[id]/          # NFT detail and buy
│   ├── auction/[id]/      # Live auction and bidding
│   ├── fractionalized/    # Fractionalised NFTs
│   ├── activity/          # Activity feed
│   ├── profile/[address]/ # Address profile
│   └── api/               # Server routes (wallet, marketplace, instant-sell, and others)
├── components/
├── lib/
│   ├── bch/               # Wallet, Electrum, contracts, indexer
│   ├── nexus-sdk/         # Marketplace SDK
│   ├── ipfs/
│   └── store/             # Zustand stores
contracts/
├── marketplace.cash
├── marketplace-v2.cash
├── auction.cash
├── auction-state.cash
├── instant-sell.cash
├── collection-bid.cash
├── fractional-vault.cash
├── fractional-claims.cash
└── p2pkh.cash
nexus-sdk/                 # Zero-dependency TypeScript client sources

More detail is in docs/features.md and BAZAAR_FEATURES.md.

Smart contracts

Marketplace (fixed price)

Marketplace(sellerPkh, price, creatorPkh, royaltyBasisPoints)
├── buy()    → Atomic swap: NFT to buyer, BCH to seller, royalty to creator
└── cancel() → Seller reclaims the NFT (requires signature)

Auction (English)

Auction(sellerPkh, minBid, endTime, creatorPkh, royaltyBasisPoints, minBidIncrement)
├── bid()     → Place a higher bid and refund the previous bidder
├── claim()   → Winner claims the NFT after timeout (pays seller and royalty)
└── reclaim() → Seller reclaims if there are no bids after timeout

Network status

  • Network: Bitcoin Cash Chipnet (testnet)
  • Electrum: chipnet.imaginary.cash:50004
  • Explorer: chipnet.chaingraph.cash
  • Faucet: tbch.googol.cash
  • Address format: bchtest:...
  • Mainnet launch is not claimed here

Scripts

npm run dev    # Development server
npm run build  # Production build
npm run start  # Production server
npm test       # Jest tests

License

MIT

About

Non-custodial NFT marketplace on Bitcoin Cash (CashTokens and CashScript). Tested on BCH Chipnet.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages