View on GitHub

Whiteflag API

Reference implementation of the Whiteflag protocol as a web API in Node.js to connect applications with the underlying blockchains

Whiteflag API Connector for Ethereum

The Whiteflag API natively supports the Ethereum blockchain.

NOTE - The Ethereum module needs updating.

Blockchain specifications

   
Whiteflag message embedding: data field
Maximum message length: dynamic
Signature algorithm: ECDSA secp256k1
Transaction hash: 256 bits (64 hexadecimals)
Secret for account creation: private key

Note that curve secp256k1 for the ECDSA signature algorthm is officially not specified to be used with JWS for Whiteflag authentication method 1. Instead, the JWS specification in RFC 7518 requires curve secp256r1 a.k.a. prime256v1. However, Whiteflag is using JSON Web Tokens just as a structure. For Whiteflag authentication method 1 to work, it is essential that the key pair and curve of the blockchain is used for the signature to prove possession of the associated secret key. See also Issue 28.

Ethereum configuration

The blockchains configuration file config/blockchains.toml should contain the Ethereum specific parameters in one of its [[blockchains]] sections.

These parameters manage Ethereum blockchain accounts:

For retrieving transactions containing Whiteflag messages from the blockchain, these parameters may be provided, otherwise default values are used:

To send and receive Whiteflag messages, the API must be connected to a Ethereum node exposing the standard Ethereum RPC interface. These parameters are used to configure the connection: