Skip to main content
European CommissionEBSI European Blockchain

Utils

Utility commands for various computations and operations.

compute thumbprint <hexOrJwk>

Command to compute the thumbprint of a key.

Parameters:

  • hexOrJwk: Key in hex format or JWK. The hex format is only for keys with alg ES256K.

compute address <hexOrJwk>

Command to compute the Ethereum address of a public key. This key must use the algorithm ES256K.

Parameters:

  • hexOrJwk: Key in hex format or JWK.

compute did2 <jwk>

Command to compute the DID for natural person (did:key) given a JWK.

Parameters:

  • jwk: JWK of the natural person.

compute wait <seconds>

Command to wait for a specified number of seconds before calling a new command. It is useful for scripts when it's necessary to wait some time, like mining a transaction in the blockchain.

Parameters:

  • seconds: Number of seconds to wait.

compute length <array>

Command to get the length of an array.

Parameters:

  • array: Array of elements.

compute epochtime <time>

Command to compute epoch time as a number or ISO string.

Parameters:

  • time: If no time is set, it will return the current time as a number. If time is a number (seconds), it will return the ISO string representation. If time is a date as a string, it will return the epoch time as a number in seconds.

Examples:

# Return the current time as a number
==> compute epochtime
1757077214

# Return the current time as a ISO string
==> compute epochtime 1739952067
2025-02-19T08:01:07.000Z

# Return the epoch time as a number
==> compute epochtime 2025-02-19
1739923200