[BREAKGLASS] Append-only mirror of github.com/signalapp/MobileCoin-Swift
Go to file
Adam Mork 9bc59e1b98
v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73)
# Title

`v1.2.0-pre0` - Network Robustness,  Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst

# Description 

Added a way for implementing apps to pass in there own `HttpRequester` which can be useful for network robustness. Subspec `LibMobileCoin` now supports Apple Silicon/M1 and Mac Catalyst. Code changes to support Fog v1.2.0.

#### `pre1` Changes 

- Uses the `v1.2.0-pre1` version of `LibMobileCoin` which supports a higher version of `GRPC`.
- Added bridging headers
- Updated Gemfile/Makefile to use the latest `cocoapods` version `1.11.2`


#### Future Work

Fix the `docs` steps in the circleci build process. Will require `jazzy` related fixes and testing on Xcode 11.

# Changes

## Network Robustness

Adds a separate `HTTP` networking architecture. An object conforming to `protocol HttpRequester` can be provided to the `NetworkConfig` object when the `MobileCoinClient` is created. Then the `TransportProtocolOption` can be changed from `grpc` to `http`.

> NOTE: This branch will not run because it depends on changes in other submodules that have not yet been merged.

### `HttpRequester`

Implementing apps/frameworks should provide an object conforming to this protocol. Our `RestApiRequester` wraps around an `HttpRequester` to communicate with with our services using `protobuf`s.

```
Sources/Network/HttpConnection/HttpRequester.swift
```

### Attested & Auth Connection Wrappers

`HTTP` versions of the Auth & Attested wrapper classes. These protocol and their default implementations handle the logic paths needed for authentication/attestation and re-authentication/attestation:

> Can become generic

```
Sources/Network/HttpConnection/ArbitraryHttpConnection.swift
Sources/Network/HttpConnection/AttestedHttpConnection.swift
```

### Networking Protocols 

Separate code-paths for `HTTP` versions of the networking protocols:

```
Sources/Network/HttpConnection/HttpCallable/AttestedHttpCallable.swift
Sources/Network/HttpConnection/HttpCallable/AuthHttpCallable.swift
Sources/Network/HttpConnection/HttpCallable/AuthHttpCallableClientWrapper.swift
Sources/Network/HttpConnection/HttpCallable/HttpCallable.swift
```

`HTTP` "interfaces" that closely mimic functionality from `GRPC`. Allows us to re-use more of our existing patterns.

```
Sources/Network/HttpConnection/HTTPInterface/HTTPCallOptions.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPClient.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPClientCall.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPMethod.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPResponse.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPStatus.swift
Sources/Network/HttpConnection/HTTPInterface/HTTPUnaryCall.swift
```

### `HTTP` Connection Implementations

Wrapper classes that interface directly with `protoc-swift` generated `.swift` files for our protobuf models.

```
Sources/Network/HttpConnection/HttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/BlockchainHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/ConsensusHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogBlockHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogKeyImageHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogMerkleProofHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogReportHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogUntrustedTxOutHttpConnection.swift
Sources/Network/HttpConnection/HttpConnections/FogViewHttpConnection.swift
```

### `HTTP` versions of `protoc-swift` generated models

The GRPC versions of these are generated by `protoc-swift`. The HTTP versions were edited by hand to work with the `HTTP` Connections implementations. 

> **This could be automated preferably with a `protoc-swift` plugin template but also `sed`/`VIM` if needed.**

```
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/attest.http.swift
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/consensus_client.http.swift
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/consensus_common.http.swift
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/ledger.http.swift
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/report.http.swift
Sources/Network/HttpConnection/HttpConnections/Http Proto Generated/view.http.swift
```

## Fog Updates 

The latest version of `fog` changes the name of a protobuf `FogLedger_Block` -> `FogLedger_BlockData`.

### Compressed Commitment 

