{"id":19866165,"url":"https://github.com/lnbits/Diagon-Alley","last_synced_at":"2025-05-02T05:32:23.407Z","repository":{"id":75624243,"uuid":"259415594","full_name":"lnbits/Diagon-Alley","owner":"lnbits","description":"Diagon Alley: a decentralised market-stall protocol.","archived":false,"fork":false,"pushed_at":"2020-06-26T11:25:12.000Z","size":59,"stargazers_count":39,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-02T20:33:12.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lnbits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-27T18:19:10.000Z","updated_at":"2024-12-27T15:43:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"de1fb98a-be72-436a-a22a-c1a17867e94c","html_url":"https://github.com/lnbits/Diagon-Alley","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2FDiagon-Alley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2FDiagon-Alley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2FDiagon-Alley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2FDiagon-Alley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lnbits","download_url":"https://codeload.github.com/lnbits/Diagon-Alley/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251993002,"owners_count":21677022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T15:25:08.993Z","updated_at":"2025-05-02T05:32:23.400Z","avatar_url":"https://github.com/lnbits.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":" \u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/SuoAxtp.png\" width=\"60%\"\u003e\n\u003c/p\u003e\n\n\n# Diagon Alley: Decentralised Market-Stall Protocol\nDiagon Alley is a decentralised market-stall protocol, that shifts emphasis from the frontend market to the merchants stall. If a frontend market (indexer) gets taken down, merchants just point their stalls elsewhere. Game-theoretically the winner of Diagon Alley is the most forthright, although suggestions on limiting bad behaviour are very welcome.\n\n## Indexers\nAn indexer is a simple frontend server and GUI that routes product, payment and shipping information between merchant and buyer. Each merchant has products in a *stall*. The stall chooses what products to list with the indexer. An indexer has one endpoint.\n\n* `/register/\u003cstall_ID\u003e` **POST** The `\u003cstall_ID\u003e` is generated by the stall. the endpoint is for stalls to fetch rating data (0-100%), register products and check the indexer is online.\n\n  Body (application/json)\u003cbr/\u003e\n  ```{\"stall_url\": \u003cstring\u003e}```\n\n  Returns 200 OK (application/json)\u003cbr/\u003e\n  ```{\"shopstatus\": \u003cboolean\u003e, \"rating\": \u003cint\u003e}```\n\nThe indexer uses the `\u003cstall_url\u003e` and `\u003cindexer_ID\u003e` for the stall endpoints.\n\nThe indexer may present information from the stalls it has registered in any way it want, either as a web shopping experience or an API or something else. It must show the stall_ID along with each product listing. When the customer clicks \"buy\" or equivalent it must fetch the invoice from the stall and present it to the customer.\n\n## Stalls\nA stall has a keypair it uses to register itself to indexes and sign invoices. That keypair isn't related to any Lightning Network keypair, it's independent.\n\nA stall can choose to list some/all products with an *indexer*. A stall is a small server that has three endpoints.\n\n* `/products/\u003cindexer_ID\u003e` **GET** for fetching all products associated with an indexer ID\n\n  Returns 200 OK (application/json)\u003cbr/\u003e\n  ```\n  [\n    {\n      \"product_id\": \u003cstring\u003e,\n      \"product_name\": \u003cstring\u003e,\n      \"categories\": \u003clist\u003e,\n      \"description\": \u003cstring\u003e,\n      \"image\": \u003cstring\u003e,\n      \"price\": \u003cint\u003e,\n      \"quantity\": \u003cint\u003e\n    },\n    ...\n  ]\n  ```\n\n\n* `/order/\u003cindexer_ID\u003e` **POST** for placing an order and sending shipping data. Returns a Lightning invoice, `metadata` and `checking_id`.\n\n  `metadata` is a JSON array encoded as string containing at least two items:\n\n  ```\n  [\n    [\n      \"text/plain\",\n      \u003cstring\u003e // detailed description of the item that will be shipped and its destination\u003e\n    ],\n    [\n      \"application/vnd.diagonalley.signature\",\n      \u003cstring\u003e // DER-encoded ECDSA secp256k1 signature of the \u003cstring\u003e tagged as \"text/plain\" the with the stall private key\n    ]\n  ]\n  ```\n\n  Invoices must contain the [`h` tag (`description_hash`)](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#tagged-fields) set to `sha256(metadata)`.\n\n  This is such that customers can be sure they are paying an invoice originating from the stall and not from a malicious indexer. The information on `metadata` may be displayed in a nice way by the indexer interface, but its validity should be checked independently by the customer, perhaps at an independent website that allows him to copy-and-paste `payment_request`, `metadata` and stall_ID.\n\n  Body (application/json)\u003cbr/\u003e\n  ```\n  {\n    \"product_id\": \u003cstring\u003e,\n    \"address\": \u003cstring\u003e,\n    \"shippingzone\": \u003cinteger\u003e,\n    \"email\": \u003cstring\u003e,\n    \"quantity\": \u003cinteger\u003e\n  }\n  ```\n\n  Returns 201 CREATED (application/json)\u003cbr/\u003e\n  ```{\"metadata\": \u003cstring\u003e, \"payment_request\": \u003cstring\u003e, \"checking_id\": \u003cstring\u003e}```\n\n* `/status/\u003cchecking_id\u003e` **GET** for checking an order status.\n\n  Returns 200 OK (application/json)\u003cbr/\u003e\n  ```{\"status\": \"SHIPPED\" | \"PAID\" | \"UNKNOWN\"}```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2FDiagon-Alley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnbits%2FDiagon-Alley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2FDiagon-Alley/lists"}