OverviewFilesCommitsIssuesDocsReleasesPeers

hypercore-kb / opencog-kb / language-learning / chatbot / data / anproto-knowledge.txt

45 lines · txt ref:
# ANProto Protocol Knowledge

## What ANProto Is
ANProto is a signing protocol for messages
ANProto uses Ed25519 signatures
ANProto is used by wirecore for message signing
A protocol defines how messages are structured and verified

## Keypairs
A keypair contains a public key and a secret key
You create a keypair using createKeyPair
createKeyPair produces a keypair
The public key is 64 hex characters
The secret key is 128 hex characters
The keypair is generated from Ed25519

## Signing
To sign a message you need a keypair
Signing takes a message and a secret key
Signing produces a signature
The signature is 128 hex characters
You sign using crypto_sign_detached

## Message Flow
First you create content
Then you hash the content using SHA256
The hash is the content hash
Then you sign the timestamp and the content hash
The timestamp is milliseconds
Signing produces a signature
The message contains the signature and the public key and the timestamp and the content hash

## Verification
To verify you need the signature and the public key and the message
Verification uses crypto_sign_verify_detached
Verification checks that the signature matches the public key
If verification passes the message is authentic

## Sending
To send an ANProto message you create a keypair
Then you create content like hello world
Then you hash the content
Then you sign the timestamp and hash with your secret key
Then you broadcast the signature and public key and timestamp and content hash