CBSA Solution Architecture Design 4 — Questions and Answers
Question 1: An architect is designing a DeFi protocol and needs to prevent flash loan attacks. Which architectural safeguard is most effective?
- Increasing gas fees for large transactions
- Using time-weighted average prices (TWAP) instead of spot prices (Correct answer)
- Requiring KYC for all liquidity providers
- Limiting single-transaction borrowing amounts
Correct answer: Using time-weighted average prices (TWAP) instead of spot prices
TWAP oracles average prices over multiple blocks, making them resistant to flash loan price manipulation that occurs within a single atomic transaction.
Question 2: A blockchain architect is designing a solution where nodes must validate transactions without accessing their full content. Which cryptographic primitive enables this?
- Symmetric encryption with shared keys
- Zero-knowledge proofs (Correct answer)
- Merkle tree root verification
- Ring signatures
Correct answer: Zero-knowledge proofs
Zero-knowledge proofs allow a prover to convince a verifier that a statement is true (e.g., a transaction is valid) without revealing the underlying data.
Question 3: When designing a blockchain network for a regulated industry, which node architecture model best balances decentralization with compliance requirements?
- Fully public permissionless nodes
- Permissioned nodes with KYC-verified operators (Correct answer)
- Single operator node with replication
- Anonymous node operators with staking
Correct answer: Permissioned nodes with KYC-verified operators
Permissioned networks with KYC-verified node operators satisfy regulatory requirements for known counterparties while maintaining distributed control across multiple organizations.
Question 4: In a blockchain solution architecture, what is the primary role of an event-driven architecture pattern using smart contract events?
- Reducing on-chain storage costs
- Enabling off-chain systems to react to on-chain state changes in real time (Correct answer)
- Replacing the need for a consensus mechanism
- Providing rollback capabilities for failed transactions
Correct answer: Enabling off-chain systems to react to on-chain state changes in real time
Smart contract events emit logs that off-chain systems can subscribe to, enabling real-time integration between blockchain state changes and traditional application systems.
Question 5: A solution architect must ensure that a blockchain smart contract correctly handles reentrancy attacks. Which design pattern directly mitigates this vulnerability?
- Using multi-signature wallets for all calls
- Checks-Effects-Interactions pattern with mutex guards (Correct answer)
- Upgrading to the latest Solidity compiler version
- Limiting smart contract code to under 100 lines
Correct answer: Checks-Effects-Interactions pattern with mutex guards
The Checks-Effects-Interactions pattern ensures state is updated before making external calls, and mutex guards prevent reentrant calls from executing while a function is in progress.
Question 6: Which sharding architecture approach is most suitable for a blockchain solution that requires cross-shard atomic transactions?
- Simple data sharding with no cross-shard communication
- Two-phase commit protocol with shard coordinators (Correct answer)
- Independent shard chains with manual reconciliation
- Single-shard processing for all critical transactions
Correct answer: Two-phase commit protocol with shard coordinators
A two-phase commit protocol coordinates atomic transactions across shards by using a prepare phase and a commit/abort phase, ensuring all-or-nothing execution across shard boundaries.
Question 7: When evaluating blockchain platforms for an IoT solution with millions of low-value microtransactions, which architecture characteristic is most critical?
- High block rewards for miners
- Feeless or near-zero fee transaction model with high throughput (Correct answer)
- Strong smart contract Turing-completeness
- Large block sizes with long confirmation times
Correct answer: Feeless or near-zero fee transaction model with high throughput
IoT microtransactions are economically infeasible on fee-based blockchains; platforms like IOTA's DAG architecture or fee-delegated chains are designed for high-volume, low-value transfers.
An architect is designing a DeFi protocol and needs to prevent flash loan attacks.
Which architectural safeguard is most effective?