> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/blockchain-security/cumulative-quiz.md).

# Cumulative Quiz

## Question 1

It is possible to prove that a single transaction is included in a block without revealing the rest of the transactions in the block because of the structure of what?

<details>

<summary>Solution</summary>

Merkle trees

</details>

## Question 2

In which of the following consensus algorithm implementations does a node's probability of being selected as a block creator change from block to block?

<details>

<summary>Solution</summary>

* Coin age-based Proof of Stake

In coin age-based Proof of Stake, a node's probability of selection depends on both stake size and the time since it was last selected to create a block, so the overall probability varies from block to block.

</details>

## Question 3

Which of the following takes advantage of the fact that it is difficult to validate a Proof of Stake blockchain?

<details>

<summary>Solution</summary>

* Fake stake attack

The fake stake attack is designed to perform a Denial of Service attack on nodes since it is computationally expensive to validate a Proof of Stake blockchain.

</details>

## Question 4

What is the probability that a node with 75% of the stake in a Proof of Stake network will be selected to create three consecutive blocks?

<details>

<summary>Solution</summary>

* 42%

The probability that a node with 75% of the stake will be selected to create three consecutive blocks is calculated as: 0.75×0.75×0.75=0.75 3 =0.421875≈42%

</details>

## Question 5

Question 5 Which of the following attacks gives up transaction fees for increased probability of block rewards?

<details>

<summary>Solution</summary>

* SPV mining

SPV mining gives up transaction fees for increased probability of block rewards.

</details>

## Question 6

Which of the following node-focused threats enables attacking a node from the blockchain?

<details>

<summary>Solution</summary>

Malicious transactions

</details>

## Question 7

Which of the following is a good way to get a random value in a smart contract?

<details>

<summary>Solution</summary>

* External random oracle

An external random oracle is a good source of randomness in a blockchain. All of the other options can be attacked or predicted.

</details>

## Question 8

This code sample includes which of the following vulnerabilities?

```solidity
function withdraw(uint _amount) {
    require(balances[msg.sender] >= _amount);
    msg.sender.send(_amount);
    balances[msg.sender] -= amount
}
```

<details>

<summary>Solution</summary>

* Reentrancy
* Unchecked return values

</details>

## Question 9

In which of the following architectures is it most likely that a transaction will "fall off" of the distributed ledger?

<details>

<summary>Solution</summary>

* DAG

In a DAG, a transaction can "fall off" of the distributed ledger by not being selected during random walks.

</details>

## Question 10

Which of the following can be used to demonstrate membership in a group?

<details>

<summary>Solution</summary>

* Ring signatures
* Zero-knowledge proofs

</details>
