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 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.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 *.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 # Force binary files to be binary

13
.gitignore vendored
View File

@ -1,5 +1,16 @@
sqlite3/sqlite-doc/ 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 ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
*.bak *.bak

View File

@ -58,8 +58,8 @@ do
katex=" --katex=./" katex=" --katex=./"
fi fi
done <$f done <$f
pandoc $katex $options $base.html $base.md echo "generating $base.html from $f"
echo "$base.html from $f" pandoc $katex $options $base.html $base.md
#else #else
# echo " $base.html up to date" # echo " $base.html up to date"
fi fi
@ -83,8 +83,8 @@ do
katex=" --katex=./" katex=" --katex=./"
fi fi
done <$f done <$f
echo "generating $base.html from $f"
pandoc $katex $options $base.html $base.md pandoc $katex $options $base.html $base.md
echo "$base.html from $f"
#else #else
# echo " $base.html up to date" # echo " $base.html up to date"
fi fi
@ -98,9 +98,9 @@ do
base=${f:0:($len-3)} base=${f:0:($len-3)}
if [ $f -nt ../../$base.html ]; if [ $f -nt ../../$base.html ];
then 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 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 #--include-in-header=style.css
echo "../..$base.html from $f"
#else #else
# echo " $base.html up to date" # echo " $base.html up to date"
fi 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 $-1$ with probability $\frac{1}{6}$, though a sparse matrix is apt to
distort a sparse vector distort a sparse vector
There exists a set of points of size $m$ that needs dimension There exists a set of $m$ points that needs dimension
$$\displaystyle{O(\frac{\log(m)}{ε^2})}$$ $$\displaystyle{\LARGE\bigcirc\normalsize\frac{\ln(m)}{ε^2}}$$
in order to preserve the distances in order to preserve the distances
between all pairs of points within a factor of$1±ε$ between all pairs of points within a factor of$1±ε$
The time to find the nearest neighbour is logarithmic in the number of points, This is apt to be a lot. We might well have ten million points, and wish to
but exponential in the dimension of the space. So we do one pass with rather preserve distances within twenty five percent, in which case we need two
large epsilon, and another pass, using an algorithm proportional to the small hundred and fifty six dimensions. So a dimensionally reduced point is not
number of candidate neighbours times the dimensionality with a small number necessarily reduced by a whole lot.
of candidate neighbours found in the first pass.
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 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, 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. normal.
But variance is, approximately, the log of probability, so Mahalanobis is 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 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 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 # Actual server
## disable password entry
Setting up an actual server is similar to setting up the virtual machine 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 modelling it, except you have to worry about the server getting overloaded
and locking up. 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, You can always undo the deliberate corruption by setting a new password,
providing you can somehow get into root. providing you can somehow get into root.
```bash ## never enough memory
passwd -D cherry
```
If a server is configured with an [ample swap file] an overloaded server will 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 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] 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 ```bash
systemctl stop nginx systemctl stop nginx
@ -1930,6 +1930,8 @@ postqueue -p
You probably will not see any TLS activity. You want to configure Postfix You probably will not see any TLS activity. You want to configure Postfix
to always attempt SSL, but not require it. to always attempt SSL, but not require it.
Modify `/etc/postfix/main.cf` using the postconf command:
```bash ```bash
# TLS parameters # TLS parameters
# #

View File

@ -3,50 +3,50 @@ set -e
set -x set -x
echo intended to be run in the event of moving repositories echo intended to be run in the event of moving repositories
git remote -v 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' git submodule foreach --recursive 'git remote -v'
cd libsodium 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 git remote set-url upstream https://github.com/jedisct1/libsodium.git
cd .. cd ..
cd mpir 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 git remote set-url upstream https://github.com/BrianGladman/mpir.git
cd .. cd ..
cd wxWidgets 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 git remote set-url upstream https://github.com/wxWidgets/wxWidgets.git
cd .. cd ..
cd wxWidgets/3rdparty/catch 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 git remote set-url upstream https://github.com/wxWidgets/Catch.git
cd ../../.. cd ../../..
cd wxWidgets/3rdparty/nanosvg 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 git remote set-url upstream https://github.com/wxWidgets/nanosvg
cd ../../.. cd ../../..
cd wxWidgets/3rdparty/pcre 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 git remote set-url upstream https://github.com/wxWidgets/pcre
cd ../../.. cd ../../..
cd wxWidgets/src/expat 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 git remote set-url upstream https://github.com/wxWidgets/libexpat.git
cd ../../.. cd ../../..
cd wxWidgets/src/jpeg 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 git remote set-url upstream https://github.com/wxWidgets/libjpeg-turbo.git
cd ../../.. cd ../../..
cd wxWidgets/src/png 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 git remote set-url upstream https://github.com/wxWidgets/libpng.git
cd ../../.. cd ../../..
cd wxWidgets/src/tiff 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 git remote set-url upstream https://github.com/wxWidgets/libtiff.git
cd ../../.. cd ../../..
cd wxWidgets/src/zlib 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 git remote set-url upstream https://github.com/wxWidgets/zlib.git
cd ../../.. cd ../../..
winConfigure.sh winConfigure.sh

View File

@ -1,6 +1,7 @@
--- ---
title: # katex
Social networking title: >-
Social networking
... ...
# the crisis of censorship # 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 SSL and the Certificate Authority system to locate a repository, which
dangerous centralization would fail under the inevitable attack. It needs to dangerous centralization would fail under the inevitable attack. It needs to
have instead for its repository name system a distributed hash table name have instead for its repository name system a distributed hash table name
system, but a Kamelia distributed hash table will come under hostil system, but a Kademlia distributed hash table will come under hostile
attack. 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. nearest neighbour by social distance.
Social distance is costly and complex to calculate. If there are more than ### Replacing Kademlia
thirty or a hundred entities, need to use dimensional reduction. But we do
not need to do it very often.
Social distance, if calculated in a shill and Sybil resistant way, lacks the [social distance metric]:recognizing_categories_and_instances.html#Kademlia
nice mathematical properties of the Kamelia distance metric, so does not {target="_blank"}
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.
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 I will describe the Kademlia distributed hash table algorithm not in the
relatively small number of repositories, even if the total number of way that it is normally described and defined, but in such a way that we
repositories out there is enormous and the number of hashes in each 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.
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.
Each repository contains all the material the poster has approved, resulting A distributed hash table works by each peer on the network maintaining a
in considerable duplication, but not enormous duplication. 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 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 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 tree signed by Bob using his secret key which is kept in a BIP39
style wallet. 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 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 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. way hash, so are not easily linked to who is posting in the feed.

View File

@ -3,68 +3,15 @@ set -e
set -x set -x
git submodule foreach --recursive 'git reset --hard' git submodule foreach --recursive 'git reset --hard'
git submodule foreach --recursive 'git clean -xdf' 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 git config --local include.path ../.gitconfig
set +e set +e
set +x set +x
rm -r x64
set -e set -e
src=libsodium/libsodium.vcxproj src=libsodium/libsodium.vcxproj
dest=libsodium/libsodium.vcxproj dest=libsodium/libsodium.vcxproj
wxwin=wxWidgets wxwin=wxWidgets
if [[ "$OSTYPE" == "linux-gnu"* ]]; then # if [[ "$OSTYPE" == "linux-gnu"* ]]; then
chmod 755 docs/mkdocs.sh # fi
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