The `TxOut` compressed commitment is no longer sent in the protobuf message because it can be reconstructed with its constituent parts (+ the user's `view_private_key`)

We now reconstruct the commitment in several places whereas before it was being returned from the decoded protobuf message.

Lastly some function signatures into `LibMobileCoin` were updated to adjust to the changes.

## Miscellaneous

New MrEnclave values

Support for Apple Silicon/M1 & Mac Catalyst

## Unit Tests

One unit test was removed. It creates a TxOut and tries to unmask the value with an **incorrect** private view key. The return value should be 'nil' but is noise. It will require a change in the rust code and should be implemented in a future release.

Some objects were re-serialized to match the new TxOut structure.

Credentials are not required for `consensus` so this has been changed in the `NetworkConfig`

Tests can be run with `TransportProtocol == .http` by changing the default value in `NetworkConfig`
2021-09-16 21:15:20 -07:00
.circleci v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
.github Big bang 2021-03-15 22:58:02 -10:00
Example v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
Sources v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
Tests v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
Vendor v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
.gitignore Big bang 2021-03-15 22:58:02 -10:00
.gitmodules Big bang 2021-03-15 22:58:02 -10:00
.jazzy.yaml [SWIFT-167] Implement use of dynamic fees (#29) 2021-05-10 18:16:29 -07:00
.swiftlint.yml Remove trailing whitespace (#6) 2021-03-18 19:44:54 -07:00
CHANGELOG.md Bump version to 1.1.0 (#40) 2021-06-10 12:16:44 -07:00
CLA.md Big bang 2021-03-15 22:58:02 -10:00
CONTRIBUTING.md Big bang 2021-03-15 22:58:02 -10:00
Gemfile Big bang 2021-03-15 22:58:02 -10:00
Gemfile.lock v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
LICENSE Big bang 2021-03-15 22:58:02 -10:00
LICENSE.md Big bang 2021-03-15 22:58:02 -10:00
Makefile Bump version to 1.1.0-pre2 (#31) 2021-05-10 19:51:37 -07:00
MobileCoin.podspec v1.2.0-pre0 - Network Robustness, Fog 1.2.0, Apple Silicon/M1 & Mac Catalyst, LibMobileCoin v1.2.0-pre1 (#73) 2021-09-16 21:15:20 -07:00
README.md Big bang 2021-03-15 22:58:02 -10:00
TERMS-OF-USE.md Update TERMS-OF-USE.md (#58) 2021-08-17 18:37:23 -07:00

MobileCoin logo

CircleCI Documentation

MobileCoin Swift

MobileCoin is a privacy-preserving payments network designed for use on mobile devices.

Sending your First Payment

  • You must read and accept the Terms of Use for MobileCoins and MobileCoin Wallets to use MobileCoin Software.
  • Please note that currently, MobileCoin Wallets are not available for download or use by U.S. persons or entities, persons or entities located in the U.S., or persons or entities in other prohibited jurisdictions.

Note to Developers

  • MobileCoin is a prototype. Expect substantial changes before the release.
  • Please see CONTRIBUTING.md for notes on contributing bug reports and code.

Table of Contents

License

MobileCoin is available under open-source licenses. Please read the LICENSE.md and corresponding LICENSE.

Cryptography Notice

This distribution includes cryptographic software. Your country may have restrictions on the use of encryption software. Please check your country's laws before downloading or using this software.

Repository Structure

Directory Description
Example Example application.
Sources Sources for the MobileCoin Swift SDK.
Tests Tests.
Vendor iOS Artifacts.

Build Instructions

The workspace can be built with make.

  1. Initialize or update submodules

    git submodule update --init --recursive
    
  2. Install Ruby

  3. Install the gem bundler

    gem install bundler
    
  4. Build the MobileCoin Swift SDK

    make
    

Note: To build libmobilecoin, run make in libmobilecoin-ios-artifacts.

Overview

MobileCoin is a payment network with no central authority. The fundamental goal of the network is to safely and efficiently enable the exchange of value, represented as fractional ownership of the total value of the network. Like most cryptocurrencies, MobileCoin maintains a permanent and immutable record of all successfully completed payments in a blockchain data structure. Cryptography is used extensively to establish ownership, control transfers, and to preserve cash-like privacy for users.

For more information about the cryptocurrency, see MobileCoinFoundation/MobileCoin.

Support

For troubleshooting help and other questions, please visit our community forum.

You can also open a technical support ticket via email.

Trademarks

MobileCoin is a registered trademark of MobileCoin Inc.