โ† All Blockchain Technology Flashcard Decks

Decentralized Application Architecture Flashcards

6 cards from real Blockchain Technology practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Decentralized Application Architecture flashcards as text
  1. A development team is creating a decentralized social media platform where users can post messages and upload images. To maintain decentralization and avoid high on-chain storage costs, where is the most appropriate place to store the user-uploaded images?

    Answer: In a decentralized storage network like IPFS, with the content identifier (CID) stored on-chain.

    Storing large files like images directly on a blockchain is prohibitively expensive and inefficient. A centralized server introduces a single point of failure and censorship risk, undermining the dApp's decentralized nature. Event logs are not designed for large data storage. The best practice is to use a decentralized storage network like IPFS to store the files off-chain and store only the unique content identifier (CID) on the blockchain, which is a small and efficient way to link the on-chain data to the off-chain file.

  2. In a typical dApp architecture, how does the user's browser-based front-end (e.g., a React app) communicate with smart contracts deployed on the Ethereum blockchain?

    Answer: Via a JavaScript library like Ethers.js or Web3.js, which connects to a blockchain node and interacts with the contract's ABI.

    Front-end applications cannot directly communicate with the blockchain. They require a JavaScript library such as Ethers.js or Web3.js. This library connects to a blockchain node (either a self-hosted one or through a service like Infura or Alchemy) and uses the smart contract's Application Binary Interface (ABI) to format and send requests (read calls or transactions) to the correct functions on the deployed contract.

  3. A smart contract for a decentralized insurance product needs to automatically trigger a payout based on real-world flight delay data. What architectural component is necessary to securely provide this external data to the smart contract?

    Answer: A decentralized oracle network.

    Blockchains are deterministic and cannot natively access external, off-chain data (like flight information from an API). This is known as the 'oracle problem'. A decentralized oracle network is a secure middleware that fetches, verifies, and delivers external data to smart contracts, solving this problem without introducing a single, centralized point of failure.

  4. Which of the following best describes the primary role of a service like Infura or Alchemy in the context of dApp architecture?

    Answer: To offer a reliable and scalable connection to blockchain nodes via an API, removing the need for developers to run their own nodes.

    Running and maintaining a full blockchain node is resource-intensive. Node providers like Infura and Alchemy manage this infrastructure, offering developers a simple and scalable API endpoint to connect their dApps to the blockchain. This allows developers to read blockchain data and submit transactions without the significant overhead of maintaining their own nodes.

  5. A developer is building a high-frequency trading dApp where users need to perform many rapid, low-cost transactions. The main blockchain suffers from high gas fees and slow confirmation times. Which architectural solution is most suitable for this use case?

    Answer: Using a Layer 2 scaling solution, such as state channels or rollups.

    Layer 2 scaling solutions are designed specifically to address the scalability limitations of Layer 1 blockchains. They process transactions off-chain, enabling high throughput and low costs, while still inheriting the security of the main chain. State channels, for example, allow parties to transact privately and instantly off-chain, submitting only the final state to the mainnet. Rollups batch many transactions together off-chain and post a compressed summary to the mainnet.

  6. When designing a dApp, a developer decides to use a sidechain instead of a state channel for handling complex computations. What is a key architectural difference between a sidechain and a state channel?

    Answer: Sidechains are separate blockchains with their own consensus mechanisms, while state channels are off-chain agreements between specific participants.

    A sidechain is an independent blockchain that runs in parallel to a mainnet and is connected by a two-way peg; it has its own blocks, validators, and consensus algorithm. A state channel is not a separate blockchain but a mechanism that locks a portion of the main chain's state so that a specific set of participants can interact privately and instantly off-chain, only settling the final state back to the main chain when they are done.