# Welcome to the Corda repository!

This documentation describes Corda, a proposed architecture for distributed ledgers, the vision for which is outlined in the Corda Introductory Whitepaper.

The goal of this prototype is to explore fundamentally better designs for distributed ledgers than what presently exists on the market, tailor made for the needs of the financial industry. We are attempting to prove or disprove the following hypothesis:

The combination of

- An upgraded state transition model
- Industry standard, production quality virtual machines and languages
- An advanced orchestration framework
- Limited data propagation
- Conflict resolution without proof of work or blocks

is sufficiently powerful to justify the creation of a new platform implementation.

Read on to learn:

Overview

- What’s included?
  - Kotlin
- Getting set up
  - If IntelliJ complains about lack of an SDK
  - Doing it without IntelliJ
- Data model
  - Overview
  - Comparison with Bitcoin
  - Comparison with Ethereum
  - Rationale for and tradeoffs in adopting a UTXO-style model
  - Rationale
  - Pros
  - Cons
- Data types
  - Amount
  - State
  - NamedByHash and UniqueIdentifier
  - FungibleAssets and Cash
  - Transaction lifecycle types
  - Party and PublicKey
  - Multi-signature support
  - Date support
  - Cryptography & maths support
- Consensus model
  - Notary
  - Validation
  - Timestamping
  - Running a notary service
  - Obtaining a signature
- Networking and messaging
  - Messaging types
  - Network Map Service
- Persistence
  - Schemas
  - Object Relational Mapping
- Creating a Cordapp
  - App Plugins
  - Services
  - Starting Nodes
  - Installing Apps
  - Starting your Node
  - Debugging your Node
  - Viewing persisted state of your Node
  - Building Against Corda
- Gradle Plugins for Cordapps
  - Building Gradle Plugins
  - Using Gradle Plugins
- Template build.gradle
- Cordformation
- Running the demos
  - Trader demo
  - IRS demo
  - IRS web demo
  - Attachment demo
- Node administration
  - Database access
  - Monitoring your node
  - Uploading and downloading attachments
  - Uploading interest rate fixes
- The Corda Configuration File
  - Configuration File Location
  - Configuration File Format
  - Configuration File Examples
  - Configuration File Fields

Tutorials

- Where to start
  - The trader demo
- Writing a contract
  - Where to put your code
  - Starting the commercial paper class
  - States
  - Commands
  - The verify function
  - Using state groups
  - Checking the requirements
  - How to test your contract
  - Adding a generation API to your contract
  - How multi-party transactions are constructed and transmitted
  - Non-asset-oriented smart contracts
  - Making things happen at a particular time
  - Encumbrances
  - Clauses
- Writing a contract using clauses
  - Commercial paper class
  - Clauses
  - Group Clause
  - Summary
  - Debugging
- Writing a contract test
  - Testing single transactions
  - Chaining transactions
- Client RPC API
- Protocol state machines
  - Introduction
  - Theory
  - A two party trading protocol
  - Suspendable functions
  - Starting your protocol
  - Implementing the seller
  - Subprotocols
  - Implementing the buyer
  - Progress tracking
  - Unit testing
  - Versioning
  - Future features
- Writing oracle services
  - Introduction
  - The two basic approaches
  - Asserting continuously varying data
  - Pay-per-play oracles
- Using attachments
  - Attachments demo
- Event scheduling
  - Introduction
  - How to implement scheduled events
  - An example
- Secure coding guidelines
  - Protocols
  - Contracts

Contracts

- Contract catalogue
  - Cash
  - Commodity
  - Commercial Paper
  - Interest Rate Swap
  - Obligation
- Interest Rate Swaps
  - Creating an instance and lifecycle
  - Technical Details

Node API

- Client RPC
  - Observables
  - Versioning
  - Thread safety
  - Error handling
  - Wire protocol

Appendix

- Release process
- Steps to cut a release
- Release notes
  - Milestone 4
  - Milestone 3
  - Milestone 2
  - Milestone 1
  - Milestone 0
- Network Simulator
  - Interface
- Code style guide
  - 1. General style
  - 2. Comments
  - 3. Threading
  - 4. Assertions and errors
  - 5. Properties
  - 6. Compiler warnings
- Building the documentation
  - Requirements
  - Build