Browse files

Merge pull request #45 from uport-project/feature/private-chain

jsonRPC selective disclose
  • Loading branch information...
pelle committed Dec 20, 2018
2 parents 8042f65 + ffef136 commit ba4fe939a029f7e08b145a5102b25084e66e3953
@@ -44,7 +44,7 @@ We currently support the following flows:
- [Selective Disclosure Flow](flows/
- [Send Verification Flow](flows/
- [Ethereum Transaction Request Flow](flows/
- [Private Chain Provisioning Flow](flows/
- [Private Chain Flow](flows/

### [More about request flows](flows/

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

- Ethereum compatible blockchain
- Public facing JSON RPC endpoint
- [MetaIdentityManager]( contract deployed on private blockchain
- [TxRelay]( contract deployed on private blockchain
- [Relay Server](/rest-apis/ for funding and relaying transactions on private chain

- Public facing JSON RPC endpoint (RPC Gateway)

## Provisioning Methodology

1. Use [Selective Disclosure Flow]( 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/ 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:

- `[JWT]`

*The following endpoints are deprecated*

- `me.uport:net/[JWT]`
- `[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 @@
!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

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
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,6 +30,7 @@ Name | Description | Required
`boxPub` | 32 byte base64 encoded [`Curve25519`]( 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/ | no
`vc` | Array of Verified Claims JWTs or IPFS hash of JSON encoded equivalent about the `iss` of this message. See [Issuer Claims](/messages/ and [Verified Claims](/messages/ | no
`rpc` | URL for the JSON RPC endpoint, ie: ``. Useful for [Private Networks](/flows/ 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](./

0 comments on commit ba4fe93

Please sign in to comment.