Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Latest commit

 

History

History
335 lines (311 loc) · 11.6 KB

migration-guide-1.8.0-1.9.0.md

File metadata and controls

335 lines (311 loc) · 11.6 KB

Libindy 1.8 to 1.9 migration Guide

This document is written for developers using Libindy to provide necessary information and to simplify their transition to Libindy 1.9 from Libindy 1.8. If you are using older Libindy version you can check migration guides history:

Table of contents

Notes

Migration information is organized in tables, there are mappings for each Libindy API part of how older version functionality maps to a newer one. Functions from older version are listed in the left column, and the equivalent newer version function is placed in the right column:

  • If some function had been added, the word 'NEW' would be placed in the left column.
  • If some function had been deleted, the word 'DELETED' would be placed in the right column.
  • If some function had been deprecated, the word 'DEPRECATED' would be placed in the right column.
  • If some function had been changed, the current format would be placed in the right column.
  • If some function had not been changed, the symbol '=' would be placed in the right column.
  • To get more details about current format of a function click on the description above it.
  • Bellow are signatures of functions in Libindy C API. The params of cb (except command_handle and err) will be result values of the similar function in any Libindy wrapper.

Libindy 1.8 to 1.9.0 migration Guide

Ledger API

Due to legal nuances Indy network should support flow to receive explicit confirmation from any transaction author that he accepts the following reality. The ledger is public and immutable and by writing data to the ledger the user will not be able to exercise the right to be forgotten, so no personal data should be published to the ledger.

So the set of new function were added to Libindy API to support work with Transaction Author Agreement concept introduced on the Ledger. This guarantees that every write transaction author agree that the information they submit to the ledger meets the requirements outlined by ledger governance.

Changes

v1.8.3 - Ledger API v1.9.0 - Ledger API
Adds a new version of Transaction Author Agreement to the ledger
NEW
indy_build_txn_author_agreement_request(
                        command_handle: CommandHandle,
                        submitter_did: *const c_char,
                        text: *const c_char,
                        version: *const c_char,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               request_json: *const c_char))
      
Gets a specific Transaction Author Agreement from the ledger
NEW
indy_build_get_txn_author_agreement_request(
                        command_handle: CommandHandle,
                        submitter_did: *const c_char,
                        data: *const c_char,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               request_json: *const c_char))
      
Adds new acceptance mechanisms for transaction author agreement
NEW
indy_build_acceptance_mechanisms_request(
                        submitter_did: *const c_char,
                        aml: *const c_char,
                        version: *const c_char,
                        aml_context: *const c_char,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               request_json: *const c_char))
      
Get acceptance mechanisms from the ledger
NEW
indy_build_get_acceptance_mechanisms_request(
                        submitter_did: *const c_char,
                        timestamp: i64,
                        version: *const c_char,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               request_json: *const c_char))
      
Appends transaction author agreement acceptance data to a request
NEW
indy_append_txn_author_agreement_acceptance_to_request(
                        request_json: *const c_char,
                        text: *const c_char,
                        version: *const c_char,
                        taa_digest: *const c_char,
                        mechanism: *const c_char,
                        time: u64,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               request_with_meta_json: *const c_char))
      
v1.8.3 - Payment API v1.9.0 - Payment API
Append payment extra JSON with TAA acceptance data
NEW
indy_prepare_payment_extra_with_acceptance_data(
                        extra_json: *const c_char,
                        text: *const c_char,
                        version: *const c_char,
                        taa_digest: *const c_char,
                        mechanism: *const c_char,
                        time: u64,
                        cb: fn(command_handle_: CommandHandle,
                               err: ErrorCode,
                               extra_with_acceptance: *const c_char))
      

Sample

acc_mech_request = indy_build_acceptance_mechanisms_request(...)
indy_sign_and_submit_request(..., acc_mech_request)

txn_author_agrmnt_request = indy_build_txn_author_agreement_request(...)
indy_sign_and_submit_request(..., txn_author_agrmnt_request)

nym_request = indy_build_nym_request(...)
nym_req_with_taa_acceptance = indy_append_txn_author_agreement_acceptance_to_request(nym_request, ...)
indy_sign_and_submit_request(..., nym_req_with_taa_acceptance)

Cache API

Currently whenever credential definitions and/or schemas is needed, it is being fetched from the ledger. This operation may last multiple seconds and is slowing down usage of credentials. Caching also enables usage of anoncreds in areas where user do not have internet coverage.

The set of new Experimental functions were added to Libindy API to achieve the following goals:

  • allow users to cache credential definitions and schemas.
  • enables purging of old (not needed more) data.
v1.8.3 - Cache API v1.9.0 - Cache API
Gets credential definition json data for specified credential definition id
NEW
indy_get_cred_def(command_handle: i32,
                  pool_handle: PoolHandle,
                  wallet_handle: WalletHandle,
                  submitter_did: *const c_char,
                  id: *const c_char,
                  options_json: *const c_char,
                  cb: Option)
          
Gets schema json data for specified schema id.
NEW
indy_get_schema(command_handle: i32,
                pool_handle: PoolHandle,
                wallet_handle: WalletHandle,
                submitter_did: *const c_char,
                id: *const c_char,
                options_json: *const c_char,
                cb: Option)
          
Purge credential definition cache
NEW
indy_purge_cred_def_cache(
                wallet_handle: WalletHandle,
                options_json: *const c_char,
                cb: Option)
          
Purge schema cache
NEW
indy_purge_schema_cache(
                wallet_handle: WalletHandle,
                options_json: *const c_char,
                cb: Option)
          

Anoncreds API

Updated behavior of indy_verifier_verify_proof function to check restrictions on requested predicates during validation of proof.