# Validate Bitcoin Transactions | Aced

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3101/validate-bitcoin-transactions
Source observed: 2026-11-04T23:34:29.058Z
Last checked: 2026-11-04T23:34:29.058+00:00
Indexed: 2026-11-06T17:13:17.172+00:00

---

# Validate Bitcoin Transactions

We provide this **Hard** SQL interview question through Aced (formerly Exponent). It asks you to identify potentially invalid Bitcoin transactions using the UTXO model and return one column named `InvalidTransactionId`.

- [All Questions](https://www.aced.io/questions)
- Category: [Coding](https://www.aced.io/questions?type=coding)
- Category: [SQL](https://www.aced.io/questions?type=sql)
- Interview format: Coding
- Reported last asked: 3 years ago
- [Upgrade](https://www.aced.io/upgrade?src=questions) to unlock detailed company statistics for this question.

## Problem

Blockchains such as Bitcoin use the UTXO (Unspent Transaction Outputs) model to track coin ownership. Each transaction consumes UTXOs as inputs and creates new UTXOs as outputs.

A transaction can be potentially invalid when either of these conditions applies:

1. The `sender` does not own the UTXO they are attempting to spend.
2. The same UTXO has already been used as an input in another transaction.

## Tables

### `transactions`

| Column | Description |
|---|---|
| `transaction_id` | Unique identifier for each transaction |
| `sender` | Address of the person initiating the transaction |
| `timestamp` | Time when the transaction was created |

### `transaction_inputs`

| Column | Description |
|---|---|
| `input_id` | Unique identifier for each input within a transaction |
| `transaction_id` | Foreign key referencing `transactions` |
| `utxo_id` | Foreign key identifying the UTXO consumed by the input |

### `utxo`

| Column | Description |
|---|---|
| `utxo_id` | Unique identifier for the UTXO |
| `address` | Owner of the UTXO |
| `amount` | Amount of cryptocurrency represented by the UTXO |

## Your task

Write a SQL query that identifies transactions that are potentially invalid under the two conditions above. The result must contain the following column:

```text
InvalidTransactionId
```

You can use the transaction sender, the ownership address recorded for each UTXO, the transaction-input relationships, and the transaction timestamp when determining which transaction IDs to return.

## Related question

- [Fraudulent Transactions](https://www.aced.io/questions/3071/fraudulent-transactions)

## Access and practice

The question interface includes Question, Solution, and Community tabs. There are no community-contributed answers currently. Running code requires an account: [Sign up to run code](https://www.aced.io/signup?src=lesson).

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3101%2Fvalidate-bitcoin-transactions&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3101%2Fvalidate-bitcoin-transactions). Opening a form does not execute a tool.