# Welcome to the R3 prototyping repository!

This documentation describes the first prototype of a possible future R3 shared ledger platform.

The goal of this prototype is to explore fundamentally better designs for transactions, states and smart contract APIs 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
- 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
- Networking and messaging
  - Messaging vs networking
  - Interfaces
  - In memory implementation
  - Network Map Service
- Running the demos
  - Trader demo
  - IRS demo
- Node administration
  - Monitoring your node
  - Uploading and downloading attachments
  - Uploading interest rate fixes
- The Interest Rate Swap Contract
  - Creating an instance and lifecycle
  - Technical Details

Tutorials

- 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
- 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

Appendix

- Using the visualiser
- Code style guide
  - 1. General style
  - 2. Comments
  - 3. Threading
  - 4. Assertions and errors
- Building the documentation
  - Requirements
  - Build