Skip to content

v0.20.0 (2021-03-10)

Compare
Choose a tag to compare
@tjwelde tjwelde released this 10 Mar 16:15
· 780 commits to develop since this release

Compare with v0.19.0

SDK split-up / Monorepo

This release changes a lot in the structure of the SDK.
The SDK was split-up into multiple separate packages. Namely:

  • @kiltprotocol/core -> KILTs core functionality.
  • @kiltprotocol/types -> Shared typescript types.
  • @kiltprotocol/config -> A new config service.
  • @kiltprotocol/utils -> Stateless utility functions and SDK Errors.
  • @kiltprotocol/messaging -> Everything related to messages and messaging.
  • @kiltprotocol/chain-helpers -> Functions to build and hold a blockchain connection. Also contains error handling for blockchain related errors.
  • @kiltprotocol/actors-api -> A convenience layer on top of KILT, to simplify usage and workflows.
  • @kiltprotocol/sdk-js -> A re-export of all the above.

Additionally, in our effort to aligning with the DID/VC spec, we have added following package:

  • @kiltprotocol/vc-export -> Converts a KILT credential to a "Verifiable Credential" and allows building presentations of it.

JSON-LD based claim hashing (cfa9534)

In preparation for the VC-Export package, we changed our KILT credentials, to use a JSON-LD based property hashing algorithm. This also fixes a potential exploit, where labels could be reordered and still lead to the same root hash.

Remove Portablegabi (deaca75)

The experimental anonymous credential feature "portablegabi" was removed, to investigate alternative solutions and to simplify the SDK. This fixes related project setup issues regarding the included WASM and asynchronous instantiation of identities.

Multi-TX (affad9d)

This feature allows the user to trigger blockchain transactions one after another, without having to wait for the preceding one to finish. It is accomplished by counting up the next nonce on the client-side, if possible, and by resigning transactions if the returned error from the chain is recoverable. The corresponding function is called Blockchain.submitTxWithReSign(), but also the Blockchain.submitTx() has resigning and nonce calculation activated.

Explicit transaction & await self defined TX status (c4490e3)

With this change, functions that require blockchain writes (store Attestation / CType, revoke Attestation, make transfer, etc.) will no longer submit the transaction, but only prepare it. Instead, a signed SubmittableExtrinsic is returned which the end user then submits by calling its send() method (optionally attaching a listener to it) or by passing it to the submitSignedTx() helper function, which allows you to promisify and await any tx status change (e.g. Finalized or inBlock)

Config Service (a1b224b)

We introduced a new Config Service, which can be used to configure the node address to connect to and to set the log level. This will be expanded on, whenever we need to introduce new configs. It can be called with KILT.config({}).

Connection Workflow (b0da030)

To connect to a KILT node, it is now required to call KILT.init({ address: <YOUR NODE ADDRESS> }) or KILT.config({ address: <YOUR NODE ADDRESS> }) before connecting, or using a blockchain function, which will implicitly connect using the set configuration. KILT.connect() doesn't take an address parameter anymore, but just connects to whatever was set via the KILT.init or the KILT.config function.

For advanced use-cases it is also possible to build the connection yourself and set it for the application as KILT.config or KILT.init would do.

SR25519 (744de64)

We changed the default identity key pair type from ed25519 to sr25519. It is still possible to use an ed25519 identity by adding the { signingKeyPairType: 'ed25519' } option to the identity builder.
This change relies on polkadot-js crypto functions, which themselves rely on an included wasm library. Because we need to wait for the crypto library to be ready, we added the await KILT.init({ ... }) function, which combines the configuration functionality of KILT.config with asynchronously waiting until the crypto is ready.
You can also wait for the crypto by calling await Identity.cryptoWaitReady(), or check if the crypto is ready by calling Identity.cryptoIsReady().

Message compression / decompression (e8d8a01)

Messages can now be compressed and decompressed by calling compress() on a Message object and just giving the CompressedMessageBody to the Message constructor, which decompresses it automatically.

Unit denomination tools (be43462)

There are new tools available to format a KILT balance and converting it back to the base unit: BalanceUtils.formatKiltBalance() and BalanceUtils.asFemtoKilt().

Attestation.verify(fe23e59)

Renamed to Attestation.checkValidity() to prevent misunderstandings.

Yarn & Prereleases

The SDK now uses yarn v2 for package management and publishes prereleases to npm instead of github packages.

Bug Fixes

  • add missing did type (#342) (0a196cc)
  • default was missing for Blockchain.submitSignedTx (0a30adf)
  • delegation revocation (#349) (656a104)
  • integration tests, dev node startup command (#343) (4ec90e3)
  • no expectations about GAS amount in tests (05d3f2c)
  • packaging (99255da)
  • setting prerelease version (753d1f9)
  • undefined assignment on double spread (#318) (10a774f)
  • versioning on devpackpublish (10dc4cd)

Features