Permalink
Browse files

review fixes

  • Loading branch information...
ajunge committed Dec 20, 2018
1 parent 71fd5e7 commit ffef13627c8440d219a156741088dfa15a0dbf83
@@ -44,7 +44,7 @@ We currently support the following flows:
- [Selective Disclosure Flow](flows/selectivedisclosure.md)
- [Send Verification Flow](flows/verification.md)
- [Ethereum Transaction Request Flow](flows/tx.md)
- [Private Chain Provisioning Flow](flows/privatechain.md)
- [Private Chain Flow](flows/privatechain.md)

### [More about request flows](flows/index.md)

@@ -16,49 +16,7 @@ The following shows the basic flow:
## Requirements

- Ethereum compatible blockchain
- Public facing JSON RPC endpoint
- [MetaIdentityManager](https://github.com/uport-project/uport-identity/blob/develop/contracts/MetaIdentityManager.sol) contract deployed on private blockchain
- [TxRelay](https://github.com/uport-project/uport-identity/blob/develop/contracts/TxRelay.sol) contract deployed on private blockchain
- [Relay Server](/rest-apis/relay-server.md) for funding and relaying transactions on private chain

- Public facing JSON RPC endpoint (RPC Gateway)

## Provisioning Methodology

1. Use [Selective Disclosure Flow](selectivedisclosure.md) to request primary identity address of user as well as the deviceKey to create a new identity on the private blockchain
2. Create transaction on IdentityManager contract calling `createIdentity` with the devicekey as the `owner`
3. Lookup the `identity` field from the `LogIdentityCreated` event in the receipt from above transaction
4. Create a valid signed [Private Chain Provisioning Message](/messages/privatechain.md) and send it to the uPort mobile app

NOTE: We will provide a better way of provisioning a owner address in future versions of this spec.

## Endpoint

The request should be sent to one of the following URLs:

- `https://id.uport.me/req/[JWT]`

*The following endpoints are deprecated*

- `me.uport:net/[JWT]`
- `https://id.uport.me/net/[JWT]`

## Client Callback

The client app SHOULD include a URL where the response is returned from the user. This can be a https url or a custom app url which receives the response.

Responses are param appended to a url fragment. If the callback requires the response as a HTTP POST, it is sent as a JSON POST request to the callback url instead.

### Successful Response

param | Description
----- | -----------
`status` | `ok`

The client app SHOULD verify that the transaction has been successfully included in a block.

### Errors

An `error` parameter is returned as the response to the Client App, containing one of following:

Error | Description
------------- | -----------
access_denied | User denies the request
The provisioning of a new network happens at the selective disclosure request. In the request the JSON RPC endpoint is passed to the uPort Mobile app thru the `rpc` parameter. The uPort Mobile App stores the endpoint and then every tx request to that `networkId` is handled thru the specific endpoint.
@@ -1,38 +1,29 @@
@startuml
!include ../uportskin.plantuml
title Private Chain Provisioning Flow
participant ProvisioningServer
title Private Chain Flow
participant ClientApp
actor Owner
participant UportMobile
actor Owner
participant RpcGateway
participant RelayServer
database PrivateChain

group Private Chain Provisioning
ProvisioningServer -> ProvisioningServer : Selective Disclosure Request
ProvisioningServer -> Owner : Show QR code containing request
Owner -> UportMobile: Scans QR code
group Private Chain Discovery
ClientApp -> UportMobile : Selective Disclosure Request\n Provide rpc endpoint
UportMobile -> Owner : Authorize Request?
Owner -> UportMobile: Allow/Disallow
UportMobile -> UportMobile: Store netId -> rpc endpoint
UportMobile -> UportMobile: Sign Selective Disclosure Response
UportMobile -> ProvisioningServer: Selective Disclosure Response
ProvisioningServer -> RpcGateway : Create Account Transaction
RpcGateway -> PrivateChain : Submit Transaction
ProvisioningServer -> UportMobile : Send Private Chain Provisioning Message
UportMobile -> Owner : Authorize Request?
Owner -> UportMobile: Allow/Disallow
UportMobile -> UportMobile: Store Account details
UportMobile -> ClientApp: Selective Disclosure Response
end

group Private Chain Interaction
ClientApp -> UportMobile : Send Ethereum Transaction Request
UportMobile -> Owner : Authorize Request?
Owner -> UportMobile: Allow/Disallow
UportMobile -> UportMobile: Sign Transaction
UportMobile -> RelayServer: Fund and relay transaction onto privatechain
RelayServer -> PrivateChain: Fueling Transaction
RelayServer -> UportMobile: Signed Transaction
UportMobile -> RpcGateway: Send transaction
RpcGateway -> PrivateChain: Submit Transaction
RpcGateway -> UportMobile: Signed Transaction
UportMobile -> ClientApp: Transaction Hash
ClientApp <-> PrivateChain: Transaction Confirmation
end
BIN -17.1 KB (76%) flows/privatechain.png
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -30,7 +30,7 @@ Name | Description | Required
`boxPub` | 32 byte base64 encoded [`Curve25519`](http://nacl.cr.yp.to/box.html) public key of requesting identity. Use to encrypt messages sent to callback URL| no
`issc` | The self signed claims for the `iss` of this message. Either as an Object of claim types for self signed claims eg: `{"name":"Some Corp Inc", "url":"https://somecorp.example","image":{"/":"/ipfs/QmSCnmXC91Arz2gj934Ce4DeR7d9fULWRepjzGMX6SSazB"}}` or the IPFS Hash of a JSON encoded equivalent. See [Issuer Claims](/messages/claims.md) | no
`vc` | Array of Verified Claims JWTs or IPFS hash of JSON encoded equivalent about the `iss` of this message. See [Issuer Claims](/messages/claims.md) and [Verified Claims](/messages/verification.md) | no
`jsonRPC` | URL for the JSON RPC endpoint, ie: `https://mainnet.infura.io/`. Useful for private networks. The `net_version` method shoud return the same networkId as the filed `net`. The JSON RPC endpoint must provide method `eth_sendRawTransaction` (https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendrawtransaction) | no
`rpc` | URL for the JSON RPC endpoint, ie: `https://mainnet.infura.io/`. Useful for [Private Networks](/flows/privatechain.md). The `net_version` method shoud return the same networkId as the filed `net`. The JSON RPC endpoint must provide the following methods: `eth_getTransactionCount`, `eth_getBalance`, `eth_estimateGas`, `eth_gasPrice`, `eth_sendRawTransaction`, `eth_getTransactionReceipt` | no

The attributes `redirect_url` and `callback_type` can also be appended to the signed request as URL encoded query parameters outside of the signed payload. They are used to specify how you want the response and control returned. For more details see [Messages](./index.md#json-web-token).

0 comments on commit ffef136

Please sign in to comment.