mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-05-13 03:07:12 +00:00
23 lines
314 B
JavaScript
23 lines
314 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const protobuf = require('protons')
|
||
|
|
||
|
module.exports = protobuf(`
|
||
|
message Exchange {
|
||
|
optional bytes id = 1;
|
||
|
optional PublicKey pubkey = 2;
|
||
|
}
|
||
|
|
||
|
enum KeyType {
|
||
|
RSA = 0;
|
||
|
Ed25519 = 1;
|
||
|
Secp256k1 = 2;
|
||
|
ECDSA = 3;
|
||
|
}
|
||
|
|
||
|
message PublicKey {
|
||
|
required KeyType Type = 1;
|
||
|
required bytes Data = 2;
|
||
|
}
|
||
|
`)
|