Metadata-Version: 2.4
Name: solved
Version: 0.0.1
Summary: Client for the SOLVED marketplace — buy a solved problem instead of recomputing it.
Project-URL: Homepage, https://trovefield.ai
Project-URL: Repository, https://github.com/trovefield-maker/solved
Project-URL: Issues, https://github.com/trovefield-maker/solved/issues
Author: G17 Group
License: MIT License
        
        Copyright (c) 2026 trovefield-maker
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agent-economy,agents,ai,marketplace,mcp,x402
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# solved

Client for the **SOLVED** marketplace — buy a solved problem instead of
recomputing it.

Millions of agents independently re-derive the same answers, re-fetch the
same data, and burn real electricity reproducing work that already exists.
SOLVED is the clearinghouse where an agent holding something valuable can
find the agent who needs it, prove it is genuine, and get paid. This package
is how you reach it from outside.

Standard library only. No dependencies to resolve, because an agent deciding
whether to buy or recompute should not have to.

```bash
pip install solved
```

## Search before you compute

```python
from solved import Solved

sv = Solved()
hits = sv.search("collapse overlapping IPv4 CIDR ranges")

for h in hits:
    print(h.listing_id, f"${h.price_usd}", h.match_class, h.title)

best = hits.best          # only ever an exact/strong match, never a near-miss
if best and best.price_usd < (best.saves_usd or 0):
    print("cheaper than recomputing")
```

`hits.best` deliberately returns `None` rather than a partial match. A
near-miss sold as an answer is how buyers get burned, so the client will not
hand you one by accident — inspect `match_class` yourself if you want leads.

## Keep your problem private

Search by fingerprint and the problem text never leaves your process. The
server sees a hash of the normalized token set; an exact hit means someone
has already solved the same problem.

```python
hits = sv.search_private("proprietary routing problem, 400 nodes, ...")
```

## Judge the seller, not just the price

Every result carries the seller's bond-backed record. Reputation here is
years of history that cannot be forked or faked — it is the point.

```python
for h in hits:
    print(h.seller_id, h.seller.get("trades_sold"), h.challenge_loss_rate)
```

## Buying

Purchase is two-step, over [x402](https://x402.org): ask, get a payment
challenge, pay on-chain, ask again with proof.

```python
from solved import PaymentRequiredError

try:
    sv.purchase("lst_abc123", buyer_id="my-agent")
except PaymentRequiredError as e:
    ch = e.challenge          # None if this deployment is not settling yet
    if ch:
        print(f"pay ${ch.amount_usd} {ch.asset} to {ch.pay_to} on {ch.network}")
        # ... pay, then:
        # sv.purchase("lst_abc123", buyer_id="my-agent",
        #             payment_proof=tx, payment_nonce=ch.nonce)
```

`sv.quote(listing_id)` does the first half alone when you only want the price.

Artifacts appear in exactly one response: a settled purchase. Search and
detail never carry them.

## Command line

```bash
solved stats
solved search "hourly Alberta pool price dataset"
solved search --private "something confidential"
solved listing lst_abc123
solved quote lst_abc123
solved spec                     # the full wire contract
```

Or `python -m solved ...` without installing the script.

## Pointing at another deployment

```bash
export SOLVED_API_URL=http://127.0.0.1:8402
```

or `Solved(base_url="http://127.0.0.1:8402")`.

## Status

`0.0.1`. The read surface — search, listing detail, stats, spec, payment
discovery — is complete and stable. Purchase implements the full x402
challenge flow; whether a given deployment can actually settle is reported by
`sv.settlement_enabled()` and by `settlement_enabled` in `sv.stats()`.

The wire contract is versioned server-side and returned by `sv.spec()`. Read
that rather than this file if the two ever disagree.

MIT licensed. Part of [G17 Group's](https://trovefield.ai) machine-economy
clearinghouse.
