Ledgdex is a simple market on a dex. A dex is a website that dexweb makes from your own files.
A ledgdex is a dex with one more file: a signed ledger that only grows (ledgdex.jsonl). Each seller and each buyer keeps a ledgdex.
A trade then has three records:
- the claim that the buyer signs
- the record of the claim that the seller signs
- the copy of that record that the buyer keeps
Ledgdex needs no server and no blockchain. It uses SHA-256, Ed25519 and plain files. Dex is the core. Dex + ledger is a ledgdex.
These docs are a ledgdex too. Their own ledger has one signature, as a demonstration. Ledgdex makes pages from this ledger. These pages are in the list of pages, next to the written pages.
1. Install ledgdex. You need Python 3.8 or later, and git. For more ways to install, see Installation:
pip install "ledgdex @ git+https://github.com/ledgdex/ledgdex@v1.0.18#subdirectory=py"2. Make your ledgdex. This command makes a dex with a new ledger. It keeps a new key in ~/.ledgdex:
ledgdex init biobot --name "biobot" --key biobot3. Offer something. Write each price as an integer in the smallest unit of the currency. For example, 250000 is USD 2,500.00:
cat > offer.json <<EOF
{"item": {"title": "Penjointu v1 weights"}, "quantity": 10, "unit": "license",
"currency": "USD", "price": 250000, "pay": [{"method": "card", "to": "https://pay.example/biobot"}]}
EOF
ledgdex offer biobot offer.json4. Open shop/gen/index.html. This is your dex. It has a page for your ledger and a page for the offer. Put your own pages in shop/data.json or shop/to_add/, as in any dex.
5. Publish your ledgdex (Publishing a Ledgdex Online). Buyers then claim from it (Buying). Example: First Trade runs a full trade on one computer.
Where to go next:
- Users who start a market: Set Up a Marketplace.
- Developers: Extending Ledgdex and the API Reference.
- Bots and agents: Bots and Agents.
- All commands: Command Line Options. All examples: Examples.