# Welcome to the Corda repository!

This documentation describes the prototype of a proposed architecture for distributed ledgers.

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?
  - Contracts
  - 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
  - FungibleAssets and Cash
  - Transaction lifecycle types
  - Party and PublicKey
  - Date support
- Consensus model
  - Notary
  - Multiple notaries
  - Validation
  - Timestamping
  - Running a Notary Service
  - Obtaining a signature
  - Changing notaries
- Networking and messaging
  - Messaging vs networking
  - Interfaces
  - In memory implementation
  - Network Map Service
- Running the demos
  - Trader demo
  - IRS demo
  - IRS web demo
- Node administration
  - Monitoring your node
  - Uploading and downloading attachments
  - Uploading interest rate fixes

Contracts

- Platform contracts
  - Cash
  - Commercial Paper
  - Interest Rate Swap
  - Obligation
- Interest Rate Swaps
  - Creating an instance and lifecycle
  - Technical Details

Tutorials

- Where to start
  - The trader demo
- Writing a contract
  - 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
  - Non-asset-oriented based smart contracts
  - Clauses
- Writing a contract using clauses
  - Commercial paper class
  - Clauses
  - Group Clause
  - Summary
- Writing a contract test
  - Testing single transactions
  - Chaining transactions
- Protocol state machines
  - Introduction
  - Theory
  - A two party trading protocol
  - Suspendable methods
  - The state machine manager
  - Implementing the seller
  - Implementing the buyer
  - Progress tracking
- Writing oracle services
  - Introduction
  - The two basic approaches
  - Asserting continuously varying data that is publicly known
  - Asserting occasionally varying data that is not publicly known
  - Implementing oracles in the framework
- Event scheduling
  - Introduction
  - How to implement scheduled events
  - An example

Appendix

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