1
0
forked from cheng/wallet

still struggling with the problem of making public ids public

This commit is contained in:
reaction.la 2022-07-01 09:18:44 +10:00
parent 3129c736f2
commit 53ec4eba6c
No known key found for this signature in database
GPG Key ID: 99914792148C8388
9 changed files with 134 additions and 111 deletions

2
.gitattributes vendored
View File

@ -35,6 +35,8 @@ Makefile text eol=lf encoding=utf-8
*.vcxproj text eol=crlf encoding=utf-8 whitespace=trailing-space,space-before-tab,tabwidth=4
*.vcxproj.filters text eol=crlf encoding=utf-8 whitespace=trailing-space,space-before-tab,tabwidth=4
*.vcxproj.user text eol=crlf encoding=utf-8 whitespace=trailing-space,space-before-tab,tabwidth=4
*.props text eol=crlf encoding=utf-8 whitespace=trailing-space,space-before-tab,tabwidth=4
# Force binary files to be binary

13
.gitignore vendored
View File

@ -1,5 +1,16 @@
sqlite3/sqlite-doc/
*.bat
## ignore Microsof Word stuff, as no one should use it in the project
## pandoc can translate it to markdown, the universal format.
*.doc
*.DOC
*.docx
*.DOCX
*.dot
*.DOT
*.rtf
*.RTF
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
*.bak

View File

@ -58,8 +58,8 @@ do
katex=" --katex=./"
fi
done <$f
pandoc $katex $options $base.html $base.md
echo "$base.html from $f"
echo "generating $base.html from $f"
pandoc $katex $options $base.html $base.md
#else
# echo " $base.html up to date"
fi
@ -83,8 +83,8 @@ do
katex=" --katex=./"
fi
done <$f
echo "generating $base.html from $f"
pandoc $katex $options $base.html $base.md
echo "$base.html from $f"
#else
# echo " $base.html up to date"
fi
@ -98,9 +98,9 @@ do
base=${f:0:($len-3)}
if [ $f -nt ../../$base.html ];
then
echo "generating $base.html from $f"
pandoc $osoptions --wrap=preserve --from markdown --to html --metadata=lang:en --css=$templates/style.css --self-contained -o ../../$base.html $base.md
#--include-in-header=style.css
echo "../..$base.html from $f"
#else
# echo " $base.html up to date"
fi

View File

