Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Added method and attribute before-and-after #546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion vcx/docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This version of libVCX represents a major step forward. The last version of libv
- vcx_credential_* - family of functions for receiving credential offers, sending credential requests and storing issued credentials in the wallet.
- vcx_disclosed_proof_* - family of functions for receiving proof requests, retrieving credentials relevant to a particular proof request and generating and sending proofs in response to proof requests.
- Many changes to vcxconfig.json parameter names

## Configuration Changes

| Previously | Currently |
Expand All @@ -33,3 +33,39 @@ The sweeping changes to libVCX/libIndy and the PoC nature of the previous versio
## Tokens/Payments

One of the major features of the this new version is the addition of token or payment related functionality. There is a new wallet API that allows the creation of payment addresses, the querying of addresses and balances, and the sending of tokens to other addresses. Payment of ledger fees and premium credentials is handled automatically when creating schemas and credential definitions and sending credential requests. While there is a payment_handle type defined in the API it is a placeholder and does not currently have any functionality. Payments are handled automatically by libVCX and addresses with sufficient balances are automatically used when payment is needed.

## Changes to Common API Calls
Most calls to methods in libvcx are unchanged or changes are small, and where they exist they usually are related to supporting the token payment system. The following table shows where changes have occurred (using the python wrapper as an example). Asterisks are used to denote changed parameters.

| Previously | Currently |
|-------------------------|-------------------------|
| vcx_init(<br />config_path:str<br />) | vcx_init(<br />config_path:str<br />) |
| Connection.create(<br />source_id:str<br />) | Connection.create(<br />source_id:str<br />) |
| connection.connect(<br />phone_nbr<br />)| connection.connect(<br />phone_nbr<br />)|
| connection.update_state()| connection.update_state()|
| connection.get_state()| connection.get_state()|
| Schema.create(<br />source_id:str, <br />name:str, <br />attrs:list<br />)<br />&nbsp;<br />&nbsp; | Schema.create(<br />source_id:str, <br />name:str, <br />\*version:str, <br />attrs:list, <br />\*payment_handle:int<br />) |
| schema.get_sequence_number() | schema.\*get_schema_id() |
| CredentialDef.create(<br />source_id:str, <br />name:str, <br />schema_seq_nbr:str, <br />)<br />&nbsp; | CredentialDef.create(<br />source_id:str, <br />name:str, <br />\*schema_id:str, <br />\*payment_handle:int<br />)|
| | cred_def.\*get_cred_def_id()|
| IssuerCredential.create(<br />source_id:str, <br />attrs:dict, <br />schema_seq_no:str, <br />name:str<br />)<br />&nbsp; | IssuerCredential.create(<br />source_id:str, <br />\*attrs:dict, <br />\*cred_def_id:str, <br />name:str, <br />\*price:str<br />) |
| credential.send_offer(<br />connection<br />) | credential.send_offer(<br />connection<br />) |
| credential.send_credential(<br />connection<br />) | credential.send_credential(<br />connection<br />) |
| credential.update_state()| credential.update_state()|
| credential.get_state()| credential.get_state()|
| Proof.create(<br />source_id:str, <br />name:str, <br />requested_attrs:list<br />)| Proof.create(<br />source_id:str, <br />name:str, <br />\*requested_attrs:list<br />)|
| proof.request_proof(<br />connection<br />)| proof.request_proof(<br />connection<br />)|
| proof.update_state()| proof.update_state()|
| proof.get_state()| proof.get_state()|
| proof.get_proof(<br />connection<br />)| proof.get_proof(<br />connection<br />)|

## Schema and Proof Attribute Changes
The attribute data structures used to define schemas and proofs have changed as follows:

| Previously | Currently |
|-------------------------|-------------------------|
| Schema:<br />&nbsp;<br />{<br />"attr_names":["attr1", "attr2", "attr3", ...],<br />"name":"schema_name",<br />"version": "version_string"<br />}| ["attr1", "attr2", "attr3", ...]|
| Proof:<br />&nbsp;<br />[{<br />&nbsp;&nbsp;"name": "attr1",<br />&nbsp;&nbsp;"issuerDid": "DID1"<br />},<br />{<br />&nbsp;&nbsp;"name": "attr2"<br />&nbsp;&nbsp;"issuerDid": "DID2",<br />}, ...<br />]<br />| [{<br />&nbsp;&nbsp;"name": "attr1",<br />&nbsp;&nbsp;"restrictions": [{<br />&nbsp;&nbsp;&nbsp;&nbsp;"criteria1_name": "criteria1_value",<br />&nbsp;&nbsp;&nbsp;&nbsp;"criteria2_name": "criteria2_value", ...<br />&nbsp;&nbsp;}, ...]<br />},<br />{<br />&nbsp;&nbsp;"name": "attr2",<br />&nbsp;&nbsp;"restrictions": []<br />}, ...<br />]|

## Documentation
For more detail on the methods and parameters, refer to the in-line documentation for the nodejs or python3 wrapper that you are using.