Skip to content

Getting Started with MWC Development

Welcome to the MWC (MimbleWimble Coin) development guide! This introduction is designed to help developers familiarize themselves with MWC's ecosystem, workflows, and tools to seamlessly integrate MWC functionalities into their applications. By understanding MWC's interactive transaction model and API usage, you'll be ready to start building secure, private, and scalable financial applications.

What is MWC?

MWC is a privacy-centric cryptocurrency built on the MimbleWimble protocol. It focuses on providing scalable and private transactions by leveraging features such as confidential transactions, CoinJoin aggregation, and a compact blockchain.

MWC differs from other cryptocurrencies due to its interactive transaction process, requiring the sender and recipient to collaborate to build and finalize a transaction. This unique approach ensures enhanced privacy and security.

Key Features of MWC

  1. Enhanced Privacy: Transactions are private by default, with no publicly visible addresses or amounts.
  2. Scalability: MimbleWimble uses a compact blockchain structure, making MWC lightweight and efficient.
  3. Interactive Transactions: Both sender and recipient must exchange data to complete a transaction, ensuring a secure and private process.

Development Prerequisites

Tools and Setup

  1. MWC Wallet:
  2. Grin Node:
    • Set up and sync a Grin node, as it acts as the interface between your application and the MWC blockchain.
  3. API Access:
    • Use the MWC Owner and Foreign APIs to programmatically manage wallets and transactions.
    • Obtain an API token for secure interactions with the wallet.

Knowledge Requirements

  • Familiarity with JSON-RPC APIs.
  • Basic understanding of the MimbleWimble protocol and cryptocurrency concepts.

MWC Transaction Model

MWC employs an interactive transaction process that involves collaboration between the sender and recipient. Here's an overview:

Sender Workflow

  1. Initiate Transaction: Start the transaction with the desired amount.
  2. Send Slatepack: Generate and send an encoded Slatepack (transaction details) to the recipient.
  3. Finalize Transaction: After receiving the recipient's response, finalize the transaction.
  4. Broadcast Transaction: Submit the finalized transaction to the Grin node for propagation across the network.
  5. Track Confirmation: Monitor the transaction status on the blockchain.

Recipient Workflow

  1. Receive Slatepack: Decode the Slatepack sent by the sender.
  2. Sign and Respond: Add a signature and modify the Slatepack.
  3. Send Response: Return the modified Slatepack to the sender.

Interactive Transaction Workflow

What is a Slatepack?

A Slatepack is an encoded message format used to exchange transaction data securely between sender and recipient. It ensures that transaction details remain private during transmission.

Key Steps in the Workflow

  1. Encoding and Decoding: Both sender and recipient must encode or decode Slatepacks during the transaction process.
  2. Signing and Modification: The recipient must add their signature to the Slatepack before returning it to the sender.
  3. Finalization: The sender finalizes the transaction after receiving the modified Slatepack.
  4. Broadcast: Once finalized, the transaction is broadcast to the Grin node.

APIs for MWC Integration

MWC provides a robust set of APIs to manage wallets, transactions, and blockchain interactions. These APIs include:

  • Owner API: For internal wallet operations like initiating transactions and querying balances.
  • Foreign API: For handling external interactions, such as receiving and finalizing transactions.

For detailed API methods, examples, and parameter descriptions, visit the official docs.rs MWC API documentation.

Tips for Developers

  1. Synchronization: Always ensure your MWC node is fully synced with the blockchain before initiating transactions.
  2. Error Handling: Implement proper error-handling mechanisms for API interactions.
  3. Security: Safeguard API tokens and use encrypted channels for data exchange.
  4. Testing: Use a testnet environment to validate your implementation before deploying on the mainnet.

Learn More

To dive deeper into MWC’s architecture and explore advanced use cases, check out:

  • MWC Wallet Documentation: For detailed wallet setup and usage.
  • MWC GitHub Repository: Access open-source code, tools, and updates.
  • MWC Community: Join forums and discussions to stay updated and get support.

Start building with MWC today and explore the possibilities of private, scalable, and secure digital transactions. Happy developing!

Released under the MIT License.