@ -38,16 +38,47 @@ form $1$, with probability $\frac{1}{6}$, $0$ with probability $\frac{4}{6}$,
$-1$ with probability $\frac{1}{6}$, though a sparse matrix is apt to
distort a sparse vector
There exists a set of points of size $m$ that needs dimension
$$\displaystyle{O(\frac{\log(m)}{ε^2})}$$
There exists a set of $m$ points that needs dimension
$$\displaystyle{\LARGE\bigcirc\normalsize\frac{\ln(m)}{ε^2}}$$
in order to preserve the distances
between all pairs of points within a factor of$1±ε$
The time to find the nearest neighbour is logarithmic in the number of points,
but exponential in the dimension of the space. So we do one pass with rather
large epsilon, and another pass, using an algorithm proportional to the small
number of candidate neighbours times the dimensionality with a small number
of candidate neighbours found in the first pass.
This is apt to be a lot. We might well have ten million points, and wish to
preserve distances within twenty five percent, in which case we need two
hundred and fifty six dimensions. So a dimensionally reduced point is not
necessarily reduced by a whole lot.
For spaces of dimension higher than fifteen or so, clever methods of
nearest neighbour search generally fail, and people generally wind up with
brute force search, comparing each point to each of the others, and then
they aggregate into groups by making near neighbours into groups, and
near groups into supergroups.
Wikipedia reports two open source methods, Locality Sensitive Hashing,
one of them used for exactly this problem, finding groups in emails.
The problem of finding near neighbours in social space, mapping the
[Kademlia]{#Kademlia} algorithm to social space, is similar but little different, since
every vertex already is more likely to have connection to neighbours, and
for an arbitrary vertex, whose connections we do not know, we want to
find a vertex among those we do know that is more likely to have a
connection to it, or to someone that has a connection to it, that is likely
to be nearer in terms of number of vertex traversals.
In which case everyone reports a value that reflects his neighbours, and
their neighbours, and their neighbours neighbours, with a neighbourhood
smell that grows more similar when we find a vertex likely to be nearest
neighbour of our target, and the problem is to construct this smell as a
moderately sized blob of data, that can be widely shared, so that each
vertex has unique smell of, say 256 or 512 bits, that reflects who it stably
has the information to quickly connect with, so you look at who you have
a connection with to find who is likely to have a connection to your target,
and he looks up those he is connected with to find someone more likely to
have a connection.
Locality sensitive hashing, LSH, including the open source email
algorithm, Nilsimsa Hash, attempts to distribute all points that are near
each other into the same bin.
So in a space of unenumerably large dimension, such as the set of substrings
of an email, or perhaps substrings of bounded length with bounds at spaces,
@ -70,7 +101,7 @@ unenumerably large dimension, where distributions are necessarily non
normal.
But variance is, approximately, the log of probability, so Mahalanobis is
more or less Bayes filtering.
more or less Bayes filtering, or at least one can be derived in terms of the other.
So we can reasonably reduce each email into twenty questions space, or, just
to be on the safe side, forty questions space. (Will have to test how many

View File

@ -172,6 +172,8 @@ cp -rv ~/.ssh /etc/skel
# Actual server
## disable password entry
Setting up an actual server is similar to setting up the virtual machine
modelling it, except you have to worry about the server getting overloaded
and locking up.
@ -204,9 +206,7 @@ but have enabled passwordless sudo for one special user, you can still get
You can always undo the deliberate corruption by setting a new password,
providing you can somehow get into root.
```bash
passwd -D cherry
```
## never enough memory
If a server is configured with an [ample swap file] an overloaded server will
lock up and have to be ungracefully powered down, which can corrupt the data
@ -1428,7 +1428,7 @@ chown -R www-data:www-data /var/www/blog.reaction.la
Replace the defines for `DB_NAME`, `DB_USER`, and `DB_PASSWORD` in `wp_config.php`, as described in [Wordpress on Lemp]
#### To import datbase by command line
#### To import database by command line
```bash
systemctl stop nginx
@ -1930,6 +1930,8 @@ postqueue -p
You probably will not see any TLS activity. You want to configure Postfix
to always attempt SSL, but not require it.
Modify `/etc/postfix/main.cf` using the postconf command:
```bash
# TLS parameters
#

View File

@ -3,50 +3,50 @@ set -e
set -x
echo intended to be run in the event of moving repositories
git remote -v
git remote set-url origin git@cpal.pw:~/wallet.git
git remote set-url --push upstream git@rho.la:~/wallet.git
git submodule foreach --recursive 'git remote -v'
cd libsodium
git remote set-url origin git@cpal.pw:~/libsodium.git
git remote set-url --push upstream git@rho.la:~/mpir.git
git remote set-url upstream https://github.com/jedisct1/libsodium.git
cd ..
cd mpir
git remote set-url origin git@cpal.pw:~/mpir.git
git remote set-url --push upstream git@rho.la:~/mpir.git
git remote set-url upstream https://github.com/BrianGladman/mpir.git
cd ..
cd wxWidgets
git remote set-url origin git@cpal.pw:~/wxWidgets.git
git remote set-url --push upstream git@rho.la:~/wxWidgets.git
git remote set-url upstream https://github.com/wxWidgets/wxWidgets.git
cd ..
cd wxWidgets/3rdparty/catch
git remote set-url origin git@cpal.pw:~/Catch.git
git remote set-url --push upstream git@rho.la:~/Catch.git
git remote set-url upstream https://github.com/wxWidgets/Catch.git
cd ../../..
cd wxWidgets/3rdparty/nanosvg
git remote set-url origin git@cpal.pw:~/nanosvg
git remote set-url --push upstream git@rho.la:~/nanosvg
git remote set-url upstream https://github.com/wxWidgets/nanosvg
cd ../../..
cd wxWidgets/3rdparty/pcre
git remote set-url origin git@cpal.pw:~/pcre
git remote set-url --push upstream git@rho.la:~/pcre
git remote set-url upstream https://github.com/wxWidgets/pcre
cd ../../..
cd wxWidgets/src/expat
git remote set-url origin git@cpal.pw:~/libexpat.git
git remote set-url --push upstream git@rho.la:~/libexpat.git
git remote set-url upstream https://github.com/wxWidgets/libexpat.git
cd ../../..
cd wxWidgets/src/jpeg
git remote set-url origin git@cpal.pw:~/libjpeg-turbo.git
git remote set-url --push upstream git@rho.la:~/libjpeg-turbo.git
git remote set-url upstream https://github.com/wxWidgets/libjpeg-turbo.git
cd ../../..
cd wxWidgets/src/png
git remote set-url origin git@cpal.pw:~/libpng.git
git remote set-url --push upstream git@rho.la:~/libpng.git
git remote set-url upstream https://github.com/wxWidgets/libpng.git
cd ../../..
cd wxWidgets/src/tiff
git remote set-url origin git@cpal.pw:~/libtiff.git
git remote set-url --push upstream git@rho.la:~/libtiff.git
git remote set-url upstream https://github.com/wxWidgets/libtiff.git
cd ../../..
cd wxWidgets/src/zlib
git remote set-url origin git@cpal.pw:~/zlib.git
git remote set-url --push upstream git@rho.la:~/zlib.git
git remote set-url upstream https://github.com/wxWidgets/zlib.git
cd ../../..
winConfigure.sh

View File

@ -1,6 +1,7 @@
---
title:
Social networking
# katex
title: >-
Social networking
...
# the crisis of censorship
@ -270,35 +271,53 @@ the same principles as Git and git repositories, except that Git relies on
SSL and the Certificate Authority system to locate a repository, which
dangerous centralization would fail under the inevitable attack. It needs to
have instead for its repository name system a distributed hash table name
system, but a Kamelia distributed hash table will come under hostil
attack.
system, but a Kademlia distributed hash table will come under hostile
attack.
So rather than a system relying on nearest neighbour by hash distance,
So rather than a distributed hash table structured by hash distance,
nearest neighbour by social distance.
Social distance is costly and complex to calculate. If there are more than
thirty or a hundred entities, need to use dimensional reduction. But we do
not need to do it very often.
### Replacing Kademlia
Social distance, if calculated in a shill and Sybil resistant way, lacks the
nice mathematical properties of the Kamelia distance metric, so does not
necessarily guarantee you will find what you are looking for. Or if it does, going to be a lot more complicated to prove. But it seems likely that most
of the time, it will perform well, because most of the time you will be
looking for someone close. We will have to find out by experiment.
[social distance metric]:recognizing_categories_and_instances.html#Kademlia
{target="_blank"}
The reason that Kamelia network cannot work in the face of enemy action, is that the shills who want to prevent something from being found create a hundred entries with a hash close to their target by Kamelia distance, and then when your search brings you close to target, it brings you to a shill, who misdirects you. Using social network distance resists this attack.
The messages of the people you are following are likely to be in a
relatively small number of repositories, even if the total number of
repositories out there is enormous and the number of hashes in each
repository is enormous, so this algorithm and data structure will scale, and
the responses to that thread that they have approved, by people you are not
following, will be commits in that repository, that, by pushing their latest
response to that thread to a public repository, they committed to that
repository.
I will describe the Kademlia distributed hash table algorithm not in the
way that it is normally described and defined, but in such a way that we
can easily replace its metric by [social distance metric], assuming that we can construct a suitable metric, which reflects what feeds a given host is following, and what feeds the hosts of which it knows the unstable network address of are following, and what stable network addresses it knows and the feeds they are following, a quantity over which a distance can be found that reflects how close a peer is to an unstable network address, or knows a peer that is likely to know a peer that is likely to know an unstable network address.
Each repository contains all the material the poster has approved, resulting
in considerable duplication, but not enormous duplication.
A distributed hash table works by each peer on the network maintaining a
large number of live and active connections to computers such that the
distribution of connections to computers distant by the distributed hash
table metric is approximately uniform by distance, which distance is for
Kademlia the $log_2$ of the exclusive-or between his hash and your hash.
And when you want to connect to an arbitrary computer, you asked the
computers that are nearest in the space to the target for their connections
that are closest to the target. And then you connect to those, and ask the
same question again.
In the course of this operation, you acquire more and more active
connections, which you purge from time to time to keep the total number
of connections reasonable, the distribution approximately uniform, the
connections preferentially to computers with long lived network addresses
and open ports, and connections that are distant from you distant from
each other.
Social distance is costly and complex to calculate, and requires that
information on a public feed showing its social connections be widely
shared, which is a lot of information that everyone has to acquire and
store, and perform a heavy calculation on. If there are more than thirty
or a hundred entities, need to use dimensional reduction. But we do not
need to do it very often.
The reason that the Kademlia distributed hash table cannot work in the
face of enemy action, is that the shills who want to prevent something
from being found create a hundred entries with a hash close to their target
by Kademlia distance, and then when your search brings you close to
target, it brings you to a shill, who misdirects you. Using social network
distance resists this attack.
The messages of the people you are following are likely to be in a
relatively small number of repositories, even if the total number of
@ -327,6 +346,17 @@ state of that tree, with the continually changing root of Bobs Merkle-patrici
tree signed by Bob using his secret key which is kept in a BIP39
style wallet.
When Dave replies to a text in Carol's feed, the Carol text and the reply by
default goes into his feed, and if it does there will be metadata in his feed
about his social network connection to Carol, which, if Bob is following
Dave's feed, can be used by Bob's client to navigate the distribute hash
table to Carol's feed.
And if Carol approves Dave's reply, or is following Dave or has buddied
Dave, and Bob is following Carol, but not following Dave, then there will
be in metadata in Carol's feed that can be used by Bob's client to navigate
the distribute hash table to Carol's feed.
The metadata in the feed sharing reveals what network addresses are
following a feed, but the keys are derived from user identity keys by a one
way hash, so are not easily linked to who is posting in the feed.

View File

@ -3,68 +3,15 @@ set -e
set -x
git submodule foreach --recursive 'git reset --hard'
git submodule foreach --recursive 'git clean -xdf'
git submodule update --init --recursive --remote
git submodule foreach --recursive 'git switch rho-fork'
git submodule foreach --recursive 'git switch --detach'
git submodule update --init --recursive
git config --local include.path ../.gitconfig
set +e
set +x
rm -r x64
set -e
src=libsodium/libsodium.vcxproj
dest=libsodium/libsodium.vcxproj
wxwin=wxWidgets
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
chmod 755 docs/mkdocs.sh
chmod 755 docs/check_html.sh
chmod 755 mpir/devel/regen
chmod 755 mpir/devel/setversion
chmod 755 mpir/tune/aligntest
chmod 755 mpir/devel/benchmpn
chmod 755 wxWidgets/build/tools/*.sh
chmod 755 wxWidgets/distrib/autopackage/makeautopackage
chmod 755 wxWidgets/docs/doxygen/*.sh
chmod 755 wxWidgets/interface/*.sh
chmod 755 wxWidgets/lib/*.sh
chmod 755 wxWidgets/misc/scripts/*.sh
chmod 755 wxWidgets/misc/scripts/check_unused_headers
chmod 755 wxWidgets/src/expat/*.sh
chmod 755 wxWidgets/src/*/contrib/oss-fuzz/*.sh
chmod 755 wxWidgets/tests/fuzz/*.sh
chmod 755 wxWidgets/utils/ifacecheck/*.sh
fi
cat $src | sed 's/<CharacterSet>MultiByte/<CharacterSet>Unicode/g' | sed 's/<RuntimeLibrary>MultiThreadedDebug</<RuntimeLibrary>MultiThreadedDebugDLL</g' | sed 's/<RuntimeLibrary>MultiThreaded</<RuntimeLibrary>MultiThreadedDLL</g'> tempx
unix2dos tempx
mv -v tempx $dest
src=libsodium/test/default/wintest.bat
cat $src | sed 's/SET[[:blank:]]\+CFLAGS=%CFLAGS%[[:blank:]]\(.*\)\/MT\(.*\)DSODIUM_STATIC[[:blank:]]\+\/DSODIUM_EXPORT/SET CFLAGS=%CFLAGS% \1\/MD\2DSODIUM_STATIC \/DSODIUM_EXPORT/g'> tempx
unix2dos tempx
mv -v tempx $src
src=mpir/msvc/vs22/lib_mpir_gc/lib_mpir_gc.vcxproj
dest=$src
cat $src | grep -v RuntimeLibrary | sed 's/^\(.*\)<PreprocessorDefinitions>NDEBUG\(.*\)$/\1<PreprocessorDefinitions>NDEBUG\2\
<RuntimeLibrary>MultiThreadedDLL<\/RuntimeLibrary>/g' | sed 's/<PlatformToolset>v[[:digit:]]\{3\}/<PlatformToolset>v143/g' | sed 's/^\(.*\)<PreprocessorDefinitions>_DEBUG\(.*\)$/\1<PreprocessorDefinitions>_DEBUG\2\
<RuntimeLibrary>MultiThreadedDebugDLL<\/RuntimeLibrary>/g' > tempx
unix2dos tempx
mv -v tempx $dest
src=mpir/msvc/vs22/dll_mpir_gc/dll_mpir_gc.vcxproj
dest=$src
cat $src | grep -v RuntimeLibrary | sed 's/^\(.*\)<PreprocessorDefinitions>NDEBUG\(.*\)$/\1<PreprocessorDefinitions>NDEBUG\2\
<RuntimeLibrary>MultiThreadedDLL<\/RuntimeLibrary>/g' | sed 's/<PlatformToolset>v[[:digit:]]\{3\}/<PlatformToolset>v143/g' | sed 's/^\(.*\)<PreprocessorDefinitions>_DEBUG\(.*\)$/\1<PreprocessorDefinitions>_DEBUG\2\
<RuntimeLibrary>MultiThreadedDebugDLL<\/RuntimeLibrary>/g' > tempx
unix2dos tempx
mv -v tempx $dest
src=mpir/msvc/vs22/lib_mpir_cxx/lib_mpir_cxx.vcxproj
dest=$src
cat $src | grep -v RuntimeLibrary | sed 's/^\(.*\)<PreprocessorDefinitions>NDEBUG\(.*\)$/\1<PreprocessorDefinitions>NDEBUG\2\
<RuntimeLibrary>MultiThreadedDLL<\/RuntimeLibrary>/g' | sed 's/<PlatformToolset>v[[:digit:]]\{3\}/<PlatformToolset>v143/g' | sed 's/^\(.*\)<PreprocessorDefinitions>_DEBUG\(.*\)$/\1<PreprocessorDefinitions>_DEBUG\2\
<RuntimeLibrary>MultiThreadedDebugDLL<\/RuntimeLibrary>/g' > tempx
unix2dos tempx
mv -v tempx $dest
src=$wxwin/include/wx/msw/setup.h
cat $src | sed 's/^#define\([[:blank:]]\+\)wxUSE_IPV6\([[:blank:]]\+\).*$/#define\1wxUSE_IPV6\21/g'| sed 's/^#define\([[:blank:]]\+\)WXWIN_COMPATIBILITY_3_0\([[:blank:]]\+\).*$/#define\1WXWIN_COMPATIBILITY_3_0\20/g'| sed 's/^#define\([[:blank:]]\+\)wxUSE_COMPILER_TLS\([[:blank:]]\+\).*$/#define\1wxUSE_COMPILER_TLS\22/g'| sed 's/^#define\([[:blank:]]\+\)wxUSE_STD_CONTAINERS\([[:blank:]]\+\).*$/#define\1wxUSE_STD_CONTAINERS\21/g'| sed 's/^#define\([[:blank:]]\+\)wxUSE_DIALUP_MANAGER\([[:blank:]]\+\).*$/#define\1wxUSE_DIALUP_MANAGER\20/g'| sed 's/^#define\([[:blank:]]\+\)WXWIN_COMPATIBILITY_3_0\([[:blank:]]\+\).*$/#define\1WXWIN_COMPATIBILITY_3_0\20/g'| sed 's/^#define\([[:blank:]]\+\)wxUSE_STD_STRING_CONV_IN_WXSTRING\([[:blank:]]\+\).*$/#define\1wxUSE_STD_STRING_CONV_IN_WXSTRING\21/g'> tempx
mv tempx $src
docs/mkdocs.sh
# if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# fi