
Product
Socket for Asana Is Now Available
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.
@celo/poprf
Advanced tools
This repository implements a threshold-computable partially-oblivious pseudo-random function (POPRF) with evaluations that are verifiable by the client.
Building upon the existing BLS threshold signature based OPRF implemented for use on Celo in ODIS, this repository implements an extension to the Pythia POPRF specification to provide threshold computation and verification against a single pre-shared public key. This construction is called Pith for its basis on Pythia and usage in the Celo PIN/Password Encrypted Account Recovery protocol PEAR.
At a high level, the POPRF is a protocol with a client and a service who collectively compute a keyed PRF (i.e. essentially a hash) over a tag input and a message input. The message input is secret to the client, and the private key input is secret to the service. In order to compute the final function the client "blinds" the message and sends it, along with the tag, to the service. The service may choose to compute the POPRF function over this blinded message and plaintext tag, resulting in a blinded evaluation. This is sent back to the client, who unblinds the evaluation to get the final output. More details are available in the specification below.
The specification linked above is also availble in this repository as specification.md.
Some application os (P)OPRF functions include:
This library provides WASM bindings for signing under the ffi/wasm.rs module. These can be built
via the wasm-pack tool. Depending on the platform you are
targeting, you'll need to use a different build flag.
Note: You can also replace celo with your own NPM username to test publish.
# Builds the WASM and wraps it as NPM package @celo/poprf
wasm-pack build --target nodejs --scope celo -- --features=wasm
The bundled WASM package will be under the pkg/ directory. You can then either pack and publish it
with wasm-pack's pack and publish commands, or manually import it in your application.
wasm-pack publish --access public
Here is an example of using the library. In practice there will be a client and a server, with the assumption that the client holds the message and the server holds the private key. In this snippet, both client and server are represented.
import * as poprf from '@celo/poprf'
import 'crypto'
const message = Buffer.from("message")
const tag = Buffer.from("tag")
// Generate a local keypair for demonstration purposes.
const keypair = poprf.keygen(crypto.randomBytes(32))
// Client: Blind the message to send to the server.
const { blindedMessage, blindingFactor } = poprf.blindMsg(message, crypto.randomBytes(32))
// Server: Evaluate the POPRF over the blinded message and tag.
const response = poprf.blindEval(keypair.privateKey, tag, blindedMessage)
// Client: Unblind and verify the evaluation returned from the server.
const result = poprf.unblindResp(keypair.publicKey, blindingFactor, tag, response)
FAQs
A threshold-computable partially-oblivous psuedo-random function
The npm package @celo/poprf receives a total of 44 weekly downloads. As such, @celo/poprf popularity was classified as not popular.
We found that @celo/poprf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.